You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Greenberg <bg...@vmsinfo.com> on 2004/08/11 23:50:22 UTC
Validation in Foreach Land.
I Hope nobody minds that I am revisiting this topic- I have scoured the
archives and the net for a solution and am only posting to the list as a
last resort...
-We are using FieldLabel and ValidField components in
conjunction with a Foreach component.
-We have noticed very funky behavior which incorrectly identifies
which Field requires user attention:
-This funky behavior can be eliminated by putting the
FieldLabel *after* the ValidField like so:
For FieldLabels A,B,C:
*THIS DOESN'T WORK: (the wrong FieldLabel comes back Red)
==================================================
A -> ValidField1
B -> ValidField2
C -> ValidField3
==================================================
*THIS WORKS: (the correct FieldLabel comes back Red)
==================================================
field1 <- A
field2 <- B
field3 <- C
==================================================
Is this just a weird bug in tapestry?
Has anyone discovered a way of working around this behaviour?
Thanks for any help you can lend!
Ben Greenberg
----code sample-----
<span jwcid="@Foreach" source="ognl:groups" value="ognl:group"
element="div">
<h2><span jwcid="@Insert" value="ognl:group.name"></span></h2>
<table class="BasketGroupOptions">
<tr>
<td>
<b>Copies:</b>
<!-- <span jwcid="@FieldLabel"
field="ognl:components.Copies">Copies</span> -->
<input type="text" jwcid="Copies" size="3"
/>
</td>
<td><b>Delivery Medium</b>:
<select jwcid="@Select">
<span jwcid="@Foreach"
source="ognl:group.deliveryMediumChoices"
value="ognl:group.deliveryMedium">
<option jwcid="@Option"
selected="ognl:group.deliveryMedium.selected"
label="ognl:group.deliveryMedium.label" />
</span>
</select>
</td>
<td><b>Digital Format</b>:
<select jwcid="@Select">
<span jwcid="@Foreach"
source="ognl:group.digitalFormatChoices"
value="ognl:group.digitalFormat">
<option jwcid="@Option"
selected="ognl:group.digitalFormat.selected"
label="ognl:group.digitalFormat.label" />
</span>
</select>
</td>
<td><b>Shipping</b>:
<select jwcid="@Select">
<span jwcid="@Foreach"
source="ognl:group.shippingChoices"
value="ognl:group.shipping">
<option jwcid="@Option"
selected="ognl:group.shipping.selected"
label="ognl:group.shipping.label" />
</span>
</select>
</td>
</tr>
</table>
<table jwcid="groupTable@contrib:Table" width="90%"
class="BasketGroup" cellpadding="0" cellspacing="0" border="0"
source="ognl:group.items" rowsClass="ognl:beans.evenOdd.next
+ 'Row'"
columns="!VMS ID:VmsID, !Product, !Title, !Price,
!Availability, !deleteLink"/>
<span jwcid="deleteLinkColumnHeader@Block"></span>
<span jwcid="deleteLinkColumnValue@Block"><a
jwcid="@DirectLink" listener="ognl:listeners.removeItem"
parameters="ognl:components.groupTable.tableRow.assetID" >Remove</a></span>
<span jwcid="ProductColumnValue@Block">
<span jwcid="@Insert" value="ognl:
components.groupTable.tableRow.product" />
<span jwcid="@Conditional"
condition="ognl:components.groupTable.tableRow.secondaryProduct">
<hr class="ProductSeparator">
<span jwcid="@Insert"
value="ognl:components.groupTable.tableRow.secondaryProduct" />
</span>
</span>
</span> <!-- end foreach -->
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org