PerShing2014 / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

Two jmesa tables #293

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi jeff.

I need to create a jsp which contains two jmesa tables but i need to have only 
one save changes button which save the information of both tables (on server 
side). Is there any way to create my own save changes button and control it on 
server side?

Thanks again!

Original issue reported on code.google.com by VictorRo...@gmail.com on 18 Oct 2010 at 7:07

GoogleCodeExporter commented 8 years ago
I have not created 2 worksheets on the same page before...it should work 
though. I am talking to Siddhant to see if there are any problems with the 
validation.

For sure you can define a save button outside the table. If you do a view 
source on the save button (on toolbar) you can see the JavaScript that it 
calls. You basically just need to do the same thing.

To submit two tables you need to make sure that you set the table state for 
each to say that the table is being saved and then generate the hidden fields. 

setSaveToWorksheet('table1');
setSaveToWorksheet('table2');

createHiddenInputFieldsForLimit('table1')
createHiddenInputFieldsForLimitAndSubmit('table2');

If you have problems I will try to help but you might need to step through the 
code if you have issues. Technically it should work but I have not done it yet. 
I have worked with multiple tables on one page though...just not multiple 
worksheets.

Original comment by jeff.johnston.mn@gmail.com on 18 Oct 2010 at 9:51

GoogleCodeExporter commented 8 years ago
Hi jeff. Thanks for your response. I think i didn´t explain well my issue, 
cause of course, i maybe can work with two tables and only one worksheet and 
then on the save action look for each column of the different tables on the 
same worksheet, is this possible¿?

Thanks again for your help!

Original comment by VictorRo...@gmail.com on 19 Oct 2010 at 6:51

GoogleCodeExporter commented 8 years ago
For sure you would have to work with two worksheets. Even if the worksheet 
strategy was plugable I am not sure it would be very useful. You would really 
need to know which table each row is referencing, and it does not know that.

You can easily get at both worksheets as long as you use the 
TableModelUtils.saveWorksheet(). You could not work with the concrete 
TableModel class for saving the worksheet as it only accepts one 
WorksheetSaver. That might be worth enhancing though...

Does that make sense?

Original comment by jeff.johnston.mn@gmail.com on 19 Oct 2010 at 3:37

GoogleCodeExporter commented 8 years ago
Siddhant got back to me and reminded me that right now we cannot have two 
worksheets on the same page. The reason is we have a "feature" that the 
worksheet will be cleared if you leave the page you are on and come back. 

Sorry...right now two worksheets on one page is not possible.

However, we are talking about removing this feature. The reason we would do it 
is because we now have a button to clear worksheet changes, and a toolbar 
widget that tells the user there are changes in the worksheet. I remember now 
that the reason we did not do that for 3.0 is because there was not enough time 
to do that and test.

Original comment by jeff.johnston.mn@gmail.com on 19 Oct 2010 at 4:22

GoogleCodeExporter commented 8 years ago
Hi jeff. Ok i can´t work with two worksheet, but i can work with one 
worksheet, can´t i¿? on the saveworksheet i can implement a worksheetimpl in 
which i can diferrenciate beetwen the rows, for example one table has a column 
of checkbox with id checkbox_c and the other with id checkbox_f. while i go 
through the saved rows on the worksheet i can ask if the property name is one 
or another and do one thing or the other. Is this right¿?

Original comment by VictorRo...@gmail.com on 19 Oct 2010 at 6:32

GoogleCodeExporter commented 8 years ago
What you are talking about is how you normally would use the Worksheet. You 
would not have to specify your own worksheetimpl either, but just use the one 
passed to you when saving.

Original comment by jeff.johnston.mn@gmail.com on 19 Oct 2010 at 7:35

GoogleCodeExporter commented 8 years ago
How to Create our own button in jmesa table....

Original comment by anandbab...@gmail.com on 10 Dec 2010 at 9:56

GoogleCodeExporter commented 8 years ago
It is possible to have two worksheets on the same page now.

Original comment by jeff.johnston.mn@gmail.com on 10 Mar 2011 at 8:12

GoogleCodeExporter commented 8 years ago
Are there any examples of using two editable worksheets on a single JSP? I've 
been searching but I haven't been able to locate. Please advise. Best, Sam

Original comment by samuel.r...@gmail.com on 6 Jan 2012 at 9:41

GoogleCodeExporter commented 8 years ago
I think this might work now...still have not tried it.

setSaveToWorksheet('table1');
setSaveToWorksheet('table2');

createHiddenInputFieldsForLimit('table1')
createHiddenInputFieldsForLimitAndSubmit('table2');

Technically, if you submit a form what you are trying to do is capture all the 
table attributes as hidden form fields so that the state is preserved. If you 
use ajax then it is not an issue as you only submit one table at a time anyway.

For sure get one worksheet working and then I can work with you to see if we 
can get two working.

Original comment by jeff.johnston.mn@gmail.com on 7 Jan 2012 at 9:21