cancel
Showing results for 
Search instead for 
Did you mean: 

parent element of the UIElement in the view.....

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try

UIElement.getContainer();

Regards, ANilkumar

Former Member
0 Kudos

Thnak you very much.

It helped solving my problem.

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Armin,

Actually i am setting many properties with one value of the child...

I thought it is not feasible to use so many context.....and bind them for one single UIElement..

thanks and Regards.

shruti

Former Member
0 Kudos

Can you please give more details? Modifying property values via UI element references is most probably not the way to go.

Armin

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Anil,

Actually i have almost 50 container......

the view is very complex........so creating 50 context element is not feasible...

Is the performance degrades...if i use it like this....

Thanks and Regards,

Shruti

Former Member
0 Kudos

I don't understand why you want to access the parent of an input field to change the visibility of the input field. Can you please explain?

Armin

Former Member
0 Kudos

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.

Former Member
0 Kudos

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