Is it possible in Appery to make dynamic pages?

This forum contains topics that were moved from Get Satisfaction
Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

Is it possible in Appery to make dynamic pages?

Post 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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Is it possible in Appery to make dynamic pages?

Post 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

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

Is it possible in Appery to make dynamic pages?

Post 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.

Post Reply