WebOS onComplete event or analog

95 Views Asked by At

I want call onclick event after form loaded. I not found onCompletion Event or any analog

something like : kind: someUI, onComplete: "Init"

2

There are 2 best solutions below

2
Pre101 On BEST ANSWER

I'm not entirely sure from your description, but it sounds like you want to cause some action to occur when the app is loaded. You might try using ready() as described in the getting started guide.

http://enyojs.com/docs/latest/developer-guide/getting-started/creating-and-building-an-app.html

The other choice is to add something to your initial App rendered that executes your buttonTapped() method.

rendered: function () {
    this.inherited(arguments);
    this.doSomething();
}
1
AC1D On

I solve it. I rewrite code like this

     {kind: IconButton, src: '@../../assets/info.png', ontap: "buttonTapped"},

create: function() {
                this.inherited(arguments);
                this.ServiceReq();
            },

    buttonTapped: function(inSender, inEvent) {

        this.ServiceReq();  
        return;

    },

    ServiceReq: function()
        { console.log('Clicked');}

But I'm not sure this is a good solution, but it works