plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

Allow dynamic fields inside label/field groupings #737

Closed displacedaussie closed 8 years ago

displacedaussie commented 8 years ago

The existing _handleLabels method in PlominoForm.py groups labels/fields together - wrapping them in a plominoFieldGroup div or a fieldset.

Normally labels/fields are grouped when they're like this:

<p><span class="plominoLabelClass">field1</span></p>
<p><span class="plominoFieldClass">field1</span></p>

But it also works with things like extra text between the label and field:

<p><span class="plominoLabelClass">field1</span></p>
<p class="form-hint">This is some helpful information about the field</p>
<p><span class="plominoFieldClass">field1</span></p>

Unfortunately it falls down when a dynamic field is included between the main label/fields:

<p><span class="plominoLabelClass">field1</span></p>
<p class="form-hint">Current value is: <span class="plominoFieldClass">dynamicTotal</span></p>
<p><span class="plominoFieldClass">field1</span></p>

This Pull Request stops the grouping from dissolving if a dynamic field is included between labels/fields that should normally be grouped together.