Question

I'm starting with Oracle ADF. I'm trying my first examples with basic components.

Starting from classic HR schema for Oracle ADF (Departments, Employees, Regions, Countries, etc.), I drop a SelectOneChoice for DepartmentsView1, and then I drop a SelectManyCheckbox for related EmployeesView3.

enter image description here

So, the data are well matched and, all employees from selected department are displayed.

Well, my two questions are:

  1. How can I preselect all checkboxes in the SelectManyCheckbox componente? I need that all related employees were preselected.
  2. If I had an input text box, a button and a SelectManyCheckbox component, how can I bind typed value in input box to the query (View Object) and then list the result in the SelectManyCheckbox component?

Maybe they are very basic questions, but I've recently started with Oracle ADF, coming from Java Spring Framwork and I'm changing the problem and programming approach and my mind too.

Any help is very appreciated, because this is a great change for me.

Was it helpful?

Solution

  1. For your first question you've asked, you need to get the binding (and cast it to JControlListBinding) of the selectManyCheckbox from the bindings and set its selected values via setSelectedIndices method.

    If you want them all to be preselected, you can iterate through all values, find their indexes, put them in an array and then pass as a parameter to the setSelectedIndices method.

  2. For the second one,

    I have no idea about the reason behind such an operation, but i guess you could create an appropiate Row with the value the has been typed in to the box, then you could add it to the RowSet (via createRow() method of the ViewObjectImpl.) that is bound the selectManyCheckbox.

Maybe because of my rookieness, I don't think that the questions you've asked can considered to be basic. :)

Bonne chance in your ADF adventure by the way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top