Page 2 of 2

Is it possible in Appery to make dynamic pages?

Posted: Tue May 26, 2015 5:45 am
by Reynaldo Libutan

Hi I finally got the chance to try this. Very simple generation is easy but when I wanted to add radio buttons on a div dynamically, I get this error.

codeError: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'/code

My code is something like...

code
$("#myDiv")&#46;html("<complex HTML here with radio buttons>");
/code
Any ideas?

Image


Is it possible in Appery to make dynamic pages?

Posted: Thu May 28, 2015 11:35 pm
by Yurii Orishchuk

Hi Reynaldo,

Nope, this error not relates to the code you run.

Please follow these steps to understand how to work with such "dynamic" areas.

1 Add "HTML" component on the page. And give this component name "myHtmlComponent"
Details: http://prntscr.com/7akj3p/direct

2 Set dimensions as "auto" and "auto".
Details: http://prntscr.com/7akjev/direct

3 Add button on the page.

4 Add to this button "Click" event handler with action "Run javascript:".

5 Use following JS code:

precode

var html = '<div><b>bold</b><br><i>italic</i><div style="color: #f00;">red<><>';

Apperyio("myHtmlComponent")&#46;html(html);

/code/pre

Run app. After button click you will see something like this: http://prntscr.com/7aklwf/direct

Regards


Is it possible in Appery to make dynamic pages?

Posted: Thu May 28, 2015 11:42 pm
by Reynaldo Libutan

Thanks for the answer but I actually solved it myself without using the HTML component. I just created elements on the fly but the error was related to dynamic radio buttons.

See this link for the problem
http://stackoverflow.com/questions/12...

I solved it by
code$myControlGroupContainer&#46;html(newMarkup);
$myControlGroupContainer&#46;trigger("create"); &#47;&#47;this is the solution/code

The reason why I don't want to use HTML component is that there's some weird wrapper codediv/code being created for it. I don't want that. It's messy.