0

How i can use EL Expressions with Attribute Element to assign an image to a caption????

asked 2011-11-04 15:10:52 +0800

smigol gravatar image smigol flag of Italy
316 2

updated 2011-11-04 15:12:38 +0800

Hi,
I want to dynamically assign the value of the Caption's image by using EL Expressions with Choose and When conditional evaluation but not work ... where I wrong? can anyone help me pls!


below, tests I did:



1° TEST NO WORK ... UnsupportedOperationException error:

Failed to assign <image > to <Caption nUFU90>
<zk switch> in native not allowed yet
[11-11-04 15:48:42.397] {http://*:80-12} >>java.lang.UnsupportedOperationException: <zk switch> in native not allowed yet






<?taglib uri="/WEB-INF/tld/commons.tld" prefix="C"?>
<window id="win_utente_detail" width="100%" height="100%"  border="normal" closable="true" apply="my.ComposerCtrl">
	<caption label="Hello">					
		<attribute name="image" trim="true">
			<zk choose="">
			    <zk when="${C:UU_isCliente(win_utente_detail$composer.argIdentity)}">    
			    	<zk choose="">
				    <zk when="${C:UU_isAbilitato(win_utente_detail$composer.argIdentity)}">~./image/icon/user_information.png</zk>
				    <zk>~./image/icon/user_lock.png</zk>
				</zk>	
			    </zk>
			    <zk>~./image/icon/user_headset.png</zk>
			</zk>
		</attribute>			
	</caption>
</window>



2° TEST (remove choose="") SEEMS TO WORK BUT THE IMAGE NOT APPEARS ... IMG SRC HAS STRANGE VALUE:

<img src="%0a%09%09%09%09%0a%09%09%09%09%20%20%20%20%20%20%20%20%0a%09%09%09%09%20%20%20%20%09%0a%09%09%09%09%09%20%20%20%20~./image/icon/user_information.png%0a%09%09%09%09%09%20%20%20%20~./image/icon/user_lock.png%0a%09%09%09%09%09%09%0a%09%09%09%09%20%20%20%20%0a%09%09%09%09%20%20%20%20~./image/icon/user_headset.png%0a%09%09%09%09%0a%09%09%09" align="absmiddle">






<?taglib uri="/WEB-INF/tld/commons.tld" prefix="C"?>
<window id="win_utente_detail" width="100%" height="100%"  border="normal" closable="true" apply="my.ComposerCtrl">
	<caption label="Hello">					
		<attribute name="image" trim="true">
			<zk>
			    <zk when="${C:UU_isCliente(win_utente_detail$composer.argIdentity)}">    
			    	<zk>
				    <zk when="${C:UU_isAbilitato(win_utente_detail$composer.argIdentity)}">~./image/icon/user_information.png</zk>
				    <zk>~./image/icon/user_lock.png</zk>
				</zk>	
			    </zk>
			    <zk>~./image/icon/user_headset.png</zk>
			</zk>
		</attribute>			
	</caption>
</window>



3° TEST NO WORK NOTHING IMAGE APPEARS:

<?taglib uri="/WEB-INF/tld/commons.tld" prefix="C"?>
<window id="win_utente_detail" width="100%" height="100%"  border="normal" closable="true" apply="my.ComposerCtrl">
	<caption label="Hello">					
		<attribute name="image">
			<zk>
			    <zk when="${C:UU_isCliente(win_utente_detail$composer.argIdentity)}">    
			    	<zk>
				    <zk when="${C:UU_isAbilitato(win_utente_detail$composer.argIdentity)}">
				    	<attribute name="image" trim="true">~./image/icon/user_information.png</attribute>	
				    </zk>
				    <zk>
				    	<attribute name="image" trim="true">~./image/icon/user_lock.png</attribute>
				    </zk>
				</zk>	
			    </zk>
			    <zk>
			    	<attribute name="image" trim="true">~./image/icon/user_headset.png</attribute>				    	
			    </zk>
			</zk>
		</attribute>			
	</caption>
</window>



BEST REGARDS


OR@AZIO

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2011-11-08 01:04:08 +0800

samchuang gravatar image samchuang
4084 4

hi

EL is static, if you need to dynamically set, use databinding

refer to Data binding

link publish delete flag offensive edit

answered 2011-11-08 20:08:10 +0800

smigol gravatar image smigol flag of Italy
316 2

updated 2011-11-08 20:10:41 +0800

hi @samchuang, thanks for your answer

maybe I've misspelled ... I would like to understand how to assign a value to the caption' s image using EL Expressions:
- Conditional Evaluation Choose and When (see)
- Special Element Attribute (see)

this is possible? how? in the examples that I posted above, where I wrong?

Best Regards

OR@ZIO

link publish delete flag offensive edit

answered 2011-11-09 10:23:01 +0800

samchuang gravatar image samchuang
4084 4

Hi

you can try to use ZK 6's Bind to to this, refer to here

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: 2011-11-04 15:10:52 +0800

Seen: 297 times

Last updated: Nov 09 '11

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