You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by easydoor <ch...@valdoise.fr> on 2010/07/05 15:09:38 UTC

Multi selection function in a Form Table

Hi all,

I'd like to have the following page and I meet some difficulties to build it ...
Could you help me please ?

When I click on Appliquer aux lignes cochées, I want to apply the
Quantité and Variation values (at the top of page) to checked lines
in the form Table.
When I click on Tout cocher, I check all lines
When I click on Tout décocher, I uncheck all lines
When I click on Enregistrer (at the bottom of page), 
I want to save all lines in my database.

I created a mySQL table which is linked via Hibernate to my formTable Data

CREATE TABLE IF NOT EXISTS `dotvariation` (
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`collegeId` smallint(4) NOT NULL,
`qte` int(10) NOT NULL,
`variation` double NOT NULL,
`montant` double NOT NULL,
`actif` tinyint(1) NOT NULL,
`lposteId` smallint(4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT
AUTO_INCREMENT=319 ;

The actif data is linked to checkbox

Could you tell me how reproduce this page behavior with the Form
Table, I tried but the select / unselect function doesn't work well
because it is linked to the data

I can send you by email the Java code of my page 

Find below the page form :
<img src="http://elus-dev.cg95.fr/elus/img/TableFormMultiSelect.jpg" border="0">


Re: Multi selection function in a Form Table

Posted by easydoor <ch...@valdoise.fr>.
Bob Schellink <sabob1 <at> gmail.com> writes:

> 
> Isn't jqgrid overkill for this? Use jQuery on its own to select the checkboxes
in the column. Google
> brings up a number of suggestions including this:
> 
>
http://beckelman.net/post/2008/11/18/Select-All-CheckBoxes-in-a-Table-Column-With-and-Without-jQuery-Plugin-Demo.aspx
> 
> On 6/07/2010 18:15, easydoor wrote:
> > So i need your help, Should i use dataprovider ? Should i use the
> > nullifyRowListOnDestroy method ? The onProcess function ?
> 
> I think you are stabbing in the dark as these concepts are unrelated. I
suggest you read the Click
> documentation to understand how it works, it will make your development
experience easier.
> 
> Bob
> 
> 
Thanks Bob, i'll try it !




Re: Multi selection function in a Form Table

Posted by Bob Schellink <sa...@gmail.com>.
On 7/07/2010 21:43, easydoor wrote:
> 
> I integrated your Google suggestion, it works fine BUT it doesn't solve my
> problem, because this Jquery plugin works on the client side and I want to
> process the selected values on server side.


Yes you select all the rows then POST the result to the backend, then process the results. Not sure
what issues you are running into.


> I read the Click documentation several times and i don't find deep explanations
> on table and tableForm to solve my problem. 
> 
> Could you point me to a solution ?


First I suggest you divide and conquer your problem. Create a small testpage using a POJO (no
Hibernate) and a static list of instances that you can play with. Then put Click in trace mode so
you can view the output and see what parameters are passed from the browser (also use Firebug to see
what parameters are passed). Are all the FormTable values passed in? Use a debugger and put
breakpoints in your submit listeners to see if they are invoked properly.

Regards

Bob

Re: Multi selection function in a Form Table

Posted by easydoor <ch...@valdoise.fr>.
Bob Schellink <sabob1 <at> gmail.com> writes:

> 
> Isn't jqgrid overkill for this? Use jQuery on its own to select the checkboxes
in the column. Google
> brings up a number of suggestions including this:
> 
>
http://beckelman.net/post/2008/11/18/Select-All-CheckBoxes-in-a-Table-Column-With-and-Without-jQuery-Plugin-Demo.aspx
> 
> On 6/07/2010 18:15, easydoor wrote:
> > So i need your help, Should i use dataprovider ? Should i use the
> > nullifyRowListOnDestroy method ? The onProcess function ?
> 
> I think you are stabbing in the dark as these concepts are unrelated. I
suggest you read the Click
> documentation to understand how it works, it will make your development
experience easier.
> 
> Bob

Hi Bob,

I integrated your Google suggestion, it works fine BUT it doesn't solve my
problem, because this Jquery plugin works on the client side and I want to
process the selected values on server side.

I read the Click documentation several times and i don't find deep explanations
on table and tableForm to solve my problem. 

Could you point me to a solution ?

Thanks





Re: Multi selection function in a Form Table

Posted by Bob Schellink <sa...@gmail.com>.
Isn't jqgrid overkill for this? Use jQuery on its own to select the checkboxes in the column. Google
brings up a number of suggestions including this:

http://beckelman.net/post/2008/11/18/Select-All-CheckBoxes-in-a-Table-Column-With-and-Without-jQuery-Plugin-Demo.aspx


On 6/07/2010 18:15, easydoor wrote:
> So i need your help, Should i use dataprovider ? Should i use the
> nullifyRowListOnDestroy method ? The onProcess function ?


I think you are stabbing in the dark as these concepts are unrelated. I suggest you read the Click
documentation to understand how it works, it will make your development experience easier.

Bob

Re: Multi selection function in a Form Table

Posted by easydoor <ch...@valdoise.fr>.
Bob Schellink <sabob1 <at> gmail.com> writes:

> 
> I don't understand your question. If you want to check/uncheck the checkboxes
why not use JavaScript?
> 
> Bob
> 
That's i tried to do with JQgrid ! but i meet a problem of integration, 
i posted a question on this forum the 23 June.
So i tried to build this multi selection function with the 
Click Form Table but the select / unselect function doesn't work well 
because it is linked to the data.

So i need your help, Should i use dataprovider ? Should i use the
nullifyRowListOnDestroy method ? The onProcess function ?

Thank you in advance





Re: Multi selection function in a Form Table

Posted by Bob Schellink <sa...@gmail.com>.
I don't understand your question. If you want to check/uncheck the checkboxes why not use JavaScript?

Bob

On 5/07/2010 23:09, easydoor wrote:
> Hi all,
> 
> I'd like to have the following page and I meet some difficulties to build it ...
> Could you help me please ?
> 
> When I click on Appliquer aux lignes cochées, I want to apply the
> Quantité and Variation values (at the top of page) to checked lines
> in the form Table.
> When I click on Tout cocher, I check all lines
> When I click on Tout décocher, I uncheck all lines
> When I click on Enregistrer (at the bottom of page), 
> I want to save all lines in my database.
> 
> I created a mySQL table which is linked via Hibernate to my formTable Data
> 
> CREATE TABLE IF NOT EXISTS `dotvariation` (
> `id` smallint(6) NOT NULL AUTO_INCREMENT,
> `collegeId` smallint(4) NOT NULL,
> `qte` int(10) NOT NULL,
> `variation` double NOT NULL,
> `montant` double NOT NULL,
> `actif` tinyint(1) NOT NULL,
> `lposteId` smallint(4) NOT NULL,
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT
> AUTO_INCREMENT=319 ;
> 
> The actif data is linked to checkbox
> 
> Could you tell me how reproduce this page behavior with the Form
> Table, I tried but the select / unselect function doesn't work well
> because it is linked to the data
> 
> I can send you by email the Java code of my page 
> 
> Find below the page form :
> <img src="http://elus-dev.cg95.fr/elus/img/TableFormMultiSelect.jpg" border="0">
> 
>