Skip to main content

on replace & static attributes

1 reply [Last post]
Joined: 2006-10-16

I have the following code block:

static attribute sliderValue : Integer = 0 on replace {
System.out.println("Slider value has changed: {sliderValue}");

When I try to compile it, I get the following compile error:

cannot find symbol:
symbol : method get$sliderValue()
location: interface mypackage.MyClass$Intf
static attribute sliderValue : Integer = 0 on replace {
1 error

If I change "static attribute" to just "attribute", I do not get the compile error, but this is not what I want. Why is this? Is this a bug or is there a way around this problem?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-11-15

The static keyword is most likely going to be removed shortly. To get something like a static attribute, you have to move it outside the class.