cancel
Showing results for 
Search instead for 
Did you mean: 

Button Action and Table Visibility

Former Member
0 Kudos

Hi,

I have created a Submit button and a table UI.

Requirement is

1) Intial deployment button and table should be visible (its working fine)

2) if i click on Submit Button, Table UI should not be visible (its working fine)

3) if once again i click on Submit Button if Table should be visible ( How to implement this).

i.e on Action of submit button if table is already visible it should invisible and viceversa.

Please help.

Regards,

Bharath

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. Create a context attribute say visibility of type WDVisibility in ur view context.

2. Bind this attribute to ur table ui element "visibility" property.

3. In doInit() method of view set visibility attribute to visible like this:

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

On Action Submit:

if(wdContext().currentContextElement().getVisibility() == WDVisibility.VISIBLE){

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

}

else{

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

}

Answers (3)

Answers (3)

former_member193821
Active Participant
0 Kudos

hi,

Thanks for response,I have awarded the points.

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Bharath,

Action button code

if(tableFlag = true)

{

tableFlag = false;

}

else

tableFlag = true;

DoModifyView Code:

if(tableFlag = true)

{

wdContext.currentContextelement.setVisible (WDVisibility.VISIBLE);

tableFlag = true;

}

else

{

wdContext.currentContextelement.setVisible (WDVisibility.NONE);

tableFlag = false;

}

Declare it static in bottom

tableFlag = false;

I try to do work around like this

Regards, Suresh KB

Former Member
0 Kudos

Suresh,

this is very bad advice.

Armin

suresh_krishnamoorthy
Active Contributor
0 Kudos

I agree -Armin.

roberto_tagliento
Active Contributor
0 Kudos

I guess you binded a Visibility attribute of context to the UI visible properties.

com.sap.ide.webdynpro.uielementdefinitions.Visibility


if (wdContext.currentContextElement().getVisAtrr() == WDVisibility.VISIBLE)
     wdContext.currentContextElement().setVisAtrr(WDVisibility.NONE)
else
     wdContext.currentContextElement().setVisAtrr(WDVisibility.VISIBLE)