Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Number Field + Format Mask when Read Only set ( inconsistent behaviour in javascript)

user5979508Jan 27 2025 — edited Jan 27 2025

When a Number Field has a true Read Only attribute. Then the number field becomes a text field and the format mask no longer applies. ( within javascript )

A format mask for example of FML999G999G999G999G990D00 would normally render 1234 as '£1,234.00'

and any of the following javascript

apex.items.P250_TOTAL.setValue(1234), $s(P250_TOTAL,1234), $("#P250_TOTAL").val('1234').change()

would normally produce a value of '£1,234.00' within the P250_TOTAL field.

Yet soon as the Read Only attribute is true then the P250_TOTAL value becomes 1234 when programmatically set via javascript.

And the getNativeValue (https://docs.oracle.com/en/database/oracle/apex/22.2/aexjs/numberFieldItem.html#getNativeValue)

becomes unavailable.

This lack of consistency of the number field between being made readonly and not appears to be a bug.

Is there a way to make a number field behave like a numer field when it is read only?

[ I am seeing this behaviour in 23.1.2 ]

NOTE

apex.items.P250_TOTAL.item_type returns NUMBER when not Read Only

and DISPLAY_SAVES_STATE when Read Only

Comments
Post Details
Added on Jan 27 2025
2 comments
231 views