Have you looked at the "live example" that uses fragments?  At first,
it might seem a bit weird, but it's really not that bad.  A fragment
is an "inline panel", meaning that you don't have to supply a separate
HTML template file for them (the markup template lives along side the
markup for the other stuff in your component).  If you'd like an
example, here's one from the wicketopia-example application:

https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java

That's the HomePage for the application.  It has a table in it that
lists all the "widgets" in the database.  For each widget in the
table, we display an "actions" column that contains a "remove" link.
So, I use a FragmentColumn (also from wicketopia) and I build up the
Fragment using an inner class.  The markup for HomePage is here:

https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.html

I hope that makes sense.  You can check out all of the source code for
wicketopia and run the example application if you want (you can use
mvn jetty:run to start it).  That might help you get a better idea of
what's going on.  Hope that helps!

On Fri, Oct 10, 2008 at 10:25 AM, miro <[EMAIL PROTECTED]> wrote:
>
> Here is my concern
> I will create several such components only for this page and not outside of
> this page , so I dont want to create a .html  file   for two little
> components,  instead use fragment and i need help in creating fragment for
> my two components Please help me ?
>
> jwcarman wrote:
>>
>> You seem to be asking the same question (or very similarly-related
>> questions) over and over again.  How about if you just explain your
>> situation/problem to the group and see if they can help you come up
>> with the best approach?  It appears as if you might be spinning your
>> wheels here.
>>
>> On Fri, Oct 10, 2008 at 10:07 AM, miro <[EMAIL PROTECTED]> wrote:
>>>
>>> I have custom components
>>>
>>>        protected class CustomMenuComponent extends Panel {
>>>                private String headerlabel;
>>>                private RepeatingView   repeatingView = new
>>> RepeatingView("repater");
>>>
>>>                public CustomMenuComponent() {
>>>                        super("custmenu");
>>>                        add(repeatingView);
>>>                }
>>>
>>>                protected void addCustomLink(CustomLinkComponenet
>>> customLinkComponenet){
>>>                        repeatingView.add(customLinkComponenet);
>>>                }
>>>
>>>                protected Label getHeader(){
>>>                        return new Label("hl",headerlabel);
>>>                }
>>>        }
>>>
>>>        protected class CustomLinkComponenet extends  Panel  {
>>>                String displayName;
>>>                Class  clazz;
>>>                public CustomLinkComponenet(String displayName, Class
>>> clazz) {
>>>                        super("customlink");
>>>                        this.displayName=displayName;
>>>                        this.clazz=clazz;
>>>                        add(getBookmarkablePageLink());
>>>                        add(getDisplayNameLabel());
>>>                }
>>>
>>>                protected BookmarkablePageLink  getBookmarkablePageLink(){
>>>                        return new BookmarkablePageLink("link", clazz);
>>>                }
>>>
>>>                protected  Label  getDisplayNameLabel(){
>>>                        return new Label("lbl",displayName);
>>>                }
>>>        }
>>> html for  component  CustomMenuComponent
>>>
>>>                <span-TAG wicket:id="custmenu">
>>>                   <ul-TAG>
>>>                                <li-TAG wicket:id="repater"></li-TAG>
>>>                   </ul-TAG>
>>>                </span-TAG>
>>> html for component   CustomLinkComponenet
>>>
>>>                                        <span-TAG wicket:id="customlink">
>>>                                                <A-TAG  href="#"
>>> wicket:id="link">
>>>                                                        <label-TAG
>>> wicket:id="lbl"></label-TAG>
>>>                                                </A-TAG>
>>>                                        </span-TAG>
>>> please help me with the options of   specifying this html for the
>>> components
>>> . I want to tie html along with the components in the java file itself
>>> is
>>> it possible ?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/html-along-with-the-component-tp19918507p19918507.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]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/html-along-with-the-component-tp19918507p19919378.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]
>
>

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

Reply via email to