Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

PATTERN is driving me crazy, pls. suggest me good syntax

Avatar

Level 8

Hello

Bcz of i placed PATTERN under DISPLAY tab, am getting errosrs like "Integer has too many digits", "Empty is too long"...I am guessing these are all bcz of some SPACES on these value fields, but not sure from where these spaces are coming? may be user entered some value and just moved the cursor/space bar right hand side, not sure, how to truncate space in BINDING tab's pattern?

I have 12 value fields in my form, they are for quantities, volumes, price, amounts. I put them as Decimal fields and each field has its own length, as mentioned below

1) Volume field - Decimal field - Limit leading digits as 15 and Limit trailing digits as 3

I put the Pattern only on Display tab as below (I didn't put any pattern any other tab, like Binding, Edit, Valiodation tabs)

By selecting the num.integer on SELECT TYPE left side, I put as below

(Checked Allow Empty, Allow Zeros check boxes)

1 .jpg

By selecting the num.decimal on SELECT TYPE left side, I put as below

(Checked Allow Empty, Allow Zeros check boxes)

2.jpg

2) Price field - Decimal field - Limit leading digits as 14 and Limit trailing digits as 4

3.jpg

4.jpg

3) Subsidy in % field - Decimal field - Limit leading digits as 2 and Limit trailing digits as 2

5.jpg

6.jpg

Thank you

5 Replies

Avatar

Level 10

Hi,

don't make things too complicated.

The more patterns you combine the more the result might not be the one you want.

The decimal pattern is described here.

http://partners.adobe.com/public/developer/en/xml/xfa_spec_3_3.pdf#page=1156

For your decimal field with 15 leading digits you can use this display pattern combination.

null{'Enter a Number'}|num{zzz,zzz,zzz,zzz,zz9.999}

Together with this edit patterns.

null{}|num{zzz,zzz,zzz,zzz,zz9.888}

Avatar

Level 8

Thank you.

Pls. let me know

1) My understading from your answer is, i need NOT to put any PATTERN in BINDING tab? am i correct?

2) Sure, i will put the suggested below syntax, but pls. let me know do i need to select any entry from the left side box (as shown in the black box in below screen shot?) and then i put the suggested below syntax/patern? or i don't need to select any entry from the left box as shwon in below screen shot as black box?

6.jpg

3) For example, if i select num.deciaml {} option.....then the blue high lighted part is coming as trail part to the syntax? is it OK, let it come?

4) So, i guess, for 2 leading and 2 training length, i need to put below pattern, am i correct?

Edit pattern would be for 2,2 is as below, am i correct?

5) Do i need to check the ALLOW EMPTY and ALLOW ZERO check boxes? or not?

6) By chance, if user put spaces, then I want to truncate spaces / delete the spaces in the middle of data or anywhere in the data/field, so can i use as below? if not, pls. suggest me for get rid off spaces from anywhere in the field, bcz i am guessing these crap spaces is causing an issues for me

Thank you