XForms: how to have radio buttons of the same group appear in many td's / rows in a grid?

StackOverflow https://stackoverflow.com/questions/19972138

  •  30-07-2022
  •  | 
  •  

Вопрос

I need radio buttons of the same group to be in more than 1 cell. How to achieve this ?

I have an <fr:grid> and I need a <xf:select1> having its items (I'm working with an itemset) to be in many <xh:tr> and <xh:td>

Edit: code sample:

   <fr:grid>
       <xh:tr>
           <xh:td>
               <xf:select1 id="ZSledig-control" appearance="full" bind="ZSledig-bind">
                   <xf:label ref="$form-resources/ZSledig/label"/>
                   <xf:hint ref="$form-resources/ZSledig/hint"/>
                   <xf:alert ref="$fr-resources/detail/labels/alert"/>
                   <xf:itemset ref="$form-resources/ZSledig/item">
                       <xf:label ref="label"/>
                       <xf:value ref="value"/>
                   </xf:itemset>
               </xf:select1>
           </xh:td>
           <xh:td/>
           <xh:td/>
           <xh:td/>
       </xh:tr>
       <xh:tr>
           <xh:td>
               <xf:select1 id="ZSverheiratet-control" appearance="full" bind="ZSverheiratet-bind">
                   <xf:label ref="$form-resources/ZSverheiratet/label"/>
                   <xf:hint ref="$form-resources/ZSverheiratet/hint"/>
                   <xf:alert ref="$fr-resources/detail/labels/alert"/>
                   <xf:itemset ref="$form-resources/ZSverheiratet/item">
                       <xf:label ref="label"/>
                       <xf:value ref="value"/>
                   </xf:itemset>
               </xf:select1>
           </xh:td>
           <xh:td>
               <xf:input id="control-39-control" bind="control-39-bind">
                   <xf:label ref="$form-resources/control-39/label"/>
                   <xf:hint ref="$form-resources/control-39/hint"/>
                   <xf:alert ref="$fr-resources/detail/labels/alert"/>
               </xf:input>
           </xh:td>
           <xh:td>
               <xf:select1 id="ZSPartnerschaft-control" appearance="full" bind="ZSPartnerschaft-bind">
                   <xf:label ref="$form-resources/ZSPartnerschaft/label"/>
                   <xf:hint ref="$form-resources/ZSPartnerschaft/hint"/>
                   <xf:alert ref="$fr-resources/detail/labels/alert"/>
                   <xf:itemset ref="$form-resources/ZSPartnerschaft/item">
                       <xf:label ref="label"/>
                       <xf:value ref="value"/>
                   </xf:itemset>
               </xf:select1>
           </xh:td>
           <xh:td>
               <xf:input id="control-11-control" bind="control-11-bind">
                   <xf:label ref="$form-resources/control-11/label"/>
                   <xf:hint ref="$form-resources/control-11/hint"/>
                   <xf:alert ref="$fr-resources/detail/labels/alert"/>
               </xf:input>
           </xh:td>
       </xh:tr>
    </fr:grid>

In the code above, I need all xf:select1 objects to be the same one. but with it's items in differents cells of the grid. The goal is to have a form looking as what you see in this picture.form sample

Это было полезно?

Решение

Currently this is not possible with Form Builder: each cell must hold a control which points to different data, and the controls are unrelated.

If you want to hack, however, you can do that, but at your own risk, as Form Builder won't know about your changes.

I put an example here:

  • I modified the second xf:select1 to point to the same bind as the first xf:select1
  • I added an xxf:group="my-group" attribute on each xf:select1
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top