Search Results


Wednesday, November 26, 2008

Hide a mandatory field

How to hide a mandatory field in OAF Page


If the business wants to hide a field in the seeded page, you can do it by personalizing the page and set Rendered property to false.
But this solution will not help you if the field is marked as mandatory by the seeded page.

The reasons are Mandatory Validations are usually done at the EO level. Hence even if you hide the mandatory field, the validation would still happen at the server. If the column has not null constraint in the table, it will throw a database error.


Can I extend the VO or EO and remove the mandatory property?
No, you cannot change the mandatory property through extension.


How to fix this?
You can fix this by setting a default value for the mandatory field.


Should I extend the VO/EO and set the default value?
Do not extend the VO/EO for the defaulting logic. Because extensions are applied at the site level and the Oracle seeded pages share the same VO/EO all over the Applications.


Where to default the value?

Extend the controller and set the value in the processRequest(){} method. This is the safest way to default the value to the mandatory field.

After defaulting the mandatory variable, personalize the page and set the rendered property to false.



Article By:
Prasanna Jayaraman

Please post your Ideas and Comments

4 comments :

Gravity said...

Hi Prasanna,
I have 2 links on my custom page and I have to display region 1 on click of link1 and display region2 on click of link 2. I tried following lot of threads on OTN. but couldnt reach a solution.
I have posted a thread on OTN.
Please give me some solution:
http://forums.oracle.com/forums/thread.jspa?threadID=878824&tstart=0
Thanks

Narayana said...

Hi Prasanna,

I need add field in global header and data display from database tables.how to slove the issue...


Thanks,
Narayana

mahakk01 said...

This post is very informative. This post explains how to hide a mandatory field. I find the method very easy. I tried this method and it works absolutely well. You can also implement it. Thanks for your post. Keep it up. You are doing excellent work.
sap ecc 7.0

Manish Chawla said...

Hi Prasanna,

This post is very beneficial to me. But I have a doubt. If any mandatory field doesn't have rendered property after personalize the page. In iExpense Page the Expense Cost Center Field doesn't have rendered property. Then Plz suggest me what should do..

Thanks
M.C;