Imagine this situation: in an input form you need to be able to pass a value from one of several LOVs to the same text field. Using JHeadstart, it’s easy to generate a messageLovField to which one LOV page is assigned. But you need more than one. How can this be done?
The Oracle ADF UIX Developer’s Guide contains a chapter on LOV pages. Using the info in this chapter, along with the UIX code generated by JHeadstart, I ended up with this next solution for assigning three buttons to three different LOV pages and making sure one inpuit field is updated by all of them.
First of all, in JHeadstart I created three LOVs based on nearly the same query. The only difference between them is the value of one query bind parameter which determines what is contained in the LOV. Next I used the code in the section about the lovOpenWindowAction Client Action in chapter 11 of the ADF UIX Developer’s Guide.
The code, it says there, to use a button to launch an LOV is this
Looking at the code generated for one of my LOVs, I copied over one parameter set to the messageLovInput in the generated UIX page. This parameter is called “destination”. My button tag now looked like this:
Please note the four lines starting with the “destination” keyword need to be on one line. Next, modify the targets value to point to the input field you’d like to update and modify the input field to be a messageTextInput and you’re done.
In my case, I also needed to update several other field in my table, depending on the value of the input field. So, I copied over the value of the partialTargets parameter over to the targets parameter in my button tag, and I was done:
Some remarks: the buttons are all referring to different Struts actions, depending on the LOV they need to bring up. Besides that, I had to put the buttons in the same table column as the field they needed to update, else the connection between them was lost. Since our table only allows updating a row when it is new, I wanted not to show the buttons if the row is readonly. Hence the “rendered” parameter in the button tag. Notice the “!” in the EL expression!
So, here are some screenshots to illustrate the three LOV windows. The first image illustrates the window that pops up when the “Plan Element” button is clicked.
The second image shows the window that pops up when the “Catalogus Element” button is clicked.
The third image shows the window that pops up when the “Nieuw Element” button is clicked.
Finally, here’s an image that shows the availability of the buttons. They only appear in the row where a new element can be added.