You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Derek Brown <ze...@yahoo.com> on 2004/12/05 09:41:27 UTC

Form values filled with last entry from ArrayList

Hello,

I have a component with a getUsers() method, this
returns an arraylist. A ForEach component displays
each user in users. Below it, I have a DirectLink
component to create a new user. Problem is when I
click the new link the form is already populated with
the last user object from the list. Setting user to
new User() in the DirectLink new action method did not
seem to help.

Is there a way to make the foreach reset the user
object after its done?

Thanks,
Derek


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


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


Re: Form values filled with last entry from ArrayList

Posted by Nick Stuart <ba...@gmail.com>.
What's your foreach structure look like? I bet you you have something like:
<span jwcid="@Foreach" source="ognl: userList" value="ognl:user "/>

If it is, then the value part is what is causing the problem. Each
time through the list the user value for the page (setUser()) is being
re-populated. So you would need to user objects possibly. A user and a
formUser, or something of the like.

Hope this helps!
-Nick

On Sun, 5 Dec 2004 16:27:06 -0500, Todd O'Bryan <to...@mac.com> wrote:
> I'm in over my depth...My suggestion was just to have a separate form
> at the bottom where you could add a new user, and to link the fields in
> that form to a completely different user object on the page than the
> one you use to go through the Foreach.
> 
> Your problem could be due to the fact that user isn't persistent, so it
> gets reinitialized when the page is reloaded, but I must admit I'm very
> vague on these issues. Howard has managed to make the statefulness of
> Tapestry so intuitive that I get a little lost when the real world
> intrudes.
> 
> 
> 
> Todd
> 
> On Dec 5, 2004, at 2:13 PM, Derek Brown wrote:
> 
> > Oops, this is my Directlink:
> >
> > <span jwcid="@DirectLink"
> > listener="ognl:listeners.newLinkAction">New
> > User</span>
> >
> >       public void newLinkAction(IRequestCycle cycle)
> >       {
> >               setUser(new User());
> >               setCreate(true);
> >       }
> >
> > The setUser to new User() does not seem to help.
> >
> > Thanks
> >
> >
> > --- Derek Brown <ze...@yahoo.com> wrote:
> >
> >> Hi,
> >>
> >> <form jwcid="@Form"
> >> listener="ognl:listeners.newAction"
> >> delegate="ognl:beans.delegate"
> >> stateful="ognl:false">
> >>
> >> That is my directlink, If I create a newUser object,
> >> dont I have to make another form for editUser as
> >> well?
> >>
> >> Thanks,
> >> Derick
> >>
> >> --- Todd O'Bryan <to...@mac.com> wrote:
> >>
> >>> There might be a way to do what you suggest, but
> >> it
> >>> would be easier to
> >>> just use a separate property (maybe newUser?) for
> >>> the DirectLink.
> >>>
> >>> Todd
> >>>
> >>> On Dec 5, 2004, at 3:41 AM, Derek Brown wrote:
> >>>
> >>>> Hello,
> >>>>
> >>>> I have a component with a getUsers() method,
> >> this
> >>>> returns an arraylist. A ForEach component
> >> displays
> >>>> each user in users. Below it, I have a
> >> DirectLink
> >>>> component to create a new user. Problem is when
> >> I
> >>>> click the new link the form is already populated
> >>> with
> >>>> the last user object from the list. Setting user
> >>> to
> >>>> new User() in the DirectLink new action method
> >> did
> >>> not
> >>>> seem to help.
> >>>>
> >>>> Is there a way to make the foreach reset the
> >> user
> >>>> object after its done?
> >>>>
> >>>> Thanks,
> >>>> Derek
> >>>>
> >>>>
> >>>>
> >>>> __________________________________
> >>>> Do you Yahoo!?
> >>>> The all-new My Yahoo! - Get yours free!
> >>>> http://my.yahoo.com
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>
> > ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail:
> >>> tapestry-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail:
> >>> tapestry-user-help@jakarta.apache.org
> >>>>
> >>>
> >>>
> >>>
> >>
> > ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> >>> tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >>> tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >>
> >>
> >>
> >> __________________________________
> >> Do you Yahoo!?
> >> Read only the mail you want - Yahoo! Mail SpamGuard.
> >>
> >> http://promotions.yahoo.com/new_mail
> >>
> >>
> > ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - Find what you need with new enhanced search.
> > http://info.mail.yahoo.com/mail_250
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

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


Re: Form values filled with last entry from ArrayList

Posted by Todd O'Bryan <to...@mac.com>.
I'm in over my depth...My suggestion was just to have a separate form 
at the bottom where you could add a new user, and to link the fields in 
that form to a completely different user object on the page than the 
one you use to go through the Foreach.

Your problem could be due to the fact that user isn't persistent, so it 
gets reinitialized when the page is reloaded, but I must admit I'm very 
vague on these issues. Howard has managed to make the statefulness of 
Tapestry so intuitive that I get a little lost when the real world 
intrudes.

Todd

On Dec 5, 2004, at 2:13 PM, Derek Brown wrote:

> Oops, this is my Directlink:
>
> <span jwcid="@DirectLink"
> listener="ognl:listeners.newLinkAction">New
> User</span>
>
> 	public void newLinkAction(IRequestCycle cycle)
> 	{
> 		setUser(new User());
> 		setCreate(true);
> 	}
>
> The setUser to new User() does not seem to help.
>
> Thanks
>
>
> --- Derek Brown <ze...@yahoo.com> wrote:
>
>> Hi,
>>
>> <form jwcid="@Form"
>> listener="ognl:listeners.newAction"
>> delegate="ognl:beans.delegate"
>> stateful="ognl:false">
>>
>> That is my directlink, If I create a newUser object,
>> dont I have to make another form for editUser as
>> well?
>>
>> Thanks,
>> Derick
>>
>> --- Todd O'Bryan <to...@mac.com> wrote:
>>
>>> There might be a way to do what you suggest, but
>> it
>>> would be easier to
>>> just use a separate property (maybe newUser?) for
>>> the DirectLink.
>>>
>>> Todd
>>>
>>> On Dec 5, 2004, at 3:41 AM, Derek Brown wrote:
>>>
>>>> Hello,
>>>>
>>>> I have a component with a getUsers() method,
>> this
>>>> returns an arraylist. A ForEach component
>> displays
>>>> each user in users. Below it, I have a
>> DirectLink
>>>> component to create a new user. Problem is when
>> I
>>>> click the new link the form is already populated
>>> with
>>>> the last user object from the list. Setting user
>>> to
>>>> new User() in the DirectLink new action method
>> did
>>> not
>>>> seem to help.
>>>>
>>>> Is there a way to make the foreach reset the
>> user
>>>> object after its done?
>>>>
>>>> Thanks,
>>>> Derek
>>>>
>>>>
>>>> 		
>>>> __________________________________
>>>> Do you Yahoo!?
>>>> The all-new My Yahoo! - Get yours free!
>>>> http://my.yahoo.com
>>>>
>>>>
>>>>
>>>>
>>>
>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>>
>>
> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>> 		
>> __________________________________
>> Do you Yahoo!?
>> Read only the mail you want - Yahoo! Mail SpamGuard.
>>
>> http://promotions.yahoo.com/new_mail
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: Form values filled with last entry from ArrayList

Posted by Derek Brown <ze...@yahoo.com>.
Oops, this is my Directlink:

<span jwcid="@DirectLink"
listener="ognl:listeners.newLinkAction">New
User</span>

	public void newLinkAction(IRequestCycle cycle)
	{
		setUser(new User());
		setCreate(true);
	}

The setUser to new User() does not seem to help.

Thanks


--- Derek Brown <ze...@yahoo.com> wrote:

> Hi,
> 
> <form jwcid="@Form"
> listener="ognl:listeners.newAction"
> delegate="ognl:beans.delegate"
> stateful="ognl:false"> 
> 
> That is my directlink, If I create a newUser object,
> dont I have to make another form for editUser as
> well?
> 
> Thanks,
> Derick
> 
> --- Todd O'Bryan <to...@mac.com> wrote:
> 
> > There might be a way to do what you suggest, but
> it
> > would be easier to 
> > just use a separate property (maybe newUser?) for
> > the DirectLink.
> > 
> > Todd
> > 
> > On Dec 5, 2004, at 3:41 AM, Derek Brown wrote:
> > 
> > > Hello,
> > >
> > > I have a component with a getUsers() method,
> this
> > > returns an arraylist. A ForEach component
> displays
> > > each user in users. Below it, I have a
> DirectLink
> > > component to create a new user. Problem is when
> I
> > > click the new link the form is already populated
> > with
> > > the last user object from the list. Setting user
> > to
> > > new User() in the DirectLink new action method
> did
> > not
> > > seem to help.
> > >
> > > Is there a way to make the foreach reset the
> user
> > > object after its done?
> > >
> > > Thanks,
> > > Derek
> > >
> > >
> > > 		
> > > __________________________________
> > > Do you Yahoo!?
> > > The all-new My Yahoo! - Get yours free!
> > > http://my.yahoo.com
> > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > >
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Read only the mail you want - Yahoo! Mail SpamGuard.
> 
> http://promotions.yahoo.com/new_mail 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

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


Re: Form values filled with last entry from ArrayList

Posted by Derek Brown <ze...@yahoo.com>.
Hi,

<form jwcid="@Form"
listener="ognl:listeners.newAction"
delegate="ognl:beans.delegate" stateful="ognl:false"> 

That is my directlink, If I create a newUser object,
dont I have to make another form for editUser as well?

Thanks,
Derick

--- Todd O'Bryan <to...@mac.com> wrote:

> There might be a way to do what you suggest, but it
> would be easier to 
> just use a separate property (maybe newUser?) for
> the DirectLink.
> 
> Todd
> 
> On Dec 5, 2004, at 3:41 AM, Derek Brown wrote:
> 
> > Hello,
> >
> > I have a component with a getUsers() method, this
> > returns an arraylist. A ForEach component displays
> > each user in users. Below it, I have a DirectLink
> > component to create a new user. Problem is when I
> > click the new link the form is already populated
> with
> > the last user object from the list. Setting user
> to
> > new User() in the DirectLink new action method did
> not
> > seem to help.
> >
> > Is there a way to make the foreach reset the user
> > object after its done?
> >
> > Thanks,
> > Derek
> >
> >
> > 		
> > __________________________________
> > Do you Yahoo!?
> > The all-new My Yahoo! - Get yours free!
> > http://my.yahoo.com
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

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


Re: Form values filled with last entry from ArrayList

Posted by Todd O'Bryan <to...@mac.com>.
There might be a way to do what you suggest, but it would be easier to 
just use a separate property (maybe newUser?) for the DirectLink.

Todd

On Dec 5, 2004, at 3:41 AM, Derek Brown wrote:

> Hello,
>
> I have a component with a getUsers() method, this
> returns an arraylist. A ForEach component displays
> each user in users. Below it, I have a DirectLink
> component to create a new user. Problem is when I
> click the new link the form is already populated with
> the last user object from the list. Setting user to
> new User() in the DirectLink new action method did not
> seem to help.
>
> Is there a way to make the foreach reset the user
> object after its done?
>
> Thanks,
> Derek
>
>
> 		
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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