Developer's Forum
~: Neelmani Welcomes You :~  
  Home
  Profession
  Java :: FAQ
  Ejb : FAQ
  JSP :: FAQ
  JSF :: FAQ
  BPEL :: FAQ
  ADF
  XML
  Web Services
  Application Server Vs Web Server
  API : Faces/AdfFaces
  DataBase
  MVC
  Codes
  => Deployment: ADF Application
  => ADF: Search
  => Returning Values from Popup
  Hr Questions
  Online Classroom
  Career
  Login Page
  Results
  My Location
  Contact
Returning Values from Popup

How to get a comma-separated list of clients by doing a multi-select from an LOV dialog:

1. go to faces-config.xml

2. Search Page: Add search.jspx and create the page where you have an input box and a command button

3. LOV Dialog Page: Add lov.jspx and create a page

a. drag and drop the view from datacontrol palette to add an ADF table

b. through the table facets->selection of af:table in the structure pane, add the af:tableSelectMany

c. through the table facets->action of af:table in the structure pane, add a command button for the table

4. Using the ADF Dialog Framework: Inside the faces-config, add a jsf navigation case from the search page to the dialog, when the action is dialog:lov

5. Inside the search.jspx, add

a. partialTriggers="commandButton1" property for the input text box (InputText1)

b. action="dialog:lov", partialSubmit="true", returnListener="#{backing_search.returned}", useWindow="true" properties for the commandButton (commandButton1)6. Inside the backing bean search.java, add the following code to enter the returned value into the text box:

public void returned(ReturnEvent event){

if (event.getReturnValue() != null){

getInputText1().setSubmittedValue(null);

getInputText1().setValue(event.getReturnValue());

}

}

 

action="#{backing_lov.submit_action}"

8. Inside the lov.java (backing bean), enter the following code for the submit_action method

public String submit_action() {

// Add event code here...

Set selected;

StringBuffer selectedConsultants = new StringBuffer("");

 

CoreTable myTable = this.getTable1();

selected = myTable.getSelectionState().getKeySet();

for (Object rowKey: selected) {

myTable.setRowKey(rowKey);

Row rwdata = ((JUCtrlValueBindingRef) myTable.getRowData()).getRow();

// Include comma before the value only if there are existing values

if (selectedConsultants.length()==0){

selectedConsultants.append(rwdata.getAttribute(0));

} else {

selectedConsultants.append(","+rwdata.getAttribute(0));

}

}

System.out.println(selectedConsultants);

AdfFacesContext.getCurrentInstance().returnFromDialog(selectedConsultants, null);

return null;

}

 

This code will require some missing imports to be added so it works correctly.

 
7. Inside the lov.jspx, for the commandButton, add the action property
Login
 
 
Username:
Password:
 
Free Download
 
  >Free Download :: JDeveloper 10.3.X

>Free Download :: Oracle 10g

>Free Download :: Microsoft SQL Server 2008

 
Download Tutorial
 
  > SOA Best Practices: The BPEL Cookbook

>Tutorial : Oracle Application Server

>Tutorial : JDeveloper
 
 
 

Xsys Software Technologies.
The Best Center for Training & Project Work in Bangalore.
 
Today, there have been 5 visitors (7 hits) on this page!...By Neelmani
This website was created for free with Own-Free-Website.com. Do you want your own website too?
Register for free