In 4.0 TextField can accept any type using translators.
Br,
Norbi
----- Original Message -----
From: "Norbert Sándor" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>; "Muhariz Jabeer"
<[EMAIL PROTECTED]>
Sent: Monday, June 20, 2005 9:05 PM
Subject: Re: newbie question - how to attach TextFields to int fields?
TextField handles only Strings.
Use ValidField or try something like:
<input jwcid="@TextField" value="ognl:convertedValue" />
// Your parameter or property of type int
public abstract int getValue();
public abstract void setValue(int value);
// Helper property which handles conversion
public String getConvertedValue()
{
return Integer.toString(getValue());
}
public void setConvertedValue(String value)
{
setValue(Integer.parseInt(value));
}
Of course apply some error checking :)
Br,
Norbi
----- Original Message -----
From: "Muhariz Jabeer" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Monday, June 20, 2005 8:40 PM
Subject: newbie question - how to attach TextFields to int fields?
hi all,
i have primitive int field in an object which im trying to attach to a
TextField component. I get a runtime exception for this. Is there a way to
let the TextField component know that its storing the form data into an
int and not a String?
.
thanks,
Muhariz.
--
In a long enough timeline,
every moment will feel like deja vu.
-Muhariz.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]