Re: getString, Label - Warn

2008-06-02 Thread Maurice Marrink
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. [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread James Carman
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. [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread Fabien D.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread James Carman
You tried what?  Moving the code to onBeforeRender() or using ResourceModel?

On Mon, Jun 2, 2008 at 8:33 AM, Fabien D. [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread Erik van Oosten
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread Fabien D.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread James Carman
No problem.  Erik gave you exactly what you need.

On Mon, Jun 2, 2008 at 10:14 AM, Fabien D. [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getString, Label - Warn

2008-06-02 Thread Fabien D.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]