ADFDeveloper - Applied - #69 Code Corner - LOV Using Bounded TaskFlows
Just as an add-on to my post, I decided to make it one step tricker by introducing a cascading effect in my List-of-Values where data comes from a WebService.
What I'm using is a DropDown of Locations and only Locations which as Departments (since we don't want empty results now hehehe). Of course, we don't want to get lazy now so I also made this DropDown to also use a WebService, and to improve performance, I keep the initial fetch in a ViewScope bean.
Default View |
Location DropDown |
I also modified the LOV to show the Location registered for the Department, for clarity hehe.
List of Values |
The add-on was pretty straightforward, just include it as parameter in the setPropertyListener upon launch of LOV.
TaskFlow |
One extra thing that needed to be handled though was the validation. This time around we're not just validating to whether the departmentId is valid, but rather the departmentId needs to be valid based on the set locationId as well.
This part can be implemented in a number of ways, but I chose to add the attribute as part of the validating component.
And there you have it! 2 layers of LOV that relies on a WebService datasource.
Can you share the code?
ReplyDeleteWhat I am looking for is an example that is using an EJB to supply the list of values in the popup.
Hi Max,
ReplyDeleteWhat part of the code are you looking for? In my example, I am using a WebService.
If you notice in my class call at initialize list in DepartmentLovPb which can be viewed in http://adfdeveloper.blogspot.com/2011/03/applied-69-code-corner-lov-using.html, I am calling a retrieve which is basically just a wrapper call for a webservice to retrieve data which can be any generic collection.
Basically, the idea is not how to get data, but how to use data since from my retrieve method call, I can use BC4j or any datasource as long as i convert it into a Map as my generic object holder.
I hope this helps.