-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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 ;)
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3717152
By: tomyeh
Use unless="${!empty user}"
or
unless="${user != null}"
Asked: 2006-05-06 15:32:48 +0800
Seen: 260 times
Last updated: May 06 '06