cancel
Showing results for 
Search instead for 
Did you mean: 

Button Visibility

Former Member
0 Kudos

Hi ,

I have 2 buttons in the view.once if i click on one button , the second button should be disabled.how to proceed on this?

Regards,

Pavani

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member40425
Contributor
0 Kudos

Hi If you want to disable the second button then create an context attribute (suppose ButtonEnable) of type boolean. and bind it with the enabled property of second button and write following code in onAction of first button.

wdContext.currentContextElement().setButtonEnable(false);

And if you want after clicking on first button second button should not visible at all then Use following approach.

create a value attribute suppose Buttonvisibility of type Visibility and bind the visibile property of your second Button with attribute ButtonVisibility.

To create value attribute "ButtonVisibility" --> Go to the properties tab --> Select the type --> click on lookup button --> Choose Dictionary Simple Type --> Expand Local Dictionary > Expand com.sap.ide.webdynpro.uielementdefinitions>Select Visibility

And write following code in onAction of first button.

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

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

Hi Pavani,

If you want to once you click on 1st button then 2 button has to Nonvisible in View.

better you have to create one Value attribute in view controller and go to Type propery of atrribute click on button beside

type properties,then set visible api in List.

Visible Type==com.sap.ide.webdynpro.uielementdefinitions.visibilty

supoose attibute Neme--Visible.

when you click on Ist button has action metheod which you have created..

action method as ---onActionVisible

public onactionvisible(event){

wdContext.currentContextelement().setVisible(wdVisibility.NONE);

/////////////////////your code/////////////////////////

}

Thanks

Jati

former_member305573
Participant
0 Kudos

Hi Pavan

In the propertyButton enabled is there. Bind it with ur context. The context should be boolean type.

Then On action event of your button you have to make enablity false. Like this

wdContext.currentContextElement().setu2026.(false);

Prashant Krishen

Former Member
0 Kudos

Hi PavaniPoruri ,

1)create on value attribute say "visible" of type com.sap.ide.webdynpro.uielementdefinitions.visibilty

2)bind this attribute to the visible property of the second button.

3)write the code in the Action of the First button.

wdContext.currentContextElement.setVisible(WDVisibility.NONE);

For Disabling the button.

1)create one context attribute of type boolean say "enable "and map it to the enable property of second button.

2)write the code in action method of first button

wdContext.currentContexElement.setEnable(false);

Regards,

srikanth