You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Luiz Henrique Rossetti <lu...@gmail.com> on 2007/06/19 13:55:11 UTC

How to use the tag with ?

Hi guys,

How can I use the s: param with s:textfield?
I need to format a Timestamp property of my Action using the mask
"dd/MM/yyyy".

MyAction

public BlablaAction extens ActionSupport{

   private Employee employee;

   getters and setters

}

public class Employee{

   private Timestamp finalDate;

   getters and setters
}

My jsp page

     <s:textfield cssClass="textfield" name="emp.finalDate" maxlength="10">
            <s:param name="value" value="employee.finalDate"/>
     </s:textfield>

My package.properties

emp.finalDate = {dd/MM/yyyy}

Re: How to use the tag with ?

Posted by Kishen Simbhoedatpanday <es...@gmail.com>.
Ok... so you could create a Number format type converter, but what about
getting the locale (i18n) format from resource bundles?

I could not find a way to get a text from the message resource bundles (like
getText('format.number') in the Action classes).

Anyone facing the same problem?


Luiz Henrique Rossetti wrote:
> 
> I resolved the problem creating a class that extends a class
> StrutsTypeConverter.
> 
> On 6/21/07, Célio Cidral Junior <cc...@gmail.com> wrote:
>>
>> I have the same problem, but as far as I could see, formatting support
>> in S2 is nasty.  You can format something with <s:text> using the
>> format defined in your resource bundle, but you can't do that with
>> <s:textfield>. WTF?!  Man, so far I've spent 3 hours trying to do make
>> that work, but just couldn't.  I'm going crazy!  Serious...
>>
>> Célio
>>
>> 2007/6/19, Luiz Henrique Rossetti <lu...@gmail.com>:
>> > Hi guys,
>> >
>> > How can I use the s: param with s:textfield?
>> > I need to format a Timestamp property of my Action using the mask
>> > "dd/MM/yyyy".
>> >
>> > MyAction
>> >
>> > public BlablaAction extens ActionSupport{
>> >
>> >    private Employee employee;
>> >
>> >    getters and setters
>> >
>> > }
>> >
>> > public class Employee{
>> >
>> >    private Timestamp finalDate;
>> >
>> >    getters and setters
>> > }
>> >
>> > My jsp page
>> >
>> >      <s:textfield cssClass="textfield" name="emp.finalDate"
>> maxlength="10">
>> >             <s:param name="value" value="employee.finalDate"/>
>> >      </s:textfield>
>> >
>> > My package.properties
>> >
>> > emp.finalDate = {dd/MM/yyyy}
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-the-%3Cs%3Aparam%3E-tag-with-%3Cs%3Atextfield%3E--tf3945930.html#a12270273
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How to use the tag with ?

Posted by Luiz Henrique Rossetti <lu...@gmail.com>.
I resolved the problem creating a class that extends a class
StrutsTypeConverter.

On 6/21/07, Célio Cidral Junior <cc...@gmail.com> wrote:
>
> I have the same problem, but as far as I could see, formatting support
> in S2 is nasty.  You can format something with <s:text> using the
> format defined in your resource bundle, but you can't do that with
> <s:textfield>. WTF?!  Man, so far I've spent 3 hours trying to do make
> that work, but just couldn't.  I'm going crazy!  Serious...
>
> Célio
>
> 2007/6/19, Luiz Henrique Rossetti <lu...@gmail.com>:
> > Hi guys,
> >
> > How can I use the s: param with s:textfield?
> > I need to format a Timestamp property of my Action using the mask
> > "dd/MM/yyyy".
> >
> > MyAction
> >
> > public BlablaAction extens ActionSupport{
> >
> >    private Employee employee;
> >
> >    getters and setters
> >
> > }
> >
> > public class Employee{
> >
> >    private Timestamp finalDate;
> >
> >    getters and setters
> > }
> >
> > My jsp page
> >
> >      <s:textfield cssClass="textfield" name="emp.finalDate"
> maxlength="10">
> >             <s:param name="value" value="employee.finalDate"/>
> >      </s:textfield>
> >
> > My package.properties
> >
> > emp.finalDate = {dd/MM/yyyy}
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: How to use the tag with ?

Posted by Célio Cidral Junior <cc...@gmail.com>.
I have the same problem, but as far as I could see, formatting support
in S2 is nasty.  You can format something with <s:text> using the
format defined in your resource bundle, but you can't do that with
<s:textfield>. WTF?!  Man, so far I've spent 3 hours trying to do make
that work, but just couldn't.  I'm going crazy!  Serious...

Célio

2007/6/19, Luiz Henrique Rossetti <lu...@gmail.com>:
> Hi guys,
>
> How can I use the s: param with s:textfield?
> I need to format a Timestamp property of my Action using the mask
> "dd/MM/yyyy".
>
> MyAction
>
> public BlablaAction extens ActionSupport{
>
>    private Employee employee;
>
>    getters and setters
>
> }
>
> public class Employee{
>
>    private Timestamp finalDate;
>
>    getters and setters
> }
>
> My jsp page
>
>      <s:textfield cssClass="textfield" name="emp.finalDate" maxlength="10">
>             <s:param name="value" value="employee.finalDate"/>
>      </s:textfield>
>
> My package.properties
>
> emp.finalDate = {dd/MM/yyyy}
>

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