Revision history [back]

click to hide/show revision 1
initial version

asked 2014-02-10 16:54:57 +0800

salman1 gravatar image salman1 flag of United Kingdom

Initialisation of components with visible attribute

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?

Initialisation of components with visible attribute

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?

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More