tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LOCHART,DOUGLAS E" <dougloch...@cablespeed.com>
Subject Re: Creating checkboxes with the same name
Date Sat, 03 Sep 2005 02:33:45 GMT
Ben,

If you need a client side solution it is doable in 
javascript.  If you don't want to use the names that 
tapestry gives you you can always give the checkboxes and 
id tag that suits your purposes.

Believe me I have to deal with complex rules with 2 and 3 
dimensional arrays of checkboxes where having a checkbox 
checked in one dimension will affect the other dynamically 
depending on the rules.

Now what I do is I have my own component render my entire 
grid of checkboxes and then use .script files to compose 
the javascript.

The trick is for every checkbox you mest call a function 
(like validateCheckboxes or something) for onclick and in 
that function you can enable/disable your form submit 
button.

I am NO whiz at javascript (this is my first web app) and 
I was able to do it fairly easily.

let me know if you a snippet or if I misunderstood your 
problem

good luck

Doug



On 9/3/05, Ben Wong <benw@matthiasgroup.com> wrote:

>> 
>> Hi everyone,
>> 
>> 
>> 
>> I am now trying do build a form with a list of checkboxes where you can
>> select one or more. Very basic. However, I want to make sure that at least
>> one item is checked (selected) before the form is submitted. This is 
>> doable
>> in Javascript if all the checkboxes have the same HTML name. It looks like
>> Tapestry creates the checkboxes with different names (e.g. selectedScan,
>> selectedScan$0, selectedScan$1.). For example, the HTML generated is:
>> 
>> 
>> 
>> <tr>
>> 
>> <td align="center"><input type="checkbox" name="selectedScan"/></td>
>> 
>> <td>lrtest02</td>
>> 
>> <td>DEVELOPER</td>
>> 
>> </tr>
>> 
>> <tr>
>> 
>> <td align="center"><input type="checkbox" name="selectedScan$0"/></td>
>> 
>> <td>lrtest03</td>
>> 
>> <td>DEVELOPER</td>
>> 
>> </tr>
>> 
>> 
>> 
>> Does anyone have any thoughts on this issue or how they have implemented
>> this? Having the checkboxes with the same name allows one to add a lot 
>> more
>> client functionality (e.g. ability to let the user select/deselect the
>> entire list).
>> 
>> 
>> 
>> Thanks,
>> 
>> Ben Wong




You can use tapestry varlidation framework.


-- Welcome to China Java Users Group(CNJUG). 
http://cnjug.dev.java.net

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


Mime
View raw message