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

Children binding converter doesn't converter a pure Collection

XMLWordPrintable

      Usage of google guava colelction filters leads to unexpected binding problems.

      public Collection<TabData> getSearchPopupResults()
      {
      	//...
      	return Collections2.filter(tabs, new Predicate<TabData>()
      	{
      
      		@Override
      		public boolean apply(final TabData tab)
      		{
      			return tab.isVisibleInSearchPopup();
      		}
      	});
      }
      
      <popup id="searchEditPopup" children="@load(model.searchPopupResults) @template(not empty model.searchPopupResults ? 'children' : 'xxx')">
      	<template name="children" var="tab">
      		<label value="@load(tab.name)" visible="@load(tab.visibleInSearchPopup)" />
      		<!-- not important -->
      	</template>
      	<!-- xxx definition and so on -->
      </popup>
      

      SEVERE: >>org.zkoss.zel.PropertyNotFoundException: Property 'name' not found on type com.google.common.collect.Collections2$FilteredCollection
      >> at org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:260)
      >> at org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:211)
      >> at org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:384)
      >> at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:87)
      >> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
      >> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
      >> at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:72)
      >> at org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:75)
      >> at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:179)
      >> at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
      >> at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40)
      >> at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:42)
      >> at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:58)
      >> 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)

            Unassigned Unassigned
            ulysses ulysses
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: