thomashan / zkgrails

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

zkspreadsheet not loading when using zkgrails 2.1 #296

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of ZKGrails you're using? On what operating system?
zkGrails 2.1

Which version of Grails you're using?
grails 2.1

What steps will reproduce the problem?
1. embed zkspreadsheet with showToolbar="true" in the application
2. spreadsheet will not load

What is the expected output? What do you see instead?
spreadsheet should be showing up as it does using zkgrails 2.0.4

Please provide any additional information below. Attaching a test case to
reproduce it is preferable.
I have been using zkspreadsheet with zkgrails 2.0.4 without any problems. 
Recently I updated to zkgrails 2.1 so I could use the clustered serializable 
feature that was added. zkspreadsheet no longer loads. I have tried multiple 
different versions of zkspreadsheet (they all work with zkgrails 2.0.4) Not 
sure if I am missing something or someone can verify that there is a problem 
embedding zkspreadsheet in zkgrails 2.1. Thanks!

Original issue reported on code.google.com by miralo...@gmail.com on 6 Jan 2013 at 4:39

GoogleCodeExporter commented 8 years ago
Thank you for reporting !

Is it possible for me to have a small app to reproduce this bug, so I can look 
into it for you quicker. Thank you.

-Chanwit

Original comment by chanwit on 6 Jan 2013 at 4:46

GoogleCodeExporter commented 8 years ago
Also could you please specify the minor version of Grails you're using (i.e. 
2.1.x).
Thank you.

Original comment by chanwit on 6 Jan 2013 at 4:48

GoogleCodeExporter commented 8 years ago
zk spreadsheet does not load when used with zkgrails 2.1 when the toolbar 
option is set to true otherwise it will load as expected. In zkgrails 2.0.4 any 
version such as zkspreadsheet 2.5 will load fine with the toolbar option.

Original comment by miralo...@gmail.com on 6 Jan 2013 at 4:49

GoogleCodeExporter commented 8 years ago
sure I can work in providing a small app. 
Grails version: 2.1
zkgrails version: 2.1
zkspreadsheet version: 2.5

Thanks

Original comment by miralo...@gmail.com on 6 Jan 2013 at 4:50

GoogleCodeExporter commented 8 years ago
I have included a zip file that contains an simple eclipse grails project. The 
only thing left is to add the zkspreadsheet jar files (2.5) to the lib 
directory (I had to delete them since the max is 10 MB).

Steps to reproduce:
configure eclipse to run with grails 2.0.4 and zkgrails 2.0.4
copy zk-spreadsheet 2.5 jars to lib directory (zss.jar, zpoi.jar, and all of 
the jars under ext folder)
run-app
view spreadsheet.zul (it will work fine)

now migrate to zkgrails 2.1.
view spreadsheet.zul (will throw an error or not load)

Thanks, let me know if you need any additional information.
Antonio.

Original comment by miralo...@gmail.com on 6 Jan 2013 at 5:47

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for the test case.

Original comment by chanwit on 6 Jan 2013 at 5:51

GoogleCodeExporter commented 8 years ago
I scheduled this fix for the next release.

Original comment by chanwit on 6 Jan 2013 at 5:52

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I've found that it may be a ZK bug as the ZK Spreadsheet may be compatible only 
with ZK 6.0, not ZK 6.5. It's error during ZK JavaScript initialization, not in 
the ZKGrails layer.

(ZKGrails 2.0 bundles ZK 6.0; but ZKGrails 2.1 uses ZK 6.5)

Original comment by chanwit on 6 Jan 2013 at 9:08

GoogleCodeExporter commented 8 years ago
Thanks for the quick response. ZK spreadsheet 2.5 was created to support zk 
6.5. The release notes say this:
ZK Spreadsheet 2.5 is a maintenance release to support ZK 6.5 along with bug 
fixes.

That is why I figured it should work with zkgrails 2.1 since it ships with zk 
6.5. I have tested their test app that ships with 6.5 and it works as expected. 
I did notice that the error took place in Javascript but I was lost as to why 
it only happens when using zkgrails 2.1. I did even try with a zkspreadsheet 
2.6 fresh build which was built Dec 28th but found the same problem.

Thanks.

Original comment by miralo...@gmail.com on 6 Jan 2013 at 4:18

GoogleCodeExporter commented 8 years ago
Thank you for your confirmation. I'll track it down again.

Original comment by chanwit on 6 Jan 2013 at 4:37

GoogleCodeExporter commented 8 years ago

Original comment by chanwit on 28 Feb 2013 at 2:22

GoogleCodeExporter commented 8 years ago

Original comment by chanwit on 4 Mar 2013 at 2:40

GoogleCodeExporter commented 8 years ago
Stacktrace found in JavaScript console:

Uncaught TypeError: Cannot read property 'skip' of undefined zul.menu.wpd:8
zul.menu.Menuitem.zk.$extends.setDisabled zul.menu.wpd:8
zul.menu.Menuitem.zk.$extends.setDisabled._adbs zul.menu.wpd:8
zk.Object.$supers zk.wpd:9
zss.Menuitem.zk.$extends.setDisabled zss.wpd:8
zss.Menupopup.zk.$extends.setDisabled zss.wpd:8
zss.Toolbarbutton.zk.$extends.setDisabled zss.wpd:8
zss.ToolbarTabpanel.zk.$extends.setDisabled zss.wpd:28
zss.ToolbarTabpanel.zk.$extends.createButtonsIfNotExist zss.wpd:28
zss.ToolbarTabbox.zk.$extends.$init zss.wpd:28
x zk.wpd:9
zss.Toolbar.zk.$extends.$init zss.wpd:28
x zk.wpd:9
zss.Spreadsheet.zk.$extends.$define.showToolbar zss.wpd:2
(anonymous function) zk.wpd:9
zk.copy._set2 zk.wpd:9
zk.Widget.zk.$extends.set

Original comment by chanwit on 4 Mar 2013 at 6:49

GoogleCodeExporter commented 8 years ago
There's a bug that prevents some initialization of the ZK component. So some 
properties are still undefined during the loading phase.

While this issue is being investigated, a workaround which can be done at the 
moment is to call:

showToolbar = true

inside the composer, in closure afterCompose = { }

Original comment by chanwit on 6 Mar 2013 at 4:02

GoogleCodeExporter commented 8 years ago
The problem is that to customize the toolbar is necessary to use an
ActionHandler():

actionHandler = new CustomizedActionHandler();
spreadsheet.setActionHandler(actionHandler)

If this code gets executed the spreadsheet never loads. Without setting the
actionHandler the toolbar and spreadsheet show up fine. In order to provide
functionality the handler needs to be set.

Original comment by miralo...@gmail.com on 6 Mar 2013 at 4:33

GoogleCodeExporter commented 8 years ago
Hello Chanwit,

I am also getting errors when I set the source for the spreadsheet after it
has loaded (even without the actionHandler being set)

1) the spreadsheet loads fine (with toolbar = true)
2) spreadsheet.setSrc("newFile.xls");

Error takes place.

Original comment by miralo...@gmail.com on 6 Mar 2013 at 4:42

GoogleCodeExporter commented 8 years ago
Thank you for the additional input. It will be a great help.

Original comment by chanwit on 6 Mar 2013 at 5:16

GoogleCodeExporter commented 8 years ago
It's been likely that ZK 6.5.1.1 used in ZKGrails 2.1 contains a bug that 
prevents ZK Spreadsheet to render correctly.

I'll pack a special version of ZKGrails for you to try. Please let me know if 
you're OK with this. It will ship ZK 6.5.0 (jars found in ZK Spreadsheet demo).

Original comment by chanwit on 7 Mar 2013 at 3:14

GoogleCodeExporter commented 8 years ago
Hello Chanwit,

this is something I noticed before that the size of the zk jar files were
different from those you can download from the release version at zkoss.org

For now getting a special version would be fine as long as all the other
features are still there. My concern is scalability. We plan to use
zkgrails as the front end framework but we need to be sure that for future
versions it will be compatible with any other zk solutions such as zk
spreadsheet, zk pivot, zk calendar or any others.

Original comment by miralo...@gmail.com on 8 Mar 2013 at 2:11

GoogleCodeExporter commented 8 years ago
Right, I remined that you noticed this before. I'll prepare one for you then.

There's nothing to worry about the compatibility. If a bug is found on my side, 
I am always happy to help. If it's a bit hard to track like this ZK's bug, our 
option is to mix-and-match the good jars together. 

The worse case is that we need to inform the ZK team that we found an 
incompatible bug among their components.

Original comment by chanwit on 8 Mar 2013 at 3:01

GoogleCodeExporter commented 8 years ago
Fixed by deliver a custom plugin.

Original comment by chanwit on 13 Mar 2013 at 3:22

GoogleCodeExporter commented 8 years ago

Original comment by chanwit on 13 Mar 2013 at 3:22