cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a Default button for a view

Former Member
0 Kudos

hi,

I have created a view in which i have more than one button in that view. Is it possible to set a particular button as a default button when page is loaded.

Thanks & Regards,

Ramesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, that's possible. Set the following for the root container of the view:

- defaultButtonId = <id of default button>

- isLayoutContainer = false

Armin

Former Member
0 Kudos

Hai Armin,

I tried this, but it is not working, can you please tell me whether i need to do any changes other than this.

Thanks & Regards,

Ramesh.

Former Member
0 Kudos

hi

you can then try with the other post , try with the visibility property on buttons .

Former Member
0 Kudos

What exactly doesn't work? The effect should be that by pressing the ENTER key inside this container, the default button is triggered.

Armin

Former Member
0 Kudos

How do you want to implement a default button behaviour by hiding certain buttons?

Armin

Former Member
0 Kudos

Hi Armin,

Yes that's what exactly i want, but it is not working.

Under RootUielementcontainer placed two buttons Button and Button1 with ID's Button and Button1 respectively. and i have set the property "Default button id = Button" in RootUielementcontainer properties. Now when i execute this application and click on Enter the cursor should be on the default button "Button" and it has to be clicked. But is not happening.

Could you please tell me whether i should do any further changes in properties.

Thanks,

Ramesh

Former Member
0 Kudos

isLayoutContainer = false

Armin

Former Member
0 Kudos

hi Armin ,

Ya Armin i set both the properties isLayoutContainer = "false" and defaultButtonId = "Button" for the RootUIElementContainer. Do i need to make any more changes apart from this.

Thanks & Regards,

Ramesh.

Former Member
0 Kudos

Hi Armin,

I have created a sample application and tested the application by placing only two buttons in the view at that time this default button is not highlithted, if i am having atleas one more uielement other than buttons in my view at that time the defaultbutton is getting highlithted and working fine. Thank You for your solution Armin, Thanks a lot.

Thanks & Regards,

Ramesh.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ramesh,

Create a value attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility and bind it to the buttons which you do not want to show when the page is loaded.

Write the below line of code in Init() of view.

wdContext.currentContextElement().set<ContextAttributeName>(WDVisibility.NONE);

when you want to see the buttons then set the visibility property to Visible.

wdContext.currentContextElement().set<ContextAttributeName>(WDVisibility.VISIBLE);

Thanks & Regards,

Jhansi Miryala