0

SpingMVC + zk jsp tags

asked 2009-04-23 22:59:44 +0800

hlopezvg gravatar image hlopezvg
21

Greetings to everyone on the zk forum

We have a large enterprise site allready made using spring mvc and spring security, we have some jsp pages that are using the submit form, with the action pointed to the j_securty_check, We would like to use zk jsp tags, but we haven't yet accomplish that. For example
<form method="post" action="./j_spring_security_check" name="loginForm" id="loginForm">
....
...
<input name="enter" type="submit" id="entrar" value="<fmt:message key="BUTTON.ENTER"/>" />
We now that ZK is based on events, but how we can just use the zk jsp tags to submit form? is that valid on zk jsp tags idea? We have allready create the validations for all the forms, and the permisology too, Do we have to recreate all the jsp pages into a zul pages? We have been investigating on the forums, but we didn't find a solution for zk jsp, the major info is using a zul pages, but we are trying to avoid that, since we have all developed with spring mvc, and It will represent an extra effort. We were also thinking on create a z:button that calls a javascript function that will call the document.action = j_security_check and the document.submit();
<z:button label="ENTRAR">
<z:attribute name="onClick">
js that calls the javascript method for the submit
</z:attribute>
</z:button>

Is this js script able to call a html object, like said, the loginForm?

Thanks

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2009-04-24 09:27:34 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

yes, in ZK,
you can call anything on the html page.

link publish delete flag offensive edit

answered 2009-04-24 17:04:51 +0800

hlopezvg gravatar image hlopezvg
21

Hi Ryan
Thanks for your reply. Do you have an example of that, please?

link publish delete flag offensive edit

answered 2009-04-24 20:28:31 +0800

deved gravatar image deved
114 1

Hi,
>> Is this js script able to call a html object, like said, the loginForm?
No, all the zk code is executed on the server side.

You can use the action property of the zk components, for example

<button action='onclick:subitFormJavascriptFunction()' />

Now, if you are on the server side take a look at the org.zkoss.zk.ui.util.Clients class.

Regards,

edgar

link publish delete flag offensive edit

answered 2009-04-25 15:39:29 +0800

jtoupin gravatar image jtoupin
156

You can use ZK's HTML components.

See http://www.zkoss.org/smalltalks/zkspringsec1/ and search for login.zul for an example.

link publish delete flag offensive edit

answered 2009-04-26 00:47:00 +0800

hlopezvg gravatar image hlopezvg
21

Hi Edgar

Thanks for your reply, I got this solution using Clients class

<z:button id="boton" label="ENTRAR">
<z:attribute name="onClick">
Clients.submitForm("loginForm");
</z:attribute>
</z:button>

Now I can submit a form.

Hi jtopin, thanks for your reply either, I will take a look of ZK's html. I will post a comment as soon as I read more about it.

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: 2009-04-23 22:59:44 +0800

Seen: 546 times

Last updated: Apr 26 '09

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