0

How to avoid "Too many characters are entered. At most 9 charcter are allowed" pop up when creating custom component of decimalbox

asked 2017-12-04 17:06:19 +0800

mangaldaslima gravatar image mangaldaslima
1 1

<currencybox visible="@load(eventIncomeData.folderEventIncomeRecord.folderRSN eq null)" maxlength="9" id="${vm.concat(eventIncomeData.nameTypeAndNumber)}_Prizes_component" style="text-align:left; float:left;" format="@load(vm.decimalFormat)" value="@bind(eventIncomeData.folderEventIncomeRecord.prizes)" onchange="@command('onChangePrizes', folderEventIncomeData = eventIncomeData)" tooltiptext="${vm.getText('FolderEventIncomeDetail:LABEL_PRIZES')}" placeholder="${vm.getText('FolderEventIncomeDetail:LABEL_PRIZES')}"/>

in the decimalFormat, i have Rs###,###,###,##0.0 this value, after entering 9 char and tabbing out. it's throwring above mentioned pop up in red. color.

Can anyone suggest, why it is happening so. in my case. I have checked in zk fiddle, it's working fine with version 7.0.8, only issue persisting with the custom components.

delete flag offensive retag edit

Comments

simplified to <decimalbox maxlength="9" format="Rs###,###,###,##0.0" onChange="" />

http://zkfiddle.org/sample/gvsdq0/1-decimal-box-limit

cor3000 ( 2017-12-05 09:58:43 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-05 11:48:46 +0800

cor3000 gravatar image cor3000
3494 1 7
ZK Team

I added a simplified version showing the same message when the formatted number exceeds the number of characters specified by the maxlength property. This property determines the maximum number of allowed characters inside the input element (including formatting characters which would be 15 in your case).

Alternatively you could implement a custom constraint, that limits the maximum value instead of the the number of characters to be independent of the formatting.

it's working fine with version 7.0.8 Can you be more specific on that? For me version 7.0.8 (8.5.0 too) shows the same default expected behavior, I don't see a difference in 7.0.8.


Another option would be to use a mask plugin as shown in our demo about form effects.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2017-12-04 17:06:19 +0800

Seen: 8 times

Last updated: Dec 05