4

Write three conditions in one zk if statement.

asked 2013-07-08 08:25:12 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

updated 2013-07-08 08:33:31 +0800

Hello Everyone,

In the below zul, i have written three zk if statements for checking the required value should not be blank, Case and Folder.

<zk> 
<window apply="org.zkoss.bind.BindComposer"
        viewModel="@id('vm') @init('com.test.TestViewModel')">

    <listbox emptyMessage="No Rows Found"
        model="@bind(vm.testModel)" width="100%">
        <template name="model">
            <listitem>
                <zk if="${each != ' '}">
                    <zk if="${each != 'Case'}">
                        <zk if="${each != 'Folder'}">
                            <label value="${each}" />
                        </zk>
                    </zk>
                </zk>
            </listitem>
        </template>
    </listbox>
</window>
</zk>

Is it possible that i can include these three conditions in one zk if statement instead of three zk if.

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2013-08-30 11:17:31 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...
<listcell if="${myBean.noFlag !='true' and  myBean.noFlag !='false'}" visible="true">
<label value=" " />
</listcell>
link publish delete flag offensive edit
2

answered 2013-07-08 10:59:33 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

Thanks for your reply but.

I tried with

if="${each != ' ' } && ${each != 'Case'} && ${each != 'Folder'}">

and

if="${each != ' ' } && each != 'Case' && each != 'Folder'}">

But org.xml.sax.SAXParseException is coming with 'The entity name must immediately follow the '&' in the entity reference.' message.

link publish delete flag offensive edit
2

answered 2013-07-09 06:27:07 +0800

nsharma gravatar image nsharma flag of India
917 1 11

updated 2013-07-09 07:47:36 +0800

OOhk...I think the symbolic form doesn't work...

try using "and","or" instead of "&&" and "||" symbols.

if="${each != ' ' } and each != 'Case' and each != 'Folder'}"&gt;
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
1 follower

RSS

Stats

Asked: 2013-07-08 08:25:12 +0800

Seen: 226 times

Last updated: Aug 30 '13

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