You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by extraquoo <ex...@gmail.com> on 2017/07/24 23:55:53 UTC

how to implement resource bundle to get text from the xml file

Hi , I want to  get the text from the corresponding xml .

how to get the text from a xml resource file and assign to String variable 
"message" ? my code is below 

add(new AbstractBehavior() {

					private static final long serialVersionUID = 1L;

					public void renderHead(IHeaderResponse response) {
						super.renderHead(response);
						if (!modalRendered) {
						
response.renderOnLoadJavascript("$('#dialog-message-forms').dialog('open');");
							*String message="You will be able to attach all supporting
documentation after you submit the report";*							
							response.renderOnLoadJavascript("$('#dialog-message-text').html( '" +
message +  " ');");
							modalRendered = true;
						}
					}
				});

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-implement-resource-bundle-to-get-text-from-the-xml-file-tp4678278.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: how to implement resource bundle to get text from the xml file

Posted by Martin Grigorov <mg...@apache.org>.
Then Component.getString(String) should work.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jul 26, 2017 at 8:00 PM, extraquoo <ex...@gmail.com> wrote:

> the current project use the i18n xml like below
> <http://apache-wicket.1842946.n4.nabble.com/file/n4678312/
> 2017-07-26_09_59_49-PDLVDAPP124.png>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/how-to-implement-resource-bundle-to-
> get-text-from-the-xml-file-tp4678278p4678312.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: how to implement resource bundle to get text from the xml file

Posted by extraquoo <ex...@gmail.com>.
the current project use the i18n xml like below 
<http://apache-wicket.1842946.n4.nabble.com/file/n4678312/2017-07-26_09_59_49-PDLVDAPP124.png> 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-implement-resource-bundle-to-get-text-from-the-xml-file-tp4678278p4678312.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: how to implement resource bundle to get text from the xml file

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Your question is not very clear.
Is the XML file a Wicket i18n file ?
If it is then you can use Component.getString(String key) method.
If it is not then you will need to load and parse it yourself.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jul 25, 2017 at 2:55 AM, extraquoo <ex...@gmail.com> wrote:

> Hi , I want to  get the text from the corresponding xml .
>
> how to get the text from a xml resource file and assign to String variable
> "message" ? my code is below
>
> add(new AbstractBehavior() {
>
>                                         private static final long
> serialVersionUID = 1L;
>
>                                         public void
> renderHead(IHeaderResponse response) {
>                                                 super.renderHead(response);
>                                                 if (!modalRendered) {
>
> response.renderOnLoadJavascript("$('#dialog-message-forms').dialog(
> 'open');");
>                                                         *String
> message="You will be able to attach all supporting
> documentation after you submit the report";*
>                                                         response.
> renderOnLoadJavascript("$('#dialog-message-text').html( '" +
> message +  " ');");
>                                                         modalRendered =
> true;
>                                                 }
>                                         }
>                                 });
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/how-to-implement-resource-bundle-to-
> get-text-from-the-xml-file-tp4678278.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>