You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hugo Palma <hu...@gmail.com> on 2008/01/08 19:50:01 UTC

T5: Editing a list of values

My use case is this,

i would like to let the user to enter an undefined number of values. I
have the UI implemented with a loop component getting the number of
cycles from a page property and in each cycle it places a new textfield
component.

The problem is, what property do i put in each of the textfield value
paramters ? I'm holding the values in a List property in my page.
I can't do <input t:type="textfield" value="myList.0"/>.

Any ideas ?
I'm thinking that i may be complicating something that probably is much
simpler.

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


Re: T5: Editing a list of values

Posted by yuan gogo <go...@gmail.com>.
Your example solved my problem also, thank you :-)

2008/1/9, Shing Hing Man <ma...@yahoo.com>:
>
> I have a micky mouse example that does something
> similar. The live example and source code is at
>
>
> http://lombok.demon.co.uk/tapestry5Demo/test/sum
>
> Shing
>
>
> --- Kevin Menard <km...@servprise.com> wrote:
>
> > You could keep track of an index variable and use
> > that to index a List in
> > your page class.  Something like the following:
> >
> > public String getValue()
> > {
> >     return values.get(index);
> > }
> >
> > public void setValue(final String value)
> > {
> >     values.set(index, value);
> > }
> >
> > Then the trick is updating the index value, but that
> > may be simpler for you.
> > I've used that trick to avoid serializing Cayenne
> > objects in a Loop.  Of
> > course, in that case, the semantics of the index
> > value are very well-defined
> > so YMMV.
> >
> > --
> > Kevin
> >
> >
> > On 1/8/08 1:50 PM, in article
> > 4783C5D9.6000707@gmail.com, "Hugo Palma"
> > <hu...@gmail.com> wrote:
> >
> > > My use case is this,
> > >
> > > i would like to let the user to enter an undefined
> > number of values. I
> > > have the UI implemented with a loop component
> > getting the number of
> > > cycles from a page property and in each cycle it
> > places a new textfield
> > > component.
> > >
> > > The problem is, what property do i put in each of
> > the textfield value
> > > paramters ? I'm holding the values in a List
> > property in my page.
> > > I can't do <input t:type="textfield"
> > value="myList.0"/>.
> > >
> > > Any ideas ?
> > > I'm thinking that i may be complicating something
> > that probably is much
> > > simpler.
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
> >
> >
>
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Editing a list of values

Posted by Shing Hing Man <ma...@yahoo.com>.
I have a micky mouse example that does something
similar. The live example and source code is at


http://lombok.demon.co.uk/tapestry5Demo/test/sum

Shing 


--- Kevin Menard <km...@servprise.com> wrote:

> You could keep track of an index variable and use
> that to index a List in
> your page class.  Something like the following:
> 
> public String getValue()
> {
>     return values.get(index);
> }
> 
> public void setValue(final String value)
> {
>     values.set(index, value);
> }
> 
> Then the trick is updating the index value, but that
> may be simpler for you.
> I've used that trick to avoid serializing Cayenne
> objects in a Loop.  Of
> course, in that case, the semantics of the index
> value are very well-defined
> so YMMV.
> 
> -- 
> Kevin
> 
> 
> On 1/8/08 1:50 PM, in article
> 4783C5D9.6000707@gmail.com, "Hugo Palma"
> <hu...@gmail.com> wrote:
> 
> > My use case is this,
> > 
> > i would like to let the user to enter an undefined
> number of values. I
> > have the UI implemented with a loop component
> getting the number of
> > cycles from a page property and in each cycle it
> places a new textfield
> > component.
> > 
> > The problem is, what property do i put in each of
> the textfield value
> > paramters ? I'm holding the values in a List
> property in my page.
> > I can't do <input t:type="textfield"
> value="myList.0"/>.
> > 
> > Any ideas ?
> > I'm thinking that i may be complicating something
> that probably is much
> > simpler.
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
> 


Home page : http://www.lombok.demon.co.uk/



      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

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


Re: T5: Editing a list of values

Posted by Kevin Menard <km...@servprise.com>.
You could keep track of an index variable and use that to index a List in
your page class.  Something like the following:

public String getValue()
{
    return values.get(index);
}

public void setValue(final String value)
{
    values.set(index, value);
}

Then the trick is updating the index value, but that may be simpler for you.
I've used that trick to avoid serializing Cayenne objects in a Loop.  Of
course, in that case, the semantics of the index value are very well-defined
so YMMV.

-- 
Kevin


On 1/8/08 1:50 PM, in article 4783C5D9.6000707@gmail.com, "Hugo Palma"
<hu...@gmail.com> wrote:

> My use case is this,
> 
> i would like to let the user to enter an undefined number of values. I
> have the UI implemented with a loop component getting the number of
> cycles from a page property and in each cycle it places a new textfield
> component.
> 
> The problem is, what property do i put in each of the textfield value
> paramters ? I'm holding the values in a List property in my page.
> I can't do <input t:type="textfield" value="myList.0"/>.
> 
> Any ideas ?
> I'm thinking that i may be complicating something that probably is much
> simpler.
> 
> ---------------------------------------------------------------------
> 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: Editing a list of values

Posted by Hugo Palma <hu...@logical-software.com>.
Yep, definitely was over complicating.
I just have to use the value parameter of the Loop component.

Hugo Palma wrote:
> My use case is this,
>
> i would like to let the user to enter an undefined number of values. I
> have the UI implemented with a loop component getting the number of
> cycles from a page property and in each cycle it places a new textfield
> component.
>
> The problem is, what property do i put in each of the textfield value
> paramters ? I'm holding the values in a List property in my page.
> I can't do <input t:type="textfield" value="myList.0"/>.
>
> Any ideas ?
> I'm thinking that i may be complicating something that probably is much
> simpler.
>
>   

-- 
Hugo Palma
----------------------------------------------------
LOGICAL SOFTWARE
Human Capital | Enterprise Java Systems | Research

Phone: (+351) 961104211
Email: hugo.palma@logical-software.com
Blog : http://blogs.logical-software.com/roller/logicalme 
Web  : http://www.logical-software.com
----------------------------------------------------


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