Pass the "code" of the Highlighted Row of a List Of Values from Popup
I have a popup window which display a list of values in a tabular form. I have no problem to do the popup or display the table.
The table has two columns; one is the "code" and the other is the "description".
When a row is highlighted and the "SELECT" button is clicked, I am supposed to pass the "code" of the highlighted row back to the parent window. And I am struggling with it.
Here is my backing bean code:
import javax.faces.model.DataModel;
import javax.faces.model.ArrayDataModel;
import delegates.GenderBean;
publicclass GenderTypesManagementBean
{
private String code;
private String description;
private String selectedGender;
privateint rowIndex = -1;
private ArrayDataModel genderModel =null;
privatestaticfinal GenderBean[] genderTypes =
{
new GenderBean("F","Female"),
new GenderBean("M","Male"),
new GenderBean("U","Unknown"),
};
public GenderTypesManagementBean()
{
genderModel =new ArrayDataModel( genderTypes );
}
public DataModel getGenderTypes()
{
return genderModel;
}
public String getCode(){
return code;
}
publicvoid setCode(String code){
this.code = code;
}
public String getDescription(){
return description;
}
publicvoid setDescription(String description){
this.description = description;
}
public String getSelectedGender(){
return selectedGender;
}
publicvoid setSelectedGender(String selectedGender){
this.selectedGender = selectedGender;
}
public String select()
{
// need help
return"success";
}
}// End GenderTypesManagementBean.java

