on 10-25-2010 4:12 PM
Hi Experts,
I have an requirement as sated below :
I have one label & input field and one button on my view. When I run this application , by default button name should come as Enable and also the input field should be enabled(editable). Now when I press 'Enable' button again the text of button should be changed to Disable also the input field should be non editable(disabled).
Any suggestion should be appreciated.
Thanks & Regards
Manish Gupta
1. Create a boolean attribute 'input_enable' and bind to Input UI element text property
2. Create a String attribute 'btn_label' and bind to Button UI element text property
3. in wdOnInit()
// set input_enable attribute to true and button text as Enabled
wdContext.currentContextElement().setInput_enable( true);
wdContext.currentContextElement().setBtn_label( "Enabled");
4. create Action for Button. in onActionClick()
// set input_enable attribute to true and button text as Enabled
wdContext.currentContextElement().setInput_enable( false);
wdContext.currentContextElement().setBtn_label( "Disabled");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think he wants to switch it whenever he clicks on the button.
ie in pseudocode
if flag in context node is true {
set flag to false
set button text to "enable"
} else {
set flag to true
set button text to "disable"
}
But this kind of question is incredibly trivial and should be apparent after going through the most basic of tutorials. I would recommend the poster goes through the tutorials; he will learn a lot more and a lot faster than asking trivial basic questions here.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.