Axon.ivy 7.0 - the Digital Business Platform - is out now...

I need to call a method on certain componentes within a rich dialog panel. I get all components of the panel and then loop over them like this:

List<ULCComponent> listComponent = panel.getComponents();
for(int i = 0; i < listComponent.size(); i++){
    if(listComponent.get(i) instanceof RLabel){
        RLabel label = (RLabel) listComponent.get(i);
        ((RLabel) listComponent.get(i)).setVisible(in.showLabel);
    }
}

In both lines with the casting I get exceptions:

Unexpected token: identifier 'listComponent'

What is wrong?

asked 18.03.2010 at 08:48

Dirk%20Busmann's gravatar image

Dirk Busmann
1222
accept rate: 0%


The normal Java casting

(RLabel) panel.getComponents(i)

does not work in ivyScript. You have to use

panel.getComponents(i) AS RLabel

then it should work. Do not forget to import RLabel.

link

answered 19.03.2010 at 03:41

Benedict%20Groppe's gravatar image

Benedict Groppe
51666
accept rate: 50%

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:

×30

Asked: 18.03.2010 at 08:48

Seen: 942 times

Last updated: 18.03.2010 at 08:48