0

if and EL ? some kinda weird

asked 2006-05-06 15:32:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3716872

By: nobody

Hello all,

if have a weird problem concerning the if/EL expression syntax.

I have a index.zul which lookes like
<?xml version="1.0" encoding="UTF-8"?>
<window title="MyWindow" width="100%" id="main">
<caption>
<toolbarbutton label="login" unless="${$user}">
</toolbarbutton>
</caption>
unnless="${user}"/>
</window>

$user is a session scope value which is a backend class implementation. Everything works fine so far.

If i add an include statement so that index.zul looks like

<?xml version="1.0" encoding="UTF-8"?>
<window title="MyWindow" width="100%" id="main">
<caption>
<toolbarbutton label="login" unless="${$user}">
</toolbarbutton>
</caption>
<-- THIS IS THE NEW IMPORT -->
<include src="/login.zul" unless="${user}"/> </window>

I get an exception:

com.potix.zk.ui.UiException: javax.servlet.jsp.el.ELException: Attempt to coerce a value of type "org.syracus.colab.realm.User" to Boolean

Is there something wrong or does the if attribute behave differently in different components ?

greets Sebastian

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2006-05-06 15:34:39 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3716876

By: nobody

Sorry the typo in the first xml example 'unnless="${user}"' was a copy&paste error. That should not make the problem ;)

link publish delete flag offensive edit

answered 2006-05-06 22:24:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3717152

By: tomyeh

Use unless="${!empty user}"
or
unless="${user != null}"

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: 2006-05-06 15:32:48 +0800

Seen: 260 times

Last updated: May 06 '06

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