cancel
Showing results for 
Search instead for 
Did you mean: 

reg UI element Properties

jnmurthi
Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

praveenkumar_kadi
Active Contributor
0 Kudos

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

jnmurthi
Participant
0 Kudos

Hi Praveen,

I want to make a table visible on click of a button. The property of the table is initially set to invisible and on click of a button, the table will be visible and will be populated.

Can you give any coding lines for this.

Regards,

Murthy.

sid_sunny
Contributor
0 Kudos

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

sid_sunny
Contributor
0 Kudos

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