Timer in Cuba Studio 7 does not generate the correct method

Hi,

In Cuba Studio 7.4 (and since 7.1), the generation of time method is not correct.
The generated code is

public void onTestTimer() {
}

while it should be

public void onTestTimer(Timer timer) {
}

So the parameter “Timer” is not added and it does not work.

Also note that it would be nice to have the method name generated from the ID (I think it is the intention as the error message is “Set component’s ID or method name”).
Having a default componentId would be nice too (I think it was the case in Studio 6.x)

Kind regards!
Thierry

Hi,

Thank you for reporting the problem.

Also, in 7.0 you can use new @Subscribe mechanism:

  1. Open screen XML
  2. Set ID for timer
  3. Set cursor on Timer and hit Alt+Enter shortcut
  4. Use Subscribe to component events method and choose TimerActionEvent

timer-xml

  1. Studio will generate a method stub:
public class NewScreen extends Screen {
    @Subscribe("demoTimer")
    private void onDemoTimerTimerAction(Timer.TimerActionEvent event) {
        // your code here
    }
}
1 Like