You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dave Greggory <da...@yahoo.com> on 2009/03/11 21:55:32 UTC
Getting value of field in Add Row section in AddRow event for Ajax Form Loop
I have this ajax form loop with a select field in the AddRow section.
<t:form>
<t:ajaxformloop t:id="urlLoop" t:source="selectedUrls" t:value="currentUrl" t:encoder="urlKeyEncoder">
${currentUrl}
<t:parameter name="addRow">
<t:select t:id="urlSelectField"
t:blankLabel="--Select--"
t:blankOption="ALWAYS"
t:model="urlSelectModel"
t:encoder="urlValueEncoder"
t:value="selectedUrl"/>
<t:addrowlink>Add URL</t:addrowlink>
</t:parameter>
</t:ajaxformloop>
</t:form>
and in the component class I have:
@Property
private String selectedUrl;
@Property
private String currentUrl;
@Property
private List<String> selectedUrls;
@OnEvent (value = EventConstants.ADD_ROW, component = "urlLoop")
public String addNewUrl()
{
selectedUrls.add(selectedUrl);
return selectedUrl;
}
But unfortunately, selectedUrl is null when the event fires. I guess the value of the select field in the AddRow section is not passed in. Is this even possible to do with AjaxFormLoop or am I doing something wrong?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Getting value of field in Add Row section in AddRow event for Ajax Form Loop
Posted by Dave Greggory <da...@yahoo.com>.
no way to do this?
is it even possible to have a select field and a custom eventlink like component that fires an event with the selected value from select field?
----- Original Message ----
From: Dave Greggory <da...@yahoo.com>
To: Tapestry users <us...@tapestry.apache.org>
Sent: Wednesday, March 11, 2009 4:55:32 PM
Subject: Getting value of field in Add Row section in AddRow event for Ajax Form Loop
I have this ajax form loop with a select field in the AddRow section.
<t:form>
<t:ajaxformloop t:id="urlLoop" t:source="selectedUrls" t:value="currentUrl" t:encoder="urlKeyEncoder">
${currentUrl}
<t:parameter name="addRow">
<t:select t:id="urlSelectField"
t:blankLabel="--Select--"
t:blankOption="ALWAYS"
t:model="urlSelectModel"
t:encoder="urlValueEncoder"
t:value="selectedUrl"/>
<t:addrowlink>Add URL</t:addrowlink>
</t:parameter>
</t:ajaxformloop>
</t:form>
and in the component class I have:
@Property
private String selectedUrl;
@Property
private String currentUrl;
@Property
private List<String> selectedUrls;
@OnEvent (value = EventConstants.ADD_ROW, component = "urlLoop")
public String addNewUrl()
{
selectedUrls.add(selectedUrl);
return selectedUrl;
}
But unfortunately, selectedUrl is null when the event fires. I guess the value of the select field in the AddRow section is not passed in. Is this even possible to do with AjaxFormLoop or am I doing something wrong?
---------------------------------------------------------------------
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