How to invoke a remote taskflow and show it in popup? - oracle-adf

I need to invoke a remote task flow deployed in different domain and open it in an inline frame(Pop up) in ADF. I followed and it's working with simple page. But when I try to invoke it in a pop up on click of button it is giving 404 Error.
Can some body help me with it please?

You can use ADF Dialog framework, but in this case it's a little complex.
First: Create a new taskflow in the consumer application and place a remote-taskflow-call as the default activity.
Second: Create a taskflow-call-activity formt the new taskflow on the consumer taskflow .
Third, in the properties of the second taskflow-call-activity under Behavior section you can configure set the Run As Dialog property to true, then configure the property Display Type to inline-popup to use an ADF popup or external-window to use a new browser window.
Finally: You must configure the action component that calls the second taskflow , in the properties of the action component (for example af:button) under the Behavior section, configure the Secondary Window you'll show, set the porperty UseWindow to true and configure the WindowEmbedStyle, WindowModalityType, and the popup window dimensions.
Here is a simple example about ADF Dialog Framework: http://andrejusb.blogspot.com/2013/03/reusable-adf-region-with-dialog.html
If you use parameters, you must send them to the First and from there to the Second taskflow.
Return values in this case are really complicated.
Hope it helps...
Rafael

Related

How to call Data Editor from Code, C1 CMS?

Under definition tree, I can attach event to open Data Editor for certain element.
However, I have no idea how to trigger the workflow to open the Editor for a given id.
I have a custom action URL which point to a custom ASPX (List of businesses about 50,000) in the console.
Now I want to trigger call the default data editor from the custom ASPX. Is that possible.
Yes you can. There is a few steps you need to take, but then you can basically mimic all console behaviors from your own aspx-page.
First of all you need to include the necessary C1 Console javascript frameworks on your page. Do that by calling ScriptLoader.Render("sub") and write the result on your page. You would also need to include this javascript on your page https://github.com/burningice2866/CompositeC1Contrib/blob/master/Teasers/Package/content/Composite/InstalledPackages/CompositeC1Contrib.Teasers/teaserConsoleFunctions.js - its some wrapper methods which are able to construct the javascript objects needed to call C1's webservice methods.
When that is setup you can trigger opening a Edit Workflow by calling the executeAction javascript method via a link containing the necessary ActionToken and EntityToken like this https://github.com/burningice2866/CompositeC1Contrib/blob/master/Teasers/Web/UI/TeaserHtmlHelper.cs#L65.
Its important to understand that everything in the C1 Console in based on these tokens. You don't edit something based on its id but always based on the EntityToken the something is represented by.
And what you want to do, whether its edit something or delete it, that thing you want to do is represented by an ActionToken. So to be able to edit something, you need an EntityToken for that something and a ActionToken for the Data Editor.

What is use of isExecuted() in ADF ViewObjectImpl class

I want to understand utility of isExecuted() in ADF's ViewObjectImpl class.
The documentation is very sparse(Indicates whether the row set has been executed or not) and I couldn't get my doubts cleared.
As per documentation, only if row set is executed at least once it will return true. But, I am seeing that as soon as my application module is created, a view Object which is housed in the application module, is returning "isExecuted() = true " .. Is this expected or is there any setting because of which this is happening ?
It is hard to see purely via the Application Module Tester.
But if you have data controls based on your AM and use them on an interface (such as a UI page), you can check the working of the isExecuted method.
On your user interface, you can create a basic page that does not bind to any of the data controls based on the VO's - but only to a simple AM operation that you expose via AM's client interface:
public void showIsExecuted() {
System.out.println("*******TestAppModuleImpl::showIsExecuted() DepartmentsView1:" + this.getDepartmentsView1().isExecuted());
System.out.println("*******TestAppModuleImpl::showIsExecuted() DepartmentsView2:" + this.getDepartmentsView1().isExecuted());
System.out.println("*******TestAppModuleImpl::showIsExecuted() ViewObj1:" + this.getViewObj1().isExecuted());
}
On a UI page (view1.jsf), you call only this method without using any of the VO based data controls and your output should show this:
*******TestAppModuleImpl::showIsExecuted() DepartmentsView1:false
*******TestAppModuleImpl::showIsExecuted() DepartmentsView2:false
*******TestAppModuleImpl::showIsExecuted() ViewObj1:false
Now, on another UI page (e.g. view2.jsf), show some of the data from one or more of the VO's and also a button for the custom AM function. After running the page, you should get the below in logs (as expected):
*******TestAppModuleImpl::showIsExecuted() DepartmentsView1:true
*******TestAppModuleImpl::showIsExecuted() DepartmentsView2:true
*******TestAppModuleImpl::showIsExecuted() ViewObj1:false
For reference, this is what my design time setup (in JDeveloper 12.2.1.1) looks like :
Also, you can further tweak the options under AM -> General -> Tuning -> Customize Runtime Instantiation Behaviour

Sencha touch mainView push/pop strange behaviour after pushing 5 forms

I'm building account system using sencha touch (architect) and now I have an issue where the code executed but the this.getMainView().pop(); NOT and the view states on current one !
my views:
Login scrn--> cstmrs list--> cstmr details--> rceipt--> checks
When I get to receipt view (without checks) the code executed and auto returned to customer's details view.
But soon I click to add a check to the receipt (only displaying the form without any code) the check view injected to mainview after that I click back button to return to receipt window, but now when I click save button the receipt is saved and the data arrives server side ok, but the big problem the this.getMainView().pop(); doesn't work or doesn't executed !!
Is there any wrong with my code? it works without displaying the 'checks' form !
Nothing in firebug/chrome debugger
I use this code to show forms:
var mainView=this.getMainView();
mainView.push({xtype: "frmChcks",title:'new check'});
And this code for getting back:
this.getMainView().pop();
Thank you in advice
Ahhhh it was because I used a hidden field called 'id', don't use 'id' for you components :-)

ADF Taskflow reset

In ADF, how to restart a taskflow region. I have a jsf page consisting of command links on one side and a region on the other. The region is always the same taskflow but I need to restart the taskflow back to defaut activity on click of any command link. RefreshCondition and refresh ifNeeded properties did not reset the task flow activity. Thanks.
Using the TF itself:
http://andrejusb.blogspot.be/2011/08/adf-dialog-framework-and-adf-task-flow.html
Using code in your backing bean:
https://forums.oracle.com/forums/thread.jspa?threadID=1013471
Have an input parameter for the taskflow,When you want to restart the region, change the value of input parameter.
The easiest option for acheving this:-
1. Create a dynamic region
2. Create a bounded taskflow with a single blank page (used for reset) and add to the dynamic region as default region
3. add other taskflows as you need and add command links to the left side
4. Enjoy...
add a "control flow" in your task flow starting and ending at same page. give some name to that "control flow".Suppose the value is "back" Now on every command link action pass that value. eg: .
//this would work.Let me know what happens

Why do i receive an object with null properties when returning from a domain service call in a SV app? i use LinqToEntitiesDomainService

i am making a call from SV app to a domain service and waiting to receive IQueryable. In my model i have an one to one relationship with the object UserSession. So in the linq query i am telling that i need an eager loading on UserSession.
return (from u in this.ObjectContext.Users.Include("UserSession") where u.UserId == pUserID
&& u.UserSession != null select u).First<User>();
inside the method in the service if i am accessing myUser.UserSession i have the UserSession object but when i receive this object on the Silverlight the myUser.UserSession is null. Why ? It is normal to have this behavior ? I am thinking that is not; because why else i would use relations in EF if i can not use them. On bad workaround is to make 2 calls, one for the user and one for the user session.
Can somebody give me a hint? thank you.
Finaly i found an answer thanks to this blog:
http://madsdevblog.blogspot.com/2011/02/eager-loading-ef4-entities-with-ria.html.
But for short i was trying to eager load the the User object and in order to do that in EF4 you must do these steps:
Step I. Disable eager loading
"1. Double click on your .edmx file in the solution explorer
2. Right click anywhere in the white space and click "Properties"
3. In the properties window, set "LazyLoadingEnabled" to false.
You will then see that in the generated file, the following line will be added:
this.ContextOptions.LazyLoadingEnabled = false;
"
Step II. Use Include in the linq query (step which i already do)
Step III. Add the [Include] attribute to the navigation properties
"1. Locate the section where Navigation Properties are set
2. Add [Include] as an attribute beneath the [DataMember()] attribute
3. Add using System.ServiceModel.DomainServices.Server; to the using section in the template.
4. Save and run the template.
"

Resources