on 12-27-2006 7:10 AM
Hi all,
I want to get the parent element of the UIelement.
I am setting the value of the parent on the basis of some condition of its child element.
So if naybody knows the method how to get parent, Please let me know.
Thanks and Regards.
Shruti.
try
UIElement.getContainer();
Regards, ANilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why do you need to get a reference to the UI element and its parent for setting some property value? Why not data binding?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
I am fetching some value from the java tables,
And depending on the value, I am setting the properties of the UIElement like whether it should be hidden field or requied field or mandatory field or readonly field.
And if the field is hidden then, I am making the parent as invisible,
So i want to get the value of the parent also...
I Think this is the feasible way,
If u can suggest any other way please let me know...
Thanks and regards.
Shruti.
Hi Shruti,
For this you can create a context attribute "ContainerVisible" of type"WDVisibility" and bind it to visiblity property of the container .
In th code if the field in the container is hidden then you can change the above attribute value to WDVISIBILITY.VISIBLE or WDVISIBILITY.NONE
Ex : if (field is hidden)
wdContext.currentCOntextElement().ContainerVisible(WDVISIBILITY.NONE);
esle
wdContext.currentCOntextElement().ContainerVisible(WDVISIBILITY.VISIBLE );
Regards, ANilkumar
Hi Armin,
I am having requirement in which i am setting the visibility of the container as true,
If any of the child is visible than container should also be visible.
Otherwise it shouldnot be visible.
So if(child visible)
{ container visible;
}
I just want to ask wherther the performance matters if i am using it this way??
Becoze making so many context is not feasible ,I think.
Thanks and Regards,
Shruti.
Some remarks:
1. Having 50 containers in a single view sounds a little bit strange to me. Perhaps the structure of the component/window should be revised.
2. Suppose you have a IWDGroup containing input fields f1, f2, f3, and you want to make the group invisible if all input fields are invisible. Let the visibility of the input fields be controlled by corresponding context attributes v1, v2, v3, of DDIC type "Visibility".
Then, you could define a calculated attribute "GroupVisibility" and implement the get-method like
WDVisibility getGroupVisibility(...)
{
return v1 == WDVisibility.VISIBLE
|| v2 == WDVisibility.VISIBLE
|| v3 == WDVisibility.VISIBLE
? WDVisibility.VISIBLE
: WDVisibility.NONE;
}
If you bind the "visible" property of the group to that attribute, you get the desired effect.
Armin
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.