I need to set the mandatory property of some widgets at the run-time depending on some run time criteria and without having a typed reference to the widget. How can I do this?

I can do this for example for the visible property. I can loop through all components of a display or other panel or container by panel.myContainer.getComponents(), select which components I am interested in and then call setVisible(Boolean) on them.

I cannot call setMandatory(Boolean) on this level but I would need to.

asked 02.02.2012 at 06:13

Eva%20Wacker's gravatar image

Eva Wacker
1111
accept rate: 0%


The problem is that panel.getComponents() returns a list of ULC components. The validation with the mandatory property is an improvement from ivyTeam which is not accessible on ULC level.

The solution would be to cast the ULC component to concrete type of widgets and then call setMandatory(Boolean) on the casted object.

for(Object object : panel.GridBagLayoutPane.getComponents()) 
{
    if(object instanceof RTextField) 
    {
        (object as RTextField).setMandatory(true);
    }
}
link

answered 29.03.2012 at 05:13

Philipp%20Haslinger's gravatar image

Philipp Hasl...
26222
accept rate: 100%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×40
×12

Asked: 02.02.2012 at 06:13

Seen: 669 times

Last updated: 02.02.2012 at 06:13