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
Related
I'm working with a hospital where we are implementing a web-application that is triggered from their own hospital information system (HIS).
The way the app works is that in their HIS, they select a patient and call the web-app with the patientId in the url.
Regarding patient safety, they want only one of those tabs open at the same time.
So if a second patient-tab is opened, the first one should be closed ..
Is this possible? And if it is, how?
Edit following danday74's answer
The url from the HIS is triggered via command line arguments (SAP system).
Firefox "http://url_to_webpage/"
when you link to the patient tab do this ...
<a ng-href="/your/patient/url" target="patientTab">open new patient tab</a>
When the link is clicked it should open the page in a new tab called "patientTab" - if another link is clicked with the target patientTab then it will use the existing "patientTab" - just make sure all your anchor tags that use the patientTab have the target set.
hope that does the job for you :)
So for the people that have a similar problem, the way we fixed it was the following:
On the init script for the page, we check if a session variable tab-token is found and if it contains a UUID
If the variable is not found, it means that no other open tab is found and we leave the tab active + create the variable and store a generated UUID in it
If a UUID is found, that means another tab is also active and we show a screen overlay with the message that another active tab was found
We watch on every change in the session variable and update the screen overlay whenever and wherever it needs to.
It is not a fool-proof solution, but in the context and usage of the application, it is sufficient ..
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
I'm trying to use AngularJS and Angular-UI-Bootstrap to create a WebApp but as I'm rather new with all this, I need some help. I'm using ng-repeat and an array to create a Tab interface.
Depending on an action in the first Tab, a second Tab is added to the interface or should be refreshed if it's already open. I've got the Tab working and have a check to make sure it isn't added again when it's already open.
The basic structure is the following: One controller (TabController) to control the Tab interface, and one controller (Tab1 and Tab2) for each Tab that's added to the interface.
Now, I have the following problem, the content of the second tab should change depending on data changed in the first tab. When the user confirms the data in the first tab, I execute a function in the TabController (to add / activate the second tab) that also changes some data in the scope. I can't seem to be able to detect the change in this data in de second tab, I've created a watch for the field, but it's only fired the first time the tab is loaded. If I use the field itself, the data is changed, but the watch doesn't fire. Anyone got an idea how I can get this to work? The data that changes should be used to make changes to other information, that's the reason I'm trying to use a watch and execute a function...
I've created a Plunker that should demonstrate in a simple example what the problem is and what I'm trying to do (I hope...)
DEMO
On the first Tab, there is a button to add a second tab (or activate it), as an example, I just increase a count that's displayed on both tabs. On the second tab, I have a local field on the scope that I fill with the global field using a $watch.
When starting the first time, the global count is one, after adding the second tab, both the global as the local count on the second tab are 2. When I go back to the first tab and click the 'Add tab' button again, the global count on both tabs is 3, but the local count on the second tab remains 2 and the watch isn't fired.
As I'm new to Angular (and web programming) I might be trying to do something that goes against all the best practices, so if someone has a better / different way to do what I'm trying to do, feel free to make any suggestions.
Your watch expression was incorrect, the correct expression would be
$scope.$watch("tabCount",
function() {
$scope.localCount = $scope.tabCount;
})
}
instead of
$scope.$watch($scope.tabCount,
The first one means you want to watch on a variable tabCountdefined over the scope.
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.
"
I cannot find where in the salesforce.com UI I can add a trigger on a file attachment. I can find triggers on almost everything else, but attachment seems to be missing from the list (even when I view source on the page and search it. Does anyone know WHERE I can put this trigger in?
There is no way to do it directly as Attachment is one of those "lesser" objects that salesforce really gets "protective" about in a random and biased way. The only "legit" way to do it is to use some external build&deploy tools such as Force.com IDE.
If however you are not a stranger to undocumented 'hacks' do the following. Go to any object's trigger list and click create new. In the URL locate entity query string parameter (e.g. entity=Case) and change it to Attachment (entity=Attachment) and press Enter. Newl loaded screen will accept Attachment trigger.
Using Eclipse (Force.com IDE plug-in), right-click on your project & select "New" > "Apex Trigger". In the dialogue window that pops up, there is an "Object" dropdown / picklist, choose the object you want from this list - "Note" or "Attachment" etc. - then choose the "events" you want to trigger to execute on.
NOTE: a best practice is only one (1) trigger per object since you cannot guarantee the order in which multiple triggers on the same object will execute.
Have you tried creating the trigger from, force.com IDE??
In my opinion it should be possible from there.
To write a trigger for attachment, there is no straight way to do it but you can do it.
By creating a trigger on other object for example create a trigger in contact object then the url of the current page shows
"https://ap1.salesforce.com/........./&entity=Contact" you have to change "entity=Attachment"
then the trigger will be created for attachment object.