PivotTablePersistenceUtils. How to save Column Width.

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

PivotTablePersistenceUtils. How to save Column Width.

Postby astaravoitau » Mon Mar 16, 2015 3:05 am

How to save Pivot Grid Column width with the PivotTablePersistenceUtils?
Which way is preferable if it is possible?
Is there any other way to do this?
astaravoitau
 
Posts: 6
Joined: Wed Apr 11, 2012 10:38 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby JIDE Support » Mon Mar 16, 2015 9:59 am

PivotTablePersistenceUtils should save the field width but not the column width. For the column width, you can call PivotTablePane.getTableColumnWidth to get a Map for each sub-table and save the Map somewhere in your application. Later you can call setTableColumnWidth to set it back. It only works if the table has exactly the same columns.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36184
Joined: Sun Sep 14, 2003 10:49 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby ngandois » Tue Jan 24, 2017 5:35 am

Hi,

I was looking for a way to persist in a file the Pivot Table column width in order to restore them later.
It leaded me to this post and I tried what you propose.

I've probably missed something because it is not working.

Here is a sample of my code:

Persist part

Code: Select all
PivotTablePane pivotTable;
JTable columnHeaderTable = pivotTable.getColumnHeaderTable();
tableColumnWidth = PivotTablePane.getTableColumnWidth((HeaderTable)columnHeaderTable);
// Then, tableColumnWidth is serialized in a file


Restore part
Code: Select all
PivotTablePane pivotTable;
// tableColumnWidth owns the content serialized in a file
JTable columnHeaderTable = pivotTable.getColumnHeaderTable();
PivotTablePane.setTableColumnWidth((HeaderTable)columnHeaderTable, tableColumnWidth);


This code is partially working.
If I have built my PivotTablePane.
Then, I save the configuration.
Do some column width changes.
Restore the configuration.
It comes back to the persisted state.

Now, If I re-build from scratch the PivotTablePane, with the same data and column configuration, the width are never restored.

I've checked what's returned by PivotTablePane.getTableColumnWidth and from one run to another, the content is different, even if I do not change the PivotTablePane configuration and content.

From one run to another, I mean that I build a PivotTablePane at each run.

What did I missed ?
ngandois
 
Posts: 32
Joined: Tue Feb 18, 2014 6:10 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby JIDE Support » Tue Jan 24, 2017 9:17 am

I see. The method can only restore the width in the same run. For different run, the key used in the HashMap will be different so it is not possible restore. I will find a way to fix it so that it is the same key as long as the column name and the field type are the same in each run.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36184
Joined: Sun Sep 14, 2003 10:49 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby ngandois » Tue Jan 24, 2017 9:40 am

Thank you for the quick reply.
Let me know if you find a way.
ngandois
 
Posts: 32
Joined: Tue Feb 18, 2014 6:10 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby ngandois » Tue Feb 07, 2017 10:34 am

Hi,

Any news on a new version delivery that will solve this problem ?

Regards
ngandois
 
Posts: 32
Joined: Tue Feb 18, 2014 6:10 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby JIDE Support » Tue Feb 07, 2017 11:05 am

I forgot to update. The latest 3.6.18 should have this bug fixed.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36184
Joined: Sun Sep 14, 2003 10:49 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby ngandois » Tue Mar 21, 2017 10:21 am

Hi,

Sorry for the late reply, I had to put on hold this topic for a while.

In the process to validate the bugfix, I integrated Jide 3.6.18 and faced the regression from 3.6.17.
See this Jide topic for details.

So I guess that we will have to wait for 3.6.19 to be released.
ngandois
 
Posts: 32
Joined: Tue Feb 18, 2014 6:10 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby JIDE Support » Tue Mar 21, 2017 10:54 am

Yes, we will try to get 3.6.19 out soon.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36184
Joined: Sun Sep 14, 2003 10:49 am

Re: PivotTablePersistenceUtils. How to save Column Width.

Postby ngandois » Wed Mar 22, 2017 3:33 am

Little update on that topic.
I was working on my project with the latest JDK 8 (1.8.0_121) and jide 3.5.15.
It appeared that the restore of the saved column size was working fine.

I came back to the former Java runtime I was using (1.8.0_66), and the restore failed, like described earlier in this topic.

We are planning to integrate Jide 3.6.19 once released, but I wanted to notify you about this, just in case it can reveal a deeper bug.


Forget about that comment, it might have been some lucky try on the Ids generation as I'm not able to reproduce it all the time, and I'm not able to identify what's making it working
ngandois
 
Posts: 32
Joined: Tue Feb 18, 2014 6:10 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 3 guests