Fusion Blog

EBS Blog


Contact Us

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
In this article, will learn how SPEL can be used in personalizations.

To begin with we will do some Q & A. This will be followed by some scenarios, and I will then end this training session with an Audio-Visual demo of SPEL.
IMPORTANT:- Please do not jump onto the SPEL Audio-Visual until you have read this article.

Why will I ever use SPEL in OA Framework?
Lets say you wish to hide a field Purchase order buyer using personalization. In order to hide that field, you can simply set the Rendered property of that field  to FALSE using personalization. However, what if your requirement is to hide or display this field conditionally? Lets say that you wish to display a Field Named Buyer if and only if the purchase order amount is greater than 4000. This can be achieved using Framework personalization and SPEL.

What is SPEL?
It is an expression that will either return TRUE or FALSE.
If Rendered property of a field in OA Framework is attached to SPEL, then
        Field will be displayed if SPEL equates to TRUE
        Field will not be displayed if SPEL equates to FALSE.

Properties that can be modified at run time using personalizations ( via spel) are :-
Rendered - To conditionally make a field in OA Framework hidden/displayed
Read Only - To conditionally make a enterable or non-enterable
Required - To make a field mandatory or non-mandatory
Enabled - To conditionally enable or disable that field

Any other properties that can be modified using SPEL?
At the moment OA Framework allows only those set of properties to be alterable via SPEL.

What is the syntax of SPEL?
I think it is better to give examples, rather than provide syntax.
Whatever the syntax is, it must always return a BOOLEAN.

For example:-

The above expression returns true if user is currently accessing OAF screen from function named IRC_VIS_HOME_SALES_JOBS

Above expression means that, if value of attribute named
IsPOGreaterThan4000 is FALSE then, the field will either be disabled or hidden or non-mandatory, depending upon which property this SPEL is attached to.

What if my requirement is to display a field named Buyer Name, if purchase order amount is greater than 4000? Can SPEL be used in this case?
Yes, if there already exists a view object attribute of type BOOLEAN. That view object attribute should have a value of TRUE if purchase order amount is greater than 4000, or else that attribute must have value FALSE.

What if i the VO in question does not already have one such attribute?
You have three options here:-
Option 1. Extend the View Object and add a transient attribute of type Boolean. In the View Object Row Implementation class, inside IsMoreThan4000 return TRUE or FALSE, depending upon the value of the PO Amount field
Option 2. Extend the controller, checking the value of the amount, via VO.
If the  amount is greater than 4000, then set the bean rendered property of buyer name field appropriately.
Option 3. Use java script. Oracle does not recommend this, but yet many implementations use this, primarily because web programmers are usually big fans of java scripting. You can either embed a java script by extending the controller or by simply using add new item using personalization, whereby the new item is of style RAWTEXT with javascript embedded within.

In this training lesson, we will use equivalent of Option 1


Anil Passi


0 #1 Suneetha 2007-04-29 00:00
Hi Anil, Thank you for the great article.. I have a requirement to make a Message Lov Input required only when the user chose a particular radio button in the radio group . Can i do this using SPEL.. Also can i use 2 SPEL routines like (based on the function security and depending on which radio button , user selects in the radio group). I will appreciate if you can throw an example..
Sune etha
0 #2 Anil Passi 2007-05-04 00:00
Hi Mayanak

Plea se create two different Form Functions for the SIT Form.
Then do personalization at Function Level.
Persona lization on First Function will use SPEL ${oa.FunctionSe curity.FUNCTION _IT_NAME} for 5 segments
Perso nalization on Second Function will use SPEL ${oa.FunctionSe curity.FUNCTION _FINANCE_NAME} for other 5 segments

T hanks,
0 #3 Mayank 2007-05-04 00:00
Comment: Hi Anil Again...a very good demo and explanation. Need your help in resolving a query. My requirement is : I create an SIT in HRMS and give access to that SIT to different employees in separate depts (IT & Finance)using SSHR. Now suppose that SIT has 10 segments, then an IT guy should be able to to fill in only the first 5 segements of that SIT, the rest 5 should appear to him but in a read only mode. Once the IT guy fills the SIT and submits, a workflow notification would go to the finance guy. The same SIT would be filled by the Finance guy as well, but now he will only be able to fill the last 5 segments and the first 5 sgements filled by the IT guy should only appear to him in a read only mode. Let me know if this is possible using SPEL in OA framework. Thanks again for your help! Regards, Mayank
0 #4 Mayank 2007-05-07 00:00
Hi Anil

Thanks a lot for your response. Sorry for asking a dumb question, but can this be done through front end ro will it needs to be handled by modifying the query as shown in your demo.

Thanks again for your help!
0 #5 Anil Passi 2007-05-09 00:00
Hi Mayank

No genuine question is a dumb question.

In answer to your query, for SPEL based on Function Security, you do not need to extend BC4J. This can achieve this purely using personalization s.

0 #6 Anil Passi 2007-06-06 00:00
Kindly have a look at below links where you will find the answer to your questions.

j Dev can generate the stubs based on WSDL URL.
You can do the same with Netbeans or with Eclipse too.



Anil Passi
0 #7 Kaustuv Tarai 2007-06-06 00:00
Hi, Anil,There are 2 wsdls and i need to know the details of how to call these 2 wsdls using Java Program.

Kau stuv.
0 #8 SUNDAR 2007-06-25 00:00
Hi anil,
We have a manager self service function which displays five segments from the assignment DFF. We would likle to make one of the segment as read only using SPEL. However when we enter the SPEL syntax as ${oa.FunctionSe curity.
0 #9 Anil Passi 2007-06-25 00:00
Hi sundar

You can use function level personalization to achieve this result

thank s
0 #10 SUNDAR 2007-06-25 00:00
Hi anil,

Can you Explain detail?

Rega rds
0 #11 SUNDAR 2007-07-02 00:00
Hi anil,
I had asked you how to make one segment as read only on 06/06/2007 at 12:23. I have solved that requirement by putting ($RO$) to that particular segment, using personalization . Now its working. Thanks for your assistance

R egards
0 #12 Anil Passi 2007-07-05 10:47
Hi Sundar

Good to hear that

A nil
0 #13 Sukhjinder 2007-10-12 06:56

Is there any way we can display one field conditional depends upon null or not null value of another field with in the same region of the page using SPEL. All fileds values are getting generated through a dyanmic view.

0 #14 Anil Passi 2007-10-12 08:17
Hi Jinder

For SPEL you need two things...
1. An event to fire a partial action
2. Boolean attributes in VO that can be mapped to say display/rendere d property.

If yours is a custom screen, then you can achieve this using SPEL
If this is a standard screen, then you will struggle, as it isn't possible to make an item fire partial action using personalization

Aninl Passi
0 #15 Sai Kumar 2007-11-28 08:20
Hi Anil,

I have a requirement in iExpenses to make a field mandatory based on the Context (Expense Type).

Can you please let me know how to achieve this requirement through personalization by using the SPEL?

Thanks in advance,
0 #16 Akhilesh Sundriyal 2008-04-03 10:44
Hi Anil,
This is Devanathan. Hope you are doing good.
I have some questions on this article.

Scena rio: Suppose Oracle apps Customer has a page with a table. one of the column in the table shld be enabled/disable d based on some condition. But customer shld do it declaratively and not programatically (shld not open jdeveloper). The condition might be like, if column A values starts with "xyz" , then column B shld be enabled/disable d.

In the above scenario, am trying to use SPEL binding. i think customer shld use ur 3rd option which i have writtern below.

Option 3. Use javascript. Oracle does not recommend this, but yet many implementations use this, primarily because web programmers are usually big fans of java scripting. You can either embed a javascript by extending the controller or by simply using add new item using personalization , whereby the new item is of style RAWTEXT with javascript embedded within.

I have created a new RAWTEXT item as one of the column item. But am not aware of how i shld use javascript in that. is the javascript here checks for column A (in the above scenario)??. Also how could i specify it in column B COZ as per oracle standards it shld use the formats ${oa.. or ${oa.FunctionSe curity. for SPEL.

Thanks in advance. waiting for your reply.
0 #17 Arun Sista 2008-04-03 16:02
Hi Devanathan,

It is perfectly understandable that Oracle does not recommend this method. Consider a scenario where a user hides a particular column that you are scrapping or even if he changes the order your logic would blow up.

What you should look to do instead is.. Make a one time effort to understand the VO for the underlying region. You could look up on about this page link at the bottom of the page by enabling FND Diagnostics profile option. Then go to the Business Component References Details and check out the view object and guess the column name. It should not be very tough to do this.

Once you have the VO and column name it is easy to write the SPEL as mentioned above.

Hope this helps.

0 #18 shashi 2008-09-18 00:56
hi Anil,
0 #19 shashi 2008-09-18 00:58
Hi Anil,

I have a requirement to make couple of segments in SiT (Special Information Types ) as REad Only. I have gone thru this thread. It says it can be done purely by personalization . Can you please guide me the steps. I have tried personalizing the Special Inforamtion Page but no luck. Please Help me out..

0 #20 JR 2009-03-10 17:12
I have a requirement to make the project field required based upon certain account segments, how can I achieve this? Any help is really appreciated.
Th anks
0 #21 surepalli 2010-01-11 02:10
Hi Anil,

I have a requirement like below.

We need to display new region in PO Requisition Notification page and this change only visible to PO notificationsa not other any notifications.

How Can I handle this scenarion?

Ple ase give me your suggestions.

R egards
0 #22 Rohit 2010-04-23 10:35
Please can you send me is you have any demo related to BI Discovrer plus how we can use all the feature of this tool
0 #23 arya 2010-12-08 02:24
Hi Anil,

I have created 5 DFF in Supplier and need to make 3 of the DFF as read only, just like Sundar's questions.
Can you explain detail to do this

0 #24 Madhu09 2012-05-03 09:13
Hi Anil,

I have developed a OAF page which contains PeriodName , EffectiveDate.
The PeriodName column is a Dropdown List.When I select the value from the Dropdownlist,th e effectivedate value must be automatically displayed.I have called plsql in the controller.The return value of the plsql procedure must be displayed in effectivedate column.Iam getting the output correctly,
But how to display the output value in effectivedate column?

Please help its urgent!!!

Than ks,
0 #25 manishs10 2012-05-22 05:13
We have a requirement in OAF to make pages readonly for specific users(Support users).

We have tried to resolve it through function security, but its behavior is just opposite what we want.

Its making a page by default read only and active for those responsibility to which function security is assigned.

need to find a way, it should be enabled by default, and should be read only for small no of users/responsib ility.

pardon me if i have put anything wrong in my query...i am very new in OAF...any suggestion on this is much appriciated.
0 #26 Vineela 2012-07-16 06:00
Hi Anil,

I am very new to OAF. I am trying to design a page where I need to get the customer name based on the customer id that I was selected in the previous text box. Pleaes help me out

V ineela
0 #27 Hi Anil, 2015-08-12 16:25
Hi Anil,

I have a requirement, where one of the DFF field in a page has to be rendered read only based on Condition.

Here My question is, is it possible to achieve through Personalization . As we dont have access to DFF field in Personalization of OAF page.

Add comment

Security code

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates

Powered by Google FeedBurner