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
(suspended)
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
(suspended)
accept rate: 50%

Yeah, programmers ... Had the same issue. Basically it drills down to RTFM. It is properly documented in the designer users guide (V 7.1) under IvyScript Reference, Operators, "Type cast operator". I ended up writing helper classes to do the job. What a waste of time ... now to be refactored.

link

answered 13.09.2018 at 08:07

Roland%20Strobl's gravatar image

Roland Strobl
(suspended)
accept rate: 0%

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:

×33

Asked: 18.03.2010 at 08:48

Seen: 2,928 times

Last updated: 13.09.2018 at 08:07