Revision history [back]

click to hide/show revision 1
initial version

answered 2019-07-18 11:39:01 +0800

hawk gravatar image hawk

http://hawkphoenix.blogsp... ZK Team

Because of enabled client render-on-demand, ZK doesn't render tab2 at page creation. It looks like Tabbox widget can't create tab's DOM and set selected tab at once.

If you don't have many tabs, disable client render-on-demand can solve this problem:

<custom-attributes org.zkoss.zul.client.rod="false"/>

Ref: https://www.zkoss.org/wiki/ZKConfigurationReference/zk.xml/TheLibraryProperties/org.zkoss.zul.client.rod

Because of client render-on-demand is enabled client render-on-demand, by default, ZK doesn't render tab2Tab 2 at page creation. Only when you select "Tab 2", it just creates the corresponding HTML elements for performance reason. It looks like Tabbox widget can't create tab's DOM and set selected tab at once.

If you don't have many tabs, disable client render-on-demand can solve this problem:

<custom-attributes org.zkoss.zul.client.rod="false"/>

Ref: https://www.zkoss.org/wiki/ZKConfigurationReference/zk.xml/TheLibraryProperties/org.zkoss.zul.client.rod

BTW, since you use ListModelList which can notify the change to its bound Tabbox automatically, you don't need to notify manually by:

BindUtils.postNotifyChange(null, null, this, "tabInfos"); //can remove this line

I will create a bug for your case in our tracker.

Because client render-on-demand is enabled by default, ZK doesn't render Tab 2 at page creation. Only when you select "Tab 2", it just creates the corresponding HTML elements for performance reason. It looks like Tabbox widget can't create tab's DOM and set selected tab at once.

If you don't have many tabs, disable client render-on-demand can solve this problem:

<custom-attributes org.zkoss.zul.client.rod="false"/>

Ref: https://www.zkoss.org/wiki/ZKConfigurationReference/zk.xml/TheLibraryProperties/org.zkoss.zul.client.rod

BTW, since you use ListModelList which can notify the change to its bound Tabbox automatically, you don't need to notify manually by:

BindUtils.postNotifyChange(null, null, this, "tabInfos"); //can remove this line

I will create a bug for your case in our tracker.tracker: https://tracker.zkoss.org/browse/ZK-4344

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