well - first of all there is a separation of concerns
toggle is the toggle collapsable border that wraps something
what it wraps just happens to be some repeater but could be anything else really

so its not necessarily healthy to merge the two somehow.

now if you do want to merge them you can use a panel

class CollapsablePanel extends Panel {
   private final RepeatingView repeater;

   CollapsablePanel(String id) {
       repeater=new RepatingView(..);
       CollapsableBorder b=new CollapsableBorder(...);
       add(b);
       b.add(repeater);
   }

   pubic void addToBody(Component c) {
       repeater.add(c);
   }
}

<wicket:panel><span wicket:id="b"><span wicket:id="repeater"></span></span></wicket:panel>

usage

CollapsablePanel p=new CollapsablePanel(...);
add(p);
p.addToBody(new SomeComponent);

<span wicket:id="p"></span>

you can also use an IComponentResolver to make it so you can just do p.add(my component) instead of p.addToBody(my component) but that is more complicated and might be a topic for another day

hope this helps

-Igor


On 8/28/06, ChuckDeal <[EMAIL PROTECTED]> wrote:


igor.vaynberg wrote:
>
> the best way, imho, to do the collapsable panels is to use borders in
> combination with setborderbodyvisible(). that way you can wrap any
> component
> or components into this collapsable border and not be limited to only
> wrapping a panel. the border will contain a header panel that will toggle
> the visibility of the body - and if you use ajaxfallbacklink for that it
> will work via ajax when available and fallback to regular page render when
> not.
>
> -Igor
>

Thanks for all of the suggestions, I am trying a Border with a RepeatingView
to handle the variable Panels.  This works, now for some icing.  My markup
for using the ContentPanel now looks like this (for two toggle sections).

<div wicket:id="togSection"><div wicket:id="sections"/></div>
<div wicket:id="togSection2"><div wicket:id="sections"/></div>

where "sections" is the RepeatingView.  This is basically how I want ALL
toggleSectionBorders to be, so I thought I would inject the "<div
wicket:id="sections"/>" into the markup somehow.  I just can't see an
obvious way to accomplish this.  I am just looking to create some clean
components for my team and if the "sections" piece was added automatically
it would definitely eliminate mistakes.

Any ideas?

Chuck
--
View this message in context: http://www.nabble.com/Creating-Panel--to-display-a-list-of-Panels-tf2123533.html#a6024785
Sent from the Wicket - User forum at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to