You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2005/06/28 15:51:00 UTC
ListEdit ... yet again
Hi I'm using Tapestry 3.0.3
Question remains ...
Example: ListEdit on instances of
public class DomainOne {
private String name;
private int count;
...
}
___How can I use this DomainOne object as source of the ListEdit?___
My first solution used a variant of this class for UI purposes, like:
public class DomainOneUI {
private String name;
private String _count;
public DomainOneUI(DomainOne i) {
this.name = i.getName();
this._count = String.valueOf(i.getCount());
}
public DomainOne getInstance() {
DomainOne instance = new DomainOne();
instance.setName(name);
instance.setAge(Integer.parseInt(_count));
return istance;
}
}
Want to know whether this is a better, less intrusive way.
Conversion/translation or something?
--
Cumquat Information Technology
De Dreef 19
3706 BR Zeist
T +31 (0)30 - 6940490
F +31 (0)10 - 6940499
http://www.cumquat.nl
Jan.Vissers@cumquat.nl
M +31 6 5 11 169 556
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: ListEdit ... yet again
Posted by Stephen Smithstone <sk...@lchost.co.uk>.
use the domain class as the source if you are using @Insert to get
the value then tapestry will convert the int to a string
On 28 Jun 2005, at 14:51, Jan Vissers wrote:
> Hi I'm using Tapestry 3.0.3
>
>
> Question remains ...
>
> Example: ListEdit on instances of
>
> public class DomainOne {
> private String name;
> private int count;
>
> ...
> }
>
> ___How can I use this DomainOne object as source of the ListEdit?___
>
>
> My first solution used a variant of this class for UI purposes, like:
>
> public class DomainOneUI {
> private String name;
> private String _count;
>
> public DomainOneUI(DomainOne i) {
> this.name = i.getName();
> this._count = String.valueOf(i.getCount());
> }
>
> public DomainOne getInstance() {
> DomainOne instance = new DomainOne();
> instance.setName(name);
> instance.setAge(Integer.parseInt(_count));
> return istance;
> }
> }
>
>
> Want to know whether this is a better, less intrusive way.
> Conversion/translation or something?
>
> --
> Cumquat Information Technology
> De Dreef 19
> 3706 BR Zeist
> T +31 (0)30 - 6940490
> F +31 (0)10 - 6940499
> http://www.cumquat.nl
>
> Jan.Vissers@cumquat.nl
> M +31 6 5 11 169 556
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
-Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org