My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 293: Two jmesa tables
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Mar 2011


 
Reported by VictorRo...@gmail.com, Oct 18, 2010
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!

Oct 18, 2010
Project Member #1 jeff.johnston.mn@gmail.com
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.

Oct 18, 2010
#2 VictorRo...@gmail.com
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!
Oct 19, 2010
Project Member #3 jeff.johnston.mn@gmail.com
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?

Oct 19, 2010
Project Member #4 jeff.johnston.mn@gmail.com
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.

Oct 19, 2010
#5 VictorRo...@gmail.com
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¿?
Oct 19, 2010
Project Member #6 jeff.johnston.mn@gmail.com
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.
Dec 10, 2010
#7 anandbab...@gmail.com
How to Create our own button in jmesa table....
Mar 10, 2011
Project Member #8 jeff.johnston.mn@gmail.com
It is possible to have two worksheets on the same page now.
Status: Fixed
Jan 6, 2012
#9 samuel.r...@gmail.com
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
Jan 7, 2012
Project Member #10 jeff.johnston.mn@gmail.com
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.






Powered by Google Project Hosting