On Mon, May 5, 2008 at 2:26 PM, Mathias P.W Nilsson
<[EMAIL PROTECTED]> wrote:
>
>  Use a ListView to iterate over the attributes, in the onPopulate you
>  then add your textfield.
>
>
>  Thanks! But the text field need a dynamic id. The name of the id is in
>  database and

This is no problem, just use the trick i showed you with the
getMarkupId to return the db id.
markupid!=wicketid

>  there can be different amount of attribute headers for different sub
>  categories.
No problem, just nest 2 ListViews.
add(new ListView("categories",listOfCategories)
{
    public void onPopulateItem(Item item)
    {
         Categorie cat=(Categorie) item.getModelObject();
         item.add(new ListView("attributes",cat.getAttributes())
         {
               public void onPopulateItem(Item item)
               {
                      item.add(new TextField("attribute",item.getModel())
                      {
                            public String getMarkupId()
                            {
                                   return idFromDb;
                            }
                      }.setOutputMarkupId(true));

               }

         });
    }
});

Obviously the above is from the top of my head but you get the idea.


Maurice

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

Reply via email to