0

access javascript function from java

asked 2006-03-14 22:58:02 +0800

admin gravatar image admin
18691 1 10 127
ZK Team


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

By: nobody

I'm trying to retreive a cookie and then set a java value from data within the cookie. The only way I know how to access cookies is through javascript.

Is there a way to access a javascript method <h:script type="text/javascript"> function somefunction(){}</h:script> from within a java method inside a <zscript>?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2006-03-15 01:30:12 +0800

admin gravatar image admin
18691 1 10 127
ZK Team


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

By: tomyeh

h:script is a XHTML component, so you you could get its content. Notice that the content is a child of h:script, rather than a property. The child is an instance of com.potix.zhtml.Text.

Cookie is accessible at the server side:

1 EL: ${cookie.name}

2. Java:
Map cookie = Executions.getCurrent().getVariableResolver().resolve("cookie");

Map cookie = comp.getDesktop().getExecution().getVariableResolver().resolve("co
okie");

link publish delete flag offensive edit

answered 2017-08-25 06:55:55 +0800

t4tutorial gravatar image t4tutorial
1

h:script is a XHTML component, so you you could get its content. Notice that the content is a child of h:script, rather than a property. The child is an instance of com.potix.zhtml.Text.

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-03-14 22:58:02 +0800

Seen: 661 times

Last updated: Aug 25