-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
This problem is driving me insane, I've spent over a week trying to figure it out. Just wondering if its a bug or something I'm doing incorrectly. Using zk 7.0. I have a sample zul as follows:
<hbox apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('xi.search.acquisition.upload.RunVM')" visible="@bind(vm.runUploadVisibility)">
<button upload="true,maxsize=-1,multiple=true,native" onUpload="@global-command('doUpload')"/>
In summary, the visibility of the hbox is determined by data binding a value. This area should be invisible until some user action (e.g. another button click) then the contents of the hbox should become visible (in this case the upload button).
I can get this to work i.e. initially runUploadVisibility is false in the VM then after a user action it is set to true, the hbox and button appear. However, when I click the button, nothing happens at all.
If runUploadVisibility is set to true in the VM (i.e. initially the hbox and all children are visible) and i click the button then the button produces an upload dialog as expected.
My question is, if visibility is false initially in the VM, does the upload button miss some initialisation code? Is this the reason it doesn't work in the above scenario?
2 | No.2 Revision |
This problem is driving me insane, I've spent over a week trying to figure it out. Just wondering if its a bug or something I'm doing incorrectly. Using zk 7.0. I have a sample zul as follows:
<hbox apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('xi.search.acquisition.upload.RunVM')" visible="@bind(vm.runUploadVisibility)">
<button upload="true,maxsize=-1,multiple=true,native" onUpload="@global-command('doUpload')"/>
</hbox>
In summary, the visibility of the hbox is determined by data binding a value. This area should be invisible until some user action (e.g. another button click) then the contents of the hbox should become visible (in this case the upload button).
I can get this to work i.e. initially runUploadVisibility is false in the VM then after a user action it is set to true, the hbox and button appear. However, when I click the button, nothing happens at all.
If runUploadVisibility is set to true in the VM (i.e. initially the hbox and all children are visible) and i click the button then the button produces an upload dialog as expected.
My question is, if visibility is false initially in the VM, does the upload button miss some initialisation code? Is this the reason it doesn't work in the above scenario?