This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Mozilla XML > October 2005 > XForms, radio buttons and check boxes: an example?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
XForms, radio buttons and check boxes: an example?
|
|
| Pascal Sartoretti 2005-10-05, 6:31 am |
| Hello,
I would like to display a form including radio buttons and check boxes.
I tried to use the <select> and <select1> tags with appearance="full",
but I still get a drop down list or a list box. The error is certainly
in my code, so where is there an example with such widgets?
Thanks for any help
Pascal Sartoretti
PS, my config:
Windows XP SP2
FireFox 1.5 Beta 1
Mozilla XForms 0.2
| |
| Michael Vincent van Rantwijk 2005-10-05, 6:33 pm |
| Pascal Sartoretti wrote:
> Hello,
>
> I would like to display a form including radio buttons and check boxes.
> I tried to use the <select> and <select1> tags with appearance="full",
> but I still get a drop down list or a list box. The error is certainly
> in my code, so where is there an example with such widgets?
....so where is your code ;)
Michael
| |
| Allan Beaufour 2005-10-05, 6:33 pm |
| Hi Pascal,
Wednesday 05 October 2005 11:33 skrev Pascal Sartoretti:
> I would like to display a form including radio buttons and check boxes.
> I tried to use the <select> and <select1> tags with appearance="full",
> but I still get a drop down list or a list box. The error is certainly
> in my code, so where is there an example with such widgets?
We only support appearance="full" for select right now (which will give you
checkboxes if I remember correctly).
You will need a recent nightly build though. We have a second preview of the
extension coming up quite soon.
--
Allan Beaufour
Linux Software Engineer
Novell, Inc.
Software for the Open Enterprise
www.novell.com/open
| |
| Pascal Sartoretti 2005-10-05, 6:33 pm |
| 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".
> 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
| |
| Pascal Sartoretti 2005-10-05, 6:33 pm |
| Michael Vincent van Rantwijk wrote:
> ...so where is your code ;)
I am not looking for debugging help, but no problem if you want to, you
can find the code below :-)
My question was simply "Is there any example available online" ?
Pascal
....
<xf:select1 ref="/request/direction" appearance="full"
selection="closed">
<xf:label class="label">Direction:</xf:label>
<xf:item>
<xf:label>One way</xf:label>
<xf:value>oneWay</xf:value>
</xf:item>
<xf:item>
<xf:label>Return</xf:label>
<xf:value>return</xf:value>
</xf:item>
</xf:select1>
....
| |
| Michael Vincent van Rantwijk 2005-10-05, 6:33 pm |
| Pascal Sartoretti wrote:
> Michael Vincent van Rantwijk wrote:
>
> I am not looking for debugging help, but no problem if you want to, you
> can find the code below :-)
>
> My question was simply "Is there any example available online" ?
Hey, I'm still learning new stuff, and looking at other people's code
helps me a lot, so thank you ;)
Michael
> Pascal
>
> ...
>
> <xf:select1 ref="/request/direction" appearance="full"
> selection="closed">
> <xf:label class="label">Direction:</xf:label>
> <xf:item>
> <xf:label>One way</xf:label>
> <xf:value>oneWay</xf:value>
> </xf:item>
> <xf:item>
> <xf:label>Return</xf:label>
> <xf:value>return</xf:value>
> </xf:item>
> </xf:select1>
>
> ...
| |
| Aaron Reed 2005-10-05, 10:29 pm |
| Pascal Sartoretti wrote:
> Allan Beaufour wrote:
>
>
>
> 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.
>
>
> 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>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|