I tried the following but couldnt get into "onUpdate" method while debugging.
I need to use checkgroup to be able to use
AjaxFormChoiceComponentUpdatingBehavior. So I created a checkgroup and added
the checkboxes into it. So I guess in each iteration I am creating one text
area, one check group and one checkbox that is attached to that checkgroup.
What I am trying to do is when I select a checkbox, I want to re-render only
the checkboxes by iterating the item list one by one. But it seems if I do
this I need to add ajaxbehaviour on to listview?? I think what I am trying
to do in here is a little bit tricky and this is not Listview is created for
am i right? I am definitely stucked. If I dont use Listview, I need to do
this by putting more lines of code and I dont want to do that.

                ListView listView = new ListView("list", data) 
                { 

                    @Override 
                    protected void populateItem(final ListItem item) { 
                            NameWrapper wrapper =
(NameWrapper)item.getModelObject(); 
                            item.add(new TextArea("name", new
PropertyModel(wrapper, "name"))); 
                            final CheckGroup checkgroup = new CheckGroup
("checkgroup", new PropertyModel(wrapper, "selected"));
                            item.add(checkgroup);
                            CheckBox check = new CheckBox("checkbox",new
Model());
                            checkgroup.setOutputMarkupId(true);
                            checkgroup.add(check);
                            checkgroup.add(new
AjaxFormChoiceComponentUpdatingBehavior() { 
                                @Override 
                                protected void onUpdate(AjaxRequestTarget
target) { 
                                        info("We are here");
                                        for (Iterator iter = item.iterator();
iter.hasNext();) {
                                           
                                        // FIND THE SELECTED ONE and DE-SELECT
the OTHER CHECKBOXES in the list
                                    }
                                        target.addComponent(checkgroup);
                                } 
                            }); 
                    } 
                }; 
                listView.setReuseItems(true); 
                add(listView); 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/creating-a-textarea-with-a-radiobutton-using-Listview-tp3829602p3843288.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to