Re: CheckGroup and ListView

2010-05-13 Thread msalman

And it was as simple as that.  

Thank you so much. 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2197959.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-12 Thread msalman

Hi,

Was any one able to test the quick start? 

Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2196464.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-07 Thread msalman


QuickStart project added.  BTW thanks for the instructions for creating the
quick start.  If any one else needs the instructions then they can be found
at:

http://www.jeremythomerson.com/blog/2008/11/wicket-quickstart-tutorial/#more-99

Well, I hope the quick start works for others too.

Thanks again.


http://n4.nabble.com/file/n2134528/wicket-quickstart-checkgroup.zip
wicket-quickstart-checkgroup.zip 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2134528.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-06 Thread msalman

Well, I have tried using ListModel as following:

selectableValues = new ListViewSelectableValue(selectableValuesList, new
ListModelSelectableValue(list))
{
..
}

and then:

selectableValues.getModelObject().add(new 
SelectableValue(newId, value 
+ newId++));


without any success.  

BTW, do I also need to set the model for the CheckGroup as following?

checkGroupSelectableValues = new
CheckGroupSelectableValue(selectedValues,  new
CollectionModelSelectableValue(list));


I did not need to do this in my other application but in this application if
I don't do it then I get the model is null exception.  I thought that when I
add the ListView Object to the CheckGroup object then the model object is
set for CheckGroup.

The bottom line is that I can not make this thing what ever I tried.

Please help.  Thanks.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2133161.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-06 Thread nino martinez wael
When using ajax you do have to add the listview again..

2010/5/6 msalman mohammad_sal...@yahoo.com:

 Well, I have tried using ListModel as following:

 selectableValues = new ListViewSelectableValue(selectableValuesList, new
 ListModelSelectableValue(list))
 {
 ..
 }

 and then:

                selectableValues.getModelObject().add(new 
 SelectableValue(newId, value 
 + newId++));


 without any success.

 BTW, do I also need to set the model for the CheckGroup as following?

 checkGroupSelectableValues = new
 CheckGroupSelectableValue(selectedValues,  new
 CollectionModelSelectableValue(list));


 I did not need to do this in my other application but in this application if
 I don't do it then I get the model is null exception.  I thought that when I
 add the ListView Object to the CheckGroup object then the model object is
 set for CheckGroup.

 The bottom line is that I can not make this thing what ever I tried.

 Please help.  Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2133161.html
 Sent from the Wicket - User 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



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



Re: CheckGroup and ListView

2010-05-06 Thread msalman

Well, I have tried removing and then adding the ListView to the CheckGroup,
but that does not work either.  

I have tried to debug this as much as I could and I do see that there are
the right values in the java objects of ListView and the wrapped list.   To
me it looks like that the code that creates the html or the script is not
clearing the old values.  But that is just my guess.  

But hopefully I am just not doing some thing right and some one would please
point that out to me.


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2133543.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-06 Thread Jeremy Thomerson
create a quickstart and post it somewhere where we can get to it and someone
will help you

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, May 6, 2010 at 7:12 PM, msalman mohammad_sal...@yahoo.com wrote:


 Well, I have tried removing and then adding the ListView to the CheckGroup,
 but that does not work either.

 I have tried to debug this as much as I could and I do see that there are
 the right values in the java objects of ListView and the wrapped list.   To
 me it looks like that the code that creates the html or the script is not
 clearing the old values.  But that is just my guess.

 But hopefully I am just not doing some thing right and some one would
 please
 point that out to me.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2133543.html
 Sent from the Wicket - User 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




Re: CheckGroup and ListView

2010-05-05 Thread msalman

I have not heard anything on this one.  I will be very thankful if I can get
some help on this one.  To help reproduce the problem I have attached simple
code files.

http://n4.nabble.com/file/n2131672/App.java App.java .  
http://n4.nabble.com/file/n2131672/PageCheckGroup.html PageCheckGroup.html .
http://n4.nabble.com/file/n2131672/PageCheckGroup.java PageCheckGroup.java .
http://n4.nabble.com/file/n2131672/SelectableValue.java SelectableValue.java
.



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2131672.html
Sent from the Wicket - User 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



Re: CheckGroup and ListView

2010-05-05 Thread Jeremy Thomerson
I haven't looked at it in detail, but you shouldn't be doing that
removeAll() and setList() stuff - it comes from a lack of using Models
properly - which is the most common mistake I see in Wicket users.  Instead,
you should give the ListView constructor an instance of some
IModelListSelectableValue.  Then simply add your new selectable value to
whatever list that model is getting it's data from.  The ListView will
auto-magically repaint everything correctly.

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, May 5, 2010 at 3:59 PM, msalman mohammad_sal...@yahoo.com wrote:


 I have not heard anything on this one.  I will be very thankful if I can
 get
 some help on this one.  To help reproduce the problem I have attached
 simple
 code files.

 http://n4.nabble.com/file/n2131672/App.java App.java .
 http://n4.nabble.com/file/n2131672/PageCheckGroup.html PageCheckGroup.html
 .
 http://n4.nabble.com/file/n2131672/PageCheckGroup.java PageCheckGroup.java
 .
 http://n4.nabble.com/file/n2131672/SelectableValue.javaSelectableValue.java
 .



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2131672.html
 Sent from the Wicket - User 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




Re: CheckGroup and ListView

2010-05-05 Thread msalman

Oh my. I was just about to send you a special email for my problem.  But you 
pre-empted me.
I will try your suggestion.
 
Thanks so much
Mohammad Salman 
(510) 673-5869 c 

Every problem has its solution(s) but there are problems with any solution





From: Jeremy Thomerson [via Apache Wicket] 
ml-node+2131687-1413056525-229...@n4.nabble.com
To: msalman mohammad_sal...@yahoo.com
Sent: Wed, May 5, 2010 2:08:06 PM
Subject: Re: CheckGroup and ListView

I haven't looked at it in detail, but you shouldn't be doing that 
removeAll() and setList() stuff - it comes from a lack of using Models 
properly - which is the most common mistake I see in Wicket users.  Instead, 
you should give the ListView constructor an instance of some 
IModelListSelectableValue.  Then simply add your new selectable value to 
whatever list that model is getting it's data from.  The ListView will 
auto-magically repaint everything correctly. 

-- 
Jeremy Thomerson 
http://www.wickettraining.com



On Wed, May 5, 2010 at 3:59 PM, msalman [hidden email] wrote: 


 
 I have not heard anything on this one.  I will be very thankful if I can 
 get 
 some help on this one.  To help reproduce the problem I have attached 
 simple 
 code files. 
 
 http://n4.nabble.com/file/n2131672/App.java App.java . 
 http://n4.nabble.com/file/n2131672/PageCheckGroup.html PageCheckGroup.html 
 . 
 http://n4.nabble.com/file/n2131672/PageCheckGroup.java PageCheckGroup.java 
 . 
 http://n4.nabble.com/file/n2131672/SelectableValue.javaSelectableValue.java
 . 
 
 
 
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2131672.html
 Sent from the Wicket - User mailing list archive at Nabble.com. 
 
 - 
 To unsubscribe, e-mail: [hidden email] 
 For additional commands, e-mail: [hidden email] 
 
 



 
View message @ 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2131687.html
 
To unsubscribe from Re: CheckGroup and ListView, click here. 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2131697.html
Sent from the Wicket - User mailing list archive at Nabble.com.


CheckGroup and ListView

2010-04-13 Thread Mohammad Salman
I use a ListView to populate a CheckGroup with Check objects.  It works fine 
and all the check boxes are displayed properly.  But when I try to add a new 
check box to the ones previously added, I keep getting the new one along with 
the previous ones in duplicate.

Here is my code. (I apologize for the format of the code)


protected void addCheckGroup(
ListSelectableValue list)
throws Exception
{
Object object = getDefaultModelObject();
checkGroupSelectableValues = new CheckGroupSelectableValue(selectedValues);
//checkGroupSelectableValues.add(new CheckGroupSelectors(groupSelector));
selectableValues = new ListViewSelectableValue(selections, list)
{

/**
 * 
 */
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(
ListItemSelectableValue item)
{
item.add(new CheckSelectableValue(check, item.getModel()));
item.add(new Label(value, new 
PropertyModelSelectableValue(item.getModel(), value)));
}
};
checkGroupSelectableValues.add(selectableValues);
selectableValues.setOutputMarkupPlaceholderTag(true);
checkGroupSelectableValues.setRenderBodyOnly(false);
checkGroupSelectableValues.setOutputMarkupPlaceholderTag(true);

add(checkGroupSelectableValues);
}





protected void addNewSelectableValue(
AjaxRequestTarget target)
throws Exception
{
ListSelectableValue list;  // new list with the new SelectableValue added 
selectableValues.removeAll();   // making sure to remove previous object
selectableValues.setList(list);   // Adding the new list to the ListView
checkGroupSelectableValues.removeAll();  // making sure to remove previous 
check boxes.
checkGroupSelectableValues.add(selectableValues);

target.addComponent(checkGroupSelectableValues);
 }

I have tried different other methods but  either I get the previous values in 
duplicates or the new value does not show up.

I will appreciate help in solving this issue.  Thanks

 Mohammad