wood burning stoves 2.0*
The moose likes JSF and the fly likes Arul Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Arul" Watch "Arul" New topic
Author

Arul

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.

please Anybody reply me...
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Please Use a Meaningful subject line
so that people will understand what your problem is.
Also use code tags to post your code.
Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
And please you code tags, so the people can read your code!


SCJP6
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Arul
 
Similar Threads
double click in textfield into the dynamic table open popup page and also get that rowkey and column
Dynamic TaleColumn
DataTable: No items found error
onDoubleClick Textfield into the dynamic Table-Get correspond row and column-UsinD VisualjSF
jsf ui:table component is not supported for different browser