Don't forget using the "wicket:enclosure" tag. For example:

  <wicket:enclosure child="lnk1">
     # One 
    |
     # Two 
  </wicket:enclosure>


  Link lnk1 = new Link("lnk1")
  {
    private static final long serialVersionUID = 1L;

    @Override
    public void onClick()
    {
      //
      // ...
      //
    }
  };
  lnk1.setVisible(...);
  add(lnk1);


  Link lnk2 = new Link("lnk2")
  {
    private static final long serialVersionUID = 1L;

    @Override
    public void onClick()
    {
      //
      // ...
      //
    }
  };
  // I want lnk1 and lnk2 to have the same visibility.
  // I do not need to set lnk2's visibility if I use the "wicket:enclosure"
tag instead.
  add(lnk2);


ensures that both links are visible if lnk1 is visible and neither link is
visible if lnk1 is invisible (whilst leaving the visibility of lnk2 to the
default of true).
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299932.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]

Reply via email to