0

Parsing error in texbox

asked 2021-07-19 14:07:38 +0800

Pramil gravatar image Pramil
1 2

updated 2021-07-21 10:07:38 +0800

cor3000 gravatar image cor3000
6005 2 7
ZK Team
>  <listbox model="@load(vm.model)"
> mold="paging"
>                  vflex="1" hflex="1" autopaging="true">
>                 <listhead sizable="true"
> children="@load(vm.visibleColumns)
> @template(each.headerTemplateName)">
>                     <template name="default" var="columnInfo">
>                         <listheader label="@load(columnInfo.label)"
> tooltiptext="@load(columnInfo.label)" 
>                             draggable="true" droppable="true"
>                     </template>   
>                 </listhead>
>                 <template name="model" var="item">
>                     <listitem children="@init(vm.visibleColumns)
> @template(each.templateName)">
>                         <template name="default" var="columnInfo">
>                             <listcell label="@bind(item[columnInfo.value])"
> />
>                         </template>
>                        
>                         <template name="textbox" var="columnInfo">
>                             <listcell><textbox
> value="@bind(item[columnInfo.value])"
> hflex="1"/></listcell>
>                         </template>
>                         
>                         
>                         <template name="datebox" var="columnInfo">
>                             <listcell><datebox
> value="@bind(item[columnInfo.value])"
> /></listcell>
>                         </template>
> 
>                         
>                         
>                         <template name="checkbox" var="columnInfo">
>                             <listcell><checkbox
> checked="@bind(item[columnInfo.value])"
> /></listcell>
>                         </template>                       
>                     </listitem>
>                 </template>
>             </listbox>

Here I am generating list box dynamically. But the problem is that exception is throwing in case texbox in <listcell><textbox value="@bind(item[columnInfo.value])" hflex="1"/></listcell>. Exception is throwing only in textbox. But the code value="@bind(item[columnInfo.value])" is working fine for datebox, checkbox etc.

19-Jul-2021 10:41:26.642 SEVERE [http-nio-8080-exec-9] org.zkoss.zk.ui.impl.UiEngineImpl.handleError org.zkoss.zel.ELException: Failed to parse the expression [${item[columnInfo}] at org.zkoss.zel.impl.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:142) at org.zkoss.zel.impl.lang.ExpressionBuilder.build(ExpressionBuilder.java:167) at org.zkoss.zkmax.bind.impl.BindExpressionBuilderEx.createValueExpression(BindExpressionBuilderEx.java:223) at org.zkoss.zel.impl.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:66) at org.zkoss.zkmax.bind.impl.BindXelFactoryEx.parseExpression(BindXelFactoryEx.java:32) at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx.init(BindEvaluatorXImplEx.java:79) at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx.access$000(BindEvaluatorXImplEx.java:45) at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx$LazyBindXelExpression.getValueExpression(BindEvaluatorXImplEx.java:129) at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx$LazyBindXelExpression.evaluate(BindEvaluatorXImplEx.java:124) at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:46) at com.stoneriver.iip.html5.zk.common.zul.TextboxEx$1.onEvent(TextboxEx.java:101) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3179) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3149) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3091) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1845) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1617) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1320) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495) at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sapiens.sa.html5.zk.portal.security.UserCredentialFilter.doFilter(UserCredentialFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.zkoss.zel.impl.parser.ParseException: Encountered " "}" "} "" at line 1, column 18. Was expecting one of:

If there is any solution please me know?

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-07-20 15:27:44 +0800

hawk gravatar image hawk
2849 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2021-07-21 10:11:35 +0800

I simulate your case with the code below, and it works fine:

<zscript><![CDATA[
Map item = new HashMap();
item.put("mykey", "myvlue");
String oneValue = "mykey";
desktop.setAttribute("info", oneValue);
]]></zscript>
<div apply="org.zkoss.bind.BindComposer">

<textbox value="@bind(item[oneValue])"/>
<textbox value="@bind(item[desktopScope.info])"/>
</div>

In the error message:

org.zkoss.zel.ELException: Failed to parse the expression [${item[columnInfo}] at

there is an wrong EL:

${item[columnInfo}

It seems there is a missing ]. I can reproduce a simialr error by removing ending ]. Although the EL expression you paste here is correct, could you check the EL in the target zul?

It's even better you can provide a zkfiddle example to reproduce the example.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2021-07-19 14:07:38 +0800

Seen: 7 times

Last updated: Jul 21

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