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:-
${oa.FunctionSecurity.IRC_VIS_HOME_SALES_JOBS}
The above expression returns true if user is currently accessing OAF screen from function named IRC_VIS_HOME_SALES_JOBS
${oa.ViewObjectName.IsPOGreaterThan4000}
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
CLICK HERE FOR THE AUDIO VISUAL DEMO OF SPEL IN OA FRAMEWORK
Comments
Thanks,
Sune etha
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,
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!
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.
Thanks,
Anil
j Dev can generate the stubs based on WSDL URL.
You can do the same with Netbeans or with Eclipse too.
http://www.google.com/search?q=site:apps2fusion.com+integrate-oa-framework-with-web-service
http://www.google.com/search?q=site:apps2fusion.com+oa-framework-with-captcha-webservice
Thanks
Anil Passi
Kau stuv.
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.
You can use function level personalization to achieve this result
thank s
anil
Can you Explain detail?
Rega rds
Sundar
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
Sundar
Good to hear that
Regards
A nil
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.
Regards
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
Thanks
Aninl Passi
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,
Sai
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.
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.
Arun.
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..
Thanks,
Shashi
Th anks
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
Subbu
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
Thanks
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,
Madhu
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.
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
Thanks,
V ineela
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.
Could you please suggest on this.
RSS feed for comments to this post