Re: XForms, radio buttons and check boxes: an example?
Aaron Reed <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Pascal Sartoretti wrote:
> Allan Beaufour wrote:
>
>> We only support appearance="full" for select right now (which will
>> give you checkboxes if I remember correctly).
>
>
> Well, I get a drop down list in fact with appearance="full".
>
xf:select1 is the combobox with the drop down, not xf:select.
xf:select1 does not support the appearance attribute, yet. When it
does, it will display radio buttons.
https://bugzilla.mozilla.org/show_bug.cgi?id=303353 is the bug that is
open against xf:select1 not supporting the appearance attribute, yet.
xf:select DOES support appearance="full" right now.
>> You will need a recent nightly build though. We have a second preview
>> of the extension coming up quite soon.
>
>
> Do you mean that the results may be different if I use the same
> extension with a nightly build or 1.5 Beta 1?
>
> Pascal
If you get the 1.5 beta 1 and the xforms.xpi for FF 1.5 Beta 1 from the
xforms project page (http://www.mozilla.org/projects/xforms) you should
be able to do xf:select with @appearance="full".
Here is an example form:
<?xml version="1.0" encoding="UTF-8"?>
<!-- basic FO page definition stuff -->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<head>
<title>Select testcase</title>
<xforms:model>
<xforms:instance id="temp" xmlns="">
<values>
<value>first value</value>
<value>second value</value>
<selectedvalue></selectedvalue>
</values>
</xforms:instance>
<xforms:bind id="Select" nodeset="/values/selectedvalue" />
</xforms:model>
</head>
<body>
<h2>Should show a select as checkboxes with 2 items</h2>
<h3>Uses select and value</h3>
<br/>
<p>
<xforms:select id="CHK" bind="Select" appearance="full">
<xforms:label></xforms:label>
<xforms:item>
<xforms:label ref="/values/value[1]"></xforms:label>
<xforms:value>firstValue</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label ref="/values/value[2]"></xforms:label>
<xforms:value>secondValue</xforms:value>
</xforms:item>
</xforms:select>
</p>
<p>
<xforms:output ref="/values/selectedvalue">
<xforms:label>Selected value: </xforms:label>
</xforms:output>
</p>
</body>
</html>