Monday, July 2, 2007

JavaScript In OA Framework

“To be or not to be…… is the question…..!” The famous soliloquy by William Shakespeare in Hamlet…. a similar scenario we have in OA Framework for JavaScript!
The exact lines of Developers’ guide for use JavaScript are as follows:
“UIX and the OA Framework are rapidly adding new features to provide a more interactive user experience
(partial page rendering, automatic table totaling, and so on). You are certainly encouraged to leverage these
features as they are released, however, you should not attempt to implement them yourself before they're
ready.
In short, JavaScript is prohibited without explicit permission from the OA Framework team. Furthermore, you
must have confirmation from the corporate UI design team that a Javascript implementation is essential for
your product.”


But this is really funny, if you are developing some web pages for your application, so expect all web features in the framework, and if they are missing definitely you have to use JavaScript to implement them, you cannot wait , for the framework team to implement them.

So, if you are developing some custom pages for your application, you can go ahead with JavaScript. I will advice to refrain from JavaScript if your extending standard OA pages, because, Oracle may not support it, in that case.
In case of custom pages, anyways oracle will not support customization, so you dam care for support.

Another interesting thing in OA Framework is that you will methods for JavaScript usage method in almost every UIX beans; in fact, framework team must be using them in development of various features in OA Framework.

What is JavaScript?

JavaScript is the Netscape-developed object scripting language used in millions of web pages and server applications worldwide. Netscape's JavaScript is a superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language, with only mild differences from the published standard.

Contrary to popular misconception, JavaScript is not "Interpretive Java". In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction.

For those who are interested and new to concept of javascript, should explore this link
http://www.javascriptmall.com/learn/

I will like to stress on one point before starting the various scenarios where JavaScript can be used, is that JavaScript is a browser specific script and may behave different in different browsers, so you must test your application code on various browsers like internet explorer, mozilla firefox, Netscape etc.

Scenarios in OA Framework, where you are bound to use javascript.
Various Pop Up Window scenarios
Closing a Window
Timely refresh of a OA Page
Client side events on different beans


Various Pop Up Window scenarios:
This is the most common scenario in OA Framework, as framework does not provide anything for pop windows, except standard LOVs, which may or may not suit your requirement.I think I have replied this thread several times on OA Framework forum, in fact, thought of writing this article, after I replied the thread so many times J.
Lets, take the most common scenario:
You need to fire a custom page as a pop up window , do some processing(say add some new values in one of the VO) and on returning back to base page, reflect the changes on base page(say the base page VO should reflect the changes done on pop up page).
Follow these steps for the solution:
1. To open a custom page..... as a modal window.... u can have a link or button(button of type button and not submit button) on base page with destination url property as following javascript:

javascript:var a = window.open('OA.jsp?page=/XXX/oracle/apps/xxx/......&retainAM=Y', 'a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no'); a.focus();

Meaning of each parameter in this javascript:
· RetainAM:If this is equal to “Y”, AM will be retained when child window is opened.
· Height: Height of the pop up or child window.
· Width: Width of pop up or child window
· Status: String, Specifies a priority or transient message in the window's status bar (This property is not readable.).
· Toolbar: Object, Represents the browser window's tool bar.
· Menubar: Object, Represents the browser window's
menu bar.
· Location:Location of window on the sceen
· Resizable: if resizable=yes, is included in above api, then child window size can be maximized.By default the child window size is fixed user cannot, increase or decrease the size.
· Scrollbar: if scrollbar=yes, is included in above api, scrollbars will appear in the child window.

Please Note : While trying to run a pop up page you get errors like:
"You are trying to access a page which is no longer active....."

The root cause of this error are the profile options:
1) FND_VALIDATION_LEVEL - None
2) FND_FUNCTION_VALIDATION_LEVEL - None
3)Framework Validation Level- None
They should be none in order to avoid the error.The root cause of the error is MAC key url validation, which is governed by the above 3 profiles.There can be scenarios when your DBA/Admin would not allow you to set these profiles at site level in order to maintain security of Apps from cross site scripting attacks.


In such scenarios, or I will say in all scenarios, its better to use a utility class in OAF called OABoundValueEmbedURL which secures your js function by bypassing the MAC key validation.You can use following code to attach js url programatically to a button/image bean :
OAImageBean img = (OAImageBean) webBean.findChildRecursive("");
//url of the page
String url ="/XXX/oracle/apps/xxx/......"
//retain am parameter
string amMode ="true";
//additional parameters i want to pass to to pop up page
String params="order_id={@workorder_id}";

//Computing page_url
String page =
url + "&retainAM=" + amMode + "&fndOAJSPinEmbeddedMode=y" + "&" +
params;
//Computing final url
String destURL =
OAWebBeanConstants.APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP +
"?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + page;

//Securing js function from MAC key validation
OABoundValueEmbedURL jsBound =
new OABoundValueEmbedURL(img, "openWindow(self, '", destURL,
"' , 'longTipWin', {width:" + width +
", height:" + height +
"}, true); return false;");

//Attaching bound value embed url to on click of image.
img.setAttributeValue(OAWebBeanConstants.ON_CLICK_ATTR, jsBound);

There are 3 important points to understand here :
1) This code has to be written in process request and not process form request, because as per OA Developer standards bean properties can only be set in process request and not process form request.

2)The additional parameters you want to pass can be passed at runtime, this is especially in case of tables/hgrids where lets say a particular column has link and each row has different parameter values to pass, you can send VO attributes as parameters like @Vo_attr_name.This will make your pop window link to be dynamic as each row js url will have different parameter values depending upron row of VO.

3)If you see the final url computed here I have used an additional parameter like
fndOAJSPinEmbeddedMode=y, this is especially in case of pages which use jtfchrome.jsp where in the JTF/JTT and OAF flows are integrated.This parameter will take care that the JS URL OF LOV page, should not be changed to jtfcrmchrome.jsp from OA.jsp which results in error of lov page.


In one of the 2 approaches you would be able to open the pop up page.

2. Now, you can do your pop up page processing by the pop page controller.
3. Now your child window should have two buttons, one for select(submit button) and another for close(button).On press of select button you will have all vaues in your trasient VO, and you can also show user a message like, " values created successfully....".The second button will be of type "button", whose destination url property will be

javascript:opener.submitForm('DefaultFormName',0,{XXX:' abc'});window.close();
(In this api you can pass n number of attributes, the second parameter will be correspondingly n-1, e.g you have to pass three attr, then second parameter of api will be 2
javascript:opener.submitForm('DefaultFormName',2,{'XXX':' abc','XXX1':'efg','XXX2':'ijk'});window.close(); )
Now in the process request of the base page CO, u can get parametre 'XXX' from the pagecontext....so
if((("abc").equals(pageContext.getParameter("XXX"))))
{///LOGIC to initialize or not to intialize some components of base page}

Please Note :
1)From Apps R12.1, the framework is also validating parameter security, so getting js parameter values by pageContext.getParameter("XXX"), can throw security exception error
FND_FORM_POST_SECURITY_FAILED. To bypass this parameter security validation , you need to take js parameter values directly from http request using following code:
pageContext.getRenderingContext().getServletRequest().getParameter("XXX");

2)Also, if you are getting error in doing a page submit on pop up page confirm:
FND: Framework Compatibility Mode profile option should have value greater than or equal to "11.5.10".


Closing a Window
To open a custom page..... as a modal window.... u can have a link or button(button of type button and not submit button) on base page with destination url property as following javascript:window.close();

Timely refresh of a OA Page
Lets, consider a scenario when you want a page refresh after every 10 seconds.Here is javascript for it:javascript:setTimeout(window.location.reload(),10000);where 10,000-->10 sec(10,000 milli sec)

What you need to do is attach with onLoad method of OABody bean, so that when the page is rendered, this javascript is triggered.You can code like this:

OABodyBean bodyBean = (OABodyBean) oapagecontext.getRootWebBean();

String javaS = “javascript:setTimeout('window.location.reload()',10000)”;
bodyBean.setOnLoad(javaS);

Client side events on different beans:
Above I have given a few of million possible situations of javascript in OA Framework.In almost all ui beans u will find methods like setOnLoad *, setOnClick* etc., where you can attach a javascript function to the bean.
Will be back with more examples of javascript in OA Framework, soon!

157 comments:

binghao said...

Hi Mukul,

I have a base page, there is a text input and image like LOV.
I open a popup window after I click on the image.then do some search.then I want to close the popup window and change the text input value on base page.but I want to it behaves like LOV ,It do not refresh the whole base page,but change the text input value only.
Is it possible?

I make a button with "javascript:opener.submitForm('DefaultFormName',1,{'pop':'abc'});window.close();" on the popup window. but I when I click the button,it will refresh the whole base page.by the way,I can't get the event in proecess request but I get the event in process Form request. so I put the the follow codes in the process form request.
if((("abc").equals(pageContext.getParameter("XXX"))))
{
pageContext.setForwardURL(//base page)
}

Thanks and Regards,
binghao

Mukul Gupta said...

Binghao,
It is possible to pass value from pop up page to base page without refresh of base page, just like standard LOV.
If
pop up page textinput Id=> popuptextinput
base page text input ID=>basepageMessageTextInput

You need to attach this javascript in pop up page button:
javascript:window.opener.document.getElementById('basepageMessageTextInput').value= document.getElementById('popuptextinput').value;window.close()

--Mukul

VPD said...
This comment has been removed by the author.
VPD said...

Hi Mukul,

I have the following scenario where I need to close a OA framework page based on the parameter passed to that page.

So to do that I am getting parameter from the page Context. In your blog you have referred to destination in the base page..In my scenario, I am forwarding to a OA framework page from an applet. So is it possible to put the same java script

javascript:window.close();

in the controller file and close the window based on the parameter? If so can you give some pointers?

I ve already tried the following in vain

OABodyBean bodyBean = (OABodyBean) pageContext.getRootWebBean();

String javaS = "javascript:window.close()";
bodyBean.setOnNavigate(javaS);

Thanks
VPD

Giridhar Varma said...

Hi Mukul,
I have a requirement in OAF page like this.
There is a MessageStyledText with a Fire Action set to it. This is displayed as a Link Item in the page. I right click on the Link Item and pop up is shown. I click on the 'Open in New Window' event in the Popup. The result page has to open in a new Window.
I tried this is not working.
I tried with StaticStyledText its working fine. But not with Message StyledText. Please let me know, if I can capture the 'Open in New Window' event of the Popup Window.

Thanks in Advance
Murali

Mukul Gupta said...

VPD,
In ur case , if i got u correctly flow is coming from a form and to OA Framework page, where based on a parameter passed from form u need to close the oaf page... rite.... in that case although u can use window.close(), but since this is the main window, u would get a pop up to confirm that u wanna close the window, is it acceptable? If yes, then u can use it.
--Mukul

Mukul Gupta said...

Giridhar ,
As per ur requirement, y r u not using oalink bean?Y u wanna use text beans? I think link bean will best suit ur requirement.
--Mukul

ram said...

hi mukul,
iam having one sanerio,
if the user logon by giving his username and password.how to check whether his user name and password is valid or not.after checking the user name and password the enduser clicks on function say example myinformation,then it has to display his Information like his name,address,mobile number just like a read only page.can you give any suggession for this.

regards
Ramkumar

Mukul Gupta said...

Ramkumar,
Validation of FND username/password can be dome via APIs in webapps context like

WebAppsContext ctx = new WebAppsContext
("T:\\users\\dbc_files\\secure\\ap618dbs_dev115.dbc");
// Process the error stack to make sure that the WebAppsContext object
// was created correctly.
OAException oaex = OAExceptionUtils.processAOLJErrorStack(ctx.getErrorStack());
if (oaex != null)
{
throw oaException;
}
// You can now initialize the user session for the new WebAppsContext
// either by validating the session if you have an Oracle Applications
// user session id, or by logging in with a user name and password
// as shown.
ctx.getSessionManager().validateLogin("fwktester", "fwkdev");

--Mukul

Arvind Goel said...

Hi Mukul,
I have a page, on this page let's say if the user is ideal for 5 minutes then I have to give a warning like you are ideal from last 5 minutes. But if the user is ideal for last 10 minutes then I have to perform some other action. Is it possible to do this?

I wrote the following code for the first Action..
String s="function update(){alert('You are ideal from last 5 min ');}";
pageContext.putJavaScriptFunction("update",s);

String javaS = "javascript:setTimeout(\"update();\", "+ 5*1000*60+" );";


OABodyBean bodyBean = (OABodyBean) pageContext.getRootWebBean();
bodyBean.setOnLoad(javaS);


Can you please guide me how to handle the second action or call one more java script function once more.

Mukul Gupta said...

Hi,
This requirement is possible to implement. I have discussed this in OA Framework Forums. See this thread link:

http://forums.oracle.com/forums/thread.jspa?threadID=585123&start=0&tstart=0

--Mukul

Rajeev Dave said...

Hi Mukul,

Creating New Region in Exsiting Page is "Customization by extension" or Modification by extention".

Does Personalization support Creating New region.

I have created two custom table and i want to show that field in exsting screen.

Please suggest.

Thanks

Rajeev Dave

Rajeev Dave said...

Hi Mukul,

Creating New Region in Exsiting Page is "Customization by extension" or Modification by extention".

Does Personalization support Creating New region.

I have created two custom table and i want to show that field in exsting screen.

Please suggest.

Thanks

Rajeev Dave

Rajesh said...

Hi Mukul,

I have a requirement where in when I click a Submit Button on the UI, a JavaScript Confirmation Message needs to be showed. Only if the user clicks OK on the confirmation, the logic in ProcessFormRequest API of controller needs to get executed.
We do not want to use the OADialog object here due to our custom requirements.
Could you pls let me know how this can be done ?

Rajesh said...

Hi Mukul,

I have a requirement where in when I click a Submit Button on the UI, a JavaScript Confirmation Message needs to be showed (something like 'Are you sure to proceed with this operation ? '). Only if the user clicks OK on the confirmation, the logic in ProcessFormRequest API of controller needs to get executed.
We do not want to use the OADialog object here due to our custom requirements.
Could you pls let me know how this can be done ?

Mukul Gupta said...
This comment has been removed by the author.
Mukul Gupta said...

Rajesh,
I have replied a thread similar to your requirement in OA Framework Forum. Here is ths link:
Confirm Thread in OAF forum

--Mukul

Mukul Gupta said...

Rajesh,
Due to formatting problems, I am not able to give exact link in last post, basically the url for the thread is

http://forums.oracle.com/forums/thread.jspa?messageID=2055132�

In this url
Remove the "?" at last and attach
"&" concatenated with "#2055132", then this thread will open up.

Anji said...

Hi Mukul,

A quick question on java script to open a other page.

How to open the other page as a model window. I mean how to make parent as not navigable until we close the child window (same as lov). I tried in different java script methods, but no luck with those.

Is this child page should also exist in same AM? I have 2 complete diffent pages, in one scenario I want to open that page do updates and come back to main page.

Can you help me on this..

Thanks in Advance

Regards,
Anji

Mukul Gupta said...

Anji,

How to open the other page as a model window. I mean how to make parent as not navigable until we close the child window (same as lov). I tried in different java script methods, but no luck with those.

>>>>>> You can use OABoundValueEmbedURL api to attach OAF js api used in LOV to open modal pop up window, here is the sample code:

String page ="/XXX/oracle/apps/xxx/aaa/bbb/webui/TestPG";
String destURL = APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?"+ OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT+ "=" + page1+"&retainAM=Y";

OABoundValueEmbedURL jsBound = new OABoundValueEmbedURL(btn2,"openWindow(self, '", destURL, "' , 'longTipWin', {width:"+900+", height:"+400+"}, true); return false;");

//button to which u need to attach
//this js function
//this should be a button
//and not submit button
OAButtonBean b = (OAButtonBean)webBean.findChildRecursive("(id of button)");
b.setAttributeValue(oracle.cabo.ui.UIConstants.ON_CLICK_ATTR, jsBound);

Is this child page should also exist in same AM? I have 2 complete diffent pages, in one scenario I want to open that page do updates and come back to main page.
>>>You should keep the same AM ideally it will help you retain VO values.
--Mukul

Anji said...

Thx Mukul,

It's working. Where can I get documents realted to these. I have much more customizations to do on this task.

I need to pass parameters and disabling standard links in child PG like logout,home etc(for this I am trying to create Region and calling it instead of page).

Can you share some links or preferable docs related to these?

Thanks a lot man..

Regards,
Anji

Mukul Gupta said...

Anji,
Since js is not supported in OAF, there is no documentation on Javascript usage in OAF.(There might be an internal documenetation available inside Oracle for the same.)

This is more how u can implement ur js knowledge in OAF. You can see /OA_HTML/cabo/oajsLibs/
which contain all js libs implemented in OA Framework or write ur own js functions.

How to pass parameters between pop up and base page... just search Oracle OAF forum... u will find numerous threads replied by me in various scenarios.Also have discussed that in article as well as see first question in this article for the same.

--Mukul

pc said...

Hi Mukul,

I have a base page with some 10 text input values.
There is a button "PButton".Now once I click the button following steps should happen:
1)All the input values will go to backend call pl/sql procedure and web services will return validated values.
2)The results will display on pop up page.

Now the problem is "PButton" should be a button or 'submit' button as with normal button pop up page is opening but form is not submitted and with submit button form getting submitted but pop up window not opening.

Also I have to show the results in a table how to create dynamic table?

Mukul Gupta said...

Pc,
Y don't you use process request of pop up page for this? Get all the textinput values from the VO(I am assuming pop up and base page AM is same) in process request of pop up page.... then pass these values in webservice proxy class call, whatever validated values u get... u can show on your pop up page.
--Mukul

Mukul Gupta said...

For creating dynamic table you need to create transient VO and populate the same in process request of pop up page,then u can show it in a table.
--Mukul

pc said...

Thnks Mukul I tried the same
Using pageContext.getParameter("Name") in pop up process request controller but getting null values.I am not using any VO as we are extending the framework.

Mukul Gupta said...

pc,
you won't get base page values in pop up page's pagecontext.If your are not using any VO, you should pass all values as url parameters... then u can retieve them using pagecontext. Else make a transient VO and attach it to each textinput bean, and u can retrieve values from this VO in pop up page.
--Mukul

Unknown said...

Hi ,
i have dropped you an email with some of my queries.Will be glad if u could take some time off and reply
thanks in advance

pc said...

Hi Mukul,

I am new to oracle app framework.Could you pls provide some link for generating dynamic table(with radio button).

Thnks

Mukul Gupta said...

Pc,
Please understand you don't need a dynamic table, instaed you need a static table in which rows are filled dynamically. Hence, just make a VO with all transient attributes you need to show in table.. and populate this VO in process request... with the values you got from web service proxy class.
--Mukul

pc said...

Thnks mukul! I have implemented the table part.
Now regarding my pop up query actually its standard page which has 20 fields.If I will cretae transient VO I have to associate it to AM for that we have to extend the standard AM(which is not feasible I think).I have tried passing it thru url but unable to get value.I have used

url destination:OA.jsp?page=/xxx/oracle/apps/imc/ocong/party/organization/webui/ppage2&retainAM=Y&Name={@organization_name} where organization_name is ID.Fetching the value in process request of popup page organization_name = pageContext.getParameter("Name");

How to store all these values in hashmap and pass it thru url?

pc said...

I got the information needed from the forum u replied earlier
http://kr.forums.oracle.com/forums/thread.jspa?threadID=603866
Thnks again!!

Mukul Gupta said...

Thats kewl.

Unknown said...

Hi Mukul,

How to display a 'quick select' column in a query result table?

Thanks and Regards,
Uma

Praveen Reddy Bakaram said...

Hi Mukull,

This is Praveen, I want to learn OAF and i was trying to download JDeveloper 9.0.3 with OA Extension from metalink and oracle.com but i was not able to find it out..there are many newer versions on that but which version to use?? my application version is
OA Framework Version 11.5.10.2CU.
MDS Version 9.0.5.4.81 (build 481)
UIX Version 2.2.18
BC4J Version 9.0.3.13.51

Please suggest me which version to download.

Unknown said...

Mukul,
How do I create lovtextinput items that are dependent on each other? None of them are mandatory. For instance: VP, Cost Center and Department. if vp is entered, then department and cost center lov values should be dependent on the lov value. But if the cost center is entered then if the vp lov is chosen, then vp lov is dependent on cost center. And so on..

Thanks
Sheena

pc said...

Hi Mukul,

I am getting very strange problem..

In my page I want to disable a button using javascript and I have used following
document.getElementById('testbutton').disabled = true where testbutton is button Id but button is not getting disabled.
I have tried with textbox also which is working perfectly and even the same code is working well in normal html.

Even
OAButtonBean p = (OAButtonBean)webBean.findChildRecursive("testbutton");
p.setDisabled(true); is working,but I want to disable only using javascript.

Pls let me know why is this happening?

Unknown said...

Hi Mukul,

I have an OAF requirement in one of my custom pages(page P).
Present Scenario :
•In the OA page(P) there’s one field ‘Project Status’ and one button ‘Approve’.
•When Approve button is clicked one procedure is being called and user can see a message ‘A concurrent request has been submitted for approval with concurrent request id : (&Request_Id). Please check the output.’ and at the same time the ‘Project Status’ gets changed to ‘Submitted for Approval’ .
•‘ Project Status’ is mapped to an EO based (let’s say table x)VO’s attribute(attribute y)
•When the concurrent request gets completed attribute y gets updated as ’Approved’/’Rejected’ in the table x, which in front end is not reflected(‘Project Status’ is still ‘Submitted for Approval’) until we do any transaction(like clicking on any other button of the P page, navigating to other pages and then coming back to page P etc. )
Requirement :
•When ‘Approve’ button is clicked the whole P page should be grayed out along with a message ‘A concurrent request has been submitted for approval and the process is in progress….please wait’
•As soon as the process gets completed everything in Page P should be enabled and the ‘Project Status’ will show the updated value i.e. ’Approved’/’Rejected’

Please help.

Thanks,
Munmun

Unknown said...

Hi Mukul,

How to open a JSP page as a separate window from OA page using javascript and also I need to pass parameter to the jsp page.

Please help.

Thanks & Regards,
Sagarika

Rahul said...

I want text box auto completion functionality in OA as we have it in javascript ....How to do it in OA

It will be great if you mail it with your suggestion to love18rahul@gmail.com

Murali said...

Hi Mukul,

I have done a custumization to generate a PDF report for a given DocType and Document ID.

I have 2 fields in xxxQuoteDevPG.xml (Parent Window) called DocType and Document Number.

Doctype is dropdown list which has 2 values i.e. Sales Quote and Manual SOW Number and Document Number is a text field with search option.

when i select the doctype as Sales Quote and search for docnumber , i will get a popup where i have "Search By" dropdown list in this i have 2 values i.e "Quote Number" and "Customer PO".

When i select a Sales Quote as Doctype i need to populate Quote Number as defualt in Search by dropdown list.

and When i select Manual SOW Number from parent window i need to defualt Customer PO in popup.

Now it is always shows Quote Number as defualt one for the doctypes.

Actually thr is only one controller atatched to xxxQuoteDevPG.xml and popup is a OA Region.

Can somebody help me on this issue.

Thanks,
MMR

Unknown said...

Hi Mukul,

My requirement is to display ‘in-line’ warnings or user messages when a user clicks a link from the Oracle Apps Navigator Menu. For example, under the Responsibility Employee Self Service – has a custom method to handle requests for leave associated with Part Time staff. I would like to display a message to users like ‘ Please contact payoll’ if they click the link.

Unknown said...

Hi Mukul,

I have another small one. Could you please let me know the steps to Register Very Simple JSP page in Oracle Apps

Because I'm Oracle forms developer, I don't have that much of experience in JAVA and JSP ...

Unknown said...

I am in the process of implementing 11.5.10 (11i) Oracle Internet Expenses module. We are facing a cute problem ‘$FLEX

when used in the KFF segments (COA), is not supported by any Oracle Self Service application. With the result, iExpense is not able to render the values and we are getting Null pointer exception, we applied the patch that Oracle suggested, but we still are not able to show other forms, as client has implemented View based value sets, which dynamically generates the parent child relationship.

client calls its COA as PTAEO (Project, Task, Award, Expense Type and Organization), the task associated with project are displayed, so on and so forth.

Has anyone come across this situation before and is there another way to achieve the same what $flex$ does.

Unknown said...

Hi mukul,
I am using table region loading records after loading i am startdate field.if the user picks particular date(ie 31-dec-2011) then it should display as "cancel".after that the user wants update the date with someother date(ie lessthan 31-dec-2011) it should accept it.
how we can do this.

Thanks,
vijayakumar

Unknown said...

Hi mukul,
I am using table region loading records after loading i am using multiselection for selecting one or morethan one row.After selecting rows it should be heighlight by color change using css with out using javascript.(Here clicking tableselection immediate color change should apply without table action)

kindly give your idea.
Thanks,
vijayakumar

Reddy said...

Hi Mukul,

I have a hgrid with 3 vos and 2 VL's.and last childnode iam giveing recursion.I have edit button for every row.I want to disbale the edit button of a row basing on its parent criteria.but for last level control i snot coming to loop in the rowimpl for VLaccessor method.Any idea how to do this.
I tried posting in Forums but no use.

Thanks
Soujanya

Harris said...

Hi Mukul,

I have to display data in table of 2 columns format but without table border and lines visible without headers of the columns.
It should display only data of the vo.

Its like how u display data of 2 column table in word doc hiding the table border and all the cell lines so that it just looks as well formatted text .

Please let me know if this is achievable in OAF.

Reetesh Sharma said...

very very nice article.

Regards,
Reetesh Sharma

pretttt said...

Hi Mukul,

First, Thanks for the great article. It has proved invaluable to me.

Next, I'm having a small problem in this. It is regarding the Close part of the popup. The "javascript:opener.submitForm('DefaultFormName',1,{'pop':'abc'});window.close();"
code refreshes the base page which is the correct behavior. But, our requirement states that the base page should not be refreshed, as the user entered data is lost due to the refresh.
I tried using just "javascript:window.close();", but, after closing popup if the user performs any action in base page, we get a AM State invalid error. Is there way to get around this?

Any help on this from anyone is much appreciated.

Thanks in advance,
Preetesh

pretttt said...
This comment has been removed by the author.
pretttt said...

Hi,

Can anyone provide me any help on the below issue?

It is regarding the Close part of the popup. The "javascript:opener.submitForm('DefaultFormName',1,{'pop':'abc'});window.close();"
code refreshes the base page which is the correct behavior. But, our requirement states that the base page should not be refreshed, as the user entered data is lost due to the refresh.
I tried using just "javascript:window.close();", but, after closing popup if the user performs any action in base page, we get a AM State invalid error. Is there way to get around this?

Any help on this from anyone is much appreciated.

Mukul Gupta said...

Hi prett,
y your base page values are lost i could not understand , as by
"javascript:opener.submitForm('DefaultFormName',1,{'pop':'abc'});window.close();"

we are just submitting the base page and not refreshing the base page.(i.e. first on this event process request is called and process form request are called one after the other).

Now if you are retaining the base page AM, the values should not be lost. Yes if you don't want your VO query to be re-eexecuted, put a if clause in process request, based on parameter value 'pop', which will let you know that the flow is coming from pop up page.
Hence when the page renders for the first time, your VO queries are executed but when the flow coming from pop up page they won't be executed.
This should resolve your scenario, if not let me know the details.
--Mukul

Chetan Karthik said...

Hi Mukul,

I have a small customization to be dealt with, in iProcurement. I am trying to restrict or limit the number of approvers while raising new requisitions. To achive this, I am trying to get hold of CompnayCode and CostCentre in LOV - VO window which is after 2 pages in the process train.

(OAMessageLovInputBean)webBean.findIndexedChildRecursive("ChargeAccountFlex0_Column) is returning null.

Can you please help? Its basically getting hold of attribute values in the process train?

Regards,
Chetan

ANAND said...

Hi Mukul,

I want to add google map of corresponding location on my OAF page.....normally using java script we can do....calling java script from oaf is it possible?...i think we need Item style regarding to attach map...

Thank you

Unknown said...

Hi Mukul,
On similar lines, i read your post on Oracle forums as well but still unclear.
I want to display a popup window on delete asking if the user is sure.that is fine.

How do i invoke transaction.commit on the click of OK on the alert window and transaction.rollback on the click of cancel button.

Thanks,
Rma

Mukul Gupta said...

Anand,
For Google map integration in Apps, a patch is available, get in touch with Oracle support.
--Mukul

Mukul Gupta said...

Rma,
Use OADialog Page for your requirement, see dev guide, you will find sample code for your requirement.
--Mukul

Vijaya said...

Hi Mukul,
How to Auto save OA Framework Page Contents in regular intervals. Now when the save button is pressed the data is saved. But how to acheive the Auto save functionality (like word) in OA Framework Page.

Please Advise

Thanks,
Vijaya

Mukul Gupta said...

Hi Vijaya,
Just add these two methods in your CO CLASS :

/**
* @param pageContext
* @param evt_name
* @param time_in_milli_sec
*/
public void attachAutoSubmitPropertyToPage(OAPageContext pageContext,String evt_name,String time_in_milli_sec)
{
OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();
String javaS = "javascript:setTimeout(\"submitForm('DefaultFormName',0,{'"+evt_name+"':'Y'});\","+time_in_milli_sec+");";
bodyBean.setOnLoad(javaS);
putLog(pageContext,"js attached :: "+bodyBean.getOnLoad());
}

/**
* @param pageContext
* @param event_name
* @return
*/
public boolean isAutoSubmitEvent(OAPageContext pageContext,String event_name)
{
boolean b=false;
String s =getJSParameterFromRequest(pageContext,event_name);
if (!isStringNull(s))
{
b=true;
pageContext.removeParameter(event_name);
}
return b;
}

Then , in process request add the api call

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
// see javadocs for parameter description
//10000 for 10 sec as we are paaing in millsec
attachAutoSubmitPropertyToPage(pageContext,"XX_EVT","10000");

.
.
.
}



In process form request... you can catch this event in every 10 sec:
public void processFormRequest(OAPageContext pageContext,
OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
.
.

if(isAutoSubmitEvent(pageContext,"XX_EVT"))
{
// YOUR LOGIC TO SAVE THE PAGE CONTENTS.
}

i hope this helps.
--Mukul

Vijaya said...

Mukul,
Thanks for the quick reply. Do I need to Import any particular class files ? I get the error when I added the two methods in the class. The errors are :
Error(62,1): class OABodyBean not found in class scc.oracle.apps.per.selfservice.appraisals.webui.SCCAppraisalContextInfoInputTabsCO

Error(65,1): method putLog(oracle.apps.fnd.framework.webui.OAPageContext, java.lang.String) not found in class scc.oracle.apps.per.selfservice.appraisals.webui.SCCAppraisalContextInfoInputTabsCO

Error(76,11): method getJSParameterFromRequest(oracle.apps.fnd.framework.webui.OAPageContext, java.lang.String) not found in class scc.oracle.apps.per.selfservice.appraisals.webui.SCCAppraisalContextInfoInputTabsCO

Error(77,6): method isStringNull(java.lang.String) not found in class scc.oracle.apps.per.selfservice.appraisals.webui.SCCAppraisalContextInfoInputTabsCO

Thanks,
Vijaya

Mukul Gupta said...

Vijaya,
Missed out 3 more sub methods u need to add in ur CO :

/**
* @param pageContext is OAPageContext in OAF Controller.
* @param param_name is the javascript parameter name.
* This method can be used for retriving parameter values used in javascript form submit.
* From Apps R12.1, the framework is also validating parameter security, so getting js parameter
* values by pageContext.getParameter("XXX"), can throw security exception error
* FND_FORM_POST_SECURITY_FAILED. To bypass this parameter security validation ,this methods
* can be utilised, as it directly takes parameter value from HTTP request.
* @return
*/
public String getJSParameterFromRequest(OAPageContext pageContext,
String param_name)
{
String s = "";
if (pageContext.getRenderingContext().getServletRequest().getParameter(param_name) !=
null)
s =
pageContext.getRenderingContext().getServletRequest().getParameter(param_name);
return s;
}

public void putLog(OAPageContext pageContext, Object o)
{
System.out.prinln(o);
}

/**
* @param s is string which needs to be validated as null or "".
* @return boolean true/false.
*/
public boolean isStringNull(String s)
{
boolean b = true;
if (!((s == null) || ("".equals(s.trim()))))
{
b = false;
}
return b;
}

This should compile ur code and make it work.

--Mukul

Vijaya said...

Mukul,
Great. Thanks a lot for your valuable code. It works great.

Thanks again,
Vijaya

Mukul Gupta said...

Great..!

Mukul Gupta said...

Vijaya,
I have also received couple of mails for such requirement from many developers, so have put up an article for this :

http://mukx.blogspot.com/2010/02/attaching-autosubmit-propety-to-oa-page.html

Vijaya said...

Mukul,
Thats really good. Can we do somthing like word.. when auto save feature is enabled then auto save otherwise save normally..
Can we incorporate that feature with this.. So that it will satisfy all types of users.

Thanks,
vijaya

Mukul Gupta said...

Just we can definately do that, you can define a profile in apps, and based on its value call the attachAuto... submit API in process requestelse not.In alternate case,user will have to press the save button.
On Svae button you can call the same code you were calling in autosubmit event.
--Mukul

Vijaya said...

Mukul,
Thank you. Users decided to have auto save after 25 minutes just before the session ends (30 minutes). But I have an issue, there are different tabs in the page, when they make changes in the first tab of a page and move on to second tab then it calls process form request which inturn enters the autosubimit event if clause and saves the page.. But I need to use this if clause only after 25 minutes.. so how do we handle this..

Thanks,
Vijaya

Mukul Gupta said...

You are talking about html tabs or subtabs ? I assume subtabs..!Now in subtab, please run in form submission mode and not redirect mode.

I don't think ur method in PFR should be called by any other event than auto submit.

--Mukul

Vijaya said...

Mukul,
How to disable a link on a particular single row in the set of rows in a oa framework page.

Thanks,
Vijaya

Mukul Gupta said...

Vijaya,
This is very simple, can be done by SPEL.Here are the steps:

1)In the table VO query, in select statement add a decode and return 0 or 1 based on ur logic to make a particular row disable or enable.

2) In VO wizard,select the java type as boolean for this attribute.
(So, in java 0 will be returned as true ad 1 will be returnd as false.)

3)Through SPEL attach this vo attribute to the disbale property of the link.

Thats it, on runtime this will disbale the link of the row for which decode of VO query returns 1.
--Mukul

Vijaya said...

Mukul,
I did not get it. The scenario is like this.. I have a item with style as link. The value is dervied from the view attribute appriasal date. The view object returns multiple rows with different dates.Now I need to disable the Appraisal Date link for only one appraisal date. How do I get the link disabled only for that particular row.

Thanks,
Vijaya

Vijaya said...

Mukul,
I do not see for link item style disable property in property inspector to attach SPEL. When I code. When I do this..
OALinkBean v2 = (OALinkBean)webBean.findChildRecursive("AppraisalDate");
v2.setDisabled(true);
then it will disable the link for all rows..

Thanks,
Vijaya

Vijaya said...

Mukul,
One more clarification regarding Auto Save feature. Can we Auto save just before the session ends and then expire the session by displaying session expired message at the same time...

Thanks,
Vijaya

Mukul Gupta said...

Vijaya,
For link, I have already told you the approach for disabling it for a single row in a table via SPEL attached to disable property of OALInkBean of Table. If you are ignorant of SPEL concept in OAF please look at developers' guide.

Regarding session timeout autosave feature, all you have to do is to use setTimeOut function of javascript and call form submit api in it, where timeout must be set to session timeout time.You can take a idea from my reply in this thread :

http://forums.oracle.com/forums/thread.jspa?threadID=585123&start=0&tstart=0

--Mukul

avinash said...

Hi Mukul,
I want to open a popup window on a button click of a custom page which will display the OAException.WARNING message if the business validations fails and allow user a facility of yes and no button on that popup. when clicked on Yes it will ignore the business validation and allow user to process and update the field value of the custom page.

Please advice

Regards,
Avinash

Vijaya said...

Hi Mukul,
I want to display a confirmation alert message when person clicks the Home/Logout/Close the browser without saving the Page. How can I acheive this functionality.

Thanks,
Vijaya

Vijaya said...

Hi Mukul,
I would like to display a confirmation alert message when the user clicks the home/Logout/close the browser link without saving the page. How can I achieve this functionality.

Thanks,
Vijaya

Mukul Gupta said...

Vijaya,this is a default feature in OAF called "Warn About Changes".All you need to so is set the Warn About Changes property to True on the pageLayout region.For details about this feature please Search and read dev guide for this topic.
--Mukul

Unknown said...

In ISource Module I have a requirement If supplier received any message from buyer and if that message is unread than
Unread Message should Pop - up on Screen while on line discussion.

Unknown said...

Hi Mukul,

In I-Sourcing Module, In on line discussion between supplier and buyer if supplier send any message to buyer than if the message is not read by supplier than a message as a hyper link shows upper right corner of the screen message displays – “1 unread message”. Now my requirement is that the unread message should blink on Screen while Online Discussion,

Thanks
Amit

Unknown said...

Hi Mukul,

In I-Sourcing Module, In on line discussion between supplier and buyer if supplier send any message to buyer than if the message is not read by supplier than a message as a hyper link shows upper right corner of the screen message displays – “1 unread message”. Now my requirement is that the unread message should blink on Screen while Online Discussion.

Mukul I need your help, its really urgent.

Thanks
Amit

Unknown said...

Hi Mukul,

I have a requirement to show a JSP page as a Popup window from a button action.
First,I have kept the jsp page in my local machine ( OA_HTML/eisrs/jsp/payroll/automation/gatherAssignment.jsp )
Then I wrote this code
(javascript:var a = window.open('OA.jsp?page=OA_HTML/eisrs/jsp/payroll/automation/gatherAssignment.jsp', 'a', 'status=no,location=no,toolbar=no,directories=no,resizable=yes,width=700,height=500,top=150,left=200,scrollbars=yes'); a.focus();) in to the DestinationURI of the button.

But i am getting error in new popup window. "The error is oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist".

I am not getting that where to do the correction for this error.
Pls help me out.

Thanks,
Niladri Saha

Mukul Gupta said...

Amit,
I can't answer your queries, until you explain me the scenario in technical terms, i haven't learnt all i-modules by heart that I understand the functionality you are talking about by ur query.

I can only advice, once you analyse the code and explain me the technical challenges you are facing.

--Mukul

Mukul Gupta said...

Niladri,
You are doing it incorrectly. OA.jsp reference is only required in case of OAF pages.

For jsp you can give direct url in the javascript function like

javascript:var a = window.open('/OA_HTML/eisrs/jsp/payroll/automation/gatherAssignment.jsp', 'a', 'status=no,
location=no,toolbar=no,directories=no,resizable=yes,width=700,height=500,top=150,left=200,scrollbars
=yes'; a.focus();

I am not sure if you have placed your jsp in $OA_HTML or $JAVA_TOP. Generally, the custom jsps'
are directly put under $OA_HTML with prefix wilke "XX" and custom OAF pages are placed under
$JAVA_TOP in complete hirarachy structure like ../eisrs/jsp/payroll/automation/gatherAssignment.

Also, please confirm this is a OAF page or a JSP. If its a OA page then u should not use .jsp
Please read dev guide for basics.
--Mukul

Unknown said...

Hi Mukul,
Thanks for your quick reply.
Yes,that is jsp page,i want to display as a popup from a button action on a base oaf page.
By removing of (OA.jsp?page=),
it is working..

Regards,
Niladri Saha.

Unknown said...

On my page upon selecting a particular value in msgchoice bean, an msgtextinput bean shd be set blank. Can u pls suggest on this along with some examples (links)? I tried for javascript approach but for some reason it is not invoking a simple function onChange event. Is javscript not available in R12.0.4? Thanks,Suvendu

Mukul Gupta said...

Suvendu,
You should only opt JavaScript in OAF if the feature/functionality is not there in standard functionality. For you requirement is very simple, you just need to attach PPR event to the message choice bean and based on it make the message text input as null.

If you have no idea of PPR, I will suggest to read "Partial Page Rendering" in OA Framework developers' guide. PPR is also demonstrated in OAF tutorials that comes along with Jdeveloper.
--Mukul

Imranahmed Peiwala said...
This comment has been removed by the author.
Imranahmed Peiwala said...

Hi Mukul,

I have one scenario in which i would like to open window/page with image. can you please guide me in this?

1. I have one OAF page on which i should have button Called "Next"

2. On clicking of this button a new window/page should be displayed with the image stored in databse. on clicking on next button again next image should be displayed on the same page and so on.

3. Is it possible to configure OAF to render window_II in the opposite screen of window_I where the OAF client resides? (If the OAF-client resides in screen_I render window with image in screen_II). That is, at the first click on the Next-button, window_II appers on screen_II and not some random location. The user will have 2 screen/monitors on his work place.

4. Given that the two windows reside on each screen, is it possible to make OAF remember the position of window_II ? The goal of this is to force the window to pop up on the same location on the same screen next time the Next-button is pressed.

5. If window_II is closed (eg. by using X) and the Next-button in window_I is pressed again, will window_II pop up in the same location and screen as previously ?

6. Is it possible to have a Print-button in window_I what prints the scanned picture in window_II ? Is it possible to have the click on this Print-button to open the standard print dialog on top of window_II ? Could the button be placed in window_II as well, having the same functionality ?

Thanks in advance,
Imranahmed Petiwala

Mukul Gupta said...

Hi Imran,
As per web design standards, you should not have more than 1 pop-up window at a time,
as this is not considered a good design. Now talking about OAF, the framework tracks each page click(HTTP Post) event , so that you get a stale data error in case you press browser back button.
In case you will have design with more than 2 pop-up windows, individual page clicks will make other window session expire and you will get stale data error in doing transactions in 2 windows simultaneously.So, the only pop up window scenarios supported well with OAF is
1) A editable modal pop-window with all events as partial page events.
2) A read only pop up window, which can be modal or non-modal.

Now coming to the last point, yes it is very much possible to take a blob item from database and
write the image on pop-up window (servelet output stream) at run time.Rest remembering all pop up locations can be handled in javscipt code not OAF.

--Mukul

Ganesh Mane said...

Hello,

I am working on one of the iExpense new page development.

This page is basically search page with results table and also has checkboxes in results table.

Functionality is very simple. Just select the records in results table selecting checkbox and update the selected records by clicking on "update" button.

But before updating I am using dialog message with Yes/No.

I am able to update the records by selecting "Yes" in dialog box button.

Issues I have:

1) Results table is not getting refreshed and check box still shows as checked after control comes to main page from dialog page.

2) Even though check box is not selected the control update logic
even though I have written the code in AMIMPL.

Please let me know what could be the issue. I am new in OAF and i have immediate delivery date of this object.

Thanks
Ganesh

Ganesh Mane said...

Hello,

I am working on one of the iExpense new page development.

This page is basically search page with results table and also has checkboxes in results table.

Functionality is very simple. Just select the records in results table selecting checkbox and update the selected records by clicking on "update" button.

But before updating I am using dialog message with Yes/No.

I am able to update the records by selecting "Yes" in dialog box button.

Issues I have:

1) Results table is not getting refreshed and check box still shows as checked after control comes to main page from dialog page.

2) Even though check box is not selected the control update logic
even though I have written the code in AMIMPL.

Please let me know what could be the issue. I am new in OAF and i have immediate delivery date of this object.

Thanks
Ganesh

Unknown said...

Hi Mukul,

I am developing a Material Order entry pages using OAF. I need to enter a new Shipping Address in a modal window if the user canniot select already existing address. Following your blog, I was able to open the modal window.

Now when I close/save and continue with the MO, I am getting the Navigation error since I am handling the BackButton navigation in the base MO page.

Also the transaction unit that has been started in the base page is lost on closing the modal window.

I am not sure what I am missing here. Thanks in advance for your help.

-Akila

Sridhar Yerram said...

Timely refresh of a OA Page :
1. I implemented the timely refresh in our custom pages.
2. Addition to that our custom pages are having a shared org region.
3. Lets consider i open custom page with timely refresh region : then it is working fine.
4. But if i open more than one custom page which are having shared org region and this timely refresh region : the pages are getting errored out with No Current Row for : sharedOrgRegionVO1. Is it the current behavior of OAF. what does it mean that "opening two pages parallely in same session is not supported in Oracle" . Please throw a light on this.

thanks
sridhar

Mukul Gupta said...

Hi sridhar ,
Thats true OAF does not support opening two pages parallely in same session , unless one page only uses ajax based PPR, similar to the case of LOV, where you open two windows simulataneously.

--Mukul

Sridhar Yerram said...

Hi Mukul,
how come the different pages will come into same session.
Before i was able to open pages independently which were having our custom ShareOrg Region.
Addition to that what i have done is timelyRefresh using the javaScript. So now i was getting an error if i open more than one pages which are having this sharedOrg and this timelyRefresh.

Sridhar Yerram said...

Hi Mukul,
one more question : Is it true that "javaScript" is not supported for OAF in mobile devices??
Is there any possible way of doing!!! it.

Sridhar Yerram said...

Hi Mukul,
one more question : Is it true that "javaScript" is not supported for OAF in mobile devices??
Is there any possible way of doing!!! it.

Mukul Gupta said...

Sridhar,
Here are mt responses :

how come the different pages will come into same session.
Before i was able to open pages independently which were having our custom ShareOrg Region.
Addition to that what i have done is timelyRefresh using the javaScript. So now i was getting an error if i open more than one pages which are having this sharedOrg and this timelyRefresh.



Basically OA framework internally track all http post actions on AN oaf PAGE(all UIX elements with submit action), so opening two pages simulatanesouly and then timely refresh will show an error because the first page does a HTTP post action and the framework tracks that, now when u do any submit action in second page... framework undertstands to be a stale data.


Is it true that "javaScript" is not supported for OAF in mobile devices??
Is there any possible way of doing!!! it


Javascript is not supported in OAF being it any platform mobile or web. Now coming to mobile, the MSDN library in mobile devices is not as extensive as your web browser, so all js functions are not supported.

--Mukul

Unknown said...

Hi Mukul,
I have a page in which i search using various criteria . I have two date text boxes and if the value of the second one is less tahn the first, i have to pop up a error message. Only if the user has the value in first less than or equal to second, i should allow him to select any thing else or click on search.
I am new to OAF. I should be firing the message only when both the values are entered > Please let me know how to proceed

God Is Back said...

Hello Mukul,
I have simple requirement where i OA table with multi select options. When i select multiple records then click on save or delete button, i need a user conformation with yes or no js script. What could be the best approach? I try to call JS script from processformrequest under button event captured. It fails in IE says "Message: Expected '('
Line: 1
Char: 10
Code: 0
URI: http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?page=xxxx/xxxx/xxx/xxx/xxx/webui/xxxxxxxPG&retainAM=Y&addBreadCrumb=Y&p_id=33300888&recnum=4336&_ti=266537815&oapc=4&oas=2PgLwnxkXVQucRGFgjwOFA.."
StringBuffer js = new StringBuffer();
js.append(" function delete(){");
js.append(" alert('aaaaaa');}");
pageContext.putJavaScriptFunction("delete", new String(js));

Rudra. said...

Very Nice. Thanks.

Sachin said...

Hi Mukul,
I have a base page, there is a advancedTable, one of the column in the table may have large amount of data, so I have given a link besides that column, if user click on that link it should display a dialog box with the value in the base page's cell. User can edit the value in dialog box and closing the dialog box updated value should get reflected in base page's cell.
In process request method of base page CO, I have typed the code as mentioned by you, which is working (I have used OABoundValueEmbedURL), it is opening the popup page with default value.
On popup window I have put two buttons Apply and Done. Apply is submit button on click of this button I am updating the value in VO based on the primary key value passed from base page. Done is normal button on click of this I am closing the popup window.
Now the problem is value is getting updated in VO but it is not getting reflected in base page (in the cell of Advanced table), also when I click on save button new value is not getting saved. I don't want to commit the change on popup window, as user can cancel the update on base page. could you please tell me where I am going wrong?

Abhay Gupta said...

Hi Mukul,

I am new in oaf. my requirement is basically I have a base(seeded)page, you know each seeded page contains Global button or link like Home,Logout,Prefernces. I want to use javascript:window.close(); functionality on all oaf page Logout global link. How to achieve this functionality I am unable to find those link on Logout.jsp page.
Plz help me out..............Thanks ABH

slokam said...

HI Mukul,

I have a requirement to popup Error or Information messages on top of the page (using FND_new_messages) and these message should have a link to other OA page. While clicking that link the new window should be open as popup window.

can you please let me know how to do this ? I tried all different ways for defining the FND message with NO LUCK.

Any help/direction would be helpful

Thank you,
slokam

Keshav said...

Hi Mukual,

I have a similar requirement in my project.

I have added a link in a standard page which opens a custom page.

But I am getting one warning as below when I save the standard page
"Action did not succeed due to the use of the browser navigation buttons. The page has been refreshed. Any un-saved changes may have been lost."

Could you help me on this.

Thanks
Keshav

Madhu said...

Hi Mukul,

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,the 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!!!

Thanks,
Madhu

Soumya said...

Hi Mukul,I have a requirement as follows
there is a column in a VO whose value is as follows" Journal Documentation, click TEST_JAW.xls
"

I need to use this value and the output should be as
Journal Documentation, click TEST_JAW.xls

Journal Documentation, click should be the prompt

TEST_JAW.xls should act as a link

on clicking it you will navigate to another page

Please suggest

Soumya said...

Hi Mukul,I have a requirement as follows
there is a column in a VO whose value is as follows" Journal Documentation, click TEST_JAW.xls
"

I need to use this value and the output should be as
Journal Documentation, click TEST_JAW.xls

Journal Documentation, click should be the prompt

TEST_JAW.xls should act as a link

on clicking it you will navigate to another page

Please suggest

Soumya said...

Hi Mukul,I have a requirement as follows
there is a column in a VO whose value is as follows" Journal Documentation, click TEST_JAW.xls
"

I need to use this value and the output should be as
Journal Documentation, click TEST_JAW.xls

Journal Documentation, click should be the prompt

TEST_JAW.xls should act as a link

on clicking it you will navigate to another page

Please suggest

abc said...

Hi Mukul,
I need to capture client machine ip address in custom OAF page. Is there any way to achieve this? I have already tried using sys_context but it returns application server's ip address.

Thank you.

Regards,
Amit

Unknown said...

Hi,
I have a requirement to implement processing page with cancel button.I mean I have a custom base page with submit button. When user clicks on submit button it would start long running process
And I should show a dialog page with clock saying process in progress message and a cancel button. User should be able to stop the process by clicking cancel button and control back to base page. OAF gives the processing page that i want but without cancel button.
I try to add cancel button on the processing page pro-grammatically but while its in processing and when i click on cancel button i cannot capture the click event.
how to add cancel button on it and capture event? Is this correct approach? If not could suggest the best approach and solution?

SC

Vamsi Mantripragada said...

Hi Mukul,

I have following requirement.

Multiple records from multiple tables will be displayed in a OA Page. User can modify the rows and if we click on submit button, a pl/sql procedure will take input and update records in respective tables. Could you please explain how can I do it.

Thanks-Vamsi

Unknown said...

I am trying to get a pop message in my OAF page once I click on a button (save), I can see the popup message only if there is an exception in my page or if I keep my java script code in processRequest, could you please help me know if there is a way that we can achieve the popup message through processformrequest?

My requirement is that I have a function call in processform request which will return a value and based on that value I need to show a java script alert (popup message).

Below is my code in processformrequest

StringBuffer jsString = new StringBuffer();
jsString.append(" function validatePage() { ");
jsString.append(" alert('Hello ');");
jsString.append(" } ");


OABodyBean bB = (OABodyBean)oapageContext.getRootWebBean();
bB.setOnClick(jsString.toString());
oapageContext.putJavaScriptFunction("validatePage", jsString.toString());

OASubmitButtonBean okButton = (OASubmitButtonBean)oawebBean.findChildRecursive("Save");
okButton.setOnClick("validatePage()");

Felix Laventman said...

hi Mukul,
I have rather simple requirenment: I need display confirmation popup on Done button pressed according to some value on the page:
if RemainingQty != 0 then
show confirmation popup
if yes then
close window
else
remain on the page
end if
end if

so I added following to the processRequest:

OAButtonBean doneBtn = (OAButtonBean)webBean.findChildRecursive("DoneBtn");

doneBtn.setOnClick("javascript:var a=parseInt(document.getElementById('RemainingQuantity').value,10);if(a!=0){input=confirm('There are still number of slabs remanied to reserve. Do you wish to exit?');if(input==true){window.close();};}");

works like a charm when RemainingQuantity != 0,
unfortunately same happens when RemainingQuantity == 0...

look like parseInt() has some issues

Please advice.

Felix

Unknown said...

Hi Mukul,

Popup functionality is working fine as you instructed in the Article.
Thanks for sharing.

One concern is , I have close button in popup to close the popup window and to capture the event for further business logic.

I am performing DML operation in popup; using close button event i am manipulating with the parent page controller. If user instead of using close button in popup , if he uses browser close button , I am not able to get the handle.
(User have to use only the popup close button (popup page button) to close the popup not the browser close button)

Is there is any possible way of hiding or disabling the browser close button using javascript or OAF and possible to apply the same OAF?

Awaiting your response...

Regards,
Zakir

Mkhan said...

Hi Mukul
I need to stay on the same page after I save that page.
Please let me know how to rendered to same page after saving as in my case page is going
to first page.

Thanks and Regards

Mkhan said...

Hi Mukul after pressing Saave Button,My Page is rendering to first Page but I want to stay on the same page(where I saved).Please help me to achieve this.

Thanks and Regards
Mkh

Ashish said...

Hi Mukul

Is there a way to timely refresh a specific region on OAF page. You have provided the mechanism to timely refresh the complete OAF page, but am looking to timely refresh specific region in oaf page.

Ayanraj said...

Hi Mukul,

I have requirement to develop a VO based Popup once i tab out from textfield.

Lets say i have three fields in the form empno, ename and job once i tab out it will show in popup multiple records related to that.

Waiting for your reply.

Thanks,
Raj

Ravi Kiran G said...

Hi Mukul,

I have a base page, by clicking on the images, i need to show the popoup page. As per the code provided in your blog i am able to show the popup, But Once i close the popoup window, come back to main page and try to do any action getting the below error.

"
You cannot complete this task because you accessed this page using the browser's navigation buttons (the browser Back button, for example).

To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward."

Below is the code That i have written in my CO PR.

Can you please help.

Thanks and Regards,
Ravi.

Romina OJEDA said...

Hi Mukul,
I have a requirement to build a page which shows a couple of elements in a table, one of the columns in the table should be a link which should open another instance of the same page passing parameters. I have tried doing this with simply entering the destination uri property in the link bean but it is not working as expected. It seems all okey, the new instances of the page open fine but when I return to the first page and fire an action is seems to have the data of the last instance window. I tried passing retaimAM parameter in both Y and N without sucess. Do you know how to achieve this?

Unknown said...

Hi Mukul,

can you help with such a problem: in OAF page, I need to obtain a xml content from external web service, pass that content to my controller and finally post the result to the database. The application server has no access to web, therefore the only way to get the content from web seems the use of javascript in OAF page. Can you please give a simple example of how to pass javascript function output to OAF page controller?

Unknown said...

Hi Mukul,

I need to two pop up windows on the click of a single button, it would be like if I click on the button first it would open my pop up window1 and once I close it, then only my pop up window2 should be opened.

Is there any way, kindly suggest

Thanks,
Affy

Unknown said...

Dear Mukul,

I want to extract data from Card and auto fill oaf page using JS.

Can you help please.

Regards,
Muhammad Wajhi Paracha

mradula said...

hi Mukul

I am opening a pop up page on a button click using javascript. Passing VO attributes in the URL. but when am fetching in the CO of the pop up page i get null values.
javascript:var a =window.open('/OA_HTML/OA.jsp?page=/bvppa/oracle/apps/pa/promis/forecast/webui/BVPActualsPG&ProdOffcNum={@ProductionOfficeNumber}&ProjId={@ProjectId}&FirmBudgetId={@FirmBudgetId}&Firm=Yes&BudgetId={@BudgetId}&retainAM=Y&fndOAJSPinEmbeddedMode=y&param1=Hello &param2=World!', 'a','height=400,width=800,status=yes,toolbar=no,menubar=no,location=no'); a.focus();

am able to fetch calue for only one attribute - FirmBudgetId.
for the rest of the attributes am getting null values. i have set the values in the CO of the base page.

Anonymous said...

Hi Mikul

I can open new OAJSP page in new window but when i close child window by using window close button and then if i perform any action in my base page it is giving steal data error.

Vinay said...

Hi Mukul,

Could you please provide me any link for adding 2 message radio buttons in table region??

Unknown said...

What is a framework?

Some time ago I asked "What is a framework?". I liked the following answer:

In the case of a framework, your code is called by it. In the case of a library, your code call it. Rails is a framework, and provides libraries too.
Our users are software engineers who care about doing JavaScript development the right way. They care about things like test driven development, performance, code quality, structure and maintainability.

JavaScriptMVC makes it simple to do all these things and more.
AngularJS

Unknown said...
This comment has been removed by the author.
Unknown said...

Hi Mukul,

Can you suggest a way to set focus on a particular MessageTextInput once the page has been rendered by partial page rendering. One way is to reload the page again and setting initial focus id (setInitialFocusId()). However, this method is prone to errors.

It would be appreciated if you can suggest a way to set cursor focus back to the same MessageTextInput field after pressing tab. Here, I am using firePartialAction as the action of that item (MessageTextInput).

Rocky said...

Hi Mukul,

I have a custom OAF page which has huge data like 500 to 600 lines and each page will display 200 records, users will navigate by clicking next to move next page do some changes on reconrd 230 and click save button. After complete the Save, page will refresh and coming back to first page. But user requested to stay on the same page when they clicked Save button.
Ex: User update row number 230 in Page 2 and click save but the page get refreshed and displayed record 1 from page 1, they need to stay the page 2 only.
Regards,
Rama.

Unknown said...

Hi,


I've a requirement of that when user will click on the Submit button of an OAF page EBS, we need to validate the values of a specific field and show error message if the vales are not matching with predefined values.
One option is to attach an LOV in that field. But page extension is not allowed here.
Can we write a client side javascript validation on the submit button of the OAF page?

Thanks in advance!!

Regards,
S Ghosh

Unknown said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz04 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

pslvseo a9 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz08 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

pslvseo a9 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz08 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

pslvseo a9 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

pslvseo a3 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

pslvseo a8 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz06 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz05 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

byodbuzz05 said...

Testimonial Tree is the leading online reputation management company. Our testimonial software makes it easy for you to collect authentic testimonials from your happy customers and automatically share the best stories online to attract new customers. Our solutions for enterprise organizations, small to mid-size businesses and individuals are empowering professionals throughout many industries.

byodbuzz03 said...

David Walsh is Mozilla’s senior web developer, and the core developer for the MooTools Javascript Framework. David’s blog reflects his skills in HTML/5, JS and CSS, and offers a ton of engaging advice and insight into front-end technologies. Even more obvious is his passion for open source contribution and trial-and-error development, making his blog one of the most honest and engaging around.
Website: davidwalsh.name

rhea said...

Hi Mukul,

could you please help me in the below scenario:

I have show an alert popup window with a message when a checkbox is checked. Could you please tell me how could i achieve this using javascript.

Thanks,
Rhea.

Chiến SEOCAM said...

nice

lưới chống chuột

cửa lưới dạng xếp

cửa lưới tự cuốn

cửa lưới chống muỗi

Chiến SEOCAM said...

คุณมีบทความดีๆ ขอให้คุณเป็นวันที่มีประสิทธิผล

bon ngam chan

máy ngâm chân giải độc

bồn mát xa chân

chậu ngâm chân giá rẻ

anne said...

Hi Mukul,

I am struggling since a week now. I've implemented a pop-up in the table actions. It's a button which would open a new page(parameters are being passed to it from the base page). This pop up page would help me to enter few details .

But an error--

You have insufficient privileges for the current operation. Please contact your System Administrator.


Keeps on coming.

Please help.

I've used the below code to call the page--


if ("createActContact".equals(pageContext.getParameter("event"))) {
System.out.println(" calling create create contact page ");

String url =
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
//retain am parameter
String amMode = "true";

//additional parameters to be passed to pop up page
Number AcctId = CustAccID;

OAFormValueBean FormCustSiteID =
(OAFormValueBean)webBean.findChildRecursive("FormValueCustSiteID");
if (FormCustSiteID != null) {
String AccSiteIDs =
(String)FormCustSiteID.getValue(pageContext);
try {
if (AccSiteIDs != null) {

AccSiteID = new Number(AccSiteIDs);
System.out.println("Account Site ID" + AccSiteID);
}

} catch (SQLException e) {
e.printStackTrace();
}

}
System.out.println("AccSiteID from form value = " + AccSiteID);

String params = "param1=" + AcctId + "param2=" + AccSiteID;
System.out.println("Parameters for creating cust con are " +
AcctId + " and " + AccSiteID);
//Computing page_url
String page =
url + "&retainAM=" + amMode + "&fndOAJSPinEmbeddedMode=y" +
"&" + params;
//Computing final url
String destURL =
OAWebBeanConstants.APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP +
"?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + page;
String javascript =
"var a = window.open('" + destURL + "', 'a','height=400,width=400,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbar=yes,location=no'); a.focus();";
pageContext.putJavaScriptFunction("javascript", javascript);

}

=========================================================================================

And in the PR of the CO of the pop up page I'm using --

param1 = pageContext.getRenderingContext().getServletRequest().getParameter("param1");
param2 = pageContext.getRenderingContext().getServletRequest().getParameter("param2");


to fetch the parameters value.



Maketting SEO said...

http://www.google.sr/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.ad/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.com.bh/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.com.bo/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.co.bw/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html

Khaled ZERIMECHE said...

Hello Team,



we have a flexfield (N Compte) developped in oracle purchasing (attribute4 for ap_supplier_sites_all), we need to create a box html that check the new input of this flexfield, the display message will be in this format:



another supplier with this compte number exist in the system, do you want to continue (YES/NO)



the flexfield has been configured in oracle forms, and it is displayed in oracle html page OAF.



you find in attchement the position of flexfield and the new request format.

markjack said...

I gained new knowledge from well written content of this blog. It is showing some different kind of strategy to keep work better and improve with every new assignment. Gracefully written blogHow to get rid of Discord Javascript Error [100% SOLVE ISSUE]

salome said...

Very interesting article with detailed explanation. Thanks for sharing. keep up the good work Angular training in Chennai

Ramez Ernest said...

Hi Mukul,

I have tried the JS location.reload(true)and it is working fine in a sample page, however, once I add some items like LovMapping the page stops refreshing.

What can I do to ensure the page is refreshing even if it has multiple items.

Hitendra Singh said...

Hi Mukul,

I have an oaf page where i have couple of text fields for search and then find button. My requirement is if use enter any value in search text and press tab then focus should immidiatly go to the find buton(skip all search field). and when find button is pressed then focus should go to the result table's text field(i have one text box inside table also to enter values). user doens't want to use key boad or tab for navigation.
is there any way i can achive this(may be using javascript).