i18n within dojo attribute

View: New views
9 Messages — Rating Filter:   Alert me  

i18n within dojo attribute

by Larry Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a text field which I would like to 'dojo-ize' by turning it into a ValidationTextBox.

One of the parameters, 'promptMessage' is a text message that is put up as a help when the focus enters the text box.

My problem is that I would like to internationalize this message. My thought was to place a struts2 text tag as the value of this attribute.

However, placing the tag inside the attribute quotes quotes the tag. Here is what I did:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter field value" />

This works, but the message is in English. To internationalize it, I tried this:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="<s:text name='fieldPrompt' />" />

But this quotes the angle brackets and the result is:

.... promptMessage="<s:text name='username' />"

I've tried a couple of other variations that do not work either. Any suggestions as to how I might do this?

-- Larry


Re: i18n within dojo attribute

by Larry Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It occurred to me to use an OGNL form to do this, but I am still having a challenge getting it to work.

I've tried

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="${getText('fieldPrompt)}" />

This gets me past the first problem, but still doesn't work. I am getting message that getText must have a prefix in the default namespace. I'm not sure where to take it from there.

Any suggestions?

-- Larry

----- Original Message -----
From: "larryreed" <larryreed@...>
To: "user" <user@...>
Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
Subject: i18n within dojo attribute

I have a text field which I would like to 'dojo-ize' by turning it into a ValidationTextBox.

One of the parameters, 'promptMessage' is a text message that is put up as a help when the focus enters the text box.

My problem is that I would like to internationalize this message. My thought was to place a struts2 text tag as the value of this attribute.

However, placing the tag inside the attribute quotes quotes the tag. Here is what I did:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter field value" />

This works, but the message is in English. To internationalize it, I tried this:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="<s:text name='fieldPrompt' />" />

But this quotes the angle brackets and the result is:

.... promptMessage="<s:text name='username' />"

I've tried a couple of other variations that do not work either. Any suggestions as to how I might do this?

-- Larry


AW: i18n within dojo attribute

by samuel.robert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I think you just need to write "%" instead of "$" in the promptMessage attribute.

Regards,


 
Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Technik AG, Hamburg, Registereintragung / Registration: Amtsgericht Hamburg HRB 56865
Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board: Stephan Gemkow
Vorstand / Executive Board: August Wilhelm Henningsen (Vorsitzender/Chairman), Dr. Peter Jansen, Uwe Mukrasch, Dr. Thomas Stueger
 
-----Ursprüngliche Nachricht-----

Von: larryreed [mailto:larryreed@...]
Gesendet: Mittwoch, 28. Oktober 2009 04:53
An: Struts Users Mailing List; Larry Reed
Betreff: Re: i18n within dojo attribute


It occurred to me to use an OGNL form to do this, but I am still having a challenge getting it to work.

I've tried

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="${getText('fieldPrompt)}" />

This gets me past the first problem, but still doesn't work. I am getting message that getText must have a prefix in the default namespace. I'm not sure where to take it from there.

Any suggestions?

-- Larry

----- Original Message -----
From: "larryreed" <larryreed@...>
To: "user" <user@...>
Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
Subject: i18n within dojo attribute

I have a text field which I would like to 'dojo-ize' by turning it into a ValidationTextBox.

One of the parameters, 'promptMessage' is a text message that is put up as a help when the focus enters the text box.

My problem is that I would like to internationalize this message. My thought was to place a struts2 text tag as the value of this attribute.

However, placing the tag inside the attribute quotes quotes the tag. Here is what I did:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter field value" />

This works, but the message is in English. To internationalize it, I tried this:

<s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox" promptMessage="<s:text name='fieldPrompt' />" />

But this quotes the angle brackets and the result is:

.... promptMessage="<s:text name='username' />"

I've tried a couple of other variations that do not work either. Any suggestions as to how I might do this?

-- Larry


 

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


Re: i18n within dojo attribute

by Sparecreative :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You¹re missing the closing inverted comma on fieldPrompt.

Z.

>
> It occurred to me to use an OGNL form to do this, but I am still having a
> challenge getting it to work.
>
> I've tried
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('fieldPrompt)}" />
>
> This gets me past the first problem, but still doesn't work. I am getting
> message that getText must have a prefix in the default namespace. I'm not sure
> where to take it from there.
>
> Any suggestions?
>
> -- Larry
>
> ----- Original Message -----
> From: "larryreed" <larryreed@...>
> To: "user" <user@...>
> Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> Subject: i18n within dojo attribute
>
> I have a text field which I would like to 'dojo-ize' by turning it into a
> ValidationTextBox.
>
> One of the parameters, 'promptMessage' is a text message that is put up as a
> help when the focus enters the text box.
>
> My problem is that I would like to internationalize this message. My thought
> was to place a struts2 text tag as the value of this attribute.
>
> However, placing the tag inside the attribute quotes quotes the tag. Here is
> what I did:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="Enter field value" />
>
> This works, but the message is in English. To internationalize it, I tried
> this:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="<s:text name='fieldPrompt' />" />
>
> But this quotes the angle brackets and the result is:
>
> .... promptMessage="<s:text name='username' />"
>
> I've tried a couple of other variations that do not work either. Any
> suggestions as to how I might do this?
>
> -- Larry
>


Parent Message unknown Re: i18n within dojo attribute

by Larry Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you for your help.

This was, I believe, a typo in the email, but not in the code. In any case, including the closing single quote does not solve the problem.

Here is the exact text and error message:

<s:textfield key="siSignInEMail" required="true" dojoType="dijit.form.ValidationTextBox"
promptMessage="${getText('siSignInEMail')}" />

The generated error text:
'The function getText must be used with a prefix when a default namespace is not specified '

In response to Samuel, thank you also. Your solution does not generate an error. It simply results in the text between double quotes being taken literally:

<s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="%{getText('signInEMail')}" />

This results in a prompt containing %{getText('signInEMail')}.



----- Original Message -----
From: "Zoran Avtarovski" <zoran@...>
To: "Struts Users Mailing List" <user@...>
Sent: Thursday, October 29, 2009 2:11:30 AM GMT -08:00 US/Canada Pacific
Subject: Re: i18n within dojo attribute

You¹re missing the closing inverted comma on fieldPrompt.

Z.

>
> It occurred to me to use an OGNL form to do this, but I am still having a
> challenge getting it to work.
>
> I've tried
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('fieldPrompt)}" />
>
> This gets me past the first problem, but still doesn't work. I am getting
> message that getText must have a prefix in the default namespace. I'm not sure
> where to take it from there.
>
> Any suggestions?
>
> -- Larry
>
> ----- Original Message -----
> From: "larryreed" <larryreed@...>
> To: "user" <user@...>
> Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> Subject: i18n within dojo attribute
>
> I have a text field which I would like to 'dojo-ize' by turning it into a
> ValidationTextBox.
>
> One of the parameters, 'promptMessage' is a text message that is put up as a
> help when the focus enters the text box.
>
> My problem is that I would like to internationalize this message. My thought
> was to place a struts2 text tag as the value of this attribute.
>
> However, placing the tag inside the attribute quotes quotes the tag. Here is
> what I did:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="Enter field value" />
>
> This works, but the message is in English. To internationalize it, I tried
> this:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="<s:text name='fieldPrompt' />" />
>
> But this quotes the angle brackets and the result is:
>
> .... promptMessage="<s:text name='username' />"
>
> I've tried a couple of other variations that do not work either. Any
> suggestions as to how I might do this?
>
> -- Larry
>


AW: i18n within dojo attribute

by samuel.robert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Not sure it works for you, but you can try this:

<s:text name="signInEMail" var="mytext"/>
<s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="${mytext}" />



 
Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Technik AG, Hamburg, Registereintragung / Registration: Amtsgericht Hamburg HRB 56865
Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board: Stephan Gemkow
Vorstand / Executive Board: August Wilhelm Henningsen (Vorsitzender/Chairman), Dr. Peter Jansen, Uwe Mukrasch, Dr. Thomas Stueger
 
-----Ursprüngliche Nachricht-----

Von: larryreed [mailto:larryreed@...]
Gesendet: Donnerstag, 29. Oktober 2009 17:59
An: Struts Users Mailing List
Betreff: Re: i18n within dojo attribute



Thank you for your help.

This was, I believe, a typo in the email, but not in the code. In any case, including the closing single quote does not solve the problem.

Here is the exact text and error message:

<s:textfield key="siSignInEMail" required="true" dojoType="dijit.form.ValidationTextBox"
promptMessage="${getText('siSignInEMail')}" />

The generated error text:
'The function getText must be used with a prefix when a default namespace is not specified '

In response to Samuel, thank you also. Your solution does not generate an error. It simply results in the text between double quotes being taken literally:

<s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="%{getText('signInEMail')}" />

This results in a prompt containing %{getText('signInEMail')}.



----- Original Message -----
From: "Zoran Avtarovski" <zoran@...>
To: "Struts Users Mailing List" <user@...>
Sent: Thursday, October 29, 2009 2:11:30 AM GMT -08:00 US/Canada Pacific
Subject: Re: i18n within dojo attribute

You¹re missing the closing inverted comma on fieldPrompt.

Z.

>
> It occurred to me to use an OGNL form to do this, but I am still
> having a
> challenge getting it to work.
>
> I've tried
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('fieldPrompt)}" />
>
> This gets me past the first problem, but still doesn't work. I am
> getting
> message that getText must have a prefix in the default namespace. I'm not sure
> where to take it from there.
>
> Any suggestions?
>
> -- Larry
>
> ----- Original Message -----
> From: "larryreed" <larryreed@...>
> To: "user" <user@...>
> Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> Subject: i18n within dojo attribute
>
> I have a text field which I would like to 'dojo-ize' by turning it
> into a
> ValidationTextBox.
>
> One of the parameters, 'promptMessage' is a text message that is put
> up as a
> help when the focus enters the text box.
>
> My problem is that I would like to internationalize this message. My
> thought
> was to place a struts2 text tag as the value of this attribute.
>
> However, placing the tag inside the attribute quotes quotes the tag.
> Here is
> what I did:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="Enter field value" />
>
> This works, but the message is in English. To internationalize it, I
> tried
> this:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="<s:text name='fieldPrompt' />" />
>
> But this quotes the angle brackets and the result is:
>
> .... promptMessage="<s:text name='username' />"
>
> I've tried a couple of other variations that do not work either. Any
> suggestions as to how I might do this?
>
> -- Larry
>


 

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


RE: AW: i18n within dojo attribute

by mgainty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


sam is correct

do you have i18nInterceptor enabled in your stack?
<interceptors>
     <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>

            <!-- Sample i18n stack -->
            <interceptor-stack name="i18nStack">
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>

*gruss*
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Subject: AW: i18n within dojo attribute
> Date: Fri, 30 Oct 2009 10:10:59 +0100
> From: samuel.robert@...
> To: user@...; larry@...
>
> Not sure it works for you, but you can try this:
>
> <s:text name="signInEMail" var="mytext"/>
> <s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="${mytext}" />
>
>
>
>  
> Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Technik AG, Hamburg, Registereintragung / Registration: Amtsgericht Hamburg HRB 56865
> Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board: Stephan Gemkow
> Vorstand / Executive Board: August Wilhelm Henningsen (Vorsitzender/Chairman), Dr. Peter Jansen, Uwe Mukrasch, Dr. Thomas Stueger
>  
> -----Ursprüngliche Nachricht-----
>
> Von: larryreed [mailto:larryreed@...]
> Gesendet: Donnerstag, 29. Oktober 2009 17:59
> An: Struts Users Mailing List
> Betreff: Re: i18n within dojo attribute
>
>
>
> Thank you for your help.
>
> This was, I believe, a typo in the email, but not in the code. In any case, including the closing single quote does not solve the problem.
>
> Here is the exact text and error message:
>
> <s:textfield key="siSignInEMail" required="true" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('siSignInEMail')}" />
>
> The generated error text:
> 'The function getText must be used with a prefix when a default namespace is not specified '
>
> In response to Samuel, thank you also. Your solution does not generate an error. It simply results in the text between double quotes being taken literally:
>
> <s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="%{getText('signInEMail')}" />
>
> This results in a prompt containing %{getText('signInEMail')}.
>
>
>
> ----- Original Message -----
> From: "Zoran Avtarovski" <zoran@...>
> To: "Struts Users Mailing List" <user@...>
> Sent: Thursday, October 29, 2009 2:11:30 AM GMT -08:00 US/Canada Pacific
> Subject: Re: i18n within dojo attribute
>
> You¹re missing the closing inverted comma on fieldPrompt.
>
> Z.
> >
> > It occurred to me to use an OGNL form to do this, but I am still
> > having a
> > challenge getting it to work.
> >
> > I've tried
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="${getText('fieldPrompt)}" />
> >
> > This gets me past the first problem, but still doesn't work. I am
> > getting
> > message that getText must have a prefix in the default namespace. I'm not sure
> > where to take it from there.
> >
> > Any suggestions?
> >
> > -- Larry
> >
> > ----- Original Message -----
> > From: "larryreed" <larryreed@...>
> > To: "user" <user@...>
> > Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> > Subject: i18n within dojo attribute
> >
> > I have a text field which I would like to 'dojo-ize' by turning it
> > into a
> > ValidationTextBox.
> >
> > One of the parameters, 'promptMessage' is a text message that is put
> > up as a
> > help when the focus enters the text box.
> >
> > My problem is that I would like to internationalize this message. My
> > thought
> > was to place a struts2 text tag as the value of this attribute.
> >
> > However, placing the tag inside the attribute quotes quotes the tag.
> > Here is
> > what I did:
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="Enter field value" />
> >
> > This works, but the message is in English. To internationalize it, I
> > tried
> > this:
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="<s:text name='fieldPrompt' />" />
> >
> > But this quotes the angle brackets and the result is:
> >
> > .... promptMessage="<s:text name='username' />"
> >
> > I've tried a couple of other variations that do not work either. Any
> > suggestions as to how I might do this?
> >
> > -- Larry
> >
>
>
>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
     
_________________________________________________________________
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009

Re: AW: i18n within dojo attribute

by Larry Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using the default stack, which I believe has that interceptor in it. In any case, the i18n works for all the other tags, so I'm not sure why it would be a problem in this case.

----- Original Message -----
From: "Martin Gainty" <mgainty@...>
To: "Struts Users Mailing List" <user@...>, larry@...
Sent: Friday, October 30, 2009 5:33:01 AM GMT -08:00 US/Canada Pacific
Subject: RE: AW: i18n within dojo attribute

sam is correct

do you have i18nInterceptor enabled in your stack?
<interceptors>
<interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>

<!-- Sample i18n stack -->
<interceptor-stack name="i18nStack">
<interceptor-ref name="i18n"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>

*gruss*
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung


Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Subject: AW: i18n within dojo attribute
> Date: Fri, 30 Oct 2009 10:10:59 +0100
> From: samuel.robert@...
> To: user@...; larry@...
>
> Not sure it works for you, but you can try this:
>
> <s:text name="signInEMail" var="mytext"/>
> <s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="${mytext}" />
>
>
>
>
> Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Technik AG, Hamburg, Registereintragung / Registration: Amtsgericht Hamburg HRB 56865
> Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board: Stephan Gemkow
> Vorstand / Executive Board: August Wilhelm Henningsen (Vorsitzender/Chairman), Dr. Peter Jansen, Uwe Mukrasch, Dr. Thomas Stueger
>
> -----Ursprüngliche Nachricht-----
>
> Von: larryreed [mailto:larryreed@...]
> Gesendet: Donnerstag, 29. Oktober 2009 17:59
> An: Struts Users Mailing List
> Betreff: Re: i18n within dojo attribute
>
>
>
> Thank you for your help.
>
> This was, I believe, a typo in the email, but not in the code. In any case, including the closing single quote does not solve the problem.
>
> Here is the exact text and error message:
>
> <s:textfield key="siSignInEMail" required="true" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('siSignInEMail')}" />
>
> The generated error text:
> 'The function getText must be used with a prefix when a default namespace is not specified '
>
> In response to Samuel, thank you also. Your solution does not generate an error. It simply results in the text between double quotes being taken literally:
>
> <s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="%{getText('signInEMail')}" />
>
> This results in a prompt containing %{getText('signInEMail')}.
>
>
>
> ----- Original Message -----
> From: "Zoran Avtarovski" <zoran@...>
> To: "Struts Users Mailing List" <user@...>
> Sent: Thursday, October 29, 2009 2:11:30 AM GMT -08:00 US/Canada Pacific
> Subject: Re: i18n within dojo attribute
>
> You¹re missing the closing inverted comma on fieldPrompt.
>
> Z.
> >
> > It occurred to me to use an OGNL form to do this, but I am still
> > having a
> > challenge getting it to work.
> >
> > I've tried
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="${getText('fieldPrompt)}" />
> >
> > This gets me past the first problem, but still doesn't work. I am
> > getting
> > message that getText must have a prefix in the default namespace. I'm not sure
> > where to take it from there.
> >
> > Any suggestions?
> >
> > -- Larry
> >
> > ----- Original Message -----
> > From: "larryreed" <larryreed@...>
> > To: "user" <user@...>
> > Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> > Subject: i18n within dojo attribute
> >
> > I have a text field which I would like to 'dojo-ize' by turning it
> > into a
> > ValidationTextBox.
> >
> > One of the parameters, 'promptMessage' is a text message that is put
> > up as a
> > help when the focus enters the text box.
> >
> > My problem is that I would like to internationalize this message. My
> > thought
> > was to place a struts2 text tag as the value of this attribute.
> >
> > However, placing the tag inside the attribute quotes quotes the tag.
> > Here is
> > what I did:
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="Enter field value" />
> >
> > This works, but the message is in English. To internationalize it, I
> > tried
> > this:
> >
> > <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> > promptMessage="<s:text name='fieldPrompt' />" />
> >
> > But this quotes the angle brackets and the result is:
> >
> > .... promptMessage="<s:text name='username' />"
> >
> > I've tried a couple of other variations that do not work either. Any
> > suggestions as to how I might do this?
> >
> > -- Larry
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>


Windows 7: It works the way you want. Learn more.

Parent Message unknown Re: AW: i18n within dojo attribute

by Larry Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you, Samuel. This solves my problem.

----- Original Message -----
From: "samuel robert" <samuel.robert@...>
To: user@..., larry@...
Sent: Friday, October 30, 2009 2:10:59 AM GMT -08:00 US/Canada Pacific
Subject: AW: i18n within dojo attribute

Not sure it works for you, but you can try this:

<s:text name="signInEMail" var="mytext"/>
<s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="${mytext}" />




Sitz der Gesellschaft / Corporate Headquarters: Lufthansa Technik AG, Hamburg, Registereintragung / Registration: Amtsgericht Hamburg HRB 56865
Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board: Stephan Gemkow
Vorstand / Executive Board: August Wilhelm Henningsen (Vorsitzender/Chairman), Dr. Peter Jansen, Uwe Mukrasch, Dr. Thomas Stueger

-----Ursprüngliche Nachricht-----

Von: larryreed [mailto:larryreed@...]
Gesendet: Donnerstag, 29. Oktober 2009 17:59
An: Struts Users Mailing List
Betreff: Re: i18n within dojo attribute



Thank you for your help.

This was, I believe, a typo in the email, but not in the code. In any case, including the closing single quote does not solve the problem.

Here is the exact text and error message:

<s:textfield key="siSignInEMail" required="true" dojoType="dijit.form.ValidationTextBox"
promptMessage="${getText('siSignInEMail')}" />

The generated error text:
'The function getText must be used with a prefix when a default namespace is not specified '

In response to Samuel, thank you also. Your solution does not generate an error. It simply results in the text between double quotes being taken literally:

<s:textfield key="signInEMail" required="true" dojoType="dijit.form.ValidationTextBox" promptMessage="%{getText('signInEMail')}" />

This results in a prompt containing %{getText('signInEMail')}.



----- Original Message -----
From: "Zoran Avtarovski" <zoran@...>
To: "Struts Users Mailing List" <user@...>
Sent: Thursday, October 29, 2009 2:11:30 AM GMT -08:00 US/Canada Pacific
Subject: Re: i18n within dojo attribute

You¹re missing the closing inverted comma on fieldPrompt.

Z.

>
> It occurred to me to use an OGNL form to do this, but I am still
> having a
> challenge getting it to work.
>
> I've tried
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="${getText('fieldPrompt)}" />
>
> This gets me past the first problem, but still doesn't work. I am
> getting
> message that getText must have a prefix in the default namespace. I'm not sure
> where to take it from there.
>
> Any suggestions?
>
> -- Larry
>
> ----- Original Message -----
> From: "larryreed" <larryreed@...>
> To: "user" <user@...>
> Sent: Friday, October 23, 2009 4:58:42 PM GMT -08:00 US/Canada Pacific
> Subject: i18n within dojo attribute
>
> I have a text field which I would like to 'dojo-ize' by turning it
> into a
> ValidationTextBox.
>
> One of the parameters, 'promptMessage' is a text message that is put
> up as a
> help when the focus enters the text box.
>
> My problem is that I would like to internationalize this message. My
> thought
> was to place a struts2 text tag as the value of this attribute.
>
> However, placing the tag inside the attribute quotes quotes the tag.
> Here is
> what I did:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="Enter field value" />
>
> This works, but the message is in English. To internationalize it, I
> tried
> this:
>
> <s:textfield key="fieldName" dojoType="dijit.form.ValidationTextBox"
> promptMessage="<s:text name='fieldPrompt' />" />
>
> But this quotes the angle brackets and the result is:
>
> .... promptMessage="<s:text name='username' />"
>
> I've tried a couple of other variations that do not work either. Any
> suggestions as to how I might do this?
>
> -- Larry
>