Page 1 of 2

Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 3:06 am
by Sexycrets

"Load" event fires just on template page, not on the page in the workarea. I need it to fire when the page is loaded (not the template) because the labels I want to map the data to are in the page. Any idea?


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 3:09 am
by maxkatz

The load even is fired once for the entire page when the page is loaded into the DOM. Is that what you see happens?


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 3:13 am
by Sexycrets

Thank you Max for the prompt reply!

My app has just two pages:
menu (one button)
showTip (two labels, based on the tipTemplate)

When you click the menu button it opens showTip. I want on the load event of it to send a REST request and map the response in the two labels.

The load event does not fire if I set it on the load of the page, just if I set it to the load of the template, but there I can't map the labels because they are not in the template.

Maybe my approach is not the proper one?


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 3:37 am
by maxkatz

Just to test, what if you don't use a template -- does the load even fire?


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 5:34 am
by Sexycrets

I tried from a fresh project and it worked, then I tried again on my project and now it works on the page inside the workarea too. Maybe I did something wrong somewhere else. Thank you so much for your help!!


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 6:35 am
by Sexycrets

Back to the beginning, I had changed nothing and the problem is still the same. The results are completely aleatory, and I am saving my app every time before testing. Don't know how to be sure it has not been cached somewhere.


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 6:35 am
by Sexycrets

Back to the beginning, I had changed nothing and the problem is still the same. The results are completely aleatory, and I am saving my app every time before testing. Don't know how to be sure it has not been cached somewhere.


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 7:03 am
by Kateryna Grynko

Hi,

This should be working.. Are there any errors in console (F12)?


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 4:15 pm
by Sexycrets

Hi Katya,

Not that I see.

In my page - load - events I have a popup which should fire onload:
http://awesomescreenshot.com/0151sd7eab

the app is here for you to see it does not fire:
http://m.sexycrets.com/

Thank you so much!


Load event not firing in pages created from custom template

Posted: Thu Oct 03, 2013 5:37 pm
by Maryna Brodina

Hello! As you create page based on Template you should add on Load event for template.