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.

Numeric Field Display

Avatar

Level 4
I think I've run into a bug with Designer. Can anyone confirm this? Or have I overlooked something?



Situation:

I have 5 numeric fields* in my form that use simple FormCalc calculations. All of them have the Object Field Display Pattern set as $z,zz9.99.



All calculations work perfectly. However, when I was testing the form I discovered something quite odd. The display is perfect until the dollar amount exceeds $9,999.99. Once over this amount the format disappears leaving just the correct result (e.g. What should be $12,345.67 is displaying as 1234567.). I tried editing the display pattern to $zzz,zzz,zz9.99 but this did not work.



Is there a JavaScript that will give me the formatting and calculations I need? Or do I need switch something else on in Designer? Thanks.



* Calculations used:

1) sum(BlackInkCost, ColourInkCost)

2) sum(WhitePaperCost, ColourPaperCost, CardStockCost, TabCost, TransparencyCost)

3) sum(CerloxCost, SpiralCost)

4) sum(ImpressionsSubTotal, PaperSubTotal, BinderySubTotal)

5) (CostSubtotal * NoDocumentsReqd)
3 Replies

Avatar

Former Community Member
This would be the expected behaviour in the case of data entered into fields which do not match the pattern. This is not a bug, since you applied a pattern to display a certain number of characters and you entered something different, the pattern will fail and the form processor will leave the display as it is.



As for increasing the number of characters in the pattern, it should work. Make sure you dont have a conflict between the edit, display and binding patterns. If they are different, you may get unexpected results.



Also, if you do have a small pattern and can enter large numbers, then you should really apply some script to make sure your value is within legal limits. The rawValue of the field will always give you the pre-display pattern value.

Avatar

Level 4
Well is my face RED! I've been making the pattern change to the "Edit Pattern" value thinking it was there to update the standard formats offered in the "Display Pattern" value. I didn't realize you could change the "Display pattern" value itself! What a waste of time for something so simple. Can I chalk this one up to NEWBIE-NESS? <br /><br />Thanks for your response David. It prompted me to look harder at the field properties again. <br /><br />BTW: What does the "Edit Pattern" value do? Other than drive newbies crazy <g>?

Avatar

Former Community Member
:) No Problem.



The edit pattern allows the user to enter a value in a specific pattern and then once the field loses focus (i.e. moves to the next field) the display pattern kicks in. Display patterns could have text literals, etc. while allowing the user to just enter the value.