TopKatz
23 Apr 2007, 9:20 AM
First let me state Im ra relative newb with OO JS.
I have been working on a messaging system. It is using a layout dialog with a grid. When you click a row (message) in the grid, it opens a second dialog that displays the message details. I was working on getting the grid to update after I delete the message in the detail dialog view and close the second dialog.
I experimented with a couple of different ways to get the datastore object over to teh second dialog so I could perform the reload. Im sure I used some bad technique's to do this. First I put the datastore var outside of the gridDialogs method. Making it a global. This worked, however it had some weird results. When I triggered this reload, every instance of the httpproxys request would all go off again. So if I had made say 10 different requests, they would all try and reload simultaneously. So next I brought the ds var back into my gridDialog method, and handed the datastore object off with a function that I was using to pass vars off to the second dialog. I then assigned it a private var in the second dialogs method, and again I could use the datastore object to reload, but it again had the same strange result of reloading all of the http requests that had been made.
In the end I added another function to my gridDialog method to perform a datastore.reload(), I then just called gridDialog.reload(), and everything seams to be playing nice.
Im going to assume that the behavior I was seeing was not a bug, but bad programing on my part. I think it had to do with scope, but Im to green to know for sure. Anyways, I figured I would post this so that if it is a bug you guys could check it out.
Katz
I have been working on a messaging system. It is using a layout dialog with a grid. When you click a row (message) in the grid, it opens a second dialog that displays the message details. I was working on getting the grid to update after I delete the message in the detail dialog view and close the second dialog.
I experimented with a couple of different ways to get the datastore object over to teh second dialog so I could perform the reload. Im sure I used some bad technique's to do this. First I put the datastore var outside of the gridDialogs method. Making it a global. This worked, however it had some weird results. When I triggered this reload, every instance of the httpproxys request would all go off again. So if I had made say 10 different requests, they would all try and reload simultaneously. So next I brought the ds var back into my gridDialog method, and handed the datastore object off with a function that I was using to pass vars off to the second dialog. I then assigned it a private var in the second dialogs method, and again I could use the datastore object to reload, but it again had the same strange result of reloading all of the http requests that had been made.
In the end I added another function to my gridDialog method to perform a datastore.reload(), I then just called gridDialog.reload(), and everything seams to be playing nice.
Im going to assume that the behavior I was seeing was not a bug, but bad programing on my part. I think it had to do with scope, but Im to green to know for sure. Anyways, I figured I would post this so that if it is a bug you guys could check it out.
Katz