cancel
Showing results for 
Search instead for 
Did you mean: 

UI Element Visibility ...

Former Member
0 Kudos

Hello Friends,

I am facing a strange problem, actually I have a lable and input filed, both have visibilits property as context element ( Visibility.addressfield ). The Context node Visibility is also avaiable in 2nd view via controller ( so its mapped node i.e. Visibility is mapped node). So far things works fine i.e from 1st view where actually the lable and input field is, I can regulate the visiblity in the 2nd view. And after some processing when I come back in 1st view and try to set the visiblity.none its not working..... the UI element are still visible in first view, I tried following to make it none.


wdThis.wdGetPOEntryCompController().wdGetContext().currentVisibilityElement().setAddressField(WDVisibility.NONE);
OR tried like this as well

wdContext.currentVisibilityElement().setAddressField(WDVisibility.NONE);

Buth both ways, in debug it shows me the visiblity none, but the element are still visible ..... any idea how I can fix it ??

Thanks and regards,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

That sounds strange. Please check again

- if node "Visibility" has cardinality 1:1, selection 1:1

- mapping of node "Visibility" is correct from both views

- lifetime of views

- all code positions the attribute values for the visibility are changed

- data binding of "visible" property for Label and InputField

Armin

Former Member
0 Kudos

Hello Armin,

The cardinality is 0...n and selectin is 0...n too,

I will changed it to 1.n and 1.1 respectively but its still shows the element, even I have made the visibility to none.

Please suggest....

Regards,

nikhil_bose
Active Contributor
0 Kudos
  • if node "Visibility" has cardinality 1:1, selection 1:1

Not 1:n its 1:1

nikhil

Edited by: Nikhil ßos on Aug 1, 2008 1:40 PM

Former Member
0 Kudos

when I do 1:1, I got exception...

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(POEntryView.Visibility): must not add elements to a Node of cardinality 0..1 or 1..1

Anyway I have fix the exception, cardinality is now 1:1 too, but still it does not work for me......... I cant make the lable and inputfiled on 1st view none ( after comming back from 2nd view )....

Edited by: Shah H on Aug 1, 2008 10:18 AM

Former Member
0 Kudos

Obviously there is some code that adds an element to node "Visibility" and this code is executed more than once. Just set cardinalities as I told and remove the code that adds the element.

Armin

srinivas_sistu
Active Contributor
0 Kudos

Hi,

1. Make sure you are not invalidating the VisibilityElement(), while coming back from the 2 nd view.

2. Are you doing this

wdContext.currentVisibilityElement().setAddressField(WDVisibility.NONE); inside if(firstTime) in wdDoModify??? if yes then do it out side if(firatRime).

If none of the above cases is true, then

do one thing,

inside your first view you will have an inbound plug from view2 to view1. there you include the above part.

i.e.,

wdContext.currentVisibilityElement().setAddressField(WDVisibility.NONE);

Regards,

Srinivas.

PradeepBondla
Active Contributor
0 Kudos

Hi Shah,

Where you are writing this code?

if you didnt do it, do as satya said, and write your code ( code to make visibility none) in the back button in second iview (view2). i.e. onAction method of a button by clicking which you are coming back to view 1.

PradeeP

Former Member
0 Kudos

hi pradeep ,

Actually I have no button which bring me back to 1st view....the logic is as follows..

on 1st view I have a dropdownkey, when user selects the dropdown ( dropdown values is not initial) then I opan a window ( my 2nd view ) , and also make the lable1 and button1 visible . User selects something form the 2nd View, and close then 2nd view...now the lable1 and button1 is visible ( which I make them visible from my 2nd view)

After user enters the values on 1st view and click button submit, I refresh the screen and there I want to make the lable1 and button1 again NONE....but when onActionSubmit when I try to do so, it does not work-out for me...

Any suggestion ???

Regards,

PradeepBondla
Active Contributor
0 Kudos

Hi,

Didnt see anything else except the cardinality as said by armin and nikil above.....

just a try.... try to validate the node before setting visibility property with .validate(); (just a try i dont think it will affect, but still).

PradeeP

Former Member
0 Kudos

There is no need to validate / invalidate that node. When it is given 1:1 cardinalities, its attributes can be used as if they would be on root-level and the node element is always there and the lead selection is always set.

Armin

Former Member
0 Kudos

Hi,

take a context attribute say, 'visible' in context and change its type to Visiblity.

Local Dictionary, UIelement definitions,Visibility.

Then bind the visible property of (in properties) your lable and input filed to this context attribute.u can have a button, and an action for it and the in that action u set the visibility of the context attribute 'visible to NONE.

let me know if u need more clarity.

Regards,

Satya.

Edited by: Satya on Aug 1, 2008 8:24 AM