Saturday, December 15, 2012

Master Form Detail Multi Select Shuttle Pattern




Below Example demonstrates having Master Form with detail as Multi Select Component.

      1.       Data Model. Each Employee can have one or more skills. All possible skills are stored in SKILLS table. Each employee skills are stored in EMPLOYEE_SKILL.

This example user Oracle default HR Schema, additional tables can be created from SelectManyShuttle\DB\database\XE\CreateSchema.sql. File is available in the application zip.

      2.       Setup the Application Module Data Model as below.




      3.       From the Data Control Panel drag and drop the Employee -> EmployeeSkill as ADF Master Form, Detail Table as below



        4.       Create a request scope Bean and add setter and getter method as below



      5.       Now to create a List of all skills add a Table binding. Go to page bindings tab, click the add under bindings. Select tree. Add a new root data source. Select Skills view object. Select the Add Icon and Add Rule. Select SkillId, SkillName as Display attributes.




       6.       Delete the skills table, and a SelectMultiShuttle component. Bind the value to bean property. To dynamically create a selectItem list, we’ll use a forEach loop.


      7.       For the current employee the available skills should get defaulted to employee skills from EMPLOYEE_SKILL table, accordingly when the items are updated the rows need to get added/removed accordingly. We’ll add the logic in setters and getters to achieve this.


        8.       Download the complete example here.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...