Hi,

I want to make a "read more" link that will make visible initially hidden label.
Running debugger I found that my Panel's constructor is called every
time I click this link.
So it again invisible.
What is wrong?

public class ReadMoreWicketPanel extends WicketPanel {
  private Label moreTextLabel;

  public ReadMoreWicketPanel(String id,
                             String title,
                             boolean escapeTitle,
                             String text,
                             boolean escapeText,
                             String moreText,
                             boolean escapeMoreText) {
    super(id, title, escapeTitle, text, escapeText);
    add(new Link("readMoreLink") {
      @Override
      public void onClick() {
        boolean is=moreTextLabel.isVisible();
        moreTextLabel.setVisible(!is);
      }
    });
    moreTextLabel=new Label("readMoreText",moreText);
    moreTextLabel.setEscapeModelStrings(escapeMoreText);
    moreTextLabel.setVisible(false);
    add(moreTextLabel);
  }
}

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

Reply via email to