0

Issue with Constraint in Textbox

asked 2011-05-18 03:08:02 +0800

rajivbandi gravatar image rajivbandi flag of India
207

Hi Everyone,
This issue is a bit of legacy. But I cannot help upgrade the ZK version as the project is an old one.
ZK version : 3.0.3, 3.0.9, 3.6.4

Scenario :
When a Textbox has maxlength of 30 or more and has a constraint with regular expression,
an issue occurs after entering an input and moving out of textbox (on blur event).

If the input is acceptable according to the given constraint, then the page is fine.

But if the input is not acceptable ,
then after textbox looses focus , the page hangs with 'processing' icon hovering on the page. (CPU usage goes to nearly 100%!!!).

Please let me know if there is a solution to this or if it has been fixed in any of the versions released afterwards.

Tested this issue on all mentioned versions above.
But this works on ZK Demo for 5.0.7 online.
Not sure what's the difference.

The constraint given is all alphabets, space (both leading and trailing), single quote, hyphen as allowed in any order.

<?page id="pageTextboxConstraint" title="ZK Sandbox" contentType="text/html;charset=UTF-8"?>
<x:zk xmlns:x="http://www.zkoss.org/2005/zul"
    xmlns:zk="http://www.zkoss.org/2005/zk"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd "
    xmlns:h="http://www.w3.org/1999/xhtml">

    <x:window >
        <x:textbox id="txtbxTest" constraint="/([a-zA-Z'-]*[ ]*)*/:invalid input" />
    </x:window>
    
</x:zk>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-05-18 05:37:48 +0800

rajivbandi gravatar image rajivbandi flag of India
207

Sorry folks. This is not an issue with ZK.

The problem was the regular expression.
Some how having * inside * in the expression was causing an issue.
Also may be the characters ', - and space might also have been a problem.

New Regular Expression : ([a-zA-Z\\'\\-\\ ])*

This one works without problem.

Note: The javaw.exe process was going to 100% as mentioned in first post.

Hope it helps someone in future.

Sorry for the trouble.

Thank You
Rajiv Bandi

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-05-18 03:08:02 +0800

Seen: 334 times

Last updated: May 18 '11

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