My setup:
Suse Linux 10
Java 1.4.2
lps-3.2
swf7, SOLO
My dilemna: I am trying to populate a <form> element with
<radiogroup> and <radiobutton> elements from javascript.
Here's my class for the form:
<class name="assessment" extends="form">
<submit name="results" data="${canvas.assessDS}"/>
<button isdefault="true"
onclick="parent.results.submit()">submit</button>
</class>
Here's my javascript that crawls an xml file and uses the data to render
a <radiogroup> with child <radiobutton> elements:
if(this.xpathQuery('@type') == 'radiogroup'){
var rg = new radgroup(view); //// view is the form
var rgname = this.xpathQuery('@id');
rg.setAttribute("name", rgname);
this.selectChild();
do {
var rb = new radiobutton(rg);
var txt = this.xpathQuery('text()');
var rbval = this.xpathQuery('@value');
var rbid = this.xpathQuery('@id');
rb.setAttribute("text", txt);
rb.setAttribute("value", rbval);
rb.setAttribute("name", rbid);
} while(this.selectNext());
this.selectParent();
}
Here's the xml I'm crawling:
<view type="assessment">
<item type="text">1. What is your definition of fun?</item>
<item type="radiogroup" id="abc">
<item type="radiobutton" value="Video">Playing video games</item>
<item type="radiobutton" value="Chatting">Chatting with
friends</item>
<item type="radiobutton" value="Eating">Eating french fries</item>
</item>
</view>
The form renders correctly and the debugger is error-free. When I
submit the form the value of the radiogroup is transmitted, but the name
of the radiogroup appears as "null" on the server. If I hard-code a
radiogroup name in the class it makes it to the server. Any ideas?
Matt Hubbard
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user