简体   繁体   中英

change a textinput into label in flex

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM