Thanks!

Comments below.

On Thu, 2006-01-26 at 19:42 -0800, Igor Vaynberg wrote:
> you do not need to create a model. the listview can work directly with
> a list.
> 
> if you want something dead simple check out OrderedRepeatingView in
> extensions. its like the listview but without anything automatic.
> there is an example usage in wicket-examples under repeaters.

I'm sure it is dead simple, but there's obviously something I'm
overlooking.

I tried reworking the online example even with a trivial example of a
list of strings, but it's not working for me. Can you see why?


Thanks a lot!!


(java and html moderately edited)

public class IndexPage
        extends SearchPage
{

    public IndexPage()
    {
        super();
        add( new SearchForm( "searchForm" ) );
    }

    private class SearchForm
            extends Form
    {

        public SearchForm( final String name )
        {
            super( name, new CompoundPropertyModel( new FormModel() ) );

            RepeatingView repeating = new RepeatingView( "itemList" );
            add( repeating );

            final List list = new Vector();
            list.add( "item1" );
            list.add( "item2" );

            for( Iterator i = list.iterator(); i.hasNext(); )
            {
                  final String string = (String)i.next();
                final WebMarkupContainer item = new WebMarkupContainer
( repeating.newChildId() );
                repeating.add( item );
                item.add( new Label( "item", string ) );
            }
        }

        public void onSubmit()
        {
        }

    }
}


<html xmlns:wicket="http://wicket.sourceforge.net/";>

    <head>
    </head>

    <body>
        <wicket:extend>

            <form wicket:id="searchForm" id="searchForm">
                <span wicket:id="itemList">
                    <span wicket:id="item"/>
                </span>
            </form>

        </wicket:extend>

    </body>

</html>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to