This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSF and the fly likes double click in textfield into the dynamic table open popup page and also get that rowkey and column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "double click in textfield into the dynamic table open popup page and also get that rowkey and column" Watch "double click in textfield into the dynamic table open popup page and also get that rowkey and column" New topic
Author

double click in textfield into the dynamic table open popup page and also get that rowkey and column

arul radhakrishnan
Greenhorn

Joined: Jul 22, 2009
Posts: 3
Hai i have created dynamic table and column also but
like this-i am writing code
FacesContext facesContext = FacesContext.getCurrentInstance();
Table table = new Table();
table.setId("table1");
table.setTitle("Dynamically Created Table");
// Create the Table Row group dynamically
TableRowGroup rowGroup = new TableRowGroup();
rowGroup.setId("rowGroup1");
rowGroup.setSourceVar("currentRow");
rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{JSP$AcademicPerformance$EnterMarksStudentSectionwise.tab_section_enrollmentDataProvider2}"));
Integer x=(Integer)getSessionBean1().getStuIdList().size();
rowGroup.setRows(x);
// Add the table row group to the table as a child
table.getChildren().add(rowGroup);
// Create the first table Column
TableColumn tableColumn1 = new TableColumn();
tableColumn1.setId("tableColumn1");
tableColumn1.setHeaderText("Roll No");
// Add the first table Column to the table row group
rowGroup.getChildren().add(tableColumn1);
// Create the Static text and set its value as TRIPID
StaticText staticText1 = new StaticText();
staticText1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['SE_ROLL_NO']}",Integer.class));//String.class
// Add the static text to the table column1
tableColumn1.getChildren().add(staticText1);
TableColumn tableColumn2 = new TableColumn();
tableColumn2.setId("tableColumn2");
tableColumn2.setHeaderText("Student Id");
rowGroup.getChildren().add(tableColumn2);
StaticText staticText2 = new StaticText();
staticText2.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['STU_ID']}",Integer.class));//String.class
tableColumn2.getChildren().add(staticText2);
TableColumn tableColumn3 = new TableColumn();
tableColumn3.setId("tableColumn3");
tableColumn3.setHeaderText("Student Name");
rowGroup.getChildren().add(tableColumn3);
StaticText staticText3 = new StaticText();
staticText3.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['SE_REMARKS']}",String.class));//String.class
tableColumn3.getChildren().add(staticText3);

attypeName1=(ArrayList<String>)getSessionBean1().getAttypeNameList();
maxMark=(ArrayList<Integer>)getSessionBean1().getMaxMarkList();

for(int k=0;k<attypeName1.size();k++){
TableColumn tableColumn4 = new TableColumn();
tableColumn4.setId("tableColumn"+(k+1));
tableColumn4.setHeaderText(attypeName1.get(k)+":"+maxMark.get(k));
rowGroup.getChildren().add(tableColumn4);

TextField textField1=new TextField();
textField1.setId("textField"+k);
textField1.setConverter(ddBrnIdConverter);
textField1.setOnDblClick("window.showModalDialog('http://localhost:8080/School/faces/JSP/AcademicPerformance/PopupStudentSectionwise.jsp'); return true;");
textField1.setText(" ");
if(k == 1){
textField1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['BR_ID']}",BigDecimal.class));
}else if(k == 2){
textField1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['BR_ID1']}",BigDecimal.class));
getSessionBean1().setAtTypename(null);
getSessionBean1().setAtTypename(attypeName1.get(k));
}else if(k == 3){
textField1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['BR_ID2']}",BigDecimal.class));
getSessionBean1().setAtTypename(null);
getSessionBean1().setAtTypename(attypeName1.get(k));
}else if(k == 4){
textField1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['BR_ID3']}",BigDecimal.class));
}else if(k == 5){
textField1.setValueExpression("text", facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{currentRow.value['BR_ID4']}",BigDecimal.class));
}else{
System.out.println("hhhhh");
}
tableColumn4.getChildren().add(textField1);



}

return table;
--------------
I need when i double click in textfield open popup page and also get that
correspond rowkey and column.
 
jQuery in Action, 2nd edition
 
subject: double click in textfield into the dynamic table open popup page and also get that rowkey and column
 
Similar Threads
Arul
jsf ui:table component is not supported for different browser
DataTable: No items found error
onDoubleClick Textfield into the dynamic Table-Get correspond row and column-UsinD VisualjSF
Dynamic TaleColumn