3 Replies Latest reply on Feb 21, 2008 7:52 AM by HooMaster

    Bound Model Not Updating Form Fields

    HooMaster
      I'm using a model defined in ActionScript that references a Gateway, DAO, and Bean that are variations extracted from a wizard-generated ColdFusion Example. I'm able to output and see that the data is returning just fine from the Remote call, and the data in my object <model> is correct, as I am using Alert.show() to view it. However, even though the data in the mxml model is visible and correct, it isn't updating the fields that are bound to it... with one exception...

      It actually works if I hit "Refresh" on the browser after loading it in once. There's an additional issue with the refresh however, as the history.js file is apparently causing the page to keep refreshing until it randomly stops or stops on a javascript error [Line: 494 -'null' is null or not an object]. At the point it stops, I'm able to pull up the bound data without issue.

      I'm using a Flex Builder "wizard-generated" ColdFusion project as reference and the only difference I can see is that they're using WindowManager to pop up the form with the data in it. I hope that isn't the problem, but before I go rebuilding my app this way, I'd love to hear if anyone else has had a similar experience, or recognizes my issue.

      Does data bound to a model need to be somehow refreshed? I appreciate any help.


      I just tested in FireFox and got the same results. It loads only after a refresh.
        • 1. Re: Bound Model Not Updating Form Fields
          HooMaster Level 1
          I've found that it only works if I refresh the page while I'm on the tab with the form fields.

          In the URL, it has: #app=e342&9923-selectedIndex=1
          If it has any 9923-selectedIndex other than 1, then it doesn't get the data.

          Is this a bug, or is there a specific way to bind data into tabs that aren't activated and/or visible yet?

          • 2. Re: Bound Model Not Updating Form Fields
            HooMaster Level 1
            I've narrowed it down to the fact that the data call and model update had to be run after the tab was activated. The work-around was to re-initiate the data call after activating the tab.

            Can anyone comment on whether this is a known fact about Flex, or am I missing something?

            I am still having a problem with the looping refresh (history.js issue).
            • 3. Re: Bound Model Not Updating Form Fields
              HooMaster Level 1
              I don't think anyone else is actually reading this thread, but in case someone is and has a similar issue...

              The short and simple answer was to add creationPolicy="all" to the application. This caused my application to wait until all the different tabs were loaded before trying to bind and populate the form fields.