4 Replies Latest reply on Jul 15, 2009 11:36 AM by tcflex

    Problem with removeallchildren. Need help.




      I have a Form container. The children are computed dynamically from the data that is refreshed for every 10 seconds. Depending upon the data I recieve, I will calucalate the number of children I need to draw. Each children will be added as a form item to the form container. The child ..i..e.. form item is a combo box. Every time I get new data I remove all the children which are present then compute new set of child data objects. I am removing the children by form.removeallchildren(). Suppose If I click on combox, it will show up all the values in the drop down, and keep it open with out selecting a value from the drop down up to say 10 sec's so that the data will get refreshed, the combo box will get deleted and the new set of child objects will be created which is expected. But the problem is, the combo box gets deleted by form.removeallchildren(), but the drop down still hangs over there with out combox which was kept open for 10 sec's.


      Please share your thoughts on this.




        • 1. Re: Problem with removeallchildren. Need help.
          Richard_Abbott Level 3


          if I was a user in this situation I'd get frustrated that the app was pulling out from under my feet the very control I was interacting with!. I suspect that the immediate problem is occurring because the drop-down list part is not a child of the form and hence not cleaned up by removeAllChildren(). Maybe you could see if a control is open in this way and either postpone the whole refresh (which I guess would not be desirable) or at least leave in place the child the user is actually interacting with and just do all the rest?


          • 2. Re: Problem with removeallchildren. Need help.
            Madhav Subedi Level 4

            What if you remove the form itself? not the children of form.

            • 3. Re: Problem with removeallchildren. Need help.
              *Prashant Shelke* Level 4

              If i have to solve the issue, I will go for re-instantiating same form for fresh data.

              • 4. Re: Problem with removeallchildren. Need help.
                tcflex Level 1



                Thanks for all your replies. Sorry for this late reply.

                I found out the problem. The problem is with the combo box control. Whether we remove the entire form and reintiate it the problem will be still seen.

                The combox has a private property known as destroydropdown where it does the clean up of drop down. The if control will check for wheher drop down exists and is still open. so there the condition fails hence drop down was not getting cleared.


                I found a work around for this, the drop down automatically closes for any event generated. So I manually dispatched a click event on form, so it closes the drop down and then later call removeallchildren. By doing this the if control in destroydropdown in combobox control will get passed and does the clean up. Hope this maight be helpful. Thanks for your time.