Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-28 Thread Howard Lewis Ship
I was just asking about that myself; Andreas seems to be taking the
lead on it. Basically, Hudson looks to have "hiccupped" and is not
building even the the face of new changes in the SVN repo.

On Wed, Apr 28, 2010 at 2:45 PM, Adam Derkey  wrote:
> Thanks for the fix on this. Do you know when a new build will be added to
> the snapshot repository so I can pin to it? The last build I am seeing in
> the repository is from 4/22.
>
> On Mon, Apr 19, 2010 at 12:41 PM, Howard Lewis Ship wrote:
>
>> Please create the issue in Jira.
>>
>> On Mon, Apr 19, 2010 at 9:29 AM, Adam Derkey 
>> wrote:
>> > Should I create a JIRA ticket for this or is there already one created
>> that
>> > I can use to track the progress?
>> >
>> > On Fri, Apr 16, 2010 at 11:06 PM, Howard Lewis Ship > >wrote:
>> >
>> >> I've been tracking this problem; there's a timing issue when Tapestry
>> >> adds a hidden field to store the t:formdata; the DOM is being streamed
>> >> to characters after the  field is added to the DOM, but before
>> >> it is fully configured.  It's deeply tricky stuff.
>> >>
>> >> On Fri, Apr 16, 2010 at 11:28 AM, Adam Derkey 
>> >> wrote:
>> >> > Was this the right list to send this to? Should I send to the dev list
>> or
>> >> > open a jira ticket?
>> >> >
>> >> > On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey 
>> >> wrote:
>> >> >
>> >> >> Using Tapestry 5.2.0-SNAPSHOT
>> >> >>
>> >> >> I'm updating multiple zones after a select on Change event. The JSON
>> >> >> response is including an extra input field after a select field in
>> one
>> >> of
>> >> >> the zones I'm updating. The extra input is then showing up in the
>> >> rendered
>> >> >> page in the browser. Why would tapestry be adding in an extra input
>> >> field?
>> >> >> Is there a way to do this without the extra input being returned?
>> >> >>
>> >> >> I created this example using the quickstart app and send the entire
>> >> project
>> >> >> if needed.
>> >> >>
>> >> >> Thanks
>> >> >> Adam
>> >> >>
>> >> >> /*
>> >> >>  * Form.java
>> >> >>  */
>> >> >> package com.test.pages;
>> >> >>
>> >> >> import com.test.model.GenericSelectModel;
>> >> >> import com.test.vo.SelectObj;
>> >> >> import java.util.ArrayList;
>> >> >> import java.util.List;
>> >> >> import org.apache.tapestry5.EventContext;
>> >> >> import org.apache.tapestry5.SelectModel;
>> >> >> import org.apache.tapestry5.ajax.MultiZoneUpdate;
>> >> >> import org.apache.tapestry5.annotations.Component;
>> >> >> import org.apache.tapestry5.annotations.Property;
>> >> >> import org.apache.tapestry5.corelib.components.Select;
>> >> >> import org.apache.tapestry5.corelib.components.Zone;
>> >> >> import org.apache.tapestry5.ioc.annotations.Inject;
>> >> >> import org.apache.tapestry5.ioc.services.PropertyAccess;
>> >> >> import org.apache.tapestry5.services.Request;
>> >> >>
>> >> >> /**
>> >> >>  *
>> >> >>  * @author aderkey
>> >> >>  */
>> >> >> public class Form {
>> >> >>
>> >> >>     @Inject
>> >> >>     private Request request;
>> >> >>
>> >> >>     @Inject
>> >> >>     private PropertyAccess propertyAccess;
>> >> >>
>> >> >>     @Component(id="selectValue1", parameters = {"model=select1Model",
>> >> >> "encoder=select1Model"})
>> >> >>     private Select select1;
>> >> >>
>> >> >>     @Property
>> >> >>     private SelectModel select1Model;
>> >> >>
>> >> >>     @Property
>> >> >>     private SelectObj selectValue1;
>> >> >>
>> >> >>     @Component(id="selectValue2", parameters = {"model=select2Model",
>> >> >> "encoder=select2Model"})
>> >> >>     private Select select2;
>> >> >>
>> >> >>     @Property
>> >> >>     private SelectModel select2Model;
>> >> >>
>> >> >>     @Property
>> >> >>     private SelectObj selectValue2;
>> >> >>
>> >> >>     @Component(id="select1ValueZone")
>> >> >>     private Zone select1ValueZone;
>> >> >>
>> >> >>     @Component(id="select2ValueZone")
>> >> >>     private Zone select2ValueZone;
>> >> >>
>> >> >>     void onActivate(EventContext ctx) {
>> >> >>         List select1List = new ArrayList();
>> >> >>         select1List.add(new SelectObj(0, "0 pre ajax"));
>> >> >>         select1List.add(new SelectObj(1, "1 pre ajax"));
>> >> >>         select1List.add(new SelectObj(2, "2 pre ajax"));
>> >> >>         select1List.add(new SelectObj(3, "3 pre ajax"));
>> >> >>         select1List.add(new SelectObj(4, "4 pre ajax"));
>> >> >>         select1Model = new GenericSelectModel(select1List,
>> >> SelectObj.class,
>> >> >> "text", "id", propertyAccess);
>> >> >>
>> >> >>         List select2List = new ArrayList();
>> >> >>         select2List.add(new SelectObj(0, "0 pre ajax"));
>> >> >>         select2List.add(new SelectObj(1, "1 pre ajax"));
>> >> >>         select2List.add(new SelectObj(2, "2 pre ajax"));
>> >> >>         select2List.add(new SelectObj(3, "3 pre ajax"));
>> >> >>         select2Model = new GenericSelectModel(select2List,
>> >> SelectObj.class,
>> >> >> "text", "id", propertyAccess);
>> >> >>     }
>> >> >>
>> >> >>     public Object onValueChangedFromS

Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-28 Thread Adam Derkey
Thanks for the fix on this. Do you know when a new build will be added to
the snapshot repository so I can pin to it? The last build I am seeing in
the repository is from 4/22.

On Mon, Apr 19, 2010 at 12:41 PM, Howard Lewis Ship wrote:

> Please create the issue in Jira.
>
> On Mon, Apr 19, 2010 at 9:29 AM, Adam Derkey 
> wrote:
> > Should I create a JIRA ticket for this or is there already one created
> that
> > I can use to track the progress?
> >
> > On Fri, Apr 16, 2010 at 11:06 PM, Howard Lewis Ship  >wrote:
> >
> >> I've been tracking this problem; there's a timing issue when Tapestry
> >> adds a hidden field to store the t:formdata; the DOM is being streamed
> >> to characters after the  field is added to the DOM, but before
> >> it is fully configured.  It's deeply tricky stuff.
> >>
> >> On Fri, Apr 16, 2010 at 11:28 AM, Adam Derkey 
> >> wrote:
> >> > Was this the right list to send this to? Should I send to the dev list
> or
> >> > open a jira ticket?
> >> >
> >> > On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey 
> >> wrote:
> >> >
> >> >> Using Tapestry 5.2.0-SNAPSHOT
> >> >>
> >> >> I'm updating multiple zones after a select on Change event. The JSON
> >> >> response is including an extra input field after a select field in
> one
> >> of
> >> >> the zones I'm updating. The extra input is then showing up in the
> >> rendered
> >> >> page in the browser. Why would tapestry be adding in an extra input
> >> field?
> >> >> Is there a way to do this without the extra input being returned?
> >> >>
> >> >> I created this example using the quickstart app and send the entire
> >> project
> >> >> if needed.
> >> >>
> >> >> Thanks
> >> >> Adam
> >> >>
> >> >> /*
> >> >>  * Form.java
> >> >>  */
> >> >> package com.test.pages;
> >> >>
> >> >> import com.test.model.GenericSelectModel;
> >> >> import com.test.vo.SelectObj;
> >> >> import java.util.ArrayList;
> >> >> import java.util.List;
> >> >> import org.apache.tapestry5.EventContext;
> >> >> import org.apache.tapestry5.SelectModel;
> >> >> import org.apache.tapestry5.ajax.MultiZoneUpdate;
> >> >> import org.apache.tapestry5.annotations.Component;
> >> >> import org.apache.tapestry5.annotations.Property;
> >> >> import org.apache.tapestry5.corelib.components.Select;
> >> >> import org.apache.tapestry5.corelib.components.Zone;
> >> >> import org.apache.tapestry5.ioc.annotations.Inject;
> >> >> import org.apache.tapestry5.ioc.services.PropertyAccess;
> >> >> import org.apache.tapestry5.services.Request;
> >> >>
> >> >> /**
> >> >>  *
> >> >>  * @author aderkey
> >> >>  */
> >> >> public class Form {
> >> >>
> >> >> @Inject
> >> >> private Request request;
> >> >>
> >> >> @Inject
> >> >> private PropertyAccess propertyAccess;
> >> >>
> >> >> @Component(id="selectValue1", parameters = {"model=select1Model",
> >> >> "encoder=select1Model"})
> >> >> private Select select1;
> >> >>
> >> >> @Property
> >> >> private SelectModel select1Model;
> >> >>
> >> >> @Property
> >> >> private SelectObj selectValue1;
> >> >>
> >> >> @Component(id="selectValue2", parameters = {"model=select2Model",
> >> >> "encoder=select2Model"})
> >> >> private Select select2;
> >> >>
> >> >> @Property
> >> >> private SelectModel select2Model;
> >> >>
> >> >> @Property
> >> >> private SelectObj selectValue2;
> >> >>
> >> >> @Component(id="select1ValueZone")
> >> >> private Zone select1ValueZone;
> >> >>
> >> >> @Component(id="select2ValueZone")
> >> >> private Zone select2ValueZone;
> >> >>
> >> >> void onActivate(EventContext ctx) {
> >> >> List select1List = new ArrayList();
> >> >> select1List.add(new SelectObj(0, "0 pre ajax"));
> >> >> select1List.add(new SelectObj(1, "1 pre ajax"));
> >> >> select1List.add(new SelectObj(2, "2 pre ajax"));
> >> >> select1List.add(new SelectObj(3, "3 pre ajax"));
> >> >> select1List.add(new SelectObj(4, "4 pre ajax"));
> >> >> select1Model = new GenericSelectModel(select1List,
> >> SelectObj.class,
> >> >> "text", "id", propertyAccess);
> >> >>
> >> >> List select2List = new ArrayList();
> >> >> select2List.add(new SelectObj(0, "0 pre ajax"));
> >> >> select2List.add(new SelectObj(1, "1 pre ajax"));
> >> >> select2List.add(new SelectObj(2, "2 pre ajax"));
> >> >> select2List.add(new SelectObj(3, "3 pre ajax"));
> >> >> select2Model = new GenericSelectModel(select2List,
> >> SelectObj.class,
> >> >> "text", "id", propertyAccess);
> >> >> }
> >> >>
> >> >> public Object onValueChangedFromSelectValue1(SelectObj selectObj)
> {
> >> >> System.out.println("onValueChangedSelectValue1");
> >> >> List select2List = new ArrayList();
> >> >> select2List.add(new SelectObj(4, "4 post ajax"));
> >> >> select2List.add(new SelectObj(5, "5 post ajax"));
> >> >> select2List.add(new SelectObj(6, "6 post ajax"));
> >> >> select2List.a

Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-19 Thread Howard Lewis Ship
Please create the issue in Jira.

On Mon, Apr 19, 2010 at 9:29 AM, Adam Derkey  wrote:
> Should I create a JIRA ticket for this or is there already one created that
> I can use to track the progress?
>
> On Fri, Apr 16, 2010 at 11:06 PM, Howard Lewis Ship wrote:
>
>> I've been tracking this problem; there's a timing issue when Tapestry
>> adds a hidden field to store the t:formdata; the DOM is being streamed
>> to characters after the  field is added to the DOM, but before
>> it is fully configured.  It's deeply tricky stuff.
>>
>> On Fri, Apr 16, 2010 at 11:28 AM, Adam Derkey 
>> wrote:
>> > Was this the right list to send this to? Should I send to the dev list or
>> > open a jira ticket?
>> >
>> > On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey 
>> wrote:
>> >
>> >> Using Tapestry 5.2.0-SNAPSHOT
>> >>
>> >> I'm updating multiple zones after a select on Change event. The JSON
>> >> response is including an extra input field after a select field in one
>> of
>> >> the zones I'm updating. The extra input is then showing up in the
>> rendered
>> >> page in the browser. Why would tapestry be adding in an extra input
>> field?
>> >> Is there a way to do this without the extra input being returned?
>> >>
>> >> I created this example using the quickstart app and send the entire
>> project
>> >> if needed.
>> >>
>> >> Thanks
>> >> Adam
>> >>
>> >> /*
>> >>  * Form.java
>> >>  */
>> >> package com.test.pages;
>> >>
>> >> import com.test.model.GenericSelectModel;
>> >> import com.test.vo.SelectObj;
>> >> import java.util.ArrayList;
>> >> import java.util.List;
>> >> import org.apache.tapestry5.EventContext;
>> >> import org.apache.tapestry5.SelectModel;
>> >> import org.apache.tapestry5.ajax.MultiZoneUpdate;
>> >> import org.apache.tapestry5.annotations.Component;
>> >> import org.apache.tapestry5.annotations.Property;
>> >> import org.apache.tapestry5.corelib.components.Select;
>> >> import org.apache.tapestry5.corelib.components.Zone;
>> >> import org.apache.tapestry5.ioc.annotations.Inject;
>> >> import org.apache.tapestry5.ioc.services.PropertyAccess;
>> >> import org.apache.tapestry5.services.Request;
>> >>
>> >> /**
>> >>  *
>> >>  * @author aderkey
>> >>  */
>> >> public class Form {
>> >>
>> >>     @Inject
>> >>     private Request request;
>> >>
>> >>     @Inject
>> >>     private PropertyAccess propertyAccess;
>> >>
>> >>     @Component(id="selectValue1", parameters = {"model=select1Model",
>> >> "encoder=select1Model"})
>> >>     private Select select1;
>> >>
>> >>     @Property
>> >>     private SelectModel select1Model;
>> >>
>> >>     @Property
>> >>     private SelectObj selectValue1;
>> >>
>> >>     @Component(id="selectValue2", parameters = {"model=select2Model",
>> >> "encoder=select2Model"})
>> >>     private Select select2;
>> >>
>> >>     @Property
>> >>     private SelectModel select2Model;
>> >>
>> >>     @Property
>> >>     private SelectObj selectValue2;
>> >>
>> >>     @Component(id="select1ValueZone")
>> >>     private Zone select1ValueZone;
>> >>
>> >>     @Component(id="select2ValueZone")
>> >>     private Zone select2ValueZone;
>> >>
>> >>     void onActivate(EventContext ctx) {
>> >>         List select1List = new ArrayList();
>> >>         select1List.add(new SelectObj(0, "0 pre ajax"));
>> >>         select1List.add(new SelectObj(1, "1 pre ajax"));
>> >>         select1List.add(new SelectObj(2, "2 pre ajax"));
>> >>         select1List.add(new SelectObj(3, "3 pre ajax"));
>> >>         select1List.add(new SelectObj(4, "4 pre ajax"));
>> >>         select1Model = new GenericSelectModel(select1List,
>> SelectObj.class,
>> >> "text", "id", propertyAccess);
>> >>
>> >>         List select2List = new ArrayList();
>> >>         select2List.add(new SelectObj(0, "0 pre ajax"));
>> >>         select2List.add(new SelectObj(1, "1 pre ajax"));
>> >>         select2List.add(new SelectObj(2, "2 pre ajax"));
>> >>         select2List.add(new SelectObj(3, "3 pre ajax"));
>> >>         select2Model = new GenericSelectModel(select2List,
>> SelectObj.class,
>> >> "text", "id", propertyAccess);
>> >>     }
>> >>
>> >>     public Object onValueChangedFromSelectValue1(SelectObj selectObj) {
>> >>         System.out.println("onValueChangedSelectValue1");
>> >>         List select2List = new ArrayList();
>> >>         select2List.add(new SelectObj(4, "4 post ajax"));
>> >>         select2List.add(new SelectObj(5, "5 post ajax"));
>> >>         select2List.add(new SelectObj(6, "6 post ajax"));
>> >>         select2List.add(new SelectObj(7, "7 post ajax"));
>> >>         select2Model = new GenericSelectModel(select2List,
>> SelectObj.class,
>> >> "text", "id", propertyAccess);
>> >>
>> >>         if(request.isXHR()) {
>> >>             return new MultiZoneUpdate("select1ValueZone",
>> >> select1ValueZone.getBody()).add("select2ValueZone",
>> >> select2ValueZone.getBody());
>> >>         } else {
>> >>             return this;
>> >>         }
>> >>     }
>> >>
>> >> }
>> >>
>> >> Form.tml
>> >>
>> >> http://tape

Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-19 Thread Adam Derkey
Should I create a JIRA ticket for this or is there already one created that
I can use to track the progress?

On Fri, Apr 16, 2010 at 11:06 PM, Howard Lewis Ship wrote:

> I've been tracking this problem; there's a timing issue when Tapestry
> adds a hidden field to store the t:formdata; the DOM is being streamed
> to characters after the  field is added to the DOM, but before
> it is fully configured.  It's deeply tricky stuff.
>
> On Fri, Apr 16, 2010 at 11:28 AM, Adam Derkey 
> wrote:
> > Was this the right list to send this to? Should I send to the dev list or
> > open a jira ticket?
> >
> > On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey 
> wrote:
> >
> >> Using Tapestry 5.2.0-SNAPSHOT
> >>
> >> I'm updating multiple zones after a select on Change event. The JSON
> >> response is including an extra input field after a select field in one
> of
> >> the zones I'm updating. The extra input is then showing up in the
> rendered
> >> page in the browser. Why would tapestry be adding in an extra input
> field?
> >> Is there a way to do this without the extra input being returned?
> >>
> >> I created this example using the quickstart app and send the entire
> project
> >> if needed.
> >>
> >> Thanks
> >> Adam
> >>
> >> /*
> >>  * Form.java
> >>  */
> >> package com.test.pages;
> >>
> >> import com.test.model.GenericSelectModel;
> >> import com.test.vo.SelectObj;
> >> import java.util.ArrayList;
> >> import java.util.List;
> >> import org.apache.tapestry5.EventContext;
> >> import org.apache.tapestry5.SelectModel;
> >> import org.apache.tapestry5.ajax.MultiZoneUpdate;
> >> import org.apache.tapestry5.annotations.Component;
> >> import org.apache.tapestry5.annotations.Property;
> >> import org.apache.tapestry5.corelib.components.Select;
> >> import org.apache.tapestry5.corelib.components.Zone;
> >> import org.apache.tapestry5.ioc.annotations.Inject;
> >> import org.apache.tapestry5.ioc.services.PropertyAccess;
> >> import org.apache.tapestry5.services.Request;
> >>
> >> /**
> >>  *
> >>  * @author aderkey
> >>  */
> >> public class Form {
> >>
> >> @Inject
> >> private Request request;
> >>
> >> @Inject
> >> private PropertyAccess propertyAccess;
> >>
> >> @Component(id="selectValue1", parameters = {"model=select1Model",
> >> "encoder=select1Model"})
> >> private Select select1;
> >>
> >> @Property
> >> private SelectModel select1Model;
> >>
> >> @Property
> >> private SelectObj selectValue1;
> >>
> >> @Component(id="selectValue2", parameters = {"model=select2Model",
> >> "encoder=select2Model"})
> >> private Select select2;
> >>
> >> @Property
> >> private SelectModel select2Model;
> >>
> >> @Property
> >> private SelectObj selectValue2;
> >>
> >> @Component(id="select1ValueZone")
> >> private Zone select1ValueZone;
> >>
> >> @Component(id="select2ValueZone")
> >> private Zone select2ValueZone;
> >>
> >> void onActivate(EventContext ctx) {
> >> List select1List = new ArrayList();
> >> select1List.add(new SelectObj(0, "0 pre ajax"));
> >> select1List.add(new SelectObj(1, "1 pre ajax"));
> >> select1List.add(new SelectObj(2, "2 pre ajax"));
> >> select1List.add(new SelectObj(3, "3 pre ajax"));
> >> select1List.add(new SelectObj(4, "4 pre ajax"));
> >> select1Model = new GenericSelectModel(select1List,
> SelectObj.class,
> >> "text", "id", propertyAccess);
> >>
> >> List select2List = new ArrayList();
> >> select2List.add(new SelectObj(0, "0 pre ajax"));
> >> select2List.add(new SelectObj(1, "1 pre ajax"));
> >> select2List.add(new SelectObj(2, "2 pre ajax"));
> >> select2List.add(new SelectObj(3, "3 pre ajax"));
> >> select2Model = new GenericSelectModel(select2List,
> SelectObj.class,
> >> "text", "id", propertyAccess);
> >> }
> >>
> >> public Object onValueChangedFromSelectValue1(SelectObj selectObj) {
> >> System.out.println("onValueChangedSelectValue1");
> >> List select2List = new ArrayList();
> >> select2List.add(new SelectObj(4, "4 post ajax"));
> >> select2List.add(new SelectObj(5, "5 post ajax"));
> >> select2List.add(new SelectObj(6, "6 post ajax"));
> >> select2List.add(new SelectObj(7, "7 post ajax"));
> >> select2Model = new GenericSelectModel(select2List,
> SelectObj.class,
> >> "text", "id", propertyAccess);
> >>
> >> if(request.isXHR()) {
> >> return new MultiZoneUpdate("select1ValueZone",
> >> select1ValueZone.getBody()).add("select2ValueZone",
> >> select2ValueZone.getBody());
> >> } else {
> >> return this;
> >> }
> >> }
> >>
> >> }
> >>
> >> Form.tml
> >>
> >> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> >> xmlns:p="tapestry:parameter">
> >>  action="#">
> >>  t:validate="required"
> >> t:zone="select1ValueZone"/>
> >> Show
> >>  >> t:id="selectValue2" t:val

Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-16 Thread Howard Lewis Ship
I've been tracking this problem; there's a timing issue when Tapestry
adds a hidden field to store the t:formdata; the DOM is being streamed
to characters after the  field is added to the DOM, but before
it is fully configured.  It's deeply tricky stuff.

On Fri, Apr 16, 2010 at 11:28 AM, Adam Derkey  wrote:
> Was this the right list to send this to? Should I send to the dev list or
> open a jira ticket?
>
> On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey  wrote:
>
>> Using Tapestry 5.2.0-SNAPSHOT
>>
>> I'm updating multiple zones after a select on Change event. The JSON
>> response is including an extra input field after a select field in one of
>> the zones I'm updating. The extra input is then showing up in the rendered
>> page in the browser. Why would tapestry be adding in an extra input field?
>> Is there a way to do this without the extra input being returned?
>>
>> I created this example using the quickstart app and send the entire project
>> if needed.
>>
>> Thanks
>> Adam
>>
>> /*
>>  * Form.java
>>  */
>> package com.test.pages;
>>
>> import com.test.model.GenericSelectModel;
>> import com.test.vo.SelectObj;
>> import java.util.ArrayList;
>> import java.util.List;
>> import org.apache.tapestry5.EventContext;
>> import org.apache.tapestry5.SelectModel;
>> import org.apache.tapestry5.ajax.MultiZoneUpdate;
>> import org.apache.tapestry5.annotations.Component;
>> import org.apache.tapestry5.annotations.Property;
>> import org.apache.tapestry5.corelib.components.Select;
>> import org.apache.tapestry5.corelib.components.Zone;
>> import org.apache.tapestry5.ioc.annotations.Inject;
>> import org.apache.tapestry5.ioc.services.PropertyAccess;
>> import org.apache.tapestry5.services.Request;
>>
>> /**
>>  *
>>  * @author aderkey
>>  */
>> public class Form {
>>
>>     @Inject
>>     private Request request;
>>
>>     @Inject
>>     private PropertyAccess propertyAccess;
>>
>>     @Component(id="selectValue1", parameters = {"model=select1Model",
>> "encoder=select1Model"})
>>     private Select select1;
>>
>>     @Property
>>     private SelectModel select1Model;
>>
>>     @Property
>>     private SelectObj selectValue1;
>>
>>     @Component(id="selectValue2", parameters = {"model=select2Model",
>> "encoder=select2Model"})
>>     private Select select2;
>>
>>     @Property
>>     private SelectModel select2Model;
>>
>>     @Property
>>     private SelectObj selectValue2;
>>
>>     @Component(id="select1ValueZone")
>>     private Zone select1ValueZone;
>>
>>     @Component(id="select2ValueZone")
>>     private Zone select2ValueZone;
>>
>>     void onActivate(EventContext ctx) {
>>         List select1List = new ArrayList();
>>         select1List.add(new SelectObj(0, "0 pre ajax"));
>>         select1List.add(new SelectObj(1, "1 pre ajax"));
>>         select1List.add(new SelectObj(2, "2 pre ajax"));
>>         select1List.add(new SelectObj(3, "3 pre ajax"));
>>         select1List.add(new SelectObj(4, "4 pre ajax"));
>>         select1Model = new GenericSelectModel(select1List, SelectObj.class,
>> "text", "id", propertyAccess);
>>
>>         List select2List = new ArrayList();
>>         select2List.add(new SelectObj(0, "0 pre ajax"));
>>         select2List.add(new SelectObj(1, "1 pre ajax"));
>>         select2List.add(new SelectObj(2, "2 pre ajax"));
>>         select2List.add(new SelectObj(3, "3 pre ajax"));
>>         select2Model = new GenericSelectModel(select2List, SelectObj.class,
>> "text", "id", propertyAccess);
>>     }
>>
>>     public Object onValueChangedFromSelectValue1(SelectObj selectObj) {
>>         System.out.println("onValueChangedSelectValue1");
>>         List select2List = new ArrayList();
>>         select2List.add(new SelectObj(4, "4 post ajax"));
>>         select2List.add(new SelectObj(5, "5 post ajax"));
>>         select2List.add(new SelectObj(6, "6 post ajax"));
>>         select2List.add(new SelectObj(7, "7 post ajax"));
>>         select2Model = new GenericSelectModel(select2List, SelectObj.class,
>> "text", "id", propertyAccess);
>>
>>         if(request.isXHR()) {
>>             return new MultiZoneUpdate("select1ValueZone",
>> select1ValueZone.getBody()).add("select2ValueZone",
>> select2ValueZone.getBody());
>>         } else {
>>             return this;
>>         }
>>     }
>>
>> }
>>
>> Form.tml
>>
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>> xmlns:p="tapestry:parameter">
>>     
>>         > t:zone="select1ValueZone"/>
>>         Show
>>         > t:id="selectValue2" t:validate="required"/>
>>     
>> 
>>
>> JSON Response:
>> {"content":"","zones":{"select2ValueZone":"> id='selectValue2-127fe104b7d' name='selectValue2'>4 post
>> ajax<\/option>5 post ajax<\/option>6
>> post ajax<\/option>7 post ajax<\/option><\/select>
>> <\/input>","select1ValueZone":"Show"}}
>>
>>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

Re: Extra input field after ajax returning MultiZoneUpdate

2010-04-16 Thread Adam Derkey
Was this the right list to send this to? Should I send to the dev list or
open a jira ticket?

On Wed, Apr 14, 2010 at 3:58 PM, Adam Derkey  wrote:

> Using Tapestry 5.2.0-SNAPSHOT
>
> I'm updating multiple zones after a select on Change event. The JSON
> response is including an extra input field after a select field in one of
> the zones I'm updating. The extra input is then showing up in the rendered
> page in the browser. Why would tapestry be adding in an extra input field?
> Is there a way to do this without the extra input being returned?
>
> I created this example using the quickstart app and send the entire project
> if needed.
>
> Thanks
> Adam
>
> /*
>  * Form.java
>  */
> package com.test.pages;
>
> import com.test.model.GenericSelectModel;
> import com.test.vo.SelectObj;
> import java.util.ArrayList;
> import java.util.List;
> import org.apache.tapestry5.EventContext;
> import org.apache.tapestry5.SelectModel;
> import org.apache.tapestry5.ajax.MultiZoneUpdate;
> import org.apache.tapestry5.annotations.Component;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.corelib.components.Select;
> import org.apache.tapestry5.corelib.components.Zone;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.ioc.services.PropertyAccess;
> import org.apache.tapestry5.services.Request;
>
> /**
>  *
>  * @author aderkey
>  */
> public class Form {
>
> @Inject
> private Request request;
>
> @Inject
> private PropertyAccess propertyAccess;
>
> @Component(id="selectValue1", parameters = {"model=select1Model",
> "encoder=select1Model"})
> private Select select1;
>
> @Property
> private SelectModel select1Model;
>
> @Property
> private SelectObj selectValue1;
>
> @Component(id="selectValue2", parameters = {"model=select2Model",
> "encoder=select2Model"})
> private Select select2;
>
> @Property
> private SelectModel select2Model;
>
> @Property
> private SelectObj selectValue2;
>
> @Component(id="select1ValueZone")
> private Zone select1ValueZone;
>
> @Component(id="select2ValueZone")
> private Zone select2ValueZone;
>
> void onActivate(EventContext ctx) {
> List select1List = new ArrayList();
> select1List.add(new SelectObj(0, "0 pre ajax"));
> select1List.add(new SelectObj(1, "1 pre ajax"));
> select1List.add(new SelectObj(2, "2 pre ajax"));
> select1List.add(new SelectObj(3, "3 pre ajax"));
> select1List.add(new SelectObj(4, "4 pre ajax"));
> select1Model = new GenericSelectModel(select1List, SelectObj.class,
> "text", "id", propertyAccess);
>
> List select2List = new ArrayList();
> select2List.add(new SelectObj(0, "0 pre ajax"));
> select2List.add(new SelectObj(1, "1 pre ajax"));
> select2List.add(new SelectObj(2, "2 pre ajax"));
> select2List.add(new SelectObj(3, "3 pre ajax"));
> select2Model = new GenericSelectModel(select2List, SelectObj.class,
> "text", "id", propertyAccess);
> }
>
> public Object onValueChangedFromSelectValue1(SelectObj selectObj) {
> System.out.println("onValueChangedSelectValue1");
> List select2List = new ArrayList();
> select2List.add(new SelectObj(4, "4 post ajax"));
> select2List.add(new SelectObj(5, "5 post ajax"));
> select2List.add(new SelectObj(6, "6 post ajax"));
> select2List.add(new SelectObj(7, "7 post ajax"));
> select2Model = new GenericSelectModel(select2List, SelectObj.class,
> "text", "id", propertyAccess);
>
> if(request.isXHR()) {
> return new MultiZoneUpdate("select1ValueZone",
> select1ValueZone.getBody()).add("select2ValueZone",
> select2ValueZone.getBody());
> } else {
> return this;
> }
> }
>
> }
>
> Form.tml
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> xmlns:p="tapestry:parameter">
> 
>  t:zone="select1ValueZone"/>
> Show
>  t:id="selectValue2" t:validate="required"/>
> 
> 
>
> JSON Response:
> {"content":"","zones":{"select2ValueZone":" id='selectValue2-127fe104b7d' name='selectValue2'>4 post
> ajax<\/option>5 post ajax<\/option>6
> post ajax<\/option>7 post ajax<\/option><\/select>
> <\/input>","select1ValueZone":"Show"}}
>
>