I tried to replicate this in Flex Builder by View Source, download zip, import Flex project into Flex Builder, but as you might expect, because I don't have your backend, or the resource bundle(s), I couldn't get it to work.
Just keep and eye on the keywordList ArrayCollection because it is obviously not getting initially populated.
BTW, you should think of getting rid of the states and using a ViewStack instead, your code is too complex, but I think you already know that
If this post answers your question or helps, please mark it as such.
OK Greg, thanks for the reply.
Here's what I am looking at: when you run the app that is working (CounterThink.cfm), everything works.
In the NG.cfm, what does not work is when you change the language while in the satate where you see the cartoons, the language itself changes fine, but the keywords ComboBox do not get updated - but it would work if the language selection were not available in that state, like in the "good" cfm page. That' why I'm thinking I have to have the keyword ComboBox wait for some kind of event before it can show the right keyword list.
I don't see that changing to ViewStack would solve the problem; is there some other angle we can look at this from?
1 person found this helpful
This is 50% shot in the dark, 50% analysis, but if you try this maybe it will fix the problem:
<c:LocaleSelectList id="localeList" creationComplete="localeList_initializeHandler(event)" change="localeList_changeHandler(event)"/>
where the change is to call localeList_initializeHandler() on the creationComplete event instead of the initialize event.
The reason I suggest this is because I am wondering if you get the expected results in the version of the app that works because when the Application object executes currentState="intro", and thus localeList_initializeHandler() is called, something else that must be set is in fact set, but in the version that does not work, because the base state is the initial state, localeList_initializeHandler() is called before everything in the base state has been created.
If the above does not work, you might try calling localeList_initializeHandler() on the Application creationComplete event.
OK Greg, I had already tried calling the handler on Application creationComplete; I also tried on the localeList creationComplete, as you suggest. Neither of those worked.
But I think you are on the right track. I am taking a few hours off the computer today, but later I plan to try moving some of the handlers around; eventually, I'll get it right. When I do, I'll let you see the new code so you know what I did. Thanks for all the help and we'll talk later.
Hello, Greg et al:
I figured out the problem and got the project working (sort of): the app did not like 'resetKeywordList()' in 'localeList_changeHandler', so I set the keywordList in the two 'getKWs_[locale]ResultHandlers' directly (result of the calls to my CFC).
That fixed the issue, but not completely: if I change language while the KeywordSelect ComboBox (on the right) selected item is not 'ALL' the cartoon AC does not refresh correctly. For now, I am getting around this by disabling the language change ComboBox (on the left) when anything other than ALL is selected. This is not so bad, until I figure out what the problem is.
If anyone wants to look, you can access the Main page of the app from here, http://www.timos.com/timos/green/greenPlanet.cfm, by pressing the CounterThink logo at the bottom. The new page, not linked to from my site yet, is http://www.timos.com/timos/green/ct/CounterThinkNEW.cfm (just insert NEW before the .cfm extension).
I know my code could be a lot better and intend to keep working on it, so I would love and really appreciate comments/suggestions that anyone wants to provide.
Regards and ciao for now.