0

Masks .zul + .jsp

asked 2010-10-07 09:18:09 +0800

helena gravatar image helena
27

Hello,
I'm needing to wear masks in some fields.
I consulted the documentation Applying Masks with JQuery (http://docs.zkoss.org/wiki/Applying_Input_Masks_With_JQuery), which works fine if I access directly the zul file.
But the problem is that I include the zul file in a jsp page, and then the masks don't work more.
Nothing was changed, I include only the zul file in jsp page through an include.

What could I do to solve the problem? What could be causing the problem?

Best regards
Helena

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-10-11 21:30:30 +0800

iantsai gravatar image iantsai
2755 1

you can take a look at this article:


http://docs.zkoss.org/wiki/Client_Side_Programming

link publish delete flag offensive edit

answered 2010-10-13 07:07:03 +0800

helena gravatar image helena
27

Thanks for the help.

Now it worked. I added the javascript file in jsp page, but the call to the mask kept in zul, like this:

Masks.jsp

<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript" src="/inc/jquery.js"></script>
        <script type="text/javascript" src="/inc/jquery.maskedinput.js"></script>
        <script type="text/javascript" src="/inc/masks.js"></script>
    </head>
    <body>
        <jsp:include page="masks.zul"/>
    </body>
</html>

masks.zul

<?xml version="1.0" encoding="UTF-8"?>

<zk xmlns="http://www.zkoss.org/2005/zul">
    <window width="100%" title="Input Mask Example" border="normal">
        <attribute name="onCreate">
            String command = "applyPhoneMask('"+phoneNumber.getUuid()+"');applyZipCodeMask('"+zipCode.getUuid()+"')";
            Clients.evalJavaScript(command);
        </attribute>
        <vbox>
            <hbox>Phone Numer: <textbox id="phoneNumber" /></hbox>
            <hbox>ZIP Code: <textbox id="zipCode" /></hbox>
        </vbox>
    </window>
</zk>

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: 2010-10-07 09:18:09 +0800

Seen: 299 times

Last updated: Oct 13 '10

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