You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Fabien D." <du...@hotmail.com> on 2008/06/02 14:15:52 UTC

getString, Label -> Warn

Hi everybody,


If I use this code :

		BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil",
HomePage.class);
		Label labelLinkAccueil = new Label ("name",getString("LabelLinkAccueil"));
		labelLinkAccueil.setEscapeModelStrings(false); 
		lien_accueil.add(labelLinkAccueil);
		lien_accueil.setVisible(true);
		add(lien_accueil);

In my log file, I have this warning :
(Localizer.java:188) - Tried to retrieve a localized string for a component
that has not yet been added to the page. This can sometimes lead to an
invalid or no localized resource returned. Make sure you are not calling
Component#getString() inside your Component's constructor. Offending
component: [MarkupContainer [Component id = panelmenu, page = <No Page>,
path = panelmenu.PanelMenu]]


Wicket doesn't like to use the constructor of a label and getString()....

How cant I resolve this warning and use getString with new Label


Thank you in advance
-- 
View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17599949.html
Sent from the Wicket - User 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: getString, Label -> Warn

Posted by "Fabien D." <du...@hotmail.com>.
With the ModelRessource, it's working, thank you :) :)
-- 
View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17602394.html
Sent from the Wicket - User 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: getString, Label -> Warn

Posted by Erik van Oosten <e....@grons.nl>.
Do this instead:

BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil", HomePage.class);
Label labelLinkAccueil = new Label ("name",new ResourceModel("LabelLinkAccueil"));


Regards,
    Erik.


Fabien D. wrote:
> Hi everybody,
>
>
> If I use this code :
>
> 		BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil",
> HomePage.class);
> 		Label labelLinkAccueil = new Label ("name",getString("LabelLinkAccueil"));
> 		labelLinkAccueil.setEscapeModelStrings(false); 
> 		lien_accueil.add(labelLinkAccueil);
> 		lien_accueil.setVisible(true);
> 		add(lien_accueil);
>
> In my log file, I have this warning :
> (Localizer.java:188) - Tried to retrieve a localized string for a component
> that has not yet been added to the page. This can sometimes lead to an
> invalid or no localized resource returned. Make sure you are not calling
> Component#getString() inside your Component's constructor. Offending
> component: [MarkupContainer [Component id = panelmenu, page = <No Page>,
> path = panelmenu.PanelMenu]]
>
>
> Wicket doesn't like to use the constructor of a label and getString()....
>
> How cant I resolve this warning and use getString with new Label
>
>
> Thank you in advance
>   

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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


Re: getString, Label -> Warn

Posted by James Carman <ja...@carmanconsulting.com>.
No problem.  Erik gave you exactly what you need.

On Mon, Jun 2, 2008 at 10:14 AM, Fabien D. <du...@hotmail.com> wrote:
>
> To use model and label ... I will try RessourceModel now
>
>
> Thank you for your help
> --
> View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17602329.html
> Sent from the Wicket - User 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
>
>

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


Re: getString, Label -> Warn

Posted by "Fabien D." <du...@hotmail.com>.
To use model and label ... I will try RessourceModel now


Thank you for your help
-- 
View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17602329.html
Sent from the Wicket - User 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: getString, Label -> Warn

Posted by James Carman <ja...@carmanconsulting.com>.
You tried what?  Moving the code to onBeforeRender() or using ResourceModel?

On Mon, Jun 2, 2008 at 8:33 AM, Fabien D. <du...@hotmail.com> wrote:
>
> I have tried, but I have the same warning
> --
> View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17600229.html
> Sent from the Wicket - User 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
>
>

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


Re: getString, Label -> Warn

Posted by "Fabien D." <du...@hotmail.com>.
I have tried, but I have the same warning
-- 
View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17600229.html
Sent from the Wicket - User 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: getString, Label -> Warn

Posted by Maurice Marrink <ma...@gmail.com>.
Make a model that does the getString in the getObject and give that
model to your label.

Maurice

On Mon, Jun 2, 2008 at 2:15 PM, Fabien D. <du...@hotmail.com> wrote:
>
> Hi everybody,
>
>
> If I use this code :
>
>                BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil",
> HomePage.class);
>                Label labelLinkAccueil = new Label ("name",getString("LabelLinkAccueil"));
>                labelLinkAccueil.setEscapeModelStrings(false);
>                lien_accueil.add(labelLinkAccueil);
>                lien_accueil.setVisible(true);
>                add(lien_accueil);
>
> In my log file, I have this warning :
> (Localizer.java:188) - Tried to retrieve a localized string for a component
> that has not yet been added to the page. This can sometimes lead to an
> invalid or no localized resource returned. Make sure you are not calling
> Component#getString() inside your Component's constructor. Offending
> component: [MarkupContainer [Component id = panelmenu, page = <No Page>,
> path = panelmenu.PanelMenu]]
>
>
> Wicket doesn't like to use the constructor of a label and getString()....
>
> How cant I resolve this warning and use getString with new Label
>
>
> Thank you in advance
> --
> View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17599949.html
> Sent from the Wicket - User 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
>
>

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


Re: getString, Label -> Warn

Posted by James Carman <ja...@carmanconsulting.com>.
It's not telling you that you can't use it as a constructor param.
It's telling you that you're trying to use it during the constructor
code of your PanelMenu class.  So, either move that code to
onBeforeRender or use a ResourceModel for your label.

On Mon, Jun 2, 2008 at 8:15 AM, Fabien D. <du...@hotmail.com> wrote:
>
> Hi everybody,
>
>
> If I use this code :
>
>                BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil",
> HomePage.class);
>                Label labelLinkAccueil = new Label ("name",getString("LabelLinkAccueil"));
>                labelLinkAccueil.setEscapeModelStrings(false);
>                lien_accueil.add(labelLinkAccueil);
>                lien_accueil.setVisible(true);
>                add(lien_accueil);
>
> In my log file, I have this warning :
> (Localizer.java:188) - Tried to retrieve a localized string for a component
> that has not yet been added to the page. This can sometimes lead to an
> invalid or no localized resource returned. Make sure you are not calling
> Component#getString() inside your Component's constructor. Offending
> component: [MarkupContainer [Component id = panelmenu, page = <No Page>,
> path = panelmenu.PanelMenu]]
>
>
> Wicket doesn't like to use the constructor of a label and getString()....
>
> How cant I resolve this warning and use getString with new Label
>
>
> Thank you in advance
> --
> View this message in context: http://www.nabble.com/getString%2C-Label--%3E-Warn-tp17599949p17599949.html
> Sent from the Wicket - User 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
>
>

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