0

A ZK Constraint Bug

asked 2009-05-05 06:42:43 +0800

achuanok gravatar image achuanok
39

updated 2009-05-06 05:55:04 +0800

一个关于正则表达式的bug,请教大家这个是不是一个zk bug。
<zk>
<window id="win_test" >
<textbox id="txt_test" constraint="/[a-z\\]*/"></textbox>
</window>
</zk>
I am using zk 3.6.1

first: at textbox input a char '-', the constraint pass, continue input a char 'a', appear the information "Illegal value".
this is a zk bug? Excuse me! My english is poor.

thanks hideokidd, my mistake, the the Constraint is constraint="/[a-z\\]*/", is not constraint="/*/"

第一次在这个页面输入字符 - ,即一个小横线。正则表达式无效,通过了校验。如果再输入 a ,则出现格式不正确的提示信息。
这是不是zk的一个bug。

delete flag offensive retag edit

10 Replies

Sort by » oldest newest

answered 2009-05-05 07:46:55 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-05-05 07:47:35 +0800

Hi,

The contraint will cause an exception at runtime,
the error appears when page creation.
I am using ZK 3.6.1.

java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*
^
at java.util.regex.Pattern.error(Pattern.java:1713)
	at java.util.regex.Pattern.sequence(Pattern.java:1878)
	at java.util.regex.Pattern.expr(Pattern.java:1752)
	at java.util.regex.Pattern.compile(Pattern.java:1460)
	at java.util.regex.Pattern.<init>(Pattern.java:1133)
	at java.util.regex.Pattern.compile(Pattern.java:823)
        at org.zkoss.zul.SimpleConstraint.<init>(SimpleConstraint.java:168)
	at org.zkoss.zul.SimpleConstraint.getInstance(SimpleConstraint.java:180)
	at org.zkoss.zul.impl.InputElement.setConstraint(InputElement.java:425)
        ...............

The error message is too long to show all, I just post first several lines.

link publish delete flag offensive edit

answered 2009-05-05 18:33:06 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

I've a problem with constraints and longbox. When a longbox have any constraints it acts like a intbox. Anyone else saw this?

I've created an issue to this: ID: 2786584

Regards,
Felipe Cypriano

link publish delete flag offensive edit

answered 2009-05-06 01:50:27 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-05-06 03:34:05 +0800

Hi fmcypriano,

I've tried your case and the values both didn't be converted,
I use zk 3.6.1, and your zk edition is?

My steps:

1.Create two longboxes

2.Fill the first one with value 12.3 and press Tab key.

3.Fill the second one with value 65.4 and press Tab key.

link publish delete flag offensive edit

answered 2009-05-06 03:27:55 +0800

achuanok gravatar image achuanok
39

thanks hideokidd, my mistake, the the Constraint is constraint="/[a-z\\]*/", is not constraint="/*/"

link publish delete flag offensive edit

answered 2009-05-06 03:54:08 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-05-06 03:54:42 +0800

Hi achuanok,

Below is my test result, any bugs?

-------------------------------------------------
input.............Constraint warning appear?
-------------------------------------------------
-.............Yes
a.............No
-a.............Yes
-------------------------------------------------

link publish delete flag offensive edit

answered 2009-05-06 05:34:14 +0800

achuanok gravatar image achuanok
39

updated 2009-05-06 05:35:49 +0800

Hi hideokidd,
-------------------------------------------------
input.............Constraint warning appear?
-------------------------------------------------
-...............No
a...............No
-a.............Yes
-...............Yes
please step by this.
-------------------------------------------------

link publish delete flag offensive edit

answered 2009-05-06 08:03:15 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

I got the same result,
I think it's a bug of textbox,
please post it to zk bugs,
thanks!
http://sourceforge.net/tracker/?group_id=152762&atid=785191

link publish delete flag offensive edit

answered 2009-05-06 11:45:35 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

Hi hideokidd,

Did you set the constraint for one of the longboxes?

My code is:

<longbox />
<longbox constraint="no negative"/>

I'm using 3.6.0, maybe it's only in this version.

Regards,
Felipe Cypriano

link publish delete flag offensive edit

answered 2009-05-06 15:04:04 +0800

achuanok gravatar image achuanok
39

Hi fmcypriano,
I am using 3.5.1 and 3.6.1 test, no problem.
<longbox /> is support Java base type long, is not double.

link publish delete flag offensive edit

answered 2009-05-06 15:13:05 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

I can't believe I'm confusing long and double!

I'm so sorry, I've deleted the issue in ZK's tracker.

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-05-05 06:42:43 +0800

Seen: 556 times

Last updated: May 06 '09

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