on 03-08-2006 2:21 PM
Hey!
I got to Views viewA og and viewB.
Between viewA and viewB i have a fireplug.
And in viewB there are some buttons (button1, button2).
Depending on what is choosen in viewA I want to set visibility to 'none' on button1 or button2 in the onActionGoToViewB.
The UI elements (inluded the button) is created with the "Layout" tool in Web Dynpro..
Can someone help me control the visibility true the code?
Hi,
Follow tyhis steps to achieve ur scenario.
1) Create 2 views. View A and View B.
2) In view B lets say u have one button.
3) create a context in view B of type com.sap.ide.webdynpro.uielementdefenitions-->visibility.
4) click on the button properties.Set the visible property to the context that was created.
5) create another context att in view A of same visibility type.
6) Map the con att of view B to View A through comp.ctrller.
7) In the on action of the view A,set the visibility accordingly for the btn in view B.
Visibility can be set by the following codes,
wdcontext.currentcontextalment.set<att>(wdvisibility.none) or (wdvisibility.visible)
Hope it helps,
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
This is my understanding of the problem:
On selection of something on View A you want to set the visibility of buttons in View B
Firstly create context attributes of type: <b>WDVisibility</b>.And associate these context attributes with the Visibility Property of Buttons.
Now, create a context attribute of type integer or string or anything in View A and name it "flag" and put that in component controller and also in View B. and do the context mapping . On firing the plug pass the value of flag to View B. Here create a method which reads this value of flag and change the visibility of buttons.
Hope this helps
Thanks
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristoffer,
You can create an attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility in the context, map this to the 'Visible' property of your UI element. Of course, since you want to control two UI elements and they can have different values you'll need two context attribtues.
Then in the your onAction method simply write the code that you desire:
wdContext.currentContextElement().setButton1Visible(WDVisibility.VISIBLE);
wdContext.currentContextElement().setButton2Visible(WDVisibility.NONE);
where Button1Visible and Button2Visible are your context attributes.
Since you want to control the behaviour across views, put these attributes in the component controllers' context. That way both views can access them, viewA to set them and viewB to map them to the UI elements.
I hope this helps,
Patrick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.