You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arjun Dhar <dh...@yahoo.com> on 2015/01/25 20:56:03 UTC

CheckGroup in a DataTable


I have a DataTable where the first column is a set of Checkboxes for every
row. I felt a CheckGroup would be a nice thing to use here for Deleting
multiple rows. However I want also Ajax events on the Check of a box to only
show the DELETE Button should any box be selected.

The problem is that in order for CheckGroup to work, I think I have to wrap
it in a "span" and make my HTML nasty like:
 

Adding AjaxFormChoiceComponentUpdatingBehavior is not receiving any events.
I assume thats because im being stubborn .. but hoping for a more elegant
solution.

.. I have to use DataTable and I need to Ajaxify the checkboxes here.
Java code is something like


Any thoughts appreciated.
thanks

-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CheckGroup in a DataTable

Posted by Sven Meier <sv...@meiers.net>.
Hi,

 > I find it tacky to have to wrap the entire DataTable in a span or a 
Div for check group

usually your web designer will use enough DIVs in the markup anyway, so 
you rarely have to add an additional one just for your Wicket component.

> "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox ... if you check the "CheckGroupSelector"

Each selected checkbox will trigger an event, which is then received by the AjaxFormChoiceComponentUpdatingBehavior. You might be able to work around this by configuring AjaxRequestAttributes#throttleSettings.

Regards
Sven

On 25.01.2015 21:54, Arjun Dhar wrote:
> Thanks ... I edited my post.
> I'll simplify my questions further:
>
> 1. I find it tacky to have to wrap the entire DataTable in a span or a Div
> for check group. Is there any way I can apply it on the column level. Its
> hard to imagine.
>
> 2. "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox it
> checks automatically, if you check the "CheckGroupSelector". ... I'd like
> only 1 Event fired if any One CheckBox is selected in the entire group. ...
> anyway to filter the event lsitener?
>
> thanks
>
> -----
> Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111p4669113.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Re: CheckGroup in a DataTable

Posted by Arjun Dhar <dh...@yahoo.com>.
Thanks ... I edited my post.
I'll simplify my questions further:

1. I find it tacky to have to wrap the entire DataTable in a span or a Div
for check group. Is there any way I can apply it on the column level. Its
hard to imagine. 

2. "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox it
checks automatically, if you check the "CheckGroupSelector". ... I'd like
only 1 Event fired if any One CheckBox is selected in the entire group. ...
anyway to filter the event lsitener?

thanks

-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111p4669113.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: CheckGroup in a DataTable

Posted by Sven Meier <sv...@meiers.net>.
Hi,

 > in order for CheckGroup to work, I think I have to wrap it in a "span"

correct, the CheckGroup needs its own HTML tag.

 >Adding AjaxFormChoiceComponentUpdatingBehavior is not receiving any 
events.

I've checked your code posted on Nabble, but it didn't seem to include 
the relevant bits.

Could you rephrase your actual problem?

Regards
Sven


On 25.01.2015 20:56, Arjun Dhar wrote:
>
> I have a DataTable where the first column is a set of Checkboxes for every
> row. I felt a CheckGroup would be a nice thing to use here for Deleting
> multiple rows. However I want also Ajax events on the Check of a box to only
> show the DELETE Button should any box be selected.
>
> The problem is that in order for CheckGroup to work, I think I have to wrap
> it in a "span" and make my HTML nasty like:
>   
>
> Adding AjaxFormChoiceComponentUpdatingBehavior is not receiving any events.
> I assume thats because im being stubborn .. but hoping for a more elegant
> solution.
>
> .. I have to use DataTable and I need to Ajaxify the checkboxes here.
> Java code is something like
>
>
> Any thoughts appreciated.
> thanks
>
> -----
> Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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