0

Illegal Syntax for Set Operation

asked 2012-02-10 13:34:01 +0800

avidD gravatar image avidD
166 2

Hello,
I am currently updating to a nightly build of ZK 6 (February 6th). I am now getting an exception on switching tabs for a piece of code that was running fine before.
This is the exception message:
org.zkoss.zel.PropertyNotWritableException: Illegal Syntax for Set Operation

This is the respective fragment of the zul file:

<tabs id="mStructureTabs"> 
        <tab id="mGeneralAttributes" label="${labels.tabs.GeneralAttributes}"
             selected="@bind(vm.focusTab eq 'mGeneralAttributes')" 
             onSelect="@command('switchTab', tab='mGeneralAttributes', tabGroup='RESOURCE')" />             
        <tab id="mRowAttributes" label="${labels.tabs.RowAttributes}"
             selected="@bind(vm.focusTab eq 'mRowAttributes')" 
             onSelect="@command('switchTab', tab='mRowAttributes', tabGroup='RESOURCE')" />                          
        <tab id="mColumnAttributes" label="${labels.tabs.ColumnAttributes}"
             selected="@bind(vm.focusTab eq 'mColumnAttributes')" 
             onSelect="@command('switchTab', tab='mColumnAttributes', tabGroup='RESOURCE')" />             
        <tab id="mNodes" label="${labels.tabs.Nodes}" 
             selected="@bind(vm.focusTab eq 'mNodes')" 
             onSelect="@command('switchTab', tab='mNodes', tabGroup='NODES')" />             
        <tab id="mNodeClasses" label="${labels.tabs.NodeClasses}"
             onSelect="@command('switchTab', tab='mNodeClasses', tabGroup='CLASSES')" />             
<!--              selected="@bind(vm.focusTab eq 'mNodeClasses')" -->     
        <tab id="mCustomAttributes" label="${labels.tabs.CustomAttributes}"
             selected="@bind(vm.focusTab eq 'mCustomAttributes')" 
      </tabs>

For the classes tab I don't get the exception as the "selected" attribute has been commented out. Thus, the error seems to be in the bind-expression. Has anyone else come across this problem? The selected-property is public and not attempted to be set at all when this exception occurs. It is however set successfully when initializing the page.

Cheers,
David

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2012-02-10 15:33:34 +0800

avidD gravatar image avidD
166 2

BTW: with "not attempted to be set" I mean, the setter method is not called as the exception is thrown before.

link publish delete flag offensive edit

answered 2012-02-13 00:52:41 +0800

paowang gravatar image paowang
140 6

The nightly build is for testing, it might has some issues or bugs.
You might update to latest or waiting for official release.

link publish delete flag offensive edit

answered 2012-02-23 09:28:51 +0800

avidD gravatar image avidD
166 2

Well, the problem persists in the official release.

link publish delete flag offensive edit

answered 2012-03-02 07:11:50 +0800

paowang gravatar image paowang
140 6

updated 2012-03-02 07:12:42 +0800

Can you provide some code for reproducing?
By the way, the syntax @bind will load and "save" specify property ( http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/MVVM/Syntax/Data%20Binding/@bind )
But the syntax of the code is "@bind(vm.focusTab eq 'mGeneralAttributes')" , vm.focusTab eq 'mGeneralAttributes' will be a boolean variable and can't be "Set".
If @bind changes to @load, it might work.

link publish delete flag offensive edit

answered 2012-03-02 09:50:36 +0800

avidD gravatar image avidD
166 2

Hi paowang,
thanks a lot. Changing @bind to @load fixed the problem. Stupid me.

link publish delete flag offensive edit

answered 2012-06-06 11:57:36 +0800

avidD gravatar image avidD
166 2

Hi,
now I upgraded to zk 6.0.1 and get a new exception notifying about an empty stack during expression evaluation.

java.util.EmptyStackException
>>	at java.util.Stack.peek(Stack.java:85)
>>	at java.util.Stack.pop(Stack.java:67)
>>	at org.zkoss.bind.xel.zel.PathELResolver.getValue(PathELResolver.java:54)
>>	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.parser.AstEqual.getValue(AstEqual.java:38)
>>	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.impl.BinderImpl.loadComponent(BinderImpl.java:1849)
>>	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1849)
>>	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1849)
>>	at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:138)
>>	at com.tn_ag.tnp.tailor.gui.ScreenBindComposer.doAfterCompose(ScreenBindComposer.java:133)
>>	at org.zkoss.zk.ui.impl.MultiComposer.doAfterCompose(MultiComposer.java:117)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:529)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:824)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:741)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:701)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1024)
>>	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
>>	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
>>	at org.zkoss.zk.ui.Executions.createComponents(Executions.java:179)
>>	at com.tn_ag.tnp.tailor.gui.LayerComposer.doAfterCompose(LayerComposer.java:272)
>>	at com.tn_ag.tnp.tailor.gui.LayerComposer.doAfterCompose(LayerComposer.java:1)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:529)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:824)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:741)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:701)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643)
>>	at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1024)
>>	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
>>	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
>>	at org.zkoss.zk.ui.Executions.createComponents(Executions.java:179)
>>	at com.tn_ag.tnp.tailor.gui.CenterStage.putOnDesktop(CenterStage.java:199)
>>	at com.tn_ag.tnp.tailor.gui.explorers.ExplorerUtils.createLayers(ExplorerUtils.java:197)
>>	at com.tn_ag.tnp.tailor.gui.listener.SwitchExplorerListener.doSwitchExplorer(SwitchExplorerListener.java:133)
>>	at com.tn_ag.tnp.tailor.gui.listener.SwitchExplorerListener.onEvent(SwitchExplorerListener.java:169)
>>	at com.tn_ag.tnp.tailor.gui.listener.SwitchExplorerListener.onEvent(SwitchExplorerListener.java:1)
>>	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.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>>	at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)

In BindEvaluatorXImpl.getValue(..) line 42 the expression is

ValueExpression[${vm.focusTab eq 'mGeneralAttributes'}]

and comp._id is 'mGeneralAttributes'

I wonder whether anyone came across this issue during upgrade?

Cheers,
David

link publish delete flag offensive edit

answered 2012-06-06 12:33:32 +0800

avidD gravatar image avidD
166 2

I see, I forgot to update the zel-dependency to 2.2.2.

link publish delete flag offensive edit
Your reply
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: 2012-02-10 13:34:01 +0800

Seen: 378 times

Last updated: Jun 06 '12

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