<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content



Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color

Related Items

Home arrow Technical Articles arrow Oracle Application Framework arrow SPEL in OA Framework - With Audio Visual Demo
This website has now moved to http://apps2fusion.com

SPEL in OA Framework - With Audio Visual Demo | Print |  E-mail
Written by Anil Passi   
Monday, 30 April 2007
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


Comments (15)add
written by Suneetha , April 29, 2007
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..
written by Anil Passi , May 04, 2007
Hi Mayanak

Please create two different Form Functions for the SIT Form.
Then do personalization at Function Level.
Personalization on First Function will use SPEL ${oa.FunctionSecurity.FUNCTION_IT_NAME} for 5 segments
Personalization on Second Function will use SPEL ${oa.FunctionSecurity.FUNCTION_FINANCE_NAME} for other 5 segments

written by Mayank , May 04, 2007
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
written by Mayank , May 07, 2007
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!
written by Anil Passi , May 09, 2007
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 personalizations.

written by Anil Passi , June 06, 2007
Kindly have a look at below links where you will find the answer to your questions.

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



Anil Passi
written by Kaustuv Tarai , June 06, 2007
Hi, Anil,There are 2 wsdls and i need to know the details of how to call these 2 wsdls using Java Program.

written by SUNDAR , June 25, 2007
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.FunctionSecurity.
written by Anil Passi , June 25, 2007
Hi sundar

You can use function level personalization to achieve this result

written by SUNDAR , June 25, 2007
Hi anil,

Can you Explain detail?

written by SUNDAR , July 02, 2007
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

written by Anil Passi , July 05, 2007
Hi Sundar

Good to hear that

SPEL Function
written by Sukhjinder , October 12, 2007

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.

written by Anil Passi , October 12, 2007
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/rendered 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

How to make a field mandatory or non-mandatory
written by Sai Kumar , November 28, 2007
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,

You must be logged in to a comment. Please register if you do not have an account yet.