xforms:select and xforms:choices issues

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xforms:select and xforms:choices issues

Trevor Jacobs
Hello,

There seem to be a few issues when grouping checkboxes using the
<xforms:choices/> element.  Please see the attached XForms. These tests
were mode using Orbeon Forms CE 4.0.

1) xforms:choices labels appear as selected checkboxes

This can be fixed by modifying line 426 of commit
041b98f5306802ec8a7da2e85b2c301060ce4839 of the
org.orbeon.oxf.xforms.processor.handlers.xhtml.XFormsSelect1Handler
class from:

             {

to

             if (item.value() != null) {

There remains a label alignment issue, but this can be fixed using
form-level CSS.

2) An error is reported when clicking on a checkbox

In the orbeon.log file, the following appears (trimmed for clarity):

+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred |
|----------------------------------------------------------------------------------------------------------------------|
|Flat hash tables cannot contain null elements. |
|----------------------------------------------------------------------------------------------------------------------|
...
|scala.collection.generic.GenericCompanion
|apply                         |GenericCompanion.scala        |  47|
|org.orbeon.oxf.xforms.control.controls.XFormsSelect|translateExternalValue
|XFormsSelectControl.scala     |  47|
|org.orbeon.oxf.xforms.control.XFormsValueControl$cl|doStoreExternalValue |XFormsValueControl.scala      
| 129|
|org.orbeon.oxf.xforms.control.controls.XFormsSelect|doStoreExternalValue |XFormsSelect1Control.scala    
|  37|
...

3) An error is reported when generating the PDF

This can be fixed by modifying line 51 of commit
18fa6539cbe9c2c700f1e8917da72d735db77465 of the
org.orbeon.oxf.xforms.itemset.XFormsItemUtils class from:

         if (controlValue != null) {

to

         if (itemValue != null && controlValue != null) {


Regards,

Trevor

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].



checkboxchoices.xml (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xforms:select and xforms:choices issues

Alessandro  Vernet
Administrator
Hi Trevor,

Indeed, Orbeon Forms most likely shouldn't generate an checkbox for an <xf:choices>, since the element isn't bound to anything. (We could imagine that if a checkbox was generated, it would be checked if all the items in the group are checked, checking it would check all the items in the group, and unchecking it would uncheck all the items in the group, but I don't think I want to go there.)

We could just skip producing the <input> for <xf:choices> per your patch. The way it looks isn't completely ridiculous (see below), but we should instead generate an enclosing element to have more flexibility with the CSS styling, like adding a border around the group.



For now, I created an issue for this:
https://github.com/orbeon/orbeon-forms/issues/929

And thank you for the feedback!

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet