tags:

views:

74

answers:

2

i create a form for order a item in flex. i use <mx:TextInput /> for getting the information from client and use a <mx:Button /> for submit the information in database. But client requirements is when user click on button then first show a confirmation page with details information that client give. But can't use another page or <mx:TextInput /> in this confirmation page, it will be <mx:Label />. After show the confirmation page if clients click on Button then submit the info.

How can i convert a <mx:TextInput /> into <mx:Label /> with all properties in flex? Is it possible?

A: 

You don't convert the TextInput to a Label. You use a separate Label component and decide which one to show based on the state of the form. Probably the most straight forward way to do it is to have two separate forms in a view stack. The first form contains TextInputs. the other form contains Labels. When the user submits the first form, just change the selectedIndex of the view stack.

lach
I can not use separate forms......any other solution?
Arif
If you don't want to use a view stack, you can still use separate controls within the same form and control their visibility using states or other variables. You need to set both the `visible` and `includeInLayout` properties of the controls to make them completely hidden.
lach
A: 

ViewStack is the most appropriate thing for that, so I agree with lach. You don't need to use Forms, just use a ViewStack with Canvas containers:

<mx:ViewStack width='100%' height='100%'>
  <mx:Canvas id='edit'>edit controls here</mx:Canvas>
  <mx:Canvas id='view'>view here</mx:Canvas>
</mx:ViewStack>

Than you can control which Canvas should be visible by changing the selectedIndex of the ViewStack.

mico