Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1153

MVVM - not possible to set selected tab on tabbox if tabs are generated using templates.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • None
    • 6.0.1
    • Components, Databind 2
    • all

      <tabbox sclass="yw-editor-area-properties-tab" selectedIndex="@bind(model.selectedTab)" >
      <tabs children="@load(model.tabs)">
      <template name="children" var="tab">
      <tab label="@load(tab.name)" sclass="yw-editor-area-properties-tab"/>
      </template>
      </tabs>
      <tabpanels children="@load(model.tabs) @template(each.wigetTab?'widget':'tab')">
      <template name="widget" var="tab">
      <tabpanel>
      <widgetslot slotID="${tab.slotId}" height="100%"/>
      </tabpanel>
      </template>
      <template name="tab" var="tab">
      <tabpanel children="@load(tab.sections) @template('children')" sclass="yw-editor-area-properties-tab-content">
      <template name="children" var="section">
      <vlayout>
      <groupbox open="@bind(section.opened)">
      <caption sclass="@load(section.opened ? 'yw-editor-area-section-open' : 'yw-editor-area-section-closed')">
      <label value="@load(section.name)" sclass="yw-editor-area-section-label"/>
      </caption>
      <div children="@load(section.fields) @template('children')">
      <template name="children" var="field">
      <hlayout sclass="@load(field.changed?'yw-attribute-container-valchanged' : 'yw-attribute-container')" >
      <label value="@load(field.name)" sclass="yw-attribute-label"/>
      <editor property="${field.property}" onValueChanged="@command('valChanged', fieldName=field.qualifier)"/>
      </hlayout>
      </template>
      </div>
      </groupbox>
      </vlayout>
      </template>
      </tabpanel>
      </template>

      </tabpanels>
      </tabbox>

      I recive

      SEVERE: >>org.zkoss.zel.ELException: Error writing 'selectedIndex' on type org.zkoss.zul.Tabbox
      >>java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
      >> at org.zkoss.zk.ui.AbstractComponent$ChildIter.<init>(AbstractComponent.java:2842)
      >> at org.zkoss.zk.ui.AbstractComponent$ChildIter.<init>(AbstractComponent.java:2834)
      >> at org.zkoss.zk.ui.AbstractComponent$Children.listIterator(AbstractComponent.java:185)
      >> at java.util.AbstractSequentialList.get(Unknown Source)
      >> at org.zkoss.zul.Tabbox.setSelectedIndex(Tabbox.java:163)
      >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      >> at java.lang.reflect.Method.invoke(Unknown Source)
      >> at org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:139)
      >> at org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      >> at org.zkoss.zel.CompositeELResolver.setValue(CompositeELResolver.java:83)
      >> at org.zkoss.xel.zel.XelELResolver.setValue(XelELResolver.java:114)
      >> at org.zkoss.bind.xel.zel.BindELResolver.setValue(BindELResolver.java:102)
      >> at org.zkoss.zel.impl.parser.AstValue.setValue(AstValue.java:215)
      >> at org.zkoss.zel.impl.ValueExpressionImpl.setValue(ValueExpressionImpl.java:256)
      >> at org.zkoss.xel.zel.ELXelExpression.setValue(ELXelExpression.java:50)
      >> at org.zkoss.bind.impl.BindEvaluatorXImpl.setValue(BindEvaluatorXImpl.java:50)
      >> at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:81)
      >> at org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:171)
      >> at org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:372)
      >> at org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1865)
      >> at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1847)
      >> at org.zkoss.bind.tracker.impl.BindUiLifeCycle$1.onEvent(BindUiLifeCycle.java:63)
      >> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2736)
      >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2685)
      >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2648)
      >> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      >> at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:308)
      >> at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:331)
      >> at org.zkoss.bind.impl.BindChildRenderer.render(BindChildRenderer.java:98)
      >> at org.zkoss.bind.impl.LoadChildrenBindingImpl.load(LoadChildrenBindingImpl.java:89)
      >> at org.zkoss.bind.impl.BinderImpl.loadOnPropertyChange(BinderImpl.java:382)
      >> at org.zkoss.bind.impl.BinderImpl.access$100(BinderImpl.java:94)
      >> at org.zkoss.bind.impl.BinderImpl$QueueListener.onEvent(BinderImpl.java:236)
      >> at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:145)
      >> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2736)
      >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2707)
      >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2648)
      >> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      >> at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1702)
      >> at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1487)
      >> at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1204)
      >> at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:558)
      >> at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:456)
      >> at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:464)
      >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      >> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      >> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      >> at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)
      >> at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      >> at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
      >> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      >> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      >> at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
      >> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      >> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      >> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:203)
      >> at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter.doFilter(DynamicCatalogVersionActivationFilter.java:93)
      >> at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter$$FastClassByCGLIB$$2d468805.invoke(<generated>)
      >> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      >> at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
      >> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      >> at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      >> at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      >> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      >> at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
      >> at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter$$EnhancerByCGLIB$$2fd96096.doFilter(<generated>)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.DataSourceSwitchingFilter.doFilter(DataSourceSwitchingFilter.java:73)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:80)
      >> at de.hybris.platform.servicelayer.web.SessionFilter$$FastClassByCGLIB$$bb4593c7.invoke(<generated>)
      >> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      >> at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
      >> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      >> at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      >> at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      >> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      >> at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
      >> at de.hybris.platform.servicelayer.web.SessionFilter$$EnhancerByCGLIB$$f1ba89d8.doFilter(<generated>)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.RedirectWhenSystemIsNotInitializedFilter.doFilter(RedirectWhenSystemIsNotInitializedFilter.java:85)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.DynamicTenantSwitchingFilter.doFilterInternal(DynamicTenantSwitchingFilter.java:68)
      >> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:47)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain$InternalFilterChain.doFilter(PlatformFilterChain.java:175)
      >> at de.hybris.platform.servicelayer.web.PlatformFilterChain.doFilterInternal(PlatformFilterChain.java:134)
      >> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      >> at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      >> at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
      >> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      >> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      >> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      >> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      >> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      >> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      >> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      >> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
      >> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      >> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      >> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
      >> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
      >> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      >> at java.lang.Thread.run(Unknown Source)

            Unassigned Unassigned
            abalwierz abalwierz
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: