wood burning stoves 2.0*
The moose likes Flex and the fly likes Flex 3 :Help needed in implementing View States Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Flex 3 :Help needed in implementing View States" Watch "Flex 3 :Help needed in implementing View States" New topic
Author

Flex 3 :Help needed in implementing View States

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi
I am new to Flex , i am trying to understand View States , tried for one hour but got confused .
(Basically by seeing the examples i understood the concept , but failed to implement )

Please help .

Assume my requirement is at the load of the page , i want to show an Login Button and a Chnage State Button (common button) only .and when the Change State button is clicked on ,i want to show the Register Button .

So for this i made two Forms , and a common button .



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


( I think some how i can write the Logic to chnage to the current state to loginForm when user clicks with some inline code , but please tell me At the start of the page please tell me why I am not able to show the Register.
.


Save India From Corruption - Anna Hazare.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Something to understand, you have three states defined: A state called "Register", a state called "loginForm" and an unnamed state. Register sets a property on the Application called RegForm giving it the value "Register". loginForm sets a property on the Application called RegForm giving it the value "Login". The unnamed state shows two forms, each containing a button. Since these properties are custom to your application your state change (if it were triggered) would propably generate an error or do nothing.

You have nothing to trigger a state change. I would recommend you stop looking at states for a while and go learn about events, which are a much more central topic in Flex than states. You will not be able to do much with Flex unless you take the time to unsderstand this very important concept.

What I think you want from your states is one form with a button whose label and operation changes. Is that right? In which case, I think your Application only needs one Form, and you only need one state that sets the label property on your form's button to the appropriate value. Whatever function response to this button's click event can direct its operation.

NB: The easiest way to create view states in unsing the GUI builder in FlexBuilder.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

sorry for posting a dumb question .

I forgot that i need to reuse the same form again and again . rather than creating two forms .

Sorry for wasting all the peoples time .

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Flex 3 :Help needed in implementing View States
 
Similar Threads
Each State consisting of a new Conatiner
Flex3 Component creation error
Form processing using register.java but it doesn't show my hashmap errormessages
Flex 3 : Dispatching an event
having components based on Data Grid's column value.