Re: Border 'auto hide'

2009-09-17 Thread Peter Thomas
On Thu, Sep 17, 2009 at 1:56 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 I have a need to 'wrap' some content inside some border style markup,
 specifically within a li ... /li combo but the panel that is being
 inserted may be visible or invisible depending on logic within the panel
 and the current session etc,.

 When the 'wrapped' panel is invisible I don't want the li  /li
 combo wrapper/border to show.

 Do borders automatically hide themselves if their 'body' component is
 invisible?

 If they don't, what would be the best way to have the border go
 invisible if the child is invisible?


How about using wicket:enclosure child=wrappedPanel around the border.

refer
http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:enclosure



 Would it be better to write a custom 'wrapper' component that assumes a
 single child markup and auto hides itself if it's child is invisible?


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




RE: Border 'auto hide'

2009-09-17 Thread Chris Colman
  If they don't, what would be the best way to have the border go
  invisible if the child is invisible?
 
 
 How about using wicket:enclosure child=wrappedPanel around the
border.
 
 refer
 http://cwiki.apache.org/WICKET/wickets-xhtml-
 tags.html#Wicket%27sXHTMLtags-Elementwicket:enclosure

AWESOME!

Everytime I need to do something special in wicket that I think will
need some home grown component I discover that there's already some
awesome wicket 'built in' component that's already made for the purpose!


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Border 'auto hide'

2009-09-17 Thread Peter Thomas
On Thu, Sep 17, 2009 at 2:19 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

   If they don't, what would be the best way to have the border go
   invisible if the child is invisible?
  
 
  How about using wicket:enclosure child=wrappedPanel around the
 border.
 
  refer
  http://cwiki.apache.org/WICKET/wickets-xhtml-
  tags.html#Wicket%27sXHTMLtags-Elementwicket:enclosure

 AWESOME!

 Everytime I need to do something special in wicket that I think will
 need some home grown component I discover that there's already some
 awesome wicket 'built in' component that's already made for the purpose!


Yeah I know the feeling :)

Just one thing, you can also search for previous discussions on this (I
tried, nabble seems to be down)

If the isVisible() logic on your wrappedPanel is expensive for e.g.
querying the database or something, be warned, Wicket calls isVisible() on
the tree of components under an enclosure a little more than you would
expect, you can put in a logger statement to check.  Of course, in most
cases you won't have any issues.



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org