How to display non numerical value for a Decimal type propety on the screen?
In our application, there is a decimal type property named "Risk ratio" which usually has a numerical value that is calculated by a declare expression rule. However, "Risk ratio" is not always possible to calculate, and our customer wanted to display a string value "N/A" on the screen for the field in such circumstances. Unfortunately, it seems the "Place holder" option of the pxNumber control does not work for a read-only field on the screen.
Defining a new property which is type of Text may solve the problem, however we have to re-implement those formatting features which already provided by the pxNumber control.
Any ideas or suggestions for solving this problem is welcomed.
The PRPC version we are using is 7.1.7.
***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
@Pankaj - sounds like a plan to me - @Chunzhi Hong - perhaps use a 'When' rule to figure whether to display the numeric value or the 'N/A' string : rather than trying to hold an 'N/A' string in a numeric property itself ?
Since they are using 7.1.7, I would recommend doing this in a single dynamic layout rather than separate sections. This will result in better performance rendering the UI. You can create two elements in the layout:
1) To display numeric value when present: drop in a field for your property and set label to "Risk ratio"
2) To display N/A when needed: drop in a Formatted text with a label of "Risk ratio" and select value to be "Constant" with "N/A".
Put a When on these 2 different elements to hide/show when appropriate.
I followed your approach, but encountered below issue.
At the design time there was "Can not render section" error message like below in the cell where the property is bound, and an error message "String value of a cell:LPCRORA does not exist for use by this record (Validate)." was displayed when I was trying to save the section rule.
I think this is a bug of the designer studio, because the included section is defined under the Data class which represent the row item of the repeating grid.
It seems that designer studio is trying to find the included section under the work class not from the data class.
BTW, the actual property name is LPCRORA which means Risk Ratio.
------ P/S --------
The cause of the error message "String value of a cell:LPCRORA does not exist for use by this record (Validate)." has been found, it was my fault.
I saved the section which is being included, in the wrong rule set version.
"Can not render section" error still exists at the design time, though we can save the parent section successfully and the repeating grid displays expected "N/A" value on the screen at the runtime.
However it seems the alignment of the text is rendered incorrectly. It seems the cell inline-Style does not work.