on 04-09-2007 12:56 PM
Hi All,
Can any one give me the coding lines for dynamically setting the properties of UI Elements (for example, like enabling the UI element dynamically or making it visible or invisible on click of a button etc...)
Regards,
Murthy.
Hi Murthy,
If you want to disable a button on runtime you can do this by setting the enabled property of the action associated with the button to false.
eg
your button id is : buttonadd
your action : onAdd
then in your code where you want to disable the button write
wdThis.wdGetonAddAction.setEnabled(false);
This code will disable the button that is associated with this action.
you can also do it as given by praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murthy,
You can use following code to disable a button(For Ex:) dynamically.
Write this line of code in wdDoModifyView method of View class
IWDBotton btn = (iWDButton) view.getElement("<your button iD>");
btn.setEnabled(false);
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks
Praveen
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narayana,
Create a context attribute say "TableVisibility" of type "visibility" bind it to the visible property of your table UI element and in the onAction of your button write this piece of code.
wdContext.currentContextElement().setTableVisibility(WDVisibility.VISIBLE);
To set this property intially to invisible write this piece of code in your wdDoInit method of your view controller
wdContext.currentContextElement().setTableVisibility(WDVisibility.BLANK)
Regards
Sid
Hi Narayana,
There are some properties of the UI which you can be access through its API and there are some properties which you can bind to a context variable and change the value of the context variable at runtime like you said the visibility of the UI.
For code samples refer to this <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating%20an%20extended%20web%20dynpro%20application.pdf">Link 1</a> <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/74cda090-0201-0010-6b91-f85b2489f765">Link 2</a>
Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.