I found that every time link is clicked ReadMoreWicketPanel-s are created again because they are populated by ListView in WebPage.
Does it mean that I must put my ReadMoreWicketPanel's instances in session? On Tue, Nov 25, 2008 at 2:48 PM, Anton Veretennikov <[EMAIL PROTECTED]> wrote: > 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]