You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lieven Govaerts <lg...@axelera.net> on 2004/01/19 15:57:22 UTC

How to select all checkboxes, per group?

Hi,


I have an HTML page that dynamically shows groups of
users, organised per group. This is not to difficult
using 2 nested foreach tags. Next to the name of each
user is a checkbox, to display the user on a map:

group 1
 \ user 1  O
 \ user 2  O
 \ user 3  O

But, now I want to add a checkbox next to the group, that,
when selected, will automatically select the checkboxes
of all users in that group. This can be achieved trough
javascript on the client side, executed when one clicks in
the group-checkbox.

My problem now is, in Javascript on the client side, how to
find all checkboxes belonging to a certain group. The names
of the checkboxes are ( see HTML source ) driverDisplay_xx
with xx a counter, as generated by Tapestry.

-------------------------------------------------------------
extract of HTML source ( after rendering ):
<tr>
<td width=20 class="MapViewText">
	<input type="checkbox" name="driverDisplay" checked="checked"/>
</td>
</tr>
<tr>
<td width=20 class="MapViewText">
	<input type="checkbox" name="driverDisplay_0" checked="checked"/>
</td>
</tr>
<tr>
<td width=20 class="MapViewText">
	<input type="checkbox" name="driverDisplay_1" checked="checked"/>
</td>
</tr>
--------------------------------------------------------------

--------------------------------------------------------------
extract of page definition:
<!-- groups -->
<component id="groups" type="Foreach">
    <binding name="source" expression="groups"/>
</component>
<component id="groupDisplay" type="Checkbox">
    <binding name="selected" expression='false'/>
</component>
<!-- drivers -->
<component id="drivers" type="Foreach">
    <binding name="source"
expression="getDrivers(components.groups.value.id)"/>
</component>
<component id="driverDisplay" type="Checkbox">
    <binding name="selected" expression='components.drivers.value.display'/>
</component>
--------------------------------------------------------------

Is it possible to add the 'id' tag to the checkbox tag, so I can use
that as my 'group id'? Or there other ways to solve this? I want to keep
everything in one form, because I only have one submit button for all
groups.

Strange that I couldn't find more information on this in the
tapestry-users archive, has nobody ever encountered this type of problem?

thx in advance,

Lieven Govaerts
Technical Director
aXelera Solutions nv
Generaal De Wittelaan 17 B22
2800 Mechelen - Belgium
Tel: +32 (0)15/50.40.60
Fax: +32 (0)15/50.40.61
www.axelera.net


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: How to select all checkboxes, per group?

Posted by Lieven Govaerts <lg...@axelera.net>.
In exactly one hour my problem is solved, thank you very much Len.
Lieven.

-----Original Message-----
From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro]
Sent: 19 January 2004 16:45
To: Tapestry users
Subject: RE: How to select all checkboxes, per group?


Yes, but in a different place. This must be done in the .jwc or .page
file.

<component ....>
      <binding name="id" expression="bla"/>
      ...
</component>

Len

On Mon, 2004-01-19 at 17:34, Lieven Govaerts wrote:

> Thank you for replying my two page question with a one-line intelligent
> comment :) Do you know if this is possible in Tapestry 2.3 or do we
> need to upgrade to 3.0 ( postponed for now because 'officialy' still in
> beta )
>
> Lieven.
>
> -----Original Message-----
> From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro]
> Sent: 19 January 2004 16:00
> To: Tapestry users
> Subject: Re: How to select all checkboxes, per group?
>
>
> I used the id for that purpose. You can set it to whatever you need.
>
> <input type="checkbox" name="driverDisplay_0" checked="checked"
> id="ognl:bla"/>
>
> Len
>
>  On Mon, 2004-01-19 at 16:57, Lieven Govaerts wrote:
>
> > Hi,
> >
> >
> > I have an HTML page that dynamically shows groups of
> > users, organised per group. This is not to difficult
> > using 2 nested foreach tags. Next to the name of each
> > user is a checkbox, to display the user on a map:
> >
> > group 1
> >  \ user 1  O
> >  \ user 2  O
> >  \ user 3  O
> >
> > But, now I want to add a checkbox next to the group, that,
> > when selected, will automatically select the checkboxes
> > of all users in that group. This can be achieved trough
> > javascript on the client side, executed when one clicks in
> > the group-checkbox.
> >
> > My problem now is, in Javascript on the client side, how to
> > find all checkboxes belonging to a certain group. The names
> > of the checkboxes are ( see HTML source ) driverDisplay_xx
> > with xx a counter, as generated by Tapestry.
> >
> > -------------------------------------------------------------
> > extract of HTML source ( after rendering ):
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay" checked="checked"/>
> > </td>
> > </tr>
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay_0" checked="checked"/>
> > </td>
> > </tr>
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay_1" checked="checked"/>
> > </td>
> > </tr>
> > --------------------------------------------------------------
> >
> > --------------------------------------------------------------
> > extract of page definition:
> > <!-- groups -->
> > <component id="groups" type="Foreach">
> >     <binding name="source" expression="groups"/>
> > </component>
> > <component id="groupDisplay" type="Checkbox">
> >     <binding name="selected" expression='false'/>
> > </component>
> > <!-- drivers -->
> > <component id="drivers" type="Foreach">
> >     <binding name="source"
> > expression="getDrivers(components.groups.value.id)"/>
> > </component>
> > <component id="driverDisplay" type="Checkbox">
> >     <binding name="selected"
> expression='components.drivers.value.display'/>
> > </component>
> > --------------------------------------------------------------
> >
> > Is it possible to add the 'id' tag to the checkbox tag, so I can use
> > that as my 'group id'? Or there other ways to solve this? I want to keep
> > everything in one form, because I only have one submit button for all
> > groups.
> >
> > Strange that I couldn't find more information on this in the
> > tapestry-users archive, has nobody ever encountered this type of
problem?
> >
> > thx in advance,
> >
> > Lieven Govaerts
> > Technical Director
> > aXelera Solutions nv
> > Generaal De Wittelaan 17 B22
> > 2800 Mechelen - Belgium
> > Tel: +32 (0)15/50.40.60
> > Fax: +32 (0)15/50.40.61
> > www.axelera.net
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: How to select all checkboxes, per group?

Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
Yes, but in a different place. This must be done in the .jwc or .page
file.

<component ....>
      <binding name="id" expression="bla"/>
      ...
</component>

Len

On Mon, 2004-01-19 at 17:34, Lieven Govaerts wrote:

> Thank you for replying my two page question with a one-line intelligent
> comment :) Do you know if this is possible in Tapestry 2.3 or do we
> need to upgrade to 3.0 ( postponed for now because 'officialy' still in
> beta )
> 
> Lieven.
> 
> -----Original Message-----
> From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro]
> Sent: 19 January 2004 16:00
> To: Tapestry users
> Subject: Re: How to select all checkboxes, per group?
> 
> 
> I used the id for that purpose. You can set it to whatever you need.
> 
> <input type="checkbox" name="driverDisplay_0" checked="checked"
> id="ognl:bla"/>
> 
> Len
> 
>  On Mon, 2004-01-19 at 16:57, Lieven Govaerts wrote:
> 
> > Hi,
> >
> >
> > I have an HTML page that dynamically shows groups of
> > users, organised per group. This is not to difficult
> > using 2 nested foreach tags. Next to the name of each
> > user is a checkbox, to display the user on a map:
> >
> > group 1
> >  \ user 1  O
> >  \ user 2  O
> >  \ user 3  O
> >
> > But, now I want to add a checkbox next to the group, that,
> > when selected, will automatically select the checkboxes
> > of all users in that group. This can be achieved trough
> > javascript on the client side, executed when one clicks in
> > the group-checkbox.
> >
> > My problem now is, in Javascript on the client side, how to
> > find all checkboxes belonging to a certain group. The names
> > of the checkboxes are ( see HTML source ) driverDisplay_xx
> > with xx a counter, as generated by Tapestry.
> >
> > -------------------------------------------------------------
> > extract of HTML source ( after rendering ):
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay" checked="checked"/>
> > </td>
> > </tr>
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay_0" checked="checked"/>
> > </td>
> > </tr>
> > <tr>
> > <td width=20 class="MapViewText">
> > 	<input type="checkbox" name="driverDisplay_1" checked="checked"/>
> > </td>
> > </tr>
> > --------------------------------------------------------------
> >
> > --------------------------------------------------------------
> > extract of page definition:
> > <!-- groups -->
> > <component id="groups" type="Foreach">
> >     <binding name="source" expression="groups"/>
> > </component>
> > <component id="groupDisplay" type="Checkbox">
> >     <binding name="selected" expression='false'/>
> > </component>
> > <!-- drivers -->
> > <component id="drivers" type="Foreach">
> >     <binding name="source"
> > expression="getDrivers(components.groups.value.id)"/>
> > </component>
> > <component id="driverDisplay" type="Checkbox">
> >     <binding name="selected"
> expression='components.drivers.value.display'/>
> > </component>
> > --------------------------------------------------------------
> >
> > Is it possible to add the 'id' tag to the checkbox tag, so I can use
> > that as my 'group id'? Or there other ways to solve this? I want to keep
> > everything in one form, because I only have one submit button for all
> > groups.
> >
> > Strange that I couldn't find more information on this in the
> > tapestry-users archive, has nobody ever encountered this type of problem?
> >
> > thx in advance,
> >
> > Lieven Govaerts
> > Technical Director
> > aXelera Solutions nv
> > Generaal De Wittelaan 17 B22
> > 2800 Mechelen - Belgium
> > Tel: +32 (0)15/50.40.60
> > Fax: +32 (0)15/50.40.61
> > www.axelera.net
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



RE: How to select all checkboxes, per group?

Posted by Lieven Govaerts <lg...@axelera.net>.
Thank you for replying my two page question with a one-line intelligent
comment :) Do you know if this is possible in Tapestry 2.3 or do we
need to upgrade to 3.0 ( postponed for now because 'officialy' still in
beta )

Lieven.

-----Original Message-----
From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro]
Sent: 19 January 2004 16:00
To: Tapestry users
Subject: Re: How to select all checkboxes, per group?


I used the id for that purpose. You can set it to whatever you need.

<input type="checkbox" name="driverDisplay_0" checked="checked"
id="ognl:bla"/>

Len

 On Mon, 2004-01-19 at 16:57, Lieven Govaerts wrote:

> Hi,
>
>
> I have an HTML page that dynamically shows groups of
> users, organised per group. This is not to difficult
> using 2 nested foreach tags. Next to the name of each
> user is a checkbox, to display the user on a map:
>
> group 1
>  \ user 1  O
>  \ user 2  O
>  \ user 3  O
>
> But, now I want to add a checkbox next to the group, that,
> when selected, will automatically select the checkboxes
> of all users in that group. This can be achieved trough
> javascript on the client side, executed when one clicks in
> the group-checkbox.
>
> My problem now is, in Javascript on the client side, how to
> find all checkboxes belonging to a certain group. The names
> of the checkboxes are ( see HTML source ) driverDisplay_xx
> with xx a counter, as generated by Tapestry.
>
> -------------------------------------------------------------
> extract of HTML source ( after rendering ):
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay" checked="checked"/>
> </td>
> </tr>
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay_0" checked="checked"/>
> </td>
> </tr>
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay_1" checked="checked"/>
> </td>
> </tr>
> --------------------------------------------------------------
>
> --------------------------------------------------------------
> extract of page definition:
> <!-- groups -->
> <component id="groups" type="Foreach">
>     <binding name="source" expression="groups"/>
> </component>
> <component id="groupDisplay" type="Checkbox">
>     <binding name="selected" expression='false'/>
> </component>
> <!-- drivers -->
> <component id="drivers" type="Foreach">
>     <binding name="source"
> expression="getDrivers(components.groups.value.id)"/>
> </component>
> <component id="driverDisplay" type="Checkbox">
>     <binding name="selected"
expression='components.drivers.value.display'/>
> </component>
> --------------------------------------------------------------
>
> Is it possible to add the 'id' tag to the checkbox tag, so I can use
> that as my 'group id'? Or there other ways to solve this? I want to keep
> everything in one form, because I only have one submit button for all
> groups.
>
> Strange that I couldn't find more information on this in the
> tapestry-users archive, has nobody ever encountered this type of problem?
>
> thx in advance,
>
> Lieven Govaerts
> Technical Director
> aXelera Solutions nv
> Generaal De Wittelaan 17 B22
> 2800 Mechelen - Belgium
> Tel: +32 (0)15/50.40.60
> Fax: +32 (0)15/50.40.61
> www.axelera.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to select all checkboxes, per group?

Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
I used the id for that purpose. You can set it to whatever you need.

<input type="checkbox" name="driverDisplay_0" checked="checked"
id="ognl:bla"/>

Len

 On Mon, 2004-01-19 at 16:57, Lieven Govaerts wrote:

> Hi,
> 
> 
> I have an HTML page that dynamically shows groups of
> users, organised per group. This is not to difficult
> using 2 nested foreach tags. Next to the name of each
> user is a checkbox, to display the user on a map:
> 
> group 1
>  \ user 1  O
>  \ user 2  O
>  \ user 3  O
> 
> But, now I want to add a checkbox next to the group, that,
> when selected, will automatically select the checkboxes
> of all users in that group. This can be achieved trough
> javascript on the client side, executed when one clicks in
> the group-checkbox.
> 
> My problem now is, in Javascript on the client side, how to
> find all checkboxes belonging to a certain group. The names
> of the checkboxes are ( see HTML source ) driverDisplay_xx
> with xx a counter, as generated by Tapestry.
> 
> -------------------------------------------------------------
> extract of HTML source ( after rendering ):
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay" checked="checked"/>
> </td>
> </tr>
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay_0" checked="checked"/>
> </td>
> </tr>
> <tr>
> <td width=20 class="MapViewText">
> 	<input type="checkbox" name="driverDisplay_1" checked="checked"/>
> </td>
> </tr>
> --------------------------------------------------------------
> 
> --------------------------------------------------------------
> extract of page definition:
> <!-- groups -->
> <component id="groups" type="Foreach">
>     <binding name="source" expression="groups"/>
> </component>
> <component id="groupDisplay" type="Checkbox">
>     <binding name="selected" expression='false'/>
> </component>
> <!-- drivers -->
> <component id="drivers" type="Foreach">
>     <binding name="source"
> expression="getDrivers(components.groups.value.id)"/>
> </component>
> <component id="driverDisplay" type="Checkbox">
>     <binding name="selected" expression='components.drivers.value.display'/>
> </component>
> --------------------------------------------------------------
> 
> Is it possible to add the 'id' tag to the checkbox tag, so I can use
> that as my 'group id'? Or there other ways to solve this? I want to keep
> everything in one form, because I only have one submit button for all
> groups.
> 
> Strange that I couldn't find more information on this in the
> tapestry-users archive, has nobody ever encountered this type of problem?
> 
> thx in advance,
> 
> Lieven Govaerts
> Technical Director
> aXelera Solutions nv
> Generaal De Wittelaan 17 B22
> 2800 Mechelen - Belgium
> Tel: +32 (0)15/50.40.60
> Fax: +32 (0)15/50.40.61
> www.axelera.net
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org