You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Zbynek Vavros <zb...@gmail.com> on 2019/07/17 18:15:29 UTC

DataTable and SelectAll checkbox

Hi,

I know this is quite old but since I do migration to Wicket8 now I think if
there is any "nice" way to do this.

The thing is we have this "mighty" checkbox in the header of a checkbox
column.
For now we use jQuery but for sure there has to be better way.

From what I have found the best way seems to use HeaderlessColumn and put
this mighty checkbox into a panel that goes into getHeader(final String
componentId).
And of course checkbox for each row into  populateItem(Item cellItem,
String componentId, IModel rowModel).

The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two are
quite separated so not even wrapping whole DataTable in CheckBoxGroup
doesn't really seem to do the trick.

Anyone figured out a better way or is jquery the thing for this?

Zbynek

Re: DataTable and SelectAll checkbox

Posted by Zbynek Vavros <zb...@gmail.com>.
My bad, using Sven's example it works fine, my app wasn't reloaded properly.

Zbynek

On Thu, Jul 18, 2019 at 3:21 PM Zbynek Vavros <zb...@gmail.com>
wrote:

> Hey Ilia,
>
> I am quite aware about this and we do something similar, I was just
> wondering is there is "native" Wickety way...
>
> Thanks,
> Zbynek
>
> On Thu, Jul 18, 2019 at 2:06 AM Илья Нарыжный <ph...@ydn.ru> wrote:
>
>> Hello,
>>
>> Or you can check implementation of IColumn with "Select All" here:
>>
>> https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/table/CheckBoxColumn.java#L49-L64
>>
>> Thanks,
>> Ilia
>>
>> ---------------------------------------------
>> Orienteer(http://orienteer.org) - open source Business Application
>> Platform
>>
>> On Wed, Jul 17, 2019 at 11:36 AM Sven Meier <sv...@meiers.net> wrote:
>>
>> > Hi,
>> >
>> > have to taken a look at:
>> >
>> >
>> >
>> https://github.com/apache/wicket/blob/wicket-8.x/wicket-examples/src/main/java/org/apache/wicket/examples/compref/CheckGroupPage.java
>> >
>> > That's the trick.
>> >
>> > Have fun
>> > Sven
>> >
>> >
>> > On 17.07.19 20:15, Zbynek Vavros wrote:
>> > > Hi,
>> > >
>> > > I know this is quite old but since I do migration to Wicket8 now I
>> think
>> > if
>> > > there is any "nice" way to do this.
>> > >
>> > > The thing is we have this "mighty" checkbox in the header of a
>> checkbox
>> > > column.
>> > > For now we use jQuery but for sure there has to be better way.
>> > >
>> > >  From what I have found the best way seems to use HeaderlessColumn and
>> > put
>> > > this mighty checkbox into a panel that goes into getHeader(final
>> String
>> > > componentId).
>> > > And of course checkbox for each row into  populateItem(Item cellItem,
>> > > String componentId, IModel rowModel).
>> > >
>> > > The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two
>> are
>> > > quite separated so not even wrapping whole DataTable in CheckBoxGroup
>> > > doesn't really seem to do the trick.
>> > >
>> > > Anyone figured out a better way or is jquery the thing for this?
>> > >
>> > > Zbynek
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>

Re: DataTable and SelectAll checkbox

Posted by Zbynek Vavros <zb...@gmail.com>.
Hey Ilia,

I am quite aware about this and we do something similar, I was just
wondering is there is "native" Wickety way...

Thanks,
Zbynek

On Thu, Jul 18, 2019 at 2:06 AM Илья Нарыжный <ph...@ydn.ru> wrote:

> Hello,
>
> Or you can check implementation of IColumn with "Select All" here:
>
> https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/table/CheckBoxColumn.java#L49-L64
>
> Thanks,
> Ilia
>
> ---------------------------------------------
> Orienteer(http://orienteer.org) - open source Business Application
> Platform
>
> On Wed, Jul 17, 2019 at 11:36 AM Sven Meier <sv...@meiers.net> wrote:
>
> > Hi,
> >
> > have to taken a look at:
> >
> >
> >
> https://github.com/apache/wicket/blob/wicket-8.x/wicket-examples/src/main/java/org/apache/wicket/examples/compref/CheckGroupPage.java
> >
> > That's the trick.
> >
> > Have fun
> > Sven
> >
> >
> > On 17.07.19 20:15, Zbynek Vavros wrote:
> > > Hi,
> > >
> > > I know this is quite old but since I do migration to Wicket8 now I
> think
> > if
> > > there is any "nice" way to do this.
> > >
> > > The thing is we have this "mighty" checkbox in the header of a checkbox
> > > column.
> > > For now we use jQuery but for sure there has to be better way.
> > >
> > >  From what I have found the best way seems to use HeaderlessColumn and
> > put
> > > this mighty checkbox into a panel that goes into getHeader(final String
> > > componentId).
> > > And of course checkbox for each row into  populateItem(Item cellItem,
> > > String componentId, IModel rowModel).
> > >
> > > The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two
> are
> > > quite separated so not even wrapping whole DataTable in CheckBoxGroup
> > > doesn't really seem to do the trick.
> > >
> > > Anyone figured out a better way or is jquery the thing for this?
> > >
> > > Zbynek
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: DataTable and SelectAll checkbox

Posted by Илья Нарыжный <ph...@ydn.ru>.
Hello,

Or you can check implementation of IColumn with "Select All" here:
https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/table/CheckBoxColumn.java#L49-L64

Thanks,
Ilia

---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform

On Wed, Jul 17, 2019 at 11:36 AM Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> have to taken a look at:
>
>
> https://github.com/apache/wicket/blob/wicket-8.x/wicket-examples/src/main/java/org/apache/wicket/examples/compref/CheckGroupPage.java
>
> That's the trick.
>
> Have fun
> Sven
>
>
> On 17.07.19 20:15, Zbynek Vavros wrote:
> > Hi,
> >
> > I know this is quite old but since I do migration to Wicket8 now I think
> if
> > there is any "nice" way to do this.
> >
> > The thing is we have this "mighty" checkbox in the header of a checkbox
> > column.
> > For now we use jQuery but for sure there has to be better way.
> >
> >  From what I have found the best way seems to use HeaderlessColumn and
> put
> > this mighty checkbox into a panel that goes into getHeader(final String
> > componentId).
> > And of course checkbox for each row into  populateItem(Item cellItem,
> > String componentId, IModel rowModel).
> >
> > The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two are
> > quite separated so not even wrapping whole DataTable in CheckBoxGroup
> > doesn't really seem to do the trick.
> >
> > Anyone figured out a better way or is jquery the thing for this?
> >
> > Zbynek
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DataTable and SelectAll checkbox

Posted by Zbynek Vavros <zb...@gmail.com>.
Hi Sven,

yeah that's what I found and tried but ended up with

org.apache.wicket.markup.MarkupException: Unable to find component with id
'checkGroupSelector' in [CheckGroup [Component id = checkGroup]]
Expected:
'searchResultComponent:subtaskListForm:checkGroup:checkGroupSelector'.
Found with similar names:
'searchResultComponent:subtaskListForm:checkGroup:dataTable:topToolbars:toolbars:2:headers:2:header:label:checkGroupSelector'

The issue as I understand it is that CheckGroupSelector is in Panel that is
created in Column.getHeader().
Of course outside of the DataTable's column the selector works just fine.

Zbynek

On Wed, Jul 17, 2019 at 8:36 PM Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> have to taken a look at:
>
>
> https://github.com/apache/wicket/blob/wicket-8.x/wicket-examples/src/main/java/org/apache/wicket/examples/compref/CheckGroupPage.java
>
> That's the trick.
>
> Have fun
> Sven
>
>
> On 17.07.19 20:15, Zbynek Vavros wrote:
> > Hi,
> >
> > I know this is quite old but since I do migration to Wicket8 now I think
> if
> > there is any "nice" way to do this.
> >
> > The thing is we have this "mighty" checkbox in the header of a checkbox
> > column.
> > For now we use jQuery but for sure there has to be better way.
> >
> >  From what I have found the best way seems to use HeaderlessColumn and
> put
> > this mighty checkbox into a panel that goes into getHeader(final String
> > componentId).
> > And of course checkbox for each row into  populateItem(Item cellItem,
> > String componentId, IModel rowModel).
> >
> > The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two are
> > quite separated so not even wrapping whole DataTable in CheckBoxGroup
> > doesn't really seem to do the trick.
> >
> > Anyone figured out a better way or is jquery the thing for this?
> >
> > Zbynek
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: DataTable and SelectAll checkbox

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

have to taken a look at:

https://github.com/apache/wicket/blob/wicket-8.x/wicket-examples/src/main/java/org/apache/wicket/examples/compref/CheckGroupPage.java

That's the trick.

Have fun
Sven


On 17.07.19 20:15, Zbynek Vavros wrote:
> Hi,
>
> I know this is quite old but since I do migration to Wicket8 now I think if
> there is any "nice" way to do this.
>
> The thing is we have this "mighty" checkbox in the header of a checkbox
> column.
> For now we use jQuery but for sure there has to be better way.
>
>  From what I have found the best way seems to use HeaderlessColumn and put
> this mighty checkbox into a panel that goes into getHeader(final String
> componentId).
> And of course checkbox for each row into  populateItem(Item cellItem,
> String componentId, IModel rowModel).
>
> The thing is, using CheckBoxGroup and CheckBoxGroupSelector these two are
> quite separated so not even wrapping whole DataTable in CheckBoxGroup
> doesn't really seem to do the trick.
>
> Anyone figured out a better way or is jquery the thing for this?
>
> Zbynek
>

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