You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Blower, Andy" <An...@proquest.co.uk> on 2009/01/29 19:08:56 UTC

T5: Problem with a loop in a form

I have a loop in a form like this:

<t:checkbox t:id="additionalLimits" value="additionalLimits"/>
<t:label for="additionalLimits">
                ${message:additionalLimits}
 <t:loop source="fieldLimiters" value="fieldLimiter" index="var:index">
<t:if test="var:index">; </t:if>
                                ${fieldLimiterName} ${fieldLimiterValues}
</t:loop>
</t:label>

Which is just to display a label for a checkbox correctly, this loop doesn't contain any form elements so it shouldn't affect the form submission at all. However when the form is submitted, I get this error:

Failure writing parameter 'index' of component Results:basicsearchbox.loop: Component Results:basicsearchbox is not rendering, so render variable 'index' may not be updated.

This is easily fixed by using an index property in the java class, but I don't see why I can't use a render variable because this loop should be ignored by the form processing - Howard do you disagree or is this a bug?

Thanks,

Andy.


RE: T5: Problem with a loop in a form

Posted by "Blower, Andy" <An...@proquest.co.uk>.
I certainly could do it that way, but I expect there to be some markup go in around these elements so it's much easier for our UI design people to add it into the tml than have to ask us to change the Java.

As I said it's not a problem I can't get around, but it doesn't seem right to me so either I've misunderstood T5 or there's a small bug here.

Thanks.

> -----Original Message-----
> From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com]
> Sent: 29 January 2009 19:20
> To: Tapestry users
> Subject: Re: T5: Problem with a loop in a form
> 
> I don't have an answer for your question, but you are using a Loop to
> build a String. Wouldn't a method in your a page or component be a
> better
> suit?
> 
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Problem with a loop in a form

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
I don't have an answer for your question, but you are using a Loop to  
build a String. Wouldn't a method in your a page or component be a better  
suit?

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: T5: Problem with a loop in a form

Posted by "Blower, Andy" <An...@proquest.co.uk>.
No idea why that template code got mangled, here's another try. (grumble...MS outlook...grumble)


I have a loop in a form like this:

<t:checkbox t:id="additionalLimits" value="additionalLimits"/>
<t:label for="additionalLimits">
    ${message:additionalLimits}
    <t:loop source="fieldLimiters" value="fieldLimiter" index="var:index">
        <t:if test="var:index">; </t:if>
        ${fieldLimiterName} ${fieldLimiterValues}
    </t:loop>
</t:label>

 
> Which is just to display a label for a checkbox correctly, this loop
> doesn't contain any form elements so it shouldn't affect the form
> submission at all. However when the form is submitted, I get this
> error:
> 
> Failure writing parameter 'index' of component
> Results:basicsearchbox.loop: Component Results:basicsearchbox is not
> rendering, so render variable 'index' may not be updated.
> 
> This is easily fixed by using an index property in the java class, but
> I don't see why I can't use a render variable because this loop should
> be ignored by the form processing - Howard do you disagree or is this a
> bug?
> 
> Thanks,
> 
> Andy.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org