cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically hide UI element

Former Member
0 Kudos

Is there a way to hide an element programmatically (for instance by calling setVisible() on a UIElement) from web dynpro? And if so, how can it be done from within a view?

Can somebody please provide a simple example? (Or maybe point me to a location to find an example?)

Thanks! Regards, Harm!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hi Harm,

Actually, you have 2 options:

1) As Arun said, using visibility property (every UI elemet has it): create context attribute with type WDVisibility, bint to mentioned property and set it in appropriate places (action handlers, event handlers etc.)

2) Access visbility property directly in wdDoModifyView (Not Recommeded).

Best regards, Maksim Rashchynski.

arun_srinivasan
Contributor
0 Kudos

hi

Let u thing that You are having textview and Two buttons

Bind the Visiblity value attribute to textview. create a two actions, let it be textviewvisible and textviewuinvisible in the action u write the following code

//@@begin javadoc:onActionTextviewvisible(ServerEvent)

/** Declared validating event handler. */

//@@end

public void onActionTextviewvisible(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionTextviewvisible(ServerEvent)

wdContext.currentContextElement().setTextview_visiblity(WDVisibility.VISIBLE);

//@@end

}

//@@begin javadoc:onActionTextviewinvisible(ServerEvent)

/** Declared validating event handler. */

//@@end

public void onActionTextviewinvisible(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionTextviewinvisible(ServerEvent)

wdContext.currentContextElement().setTextview_visiblity(WDVisibility.NONE);

//@@end

}

<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</a>

<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/44/8da74052033713e10000000a155106/frameset.htm">Help Link</a>

Hope this helps,

Regards,

Arun