JSF dataTable dynamic columns Problem

Hello everybody,
I'm trying to display a table with a dynamic number of columns. I found only 1 topic on the matter and tried it out.
The JSP Page has this tag:
<h:dataTable      binding="#{ViewBean.dataTable}"
     value=     "#{ViewBean.tableRows}"
     var=     "#{row}" />
My "viewBean" contains the following code:
In constructor:
dataTable = new UIData();
//This one contains a simple list of 10 integers so that 10 rows are rendered, just for testing.
public ArrayList getTableRows ()
     ArrayList lst = new ArrayList();
     for (int n=0; n<10; n++) {
     lst.add(new Integer(n));
     return lst;
//Now my databinding thingy:
public UIData getDataTable()
UIColumn col;
UIOutput out = null;
Application app = app = FacesContext.getCurrentInstance().getApplication();
int colCount = 3;
     for(int j = 0; j < colCount; ++j) {
out = new UIOutput();
col = new UIColumn();
ValueBinding vb = app.createValueBinding("#{" + j + "}"); //just a simple expression with nothing difficult in it.
out.setValueBinding("value", vb);
out.setRendererType("Text");
col.getChildren().add(out);
dataTable.getChildren().add(col);
     return dataTable;
Now the error I get:
[com.sun.faces.el.ValueBindingImpl] getValue(ref=ViewBean.tableRows)
[com.sun.faces.el.VariableResolverImpl] resolveVariable: Resolved variable:biz.mbisoftware.ep.view.ListView@ee0373
[com.sun.faces.el.ValueBindingImpl] getValue Result:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[com.sun.faces.el.ValueBindingImpl] -->Returning [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[com.sun.faces.renderkit.html_basic.HtmlBasicRenderer] Begin encoding component _id2
[com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer] component.getValue() returned Name
[com.sun.faces.renderkit.html_basic.HtmlBasicRenderer] Value to be rendered Name
[com.sun.faces.renderkit.html_basic.ButtonRenderer] Begin encoding children _id0
[com.sun.faces.renderkit.html_basic.HtmlBasicRenderer] Begin encoding component _id3
[com.sun.faces.el.ValueBindingImpl] getValue(ref=1)
[com.sun.faces.el.ValueBindingImpl] getValue Result:1
[com.sun.faces.el.ValueBindingImpl] -->Returning 1
[com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer] component.getValue() returned 1
[com.sun.faces.application.ApplicationImpl] Created converter of type javax.faces.convert.LongConverter
[com.sun.faces.renderkit.html_basic.HtmlBasicRenderer] Value to be rendered 1
[com.sun.faces.taglib.html_basic.DataTableTag] id: null class: com.sun.faces.taglib.html_basic.DataTableTag
java.lang.NullPointerException
...long traceback...
Anyone has an idea what happened, or why it's not working? I have no clue.
Thx for your time.
Bjoern

Hello derBjoern,
First off, it's not valid to have an expression in the value of the var
attribute. "var" should just be a String.
Secondly, there are some typos in your sample, perhaps these were
introduced during posting to the forum, but I had to remove them to get
it to run for me.
* "app = app ="
* There is no "Text" renderer type in the standard RenderKit. The
proper name is "javax.faces.Text". (The error message is terrible
here).
Once I did that. It worked using the latest build from java.net.
Here is the revised getDataTable() method.
public UIData getDataTable()
     UIColumn col;
     UIOutput out = null;
     Application app = FacesContext.getCurrentInstance().getApplication();
     int colCount = 3;
     for(int j = 0; j < colCount; ++j) {
     out = new UIOutput();
     col = new UIColumn();
     ValueBinding vb = app.createValueBinding("#{" + j + "}"); //just a simple expression with nothing difficult in it.
     out.setValueBinding("value", vb);
     out.setRendererType("javax.faces.Text");
     col.getChildren().add(out);
     dataTable.getChildren().add(col);
     return dataTable;
The output I received was:
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
0      1      2
Ed (JSR-252 Spec co-lead)

Similar Messages

  • Question about jdbc and jsf datatable

    hello
    I was wondering whether it was a correct way :
    -retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.
    or
    Is there any better way I can speed up retrieving data from databse ?
    regards

    orkun wrote:
    I was wondering whether it was a correct way :
    -retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
    Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware.

  • Dynamic columns in ADF Table don't work as they do in dataTable

    Hello!
    I've tried the sample from http://forum.java.sun.com/thread.jspa?forumID=427&threadID=560252 and all is working perfectly fine.
    Since my company has decided to go with ADF I've tried to port this sample to ADF. However I am experiencing one major problem. The dynamically created columns all have the same ID in different rows. That's why only the last row displays the correct values. Has anyone tried to port the sample from the JSF Forum to the ADF Table and succeeded? Is there a way to manipulate the IDs manually and if so, where do we do it?
    Any help would be greatly appreciated.

    The Develop the JSF/Tiles Application section explains the procedure to dynamically bind column values to a JSF data table. ADF JSF table column binding is similar to the JSF datatable.
    http://www.oracle.com/technology/pub/articles/vohra_tiles.html

  • JSF dataTables - Problem during retrieving data from bean

    Hi, Below is the Stack Trace got on displaying data using JSF datatables.
         This error occurs somtimes and is not very frequent.We are using jboss seam, jboss-4.0.5.GA server and Hibernate.
         Anyone knows about this problem and how it can be resolved?
         Thanks in advance
         javax.faces.el.EvaluationException: Cannot get value for expression '#{loc.companyName}'
              at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
              at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
              at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:508)
              at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:433)
              at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
              at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
              at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
              at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
              at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
              at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:54)
              at org.apache.jsp.menu_jsp._jspx_meth_h_panelGrid_0(menu_jsp.java:225)
              at org.apache.jsp.menu_jsp._jspx_meth_f_subview_0(menu_jsp.java:118)
              at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:87)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
              at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
              at org.apache.jsp.finish_005fregistration_jsp._jspx_meth_h_form_0(finish_005fregistration_jsp.java:263)
              at org.apache.jsp.finish_005fregistration_jsp._jspx_meth_f_view_0(finish_005fregistration_jsp.java:139)
              at org.apache.jsp.finish_005fregistration_jsp._jspService(finish_005fregistration_jsp.java:93)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
              at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
              at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
              at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
              at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at com.kmedia.filter.RequestFilter.doFilter(RequestFilter.java:184)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)
         Caused by: java.lang.NullPointerException
              at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:620)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
              at org.jboss.seam.jsf.SeamApplication11.getPropertyResolver(SeamApplication11.java:197)
              at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
              at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
              at org.apache.commons.el.BinaryOperatorExpression.evaluate(BinaryOperatorExpression.java:154)
              at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
              ... 70 more
         10:23:55 Servlet.service() for servlet jsp threw exception
         Also check the JSF page, Backing bean, and VO
         JSF page
         <h:dataTable value="#{finishedRegistrationBean.list}" var = "loc" >
                        <h:column>
         <f:facet name="header">
                        <h:outputText value="#{displaymessages.registrationDate}" />
                        </f:facet>
                        <span class="bodylighttext"> <h:outputText value="#{loc.registrDate}" /> </span>
                                                                                                   </h:column>
                        <h:column>
                        <f:facet name="header">
                        <h:outputText value="#{displaymessages.companyName}" />
                        </f:facet>
                        <span class="bodylighttext"> <h:outputText
                        value="#{loc.companyName}" /> </span>
                        </h:column>
                        <h:column>
                        <f:facet name="header">
                             <h:outputText value="#{displaymessages.Address}" />
                             </f:facet>
                        <span class="bodylighttext"> <h:outputText
                        value="#{loc.address}" /> </span>
                        </h:column>
                        <h:column>
                        <f:facet name="header">
                        <h:outputText value="#{displaymessages.Action}" />
                        </f:facet>
                        <h:commandLink target="_blank"
                        action="#{finishedRegistrationBean.viewFinishedRegistrationPage(loc)}">
                        <h:graphicImage value="images/view_icon.gif"
                        alt="#{displaymessages.info_tooltip_view}"
                        width="17" height="17" style="border:0" />
                        </h:commandLink>
                        </h:column>
    </h:dataTable>
    Backing bean
                        @Name("finishedRegistrationBean")
                        public class FinishedRegistrationBean {
                             @In
                             private User user;
                             @In
                             private FacesMessages facesMessages;
                             private List<FinishedRegistrationVO> list;
                             public FinishedRegistrationBean() throws KMException {
                                  filterFinishedRegistration();
                             public void filterFinishedRegistration() throws KMException
                             list = new ArrayList<FinishedRegistrationVO>();
                             finished_list = userDAO.searchFinishedRegistrationDetails(country_code,uniqueID, companyName, user.getUserName());
                             public void setList(List<FinishedRegistrationVO> list) {
                                  this.list = list;
                             public List<FinishedRegistrationVO> getList() {
                             return list;
    FinishedRegistrationVO
         public class FinishedRegistrationVO {
              private String uniqId;
              private String companyName;
              private Date registrDate;
              private String address;
              public String getCompanyName() {
                   return companyName;
              public void setCompanyName(String companyName) {
                   this.companyName = companyName;
              public String getAddress() {
                   return address;
              public void setAddress(String address) {
                   this.address = address;
              public String getUniqId() {
                   return uniqId;
              public void setUniqId(String uniqId) {
                   this.uniqId = uniqId;
              public Date getRegistrDate() {
                   return registrDate;
              public void setRegistrDate(Date registrDate) {
                   this.registrDate = registrDate;
         }

    Could you please post your
    -HBM
    -faces-config.xml

  • Dynamic columns in datatable...

    Hi guys,
    i've a question about datatable.
    I have to use datatable for inserting data into db.
    My question is:
    I'm developed a datatable with 5 columns and various rows,i've create an actionlistener and when i click it each row is successfully inserted.
    Now i want adding some columns to datatable depending by a number inserted by user.
    That is:
    the user inserts 3(for example) and the user sees in another page
    the datatable with the 5 fixed columns and others 3 columns...
    Clicking the actionListener i want the 5 columns values were inserted in a table(and it's easy) and the others variable column's number were inserted as different row in another table...
    excuse me for my english....i try an example....
    This can be one row
    giuseppe napoli milano italia europa ---variable(age address sex)----i want giuseppe napoli milano italia europa is inserted as a row in user table and age,address,sex are inserted as different rows into details table....
    i want knowing how ciclying among dynamic different columns values and inserting each value as a different row....
    thanks very much,please help me with code or ideas...

    thanks...
    but my problem is this:
    i've create a populate method that has to add dynamic column,i've supposed a fixed value,3, to my existing datatable.
    public HtmlDataTable populateMyDataTable() throws Exception{
              getBiosampleDataTable();
              for (int i=0;i<2;i++){
                   //UIOutput header = new UIOutput();
                //header.setValue(headers);
    // Set output.
    UIInput output = new UIInput();
    ValueBinding biosampleItem =
    FacesContext
    .getCurrentInstance()
    .getApplication()
    .createValueBinding("#{biosampleItem[" + i + "]}");
    output.setValueBinding("value", biosampleItem);
    // Set column.
    UIColumn column = new UIColumn();
    //column.setHeader(header);
    column.getChildren().add(output);
    // Add column.
    biosampleDataTable.getChildren().add(column);
    setBiosampleDataTable(biosampleDataTable);
              return biosampleDataTable;
    i've
    public HtmlDataTable getBiosampleDataTable() throws Exception {
              loadBiosamples();
              return populateMyDataTable();
         }and
    public void loadBiosamples() throws Exception {
              if (load==0){
              for (int i = 0; i < nrows; i++) {
                   Biosample biosample = new Biosample();
                   biosamples.add(biosample);
                   setBiosamples(biosamples);
                   load=1;
              else
                   setBiosamples(biosamples);
         where is my error?
    I'vejavax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Exception getting value of property biosampleDataTable of base of type : giu.BiosamplesTableand i'm not sure about my code...can you help me?

  • How to dynamically create a JSF dataTable from a String[][] array

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

  • Problem with jsf DataTable

    when data is fetch using user criteria:
    i have a problem with jsf DataTable. I use e request bean to populate the datatable and i insert a commandButton column. The data dispay successfully into the datatable, but when a push the button on the row...the page simply refresh and notinhg else
    when data is fetch using constants:
    The data dispay successfully into the datatable, when a push the button on the row...the action execute OK

    Hi,
    I don't think that with this description only anybody on this list is able to help you.
    I use e request bean to populate the datatable and i insert a commandButton column
    What is a command button column and what does it do ?
    but when a push the button on the row...the page simply refresh and notinhg else
    What did you do to debug the problem ?
    when data is fetch using constants
    What does this mean ?
    Frank

  • Problem with dynamic columns in smartforms.

    Dear SDN Experts,
    I have a requirement in smartforms for dynamic columns.
    i have used template with 10 columns, So from these 10 columns,Columns may vary monthly MIN 2 to MAX 10 depending on
    readings with them  for that month.
    i cannot fix column headings also,Because headings also changes dynamically.
    So Problem is if there is no data in columns,Columns is displayng empty.
    For EX: In this month i have 2 columns data remaining all columns is displaying empty boxes.
    Please suggest me a solution  is this posible in smartforms if i use table also.
    <removed by moderator>
    Regrds,
    MNR
    Edited by: Thomas Zloch on Sep 11, 2011 3:50 PM

    Hi friend,
    See the link below it is having the solution of hiding the columns in smart forms
    Hide table columns in smart form?
    Create a table to display your values with 12 col and hide the columns based on the idea provided in the link above.
    I think this will solve your issue if you still have queries please revert back to me i will help you.
    Thanks,
    Sri Hari

  • DataTable with dynamic columns

    Does somebody have an example of how to code a h:dataTable with dynamic columns? I have seen hints about how to do it in these two articles:
    http://forum.java.sun.com/thread.jspa?forumID=427&threadID=5218508
    http://forum.java.sun.com/thread.jspa?threadID=577589&messageID=2909047
    but a complete working example would be really helpful.
    I think the key is understanding the "binding" parameter to h:dataTable but I'm having a hard time understanding it. Thanks.

    I found it here:
    http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDatatable

  • JSF Datatable inside a datatable problems

    Hi,
    i am having a datatable with 3 rows mapping to a column in the database table..now i have another datatable inside the previous datatable mapping to another column in the database.... i am able to fetch the values from the database and populate in the 2 datatables.my first datatable has one column and it is a component label.my second datatable has 4 columns..a select many checkboxes,a component label,and 2 text fields.
    Now the problem comes when i need to save the values that are being entered in the datatable..how do i get the values of the checkbox and the textfields and update in the database.and remember i need to get the values of all the components in both the datatables and update in the database...my JSP code and the backing bean codes are as follows.......pls help me with this problem
    JSP Code:
    <h:dataTable binding="#{AttributeSelection.uiTable2}" id="dataTable2" rowClasses="form"
    value="#{AttributeSelection.arrayDataModel}" var="currentRow1">
    <h:column binding="#{AttributeSelection.column5}" id="column5">
    <h:outputText binding="#{AttributeSelection.outputText1}" id="outputText1" value=""/>
    <f:facet name="header"/>
    <h:dataTable binding="#{AttributeSelection.uiTable1}" border="1" headerClass="form_bold"
    id="dataTable1" rowClasses="form" value="#{currentRow1['attributes']}" var="currentRow">
    <h:column binding="#{AttributeSelection.column1}" id="column1">
    <h:selectBooleanCheckbox binding="#{AttributeSelection.checkbox1}" id="checkbox1" value="#{currentRow.checkbox1}"/>
    <f:facet name="header"/>
    </h:column>
    <h:column binding="#{AttributeSelection.column2}" id="column2">
    <h:outputText binding="#{AttributeSelection.outputText3}" id="outputText3" value="#{currentRow['name']}"/>
    <f:facet name="header">
    <h:outputText binding="#{AttributeSelection.outputText4}" id="outputText4"
    style="height: 23px; width: 50%" styleClass="form_bold" value="#{currentRow1['category']}"/>
    </f:facet>
    </h:column>
    <h:column binding="#{AttributeSelection.column3}" id="column3">
    <h:inputText binding="#{AttributeSelection.textField1}" id="textField1"
    style="height: 24px; width: 65%" styleClass="input" value="#{currentRow['defaultMin']}"/>
    <f:facet name="header">
    <h:outputText binding="#{AttributeSelection.outputText8}" id="outputText8" value="Min"/>
    </f:facet>
    </h:column>
    <h:column binding="#{AttributeSelection.column4}" id="column4">
    <h:inputText binding="#{AttributeSelection.textField2}" id="textField2"
    style="height: 24px; width: 65%" styleClass="input" value="#{currentRow['defaultMax']}"/>
    <f:facet name="header">
    <h:outputText binding="#{AttributeSelection.outputText9}" id="outputText9" style="" value="Max"/>
    </f:facet>
    </h:column>
    </h:dataTable>
    </h:column>
    </h:dataTable>
    Backing Bean Code:
    * AttributeSelection1.java
    * Created on January 23, 2006, 10:46 AM
    * Copyright Sidharth_Mohan
    package tpalt;
    import com.equifax.ems.tpalt.order.dao.OrderDataDAO;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import java.util.ArrayList;
    import javax.faces.component.*;
    import javax.faces.model.ArrayDataModel;
    import com.equifax.ems.tpalt.order.model.OrderAttribute;
    import com.equifax.ems.tpalt.order.model.OrderCategory;
    import com.sun.faces.el.MethodBindingImpl;
    import java.util.Iterator;
    import java.util.Map;
    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;
    import javax.faces.el.MethodBinding;
    public class AttributeSelection extends AbstractPageBean {
    * Bean initialization.
    // </editor-fold>
    public AttributeSelection() {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    try {
    } catch (Exception e) {
    log("AttributeSelection Initialization Failure", e);
    throw e instanceof javax.faces.FacesException ? (FacesException) e : new FacesException(e);
    // </editor-fold>
    // Additional user provided initialization code
    protected tpalt.ApplicationBean1 getApplicationBean1() {
    return (tpalt.ApplicationBean1)getBean("ApplicationBean1");
    protected tpalt.SessionBean1 getSessionBean1() {
    return (tpalt.SessionBean1)getBean("SessionBean1");
    // </editor-fold>
    * Bean cleanup.
    protected void afterRenderResponse() {
    }private int __placeholder;
    private HtmlForm form1 = new HtmlForm();
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    public UIData uiTable1 = new UIData();
    * Getter for property uiTable.
    * @return Value of property uiTable.
    public UIData getUiTable1() {
    return uiTable1;
    * Setter for property uiTable.
    * @param uiTable New value of property uiTable.
    public void setUiTable1(UIData uiTable1) {
    this.uiTable1 = uiTable1;
    private UIColumn column1 = new UIColumn();
    public UIColumn getColumn1() {
    return column1;
    public void setColumn1(UIColumn uic) {
    this.column1 = uic;
    private UIColumn column5 = new UIColumn();
    public UIColumn getColumn5() {
    return column5;
    public void setColumn5(UIColumn uic) {
    this.column5 = uic;
    private HtmlOutputText outputText1 = new HtmlOutputText();
    public HtmlOutputText getOutputText1() {
    return outputText1;
    public void setOutputText1(HtmlOutputText hot) {
    this.outputText1 = hot;
    public UIData uiTable2 = new UIData();
    * Getter for property uiTable.
    * @return Value of property uiTable.
    public UIData getUiTable2() {
    return uiTable2;
    * Setter for property uiTable.
    * @param uiTable New value of property uiTable.
    public void setUiTable2(UIData uiTable2) {
    this.uiTable2 = uiTable2;
    private ArrayDataModel arrayDataModel = new ArrayDataModel();
    public ArrayDataModel getArrayDataModel() {
    ArrayList orderList =new ArrayList();
    OrderDataDAO orderData =new OrderDataDAO();
    ArrayList orderCategories = new ArrayList();
    try
    orderList = (ArrayList) orderData.getAllAttributes();
    for (int i =0;i<orderList.size();i++)
    OrderAttribute or =(OrderAttribute)orderList.get(i);
    //or.setCheckbox1(true);
    String category = (String)or.getCategory();
    OrderCategory orderCategory = new OrderCategory();
    ArrayList attributesforCategory = new ArrayList();
    for (int j = i;j<orderList.size();j++){
    OrderAttribute ora =(OrderAttribute)orderList.get(j);
    if (category.equals(ora.getCategory())){
    attributesforCategory.add(ora);
    orderList.remove(j);
    j = i;
    orderCategory.setCategory(category);
    orderCategory.setAttributes(attributesforCategory);
    orderCategories.add(orderCategory);
    //dataTable2Model.setWrappedData(orderCategories);
    arrayDataModel = new ArrayDataModel(orderCategories.toArray());
    catch (Exception ex) {
    return arrayDataModel;
    public void setArrayDataModel(ArrayDataModel dtdm) {
    this.arrayDataModel = dtdm;
    private UIColumn column2 = new UIColumn();
    public UIColumn getColumn2() {
    return column2;
    public void setColumn2(UIColumn uic) {
    this.column2 = uic;
    private HtmlOutputText outputText3 = new HtmlOutputText();
    public HtmlOutputText getOutputText3() {
    return outputText3;
    public void setOutputText3(HtmlOutputText hot) {
    this.outputText3 = hot;
    private UIColumn column3 = new UIColumn();
    public UIColumn getColumn3() {
    return column3;
    public void setColumn3(UIColumn uic) {
    this.column3 = uic;
    private HtmlOutputText outputText4 = new HtmlOutputText();
    public HtmlOutputText getOutputText4() {
    return outputText4;
    public void setOutputText4(HtmlOutputText hot) {
    this.outputText4 = hot;
    private UIColumn column4 = new UIColumn();
    public UIColumn getColumn4() {
    return column4;
    public void setColumn4(UIColumn uic) {
    this.column4 = uic;
    private HtmlOutputText outputText8 = new HtmlOutputText();
    public HtmlOutputText getOutputText8() {
    return outputText8;
    public void setOutputText8(HtmlOutputText hot) {
    this.outputText8 = hot;
    private HtmlOutputText outputText9 = new HtmlOutputText();
    public HtmlOutputText getOutputText9() {
    return outputText9;
    public void setOutputText9(HtmlOutputText hot) {
    this.outputText9 = hot;
    public UIInput textField1 = new UIInput();
    public UIInput getTextField1() {
    return textField1;
    public void setTextField1(UIInput hit) {
    this.textField1 = hit;
    public UIInput textField2 = new UIInput();
    public UIInput getTextField2() {
    return textField2;
    public void setTextField2(UIInput hit) {
    this.textField2 = hit;
    public UISelectBoolean checkbox1 = new UISelectBoolean();
    public UISelectBoolean getCheckbox1() {
    return checkbox1;
    public void setCheckbox1(UISelectBoolean hsbc) {
    this.checkbox1 = hsbc;
    public String save_action() {
    try{
    java.lang.System.out.println("<<<<<<<<<<<<<<<Button Came<<<<<<<<<<<<<<<<<<>>>>>>>");
    java.lang.System.out.println("====================Welcome to the Button action======================");
    int firstIndex = uiTable2.getFirst();
    int rows = uiTable2.getRowCount();
    java.lang.System.out.println("----------------------FIRST INDEX-----------------------"+firstIndex);
    java.lang.System.out.println("----------------------ROWS-----------------------"+rows);
    ArrayList orderAttribs = orderCat.getAttributes();
    Iterator it = orderAttribs.iterator();
    while(it.hasNext())
    OrderAttribute currentAttribute = (OrderAttribute) it.next();
    java.lang.System.out.println("==================String Value===================" + currentAttribute.getCheckbox1());
    java.lang.System.out.println("==================String Value===================" + currentAttribute.getName());
    java.lang.System.out.println("==================String Value===================" + currentAttribute.getDefaultMin());
    java.lang.System.out.println("==================String Value===================" + currentAttribute.getDefaultMax());
    catch (Exception e) {
    e.printStackTrace();
    return "Test";
    private HtmlCommandButton save = new HtmlCommandButton();
    public HtmlCommandButton getSave() {
    return save;
    public void setSave(HtmlCommandButton hcb) {
    this.save = hcb;
    Please Reply me with this solution soon.............
    Thanx,
    Sidharth
    }

    you may get some help in the following...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    -Regards,
    Aniruddha

  • Problem with dynamic column in SBWP

    Hi Friends,
    In SWL1 I have created two attributes with header as "CANCELLED" and " DESCRIPTION" for a particular task.But my SBWP is still showing columns as "Dynamic column" for the workitems of that task.
    Please help me on this.
    Thanks.
    Dilip

    Hi Dilip,
    The column headings will only appear in the task-specific view. In other words, by default the headers will be generic because you can have mixed tasks in the worklist, and column 1 can be a date for one task and a company name for another.
    The user needs to expand the tree on the left hand side and navigate to the "Approve Purchase Order" (or whatever) node to show only items of that task, then column headers should show up.
    Regards,
    Mike

  • Jsf datatable mit hibernate

    hi, kann jemand mich helfen? ich habe fast das selbe Problem wie
    http://www.tutorials.de/forum/j2ee/264251-hibernate-collection-mit-list.html
    habe eine bidirektionale many-to-one assoziation
    employee *-1 division
    benutze jsf(myfaces1.1 here nicht so relevant) und hibernate3.1core
    in View divisionList.jsp :
    <h:column>
                           <f:facet name="header">
                                <h:outputText value="Employees"/>
                           </f:facet>
                           <h:dataTable id="divEmployee"
                                             value="#{division.employees}"
                                             var="employee">
                                  <h:column>
                                      <h:outputText value="#{employee.nickname}"></h:outputText>   //fehlerort, kann nickname nicht kennen
                                  </h:column>
                           </h:dataTable>
                        </h:column>als ich die View aufrufen, kommt die fehlermeldung :
    javax.faces.el.PropertyNotFoundException: Bean: org.hibernate.collection.PersistentSet, property: nickname
         org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:500)
         org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:472)
         org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:436)
         org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
         org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:535)
         org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
         org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
    mapping in Employee.hbm.xml :
    <many-to-one name="division" class="....hibernate.Division" fetch="select" lazy="false">
                     <column name="EMP_DIVISION" />
                 </many-to-one>in Division.hbm.xml :
    <set name="employees" inverse="true">
                <key>
                    <column name="EMP_DIVISION" />
                </key>
                <one-to-many class=".....hibernate.Employee" />
            </set>--------------------------------------------------------------------------------------------------------------------
    in beans: in Division.java
    private Set employees = new HashSet(0);in employee.java einfach :
    private Division division;

    i have not posted the completely code and omitted the getter and setter.
    L�sung gefunden: zwei M�glichkeiten
    1. You can try extended data table from tomahawk, it can work with Sets.
    2. switch from Set to List on my hibernate entities associations.
    genau see:
    http://www.nabble.com/nested-ui:repeat-t2072816.html

  • How to add dynamic columns & rows

    I want to display the data in the columns (seperated by partition) of the fieldNames I select.
    Suppose my Query is like
    Select Fax,Phone from Customers
    Now I want to display the data of Fax& Phone in two different columns & its heading as also Fax & Phone
    My code for the same is like this
    This is my Northwind.jsp
    <%@ taglib uri = "http://java.sun.com/jsf/core" prefix = "f"%>
    <%@ taglib uri = "http://java.sun.com/jsf/html" prefix = "h"%>
    <f:view>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
            <HEAD>
                <TITLE>Northwind</TITLE>
                <LINK REL = "STYLESHEET" HREF = "./css/styles.css" TYPE = "text/css">
            </HEAD>
            <BODY>
                <CENTER>
                    <TABLE BORDER = 5>
                        <TR>
                            <TH CLASS = "TITLE">
                               Northwind Database
                            </TH>
                        </TR>
                    </TABLE>
                    <P>
                    <h:panelGrid id="MainGrid" />
                    <h:dataTable binding="#{fieldList.dataTable}"
                        value= "#{fieldList.data11}"
                        var= "#{row}" border="1"
                        id="RootTable" />
                </CENTER>
            </BODY>
        </HTML>
    </f:view>My java code for the same is as follows
    public UIData getDataTable()
        javax.faces.component.UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
        UIComponent panelGrid1= root.findComponent("MainGrid");
        UIComponent  datatable = panelGrid1.findComponent("RootTable");
        UIData dataTable= new UIData();
        UIColumn col;
        UIOutput out = null;
        Application app = FacesContext.getCurrentInstance().getApplication();
        int ctr=getCounter();
        int colCount = 1;
        for(int j = 0; j < colCount; ++j)
            out = new UIOutput();
            col = new UIColumn();
            HtmlOutputText headerComponent = new HtmlOutputText();
            headerComponent.setId("Header1"+ctr);
            col.setHeader(headerComponent);
            headerComponent.setValue(fieldName);
            ValueBinding vb = app.createValueBinding("#{data11}");
            out.setValueBinding("value", vb);
            out.setRendererType("javax.faces.Text");
            col.getChildren().add(out);
            dataTable.getChildren().add(col);
            ctr++;
        panelGrid1.getChildren().add(dataTable);
        return dataTable;
    public Result getData11()
        System.out.println("In getData11");
        try
                Context context = new InitialContext();
                Map sessionMap=FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
                FieldList flist=(FieldList)sessionMap.get("fieldList");
                DataSource dataSource =
                (DataSource)context.lookup("java:comp/env/jdbc/Northwind");
                Connection connection = dataSource.getConnection();
                Statement statement = connection.createStatement();
                String query = getQuery();
                System.out.println("In getData11 ::query::::::::"+query);
                ResultSet resultSet = statement.executeQuery(query);
                ResultSetMetaData rsmd = resultSet.getMetaData();
                int numberOfColumns = rsmd.getColumnCount();
              //  System.out.println("resultSet.getMetaData() numberOfColumns="+numberOfColumns );
               for(int ii=1;ii<=numberOfColumns;ii++)
                   System.out.println("rsmd.getColumnName(ii)::::::::"+rsmd.getColumnName(ii));
                System.out.println("numberOfColumns::::::::"+numberOfColumns);
                boolean b = rsmd.isSearchable(1);
                Result result=ResultSupport.toResult(resultSet);
                return(result);
                } catch(Exception e)
                System.out.println("Connection error "+e);
                return(null);
    }Here I am not getting the data but I am getting the header name with no data in it.
    Can Anybody tell what is wrong in the code or how it should be done.

    Hi,
    You can add columns dynamically ,
    In your bean code
    private UIColumn mycolumn = new UIColumn();
    public UIColumn getMyColumn() {
    return mycolumn ;
    public void setMyColumn(UIColumn uic) {
    this.mycolumn = uic;
    and in your jsf page
    <h:column binding="#{YourBean.mycolumn }" id="column1">
    <h:outputText value="My Value"/>
    <f:facet name="header">
    <h:outputText value="My Header"/>
    </f:facet>
    </h:column>

  • How to change recordset bahaviour to accept dynamic column names in the where clause

    Hi
    im using php-mysql and i make a recordset and i want to make the column names in the where clause to be dynamic like
    "select id,name from mytable where $tablename-$myvar";
    but when i do this my i break the recordset and it disappear
    and when i use variables from advanced recordset it only dynamic for the value of the column not for the column name
    and when i write the column name to dynamic as above by hand it truns a red exclamation mark on the server behaviour panel
    so i think the only way is to change the recordset behaviour is it? if so How to make it accept dynamic column names?
    thanks in advance.

    As bregent has already explained to you, customizing the recordset code will result in Dreamweaver no longer recognizing the server behavior. This isn't a problem, but it does mean that you need to lay out your dynamic text with the Bindings panel before making any changes. Once you have changed the recordset code, the Bindings panel will no longer recognize the recordset fields.
    Using a variable to choose a column name is quite simple, but you need to take some security measures to ensure that the value passed through the query string isn't attempting SQL injection. An effective way of doing this is to create an array of acceptable column names, and check that the value matches.
    // create array of acceptable values
    $valid = array('column_name1', 'column_name2', 'column_name3');
    // if the query string contains an acceptable column name, use it
    if (isset($_GET['colname']) && in_array($_GET['colname'], $valid)) {
      $col = $GET['colname'];
    } else {
      // set a default value if the submitted one was invalid
      $col = 'column_name1'
    You can then use $col directly in the SQL query.

  • How to get the dynamic columns in UWL portal

    Hi All,
    I am working on UWL Portal. I am new to UWL. I have down loaded uwl.standard XML file and costomized for getting the  values for "select a Subview" dropdown and I am able to see the values in the dropdown. Now my requirement is to get the dynamic columns based on the selection from dropdown value.
    can any body suggest on how to get the dynamic columns in UWL portal.

    Hi  Manorama,
    1) If you have already created a portal system as mentioned in following blog
                  /people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer
    2) If not, then try to create the same. Do not forgot to give the Alias name .
    3) After creating a system, log on to the VC, Create one iView.
    4) Now Click on "Find Data" button from the list which you can view in right side to Visual composer screen.
    5) After clicking on "Find Data" button, it will ask for System. If you have created your system correctly and Alias name is given properly, then your mentioned Alias name is appeared in that list.
    6) Select your system Alias name and perform search.
    7) It will display all the BAPIs and RFCs in your systems.
    8) Select required BAPI and develop the VC application.
    Please let me know if you any further problems.
    Thanks,
    Prashant
    Do reward points for useful answers.

Maybe you are looking for

  • Expanding Text Box

    Good afternoon, I've recently converted an old Wordperfect document to PDF.  The form has many fillable fields, which have been setup and are working fine.  In the middle of the page, however, there is a place for the person to put in a narrative.  T

  • Display flickers on start up

    My display flickers slowly when coming out of sleep or booting up. After a short while the monitor works perfectly.  After it goes into sleep mode, or when the screen saver goes dark, upon awakening the flicker starts again. I recently replaced my AT

  • How to disable indexing in ANY USB drive not specific from privacy in spotlight menu

    Hi all, I would like to disable from indexing "ANY" usb device that i connect to my macbook pro. I know the option from spotlight -> privacy and exlude a hdd or usb device with the + sign. But i want to have something for any external device i can't

  • Dso data activation error

    Hi experts, During the activation of data in DSO I got an error, there is an invalid entry. There are almost 15 million records in this DSO I dont want to reload and activate them again because I am on quality server. I just want to keep these record

  • Getting Attriutes from servlet sessions

    Hi currently doing a college project and im having problems with sessions, i cant seem to be able to put a value into the session and print it off from a different servlet. The project has a basic login page where the user enters a username and passw