What is use of isExecuted() in ADF ViewObjectImpl class - oracle-adf

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

Related

React+Redux+Asynch: data loading cascade, start the following after the previous complete

Having not much experience in ReactJS currently trying to solve components cascade loading. Let me explain use case on an example.
Assume we have 3 comboboxes - Author, Book, Library.
Something triggers loading Author data -> When data is loaded, the first found author is automatically selected and is used as search criteria for the second combobox(Book) -> When all books of the selected Author is loaded, the first found book is selected. The selected Author and Book are used as search criteria for the 3rd combobox(Library) - after library is found select the first in the list.
Data is loaded using 'cross-fetch'.
Internal component is built from 3 "Select"(comboboxes) controls. Initially, an internal
implementation of 'Select' React control is used but the flow was
checked with react-select library as well. In both cases the
initialization of comboboxes looks similar:
<Select
options={authors}
value={selectedAuthor}
onChange={this._authorChanged}
/>
react-redux#connect maps state to props
So the questions is:
how properly and what is a proper place to catch "data loading is complete" events so that the next planning loadings may be initiated?
What I did/thought about:
I can detect in render() method that it is time to start the following data loading but as I learned it is not a good solution(we better not to do any operations other than required for rendering inside the method).
Theoretically, I can build loading chain from my actions but at the moment I do not like the idea as:
despite load method is currently used only for the initializaion of combobox later I want to reuse it in other places where next loading is not needed;
currently for me this does not look consistent when data load is not fired by ui events
I thought setting default selected value value={selectedAuthor}
during initialization would fire onChange event but it seems not true(at least in my case).

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.

Common Exposed filter for each tab in drupal 7

I have different fields and showing in different blocks, and want to apply exposed filter to all but my problem is it shows different exposed filters for each different block. I want to make it common for each block.
Below are the steps,
I made 5 blocks to be displayed for each buttons.
Added exposed filter for languages for each block.
Now each block showing its different exposed filter.
But I want the exposed filter should be shown above the buttons and should work for each block display. Attached screenshot for the issue.
I installed Views Global Filter but is gives Session error.
I was just about to suggest the Views Global Filter.
Another way is to set a contextual filter on all your blocks that pulls from the url, so they each pull the same value.
This is an active issue in the views issue queue, with a few people who have made it work:
https://www.drupal.org/node/1587894
Comment #6 has some simple code, and that would be applied here
https://www.drupal.org/node/1871388
After 3 days, I haven't found the solution, even by programmatically.
Then what I had the last option(in my mind, huh) is,
I get all the fields in one block only, not creating the different blocks for different tab or buttons.
Used the description of Better Exposed Filters, in which I pasted my buttons/tab UI HTML as its.
Now on changing the language all the fields are fetched according to the selected language. But in this case my active tab/button get lost its activeness.
Now, I need to get the last active tab/buuton, so that I can click it again to get the active tab after filtering my languages.
Below is the piece of code which is need to my js file.
// Active target element to make the tab/button active after
// ajax responds in filter
var activeTargetElement;
Drupal.behaviors.events = {
attach: function (context, settings) {
$('#views-exposed-form-MY_VIEW_MACHINE_NAME-BLOCK_NAME', context).ajaxStart(function () {
// my tabs/button are active on the basis of data-target attribute,
// so need to memorise which tab/button is active before fitering any language
activeTargetElement = $('#MY_TABS li.active a').data('target');
}).ajaxSuccess(function () {
// if any target is memorised, then simply click it or trigger a click event for it
if($('[data-target="'+activeTargetElement+'"]').length){
$('[data-target="'+activeTargetElement+'"]').click();
}
});
}
};

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

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

Want to display results of a callout

When a user 'Saves' a Contact (for example), whether it's new or just updated, I need to:
Do an external callout using one of the Contact field values as a lookup
Display the results of the callout, so the user can make a selection
Update the Contact based on the user's selection display the updated Contact
I have found two aproaches, but have reached a point in both that I need to resolve.
Trigger Based Method
In the 'after' trigger pass the lookup string to a callback.
Update the Contact with the selection
Issues
How do you pass the lookup string or results to a visualforce page to display the lookup results?
When the user makes the selection and the update has been done, how do I move back to the updated contact?
Override Base Method
I found a discussion here that seems to suggests using overriding & redirection to someone asking about 'Edit'. I think this could also be done with the 'Save' button.
Issue
This is meant to be a deployable sollution, so I think that the override has to be set in code (I'm using the IDE) and not via Setup (or am I wrong?). I can't find out if this is possible or how to do it
Sorry for detailed question. Didn't want to just ask the wrong question (i.e. assume I know the best approach).
Thanks...
For the trigger-based method, you cannot change the built-in Save functionality, but (per your second solution) you can override the Edit button and recreate the Edit page with Visualforce, which would give you full control over the Save button and how you handle the callout and redirecting.
The release notes for Spring '10 indicate that standard-button overrides are now available for packaging, as they can be created through the Metadata API.

Resources