Thanks Timo for your very helpful suggestion!

Best Regards,
/Peter

2008/6/11 Timo Rantalaiho <[EMAIL PROTECTED]>:

> On Wed, 11 Jun 2008, Peter Eriksson wrote:
> > I will answer my own post, just in case somebody else is looking for a
> > solution to the same problem. I have found two ways to get the resource
> > loading to do exactly what I want (There are probably a lot more out
> there):
>
> Thanks for posting that, and cool that you found it out!
>
> >         add(new Label("nameLabel", new StringResourceModel("nameLabel",
> > this, null)));
> >         add(new Label("name"));
>
> These Label pairs smell like a custom component to me, e.g.
>
>  public class LabeledText extends WebMarkupContainer {
>      public LabeledText(String textId, MarkupContainer parent) {
>          super(textId + "Container");
>          String labelId = textId + "Label";
>          add(new Label(labelId, new StringResourceModel(labelId, parent,
> null)));
>          add(new Label(textId);
>      }
>  }
>
> Then in ContactPanel constructor you do
>
>    add(new LabeledText("userName", this));
>    add(new LabeledText("phone", this));
>    add(new LabeledText("email", this));
>
> and change the markup accordingly (to something like
> <wicket:panel>
>     <table>
>         <tr wicket:id="nameContainer">
>              <td><span wicket:id="nameLabel"></span></td>
>             <td><span wicket:id="name"></span></td>
>         </tr>
>       ...
> )
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to