Hi

i've experienced some problems with the AjaxLazyLoadPanel:

the task is, to load a dynamic list (1- n) of String | Checkbox
like this:

String | Checkbox
String | Checkbox
String | Checkbox


this works with excellent with the Listview:

i'm using the Wicket Wizard and the list is generated out of previous
input, so i have to use the AjaxLazyLoadPanel


i've tried to perform this task with a Fragment


KeyListAjaxPanel is a wrapper like "NameWrapper" in
http://cwiki.apache.org/WICKET/listview-with-checkboxes.html



is it in principle possible to load this dynamic list with ajax lazy load?
or are there any problems with my code?

Christoph
==============================================

Code:


---------------------------------------------------------------------------------------Panel
of wizard
        add(new AjaxLazyLoadPanel("wrapper", new Model()) {

            @Override
            public Component getLazyLoadComponent(final String id) {

                class KeyListAjaxPanel extends Fragment{

                private List formKeys = new ArrayList();

                        
                        public KeyListAjaxPanel(final String id, final String 
markupId) {
                        super(id, markupId);
                        formKeys.add(new KeyCheckBoxWrapper("dynamic item 1"));
                        formKeys.add(new KeyCheckBoxWrapper("dynamic item 2"));
                        formKeys.add(new KeyCheckBoxWrapper("dynamic item 3"));
                        formKeys.add(new KeyCheckBoxWrapper("dynamic item 4"));

                                ListView listView = new ListView("list", 
formKeys)
                                {
                                        @Override
                                        protected void populateItem(ListItem 
item)
                                        {
                                                KeyCheckBoxWrapper wrapper =
(KeyCheckBoxWrapper)item.getModelObject();
                                                item.add(new Label("name", 
wrapper.getName()));
                                                item.add(new CheckBox("check", 
new
PropertyModel(wrapper, "selected")));
                                        }
                                };
                
                                listView.setReuseItems(true);
                                
                                add(listView);
                                
                        }
                        
                }

                return new KeyListAjaxPanel("wrapper", "fragmentid");

            }

        });
---------------------------------------------------------------------------------------Panel
of wizard

---------------------------------------------------------------------------------------HTML
for Panel of wizard
<wicket:panel>

<wicket:fragment wicket:id="wrapper"></wicket:fragment>

</wicket:panel>

<wicket:fragment wicket:id="fragmentid" >

<table>
<tbody>
  <tr wicket:id="list">
        <td><span wicket:in="name">text</span></td>
        <td><input wicket:id="check" type="checkbox" /></td>
  </tr> 
</tbody>
</table>
</wicket:fragment>
---------------------------------------------------------------------------------------HTML
for Panel of wizard

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to