DataTable bug?

I cant seem to get this working and have no idea why.
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>evidence</title>
</head>
<body>
      <f:view> 
      <h:outputText value="#{bean.evidence.evidenceid}" />
        <h:form>
            <rich:datascroller align="left"  for="evidenceList" maxPages="20" />
            <rich:spacer height="30" />
            <rich:dataTable  rows="10" id="evidenceList" value="#{bean.allEvidence}" var="ev">
               <h:column>
                    <f:facet name="header">
                         <h:outputText value="EvidenceId" />
                    </f:facet>
                    <h:outputText value="#{ev.evidenceid}" />
               </h:column>
               </rich:dataTable>
        </h:form>
</f:view>
</body>
</html>
<h:outputText value="#{ev}" /> works and I see the bracketed toString output of the object e.g. [[1],[1]]
Bean -:
package uk.ac.ukoln.impact.bean;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import uk.ac.ukoln.impact.entity.Evidence;
public class Bean {
     String text;
     public Bean() {
     public String getText() {
     return text;
     public void setText(String text) {
     this.text = text;
     public Evidence getEvidence() {
          Evidence e = new Evidence();
          e.setEvidenceid(100);
          e.setMsginid(100);
          return e;
     public List<Evidence> getAllEvidence() {
          EntityManagerFactory emf = Persistence.createEntityManagerFactory("example");     
        EntityManager  em = emf.createEntityManager();
        List<Evidence> evidences = null;
        try {
            em.getTransaction().begin();
            return em.createNativeQuery("SELECT * FROM evidence").getResultList();
        } catch(Exception ex) {
            em.getTransaction().rollback();
        } finally {
            em.close();
          return null;
}Entity -:
package uk.ac.ukoln.impact.entity;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
@Entity
public class Evidence implements Serializable {
     @Id
     private int evidenceid;
     private int msginid;
     @OneToOne
     @JoinTable(name="report_evidence",
          joinColumns=@JoinColumn(name="evidenceId"),
          inverseJoinColumns=@JoinColumn(name="reportId"))
     private Set<Report> reportCollection;
     private static final long serialVersionUID = 1L;
     public Evidence() {
          super();
     public int getEvidenceid() {
          return this.evidenceid;
     public void setEvidenceid(int evidenceid) {
          this.evidenceid = evidenceid;
     public String getEid() {
          return "jggf";
     public void setEid(String Eid) {
     public int getMsginid() {
          return this.msginid;
     public void setMsginid(int msginid) {
          this.msginid = msginid;
     public Set<Report> getReportCollection() {
          return this.reportCollection;
     public void setReportCollection(Set<Report> reportCollection) {
          this.reportCollection = reportCollection;
}I am using tomcat 6, jsf1.2 latest and richfaces - the problem is still there with h:dataTable and all standard taglibs.
I am sure I must be missing something easy but cant figure this one out. Any help appreciated.

Forgot the stack
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NumberFormatException: For input string: "evidenceid"
     at java.lang.NumberFormatException.forInputString(Unknown Source)
     at java.lang.Integer.parseInt(Unknown Source)
     at java.lang.Integer.parseInt(Unknown Source)
     at javax.el.ListELResolver.coerce(ListELResolver.java:166)
     at javax.el.ListELResolver.getValue(ListELResolver.java:51)
     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
     at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
     at org.apache.el.parser.AstValue.getValue(AstValue.java:97)
     at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
     at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
     at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
     at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
     at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:850)
     at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
     at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
     at org.richfaces.renderkit.AbstractTableRenderer.encodeOneRow(AbstractTableRenderer.java:246)
     at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:87)
     at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:101)
     at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:994)
     at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:107)
     at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:92)
     at org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:139)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
     at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
     at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:273)
     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:204)
     at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
     at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     at java.lang.Thread.run(Unknown Source)

Similar Messages

  • Validator in dataTable - bug?

    Hi,
    I am using validators in a dataTable, and it works, but in some cases the behaviour is not adequate.
    Some code first :
    <h:dataTable value='#{apps}' var='app'>
         <h:column>
              <f:facet name='header'>
                    <h:outputText value='#{msgs.name}' />
                 </f:facet>
              <h:message for='appname' style='color:red;'/>
           <h:inputText value='#{app.name}' id='appname' required='true' >
               <f:validator .... />
           </h:inputText>
         </h:column>
    As I said - the validation works fine. What is strange is that if a validator is used outside a dataTable, and validation fails, then any new values in the dataTable are lost!! UNLESS (as is here) there is a validator on some field in the dataTable - then if validation fails in the dataTable (regardless if validation outside fails or not) values in the table are preserved, but     then when correct values are entered in the table and validation inside the dataTable succeeds, but fails outside - the validated values on the row in question of the dataTable disappear!!!!! (they are not displayed when the page is reloaded).
    Seams like a bug?
    Is there any way to correct that behaviour, e.g. to force the values in the table that are still not in the model to be kept on the page after outside validation fails and page reloads?
    Thanks for any suggestions!
    Message was edited by:
    ing-uk

    i nee to get the IDs of the component in the Datable
    how can i achieve thatJust get the Object reference itself by getRowData(). Also see http://balusc.xs4all.nl/srv/dev-jep-dat.html how to use datatables.

  • Nested dataTable bug?

    I�m having a problem with nested dataTables. The complete source code is attached.
    My backing bean has properties keys and map. Keys is an array of strings. Map is a map keyed off keys with string array values.
    The faces jsp creates a table with one row per key. The key is displayed in the first column and the second column holds another table displaying the elements of the corresponding map entry.
    Various command links with nested <f:param> elements are in the cells and footers of the nested table. The parameter values reference the var property of either the inner or outer tables. All command links reference the same action listener which prints the value of the parameter to stdout.
    Clicking on outer var always works.
    Clicking on inner var yields the correct result only if you are in the last row of the outer table.
    Clicking once on any of the footer link command links causes the action listener to be invoked once for each row of the outer table.
    Have I found a bug, am I doing something wrong, or is this functionality not supported?
    Any help appreciated.
    Nick
    Backing Bean Source:
    package test;
    import java.util.*;
    import javax.faces.component.UIParameter;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    public class NestedTableBean {
         private Map map;
         private String[] keys;
         public NestedTableBean() {
              keys = new String[]{"1", "2", "3"};
              map = new HashMap();
              map.put(keys[0], new String[]{"1a", "1b", "1c"});
              map.put(keys[1], new String[]{"2a", "2b", "2c"});
              map.put(keys[2], new String[]{"3a", "3b", "3c"});
         public Map getMap() {
              return map;
         public String[] getKeys() {
              return keys;
         public void doIt(ActionEvent actionEvent) {
              String param = null;
             List children = actionEvent.getComponent().getChildren();
             for (int i = 0; i < children.size(); i++) {
               if (children.get(i) instanceof UIParameter) {
                 UIParameter currentParam = (UIParameter) children.get(i);
                 if (currentParam.getName().equals("param") &&
                     currentParam.getValue() != null) {
                   param = currentParam.getValue().toString();
                   break;
             FacesContext context = FacesContext.getCurrentInstance();
             String id = actionEvent.getComponent().getClientId(context);
             System.out.println("In doIt(), component id: "+id+", param: "+param);
    }Faces JSP Source:
    <h:dataTable border="2" value="#{nestedTable.keys}" var="outerVar">
    <h:column>
      <h:outputText value="#{outerVar}"/>
    </h:column>
    <h:column>
      <h:dataTable  border="1" value="#{nestedTable.map[outerVar]}" var="innerVar">
       <h:column>
        <h:panelGrid columns="3">
         <h:outputText value="#{innerVar}"/>
         <h:commandLink actionListener="#{nestedTable.doIt}">
          <h:outputText value="outerVar"/>
          <f:param name="param" value="#{outerVar}"/>
         </h:commandLink>
         <h:commandLink actionListener="#{nestedTable.doIt}">
          <h:outputText value="innerVar"/>
          <f:param name="param" value="#{innerVar}"/>
         </h:commandLink>
        </h:panelGrid>
       </h:column>
       <f:facet name="footer">
        <h:panelGrid columns="2">
         <h:commandLink actionListener="#{nestedTable.doIt}">
          <h:outputText value="footer link"/>
          <f:param name="param" value="#{outerVar}"/>
         </h:commandLink>
        </h:panelGrid>
       </f:facet>
      </h:dataTable>
    </h:column>
    </h:dataTable>

    Hello,
    I have the same problem, when I use an nested dataTable the ActionEvent of the Second dataTable get always the Last Row of the First dataTable.
    The complete code :
    -=-=-=-=-=-=-=-=-=-=-=-=- PAGE.JSP -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    <h:dataTable id="categorias" var="categoria" value="#{UserBean.allCategorias}">
        <h:column>
            <h:dataTable id="items" var="item" value="#{categoria.items}">
               <f:facet name="header">
                   <h:outputText value="#{categoria.nome}" />
               </f:facet>
               <h:column>
                   <f:facet name="header">
                       <h:outputText value="Item" />
                   </f:facet>
                   <h:outputText value="#{item.nome}" />
               </h:column>
               <h:column>
                   <f:facet name="header">
                       <h:outputText value="Qtd Solicitada" />
                   </f:facet>
                    <h:outputText value="#{item.qtdSolicitada}" />
                </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Qtd Recebida" />
                </f:facet>
                <h:outputText value="#{item.qtdEfetivada}" />
             </h:column>
              <h:column>
                  <h:panelGrid columns="2">
                      <h:inputText id="selected" size="5" />
                      <h:commandButton id="confirmar" immediate="true" image="images/confirmar_1.gif" actionListener="#{UserBean.processAction}">
                          <f:param id="itemId" name="id" value="#{item.nome}" />
                      </h:commandButton>
                  </h:panelGrid>
             </h:column>
         </h:dataTable>
    </h:column>
    </h:dataTable>-=-=-=-=-=-=-=-=-=-=-=-=- UserBean.java -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    public void processAction(ActionEvent event) throws AbortProcessingException {
        /* Find the UIParameter component by expression */
       UIParameter component = (UIParameter) event.getComponent().findComponent("itemId");
       /* param itemId - Wrong (use Debug to see) */
    }

  • DataTable in dataTable fix details (JSF 1.1)

    I posted a message yesterday indicating that some of the problems with nested dataTables had not been fixed in the JSF 1.1 release. Since that posting, I have done some more research, and have more specific information regarding the remaining problems and a way to fix them. The remaining problems are:
    1) Values from inputText fields in the inner dataTable are ignored on submit (except for the last row of the table). The problem is that processDecodes is called on the inner table component multiple times (once per row of the outer table), and the "saved = new HashMap();" statement effectively wipes out any values that were decoded from the previous row, so that at the end of the process, the only decoded values that remain are those from the last row. My suggested fix for that problem is:
    a) to create a "boolean isOuterTable()" method on UIData that determines whether or not this table is the outermost table (i.e. go up through the parent chain and see if there are any UIData ancestors).
    b) create a "clearSaved" method on UIData as follows:
    protected void clearSaved() {
        saved = new HashMap();
    }c) create a "clearDescendants" method on UIData that goes visits all of the UIData's descendants (i.e. facets and children, and their facets and children, recursively), and calls clearSaved on any UIData components that are found
    d) in the processDecodes method for UIData, replace:
    saved = new HashMap();with
    if (isOuterTable()) {
        clearSaved();
        clearDescendants();
    }2) When a commandButton in the inner dataTable is clicked, actions are fired for all rows of the outer dataTable. This is one case of a larger problem. The implementation of getClientId in UIComponentBase uses a cached value, if the ID has been computed previously. For components within dataTables, this is a problem because these components are referenced multiple times for different rows of the outer table, and the row number of the outer table is part of the client ID. To fix this, I suggest the following (maybe overkill, but it works):
    a) Create a "clearCachedValues" method on UIData, which visits all of the UIData's descendants, and sets their clientId to null. A hack to do this is:
    descendant.setId(descendant.getId())It would be better to have a method on UIComponent for this. NOTE: I have also found that if I come across a descendant that is a UIData, I also need to set that component's "model" attribute to null, because the calculation of this model refers to that dataTable's value valueBinding, which may be defined in terms of the current row of the outer table.
    b) Add a call to clearCachedValues to the end of the setRowIndex method on UIData.
    There may be other, better ways to fix these problems, but I thought it might be helpful to describe my fixes in detail, so that whoever is responsible for fixing the reference implementation can at least have the benefit of my research.
    I would like to see a bug opened for these problems, and I would like to be able to see the descriptions of known JSF bugs. Before JSF 1.1 came out I was worried that the nested dataTables bug (C026) description (which I was unable to find) might not be complete, and that as a result, the problems with nested dataTables would not be completely fixed in JSF 1.1. As it turned out my worries were not unfounded.

    JD> 2) When a commandButton in the inner dataTable is clicked, actions
    JD> are fired for all rows of the outer dataTable. This is one case of a
    JD> larger problem. The implementation of getClientId in UIComponentBase
    JD> uses a cached value, if the ID has been computed previously. For
    JD> components within dataTables, this is a problem because these
    JD> components are referenced multiple times for different rows of the
    JD> outer table, and the row number of the outer table is part of the
    JD> client ID. To fix this, I suggest the following (maybe overkill, but
    JD> it works):
    I've fixed part 1). I've essentially done as you suggested.
    I can't reproduce part 2). I've posted the webapp where I try to do
    this at
    http://blogs.sun.com/roller/resources/edburns/jsf-nested-datatables.war
    Please put the JSF 1.1 jars in common lib, or WEB-INF/lib in this war
    and then visit
    http://host:port/jsf-nested-datatables/faces/test2.jsp
    Click on the outer buttons, you'll see that the outer listener fires
    once.
    Click on the inner buttons, you'll see that the inner listener once.
    Can you please help me reproduce this?
    Ed

  • BUG JSF h:dataTable with JDBC ResultSet - only last column is updated

    I tried to create updatable h:dataTable tag with three h:inputText columns with JDBC ResultSet as data source. But what ever I did I have seceded to update only the last column in h:dataTable tag.
    My JSF page is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1250"/>
    <title>Stevan</title>
    </head>
    <body><h:form>
    <p>
    <h:messages/>
    </p>
    <p>
    <h:dataTable value="#{tabela.people}" var = "record">
    <h:column>
    <f:facet name="header">
    <h:outputText value="PIN"/>
    </f:facet>
    <h:inputText value="#{record.PIN}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Surname"/>
    </f:facet>
    <h:inputText value="#{record.SURNAME}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:inputText value="#{record.NAME}"/>
    </h:column>
    </h:dataTable>
    </p>
    <h:commandButton value="Submit"/>
    </h:form></body>
    </html>
    </f:view>
    My java been is:
    package com.steva;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class tabela {
    private Connection conn;
    private ResultSet resultSet;
    public tabela() throws SQLException, ClassNotFoundException {
    Statement stmt;
    Class.forName("oracle.jdbc.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
    public ResultSet getPeople() {
    return resultSet;
    I have instaled “Oracle Database 10g Express Edition Release 10.2.0.1.0” – product on my PC localy. I have enabled HR schema and I have instaled and pupulated with sample data folloving table:
    CREATE TABLE "PERSON"
    (     "PIN" VARCHAR2(20) NOT NULL ENABLE,
         "SURNAME" VARCHAR2(30),
         "NAME" VARCHAR2(30),
         CONSTRAINT "PERSON_PK" PRIMARY KEY ("PIN") ENABLE
    I have:
    Windows XP SP2
    Oracle JDeveloper Studio Edition Version 10.1.3.1.0.3894
    I am not shure why this works in that way, but I think that this is a BUG
    Thanks in advance.

    Hi,
    I am sorry because of formatting but while I am entering text looks fine but in preview it is all scrambled. I was looking on the Web for similar problems and I did not find anything similar. Its very simple sample and I could not believe that the problem is in SUN JSF library. I was thinking that problem is in some ResultSet parameter or in some specific Oracle implementation of JDBC thin driver. I did not try this sample on any other platform, database or programming tool. I am new in Java and JSF and I have some experience only with JDeveloper.
    Java been(session scope):
    package com.steva;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class tabela {
    private Connection conn;
    private ResultSet resultSet;
    public tabela() throws SQLException, ClassNotFoundException {
    Statement stmt;
    Class.forName("oracle.jdbc.OracleDriver");
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
    stmt = conn.createStatement
    (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
    public ResultSet getZaposleni() {
    return resultSet;
    JSF Page:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1250"/>
    <title>Stevan</title>
    </head>
    <body><h:form>
    <p>
    <h:messages/>
    </p>
    <p>
    <h:dataTable value="#{tabela.zaposleni}" var = "record">
    <h:column>
    <f:facet name="header">
    <h:outputText value="PIN"/>
    </f:facet>
    <h:inputText value="#{record.PIN}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Surname"/>
    </f:facet>
    <h:inputText value="#{record.SURNAME}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:inputText value="#{record.NAME}"/>
    </h:column>
    </h:dataTable>
    </p>
    <h:commandButton value="Submit"/>
    </h:form></body>
    </html>
    </f:view>

  • Matrix with DataTable - GetLineData and SetLineData B1 8.8 Bug

    Hi experts,
    I have a matrix bounded to a DataTable and I succefully load the matrix with:
    DataTable dt = form.DataSources.DataTables.Item("matDT");
    dt.ExecuteQuery(sql);
    Matrix mat = form.Items.Item("mat").Specific as Matrix;
    mat.LoadFromDataSource();
    mat.AutoResizeColumns();
    Now in Event et_VALIDATE(after), i would like to change some not editable column of the matrix
    [B1Listener(BoEventTypes.et_VALIDATE, false)]
    public virtual void OnAfterValidate(ItemEvent pVal) {
              if(pVal.ItemUID!="mat")
                    return;
              Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
              Matrix mat = form.Items.Item("mat").Specific as Matrix;
              DataTable dt = form.DataSources.DataTables.Item("matDT");
              //Pont 1)
              mat.GetLineData(pVal.Row)     
              //Point 2
              //Change Values
              int minutes = dt.GetValue("U_Minutes", pVal.Row-1);
              dt.SetValue("U_Hours",pVal.Row-1, (double) minutes / 60);
              //Point 3
              mat.SetLineData(pVal.Row);
    Now I will expain the problem:
    For simplicity assume the matrix has 2 rows after load. After the user edit a column, validate event fires and:
    -) After the call of GetLineData  in Point 1) I verified that all DataTable Rows are identical (derived from the first row in the matrix)
    -) If I substitute GetLineData   in point 1) with FlushToDataSource, DataTable became corret but after the call of SetLineData in point 3) all the matrix rows are identical (derived from the first DataTable row).
    -) If I also substitute SetLineData   in point 3) with LoadFromDataSource, all works fine but i loose focus and performances
    Is it a B1 8.8 Bug?

    Yes, but sap said that my  customer is not officially approved.
    the following is the original text.
    Please note that SAP Business One Release 8.8 has only been released for
    Ramp-Up. Because of this, only approved projects for productive usage a
    re fully supported by SAP Business One Support. However feedback on prod
    uct quality or bugs reporting from all partners - even from partners who
    are not part of the Ramp-Up - is welcome and highly appreciated.
    According to the information we have, your customer is not officially ap
    proved for Ramp-Up yet. Due to the difficulty to estimate the number of
    messages that will be submitted, SAP cannot commit itself to solving all
    issues reported about projects not officially approved for Ramp-Up, nor
    guarantee any response times.
    Kind regards,
    SAP Business One Support

  • JSC1 bug ( LinkAction with in dataTable)

    Hi,
    I have come across a very strange behaviour, which i think is JSC bug but not sure.
    Steps to reproduce the problem/bug:
    1. Create a new project,
    2. Drag and drop output text.
    3. Drag and drop button.
    4. Drag and drop dataTable component.
    5. Drag and drop a Table from dataSources of ServerNavigator window.
    6. Select & right click on dataTable1 in ApplicationOutline window
    7. Select Bind to Database.
    8. Select the rowset and click Ok
    9. Select & right click on dataTable1 in ApplicationOutline window again.
    10. Select Table Layout, select one of the colum names on the RHS and change the component type to Link (action).
    11. Click 'Apply' and then 'Ok'
    12. Select the linkAction1 in ApplicationOutline, right click and select Edit action event handler.
    13. In event handler, replace
    return null; --- with return "Page2";
    14. with in the event handler for the button,
    add something like
    outputText1.setValue("Is this a bug??");
    15. Create a new page,-- Page2.
    16. Select Page Naviagtion in Project Navigator window.
    17. Drag and drop from Page1 to Page 2 to create a link, and name the link as Page2.
    18. Run the project.
    19. Click one of the links with in the dataTable of Page1, Page2 is displayed(so far so good).
    20. Now click the browsers back buttton of Page 2, Page 1 is displayed(still working fine)
    21. Now click the button in Page 1, instead of displaying the text "Is this a bug??", Page 2 is displayed. In background, it executes the button event handler function and ALSO linkAction event handler and hence displays Page2. This behaviour can be repeated again.
    I can't understand why linkAction event handler is executed? Why is the link action event handler fired???
    This happens only with linkAction within the dataTable, if the linkAction is outside the dataTable, it works fine as expected and displays the text "Is this a bug?".
    It also works fine if you don't use the browsers back button,
    1. Create a naviagtion link from Page2 to Page1
    2. Use that link to go to Page 1 from Page 2, DONT USE BROWSERS BACK BUTTON
    3. Click the button in Page 1, it works fine as expected and displays the text "Is this a bug?".
    Is this a known bug? If so whats the workaround?
    Or Am i going wrong some where?????????/
    I need the solution ASAP, pleaseeeeeeeeee...
    Cheers

    Running your code never show page 2 in my Firefox
    Your code in 13 returns only a String.
    12     Drop it
    13     Drop it
    17     Click page 1 and drag from linkAction1 to page 2
    Run
    Hope this solves your problem.

  • Bug : Datatable with disabled checkboxes

    Hello,
    I was able to implement a datatable with modify, delete links for each row.
    The following code works:
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
    The table is displayed properly in the browser. But, when I click on the modify, delete links,
    the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
    is not called.
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
         <h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>I would be glad to know if there is any workaround.
    Thanks,
    Ajay

    I forgot to mention that there is no error message in the log file. The same page is displayed again
    after clicking on the Modify or Delete Link.
    If I remove the third column (disabled checkbox), the modify and delete links work fine.

  • DataTable.Rows.Count property is occasionally wrong

    I have a web service in C#.NET which calls a stored procedure using ADO.NET. The stored procedure is always returning 1 row, which is then loaded into a DataTable. The Rows.Count property of the DataTable is then examined.
    When this web service is called repeatedly with numerous requests, it occasionally returns Rows.Count as 0 when it should be 1. I have debugged and examined it at runtime and found that there is indeed 1 row in the datatable, but that the Rows.Count property
    is 0.
    Is this a known bug?
    I'm using .Net Framework 2.0
    Note: This is an issue that occurs very rarely. My testing shows that it takes about 90 minutes to recreate it when you have 2 concurrent processes sending requests repeatedly at a rate of about 10 requests per second.

    Are you sure that there aren't multiple threads access the DataTable?
    Can you post a repro? 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Using commandLinks and commandButtons in dataTables

    I'm trying to create a page that displays data from a database and allows you to edit individual rows by clicking on either a commandButton or a commandLink within a dataTable that then takes you to another page where you can edit that particular row of the table.
    When using a commandButton, it works perfectly for all but the last entry in the table. But when the button in the last line is clicked, nothing happens at all, it does not seem to call the action listener and it does not perform the navigation based on the action. But with all the previous buttons it calls the actionListener and navigates perfectly. Can anyone tell me why this would be? The code is as follows:
    <h:dataTable value="#{Categories.categories}" var="category" >
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.deptColumnHead}"/></f:facet>
    <h:outputText value="#{category.departmentName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.categoriesColumnHead}"/></f:facet>
    <h:outputText value="#{category.categoriesList}"/>
    </h:column>
    <h:column>
    <h:form>
    <h:inputHidden id="dept" value="#{category.departmentId}"/>
    <h:commandButton id="editButton" action="EditCat" actionListener="#{Categories.editListener}" value="{msgs.editSelectedButtonText}"/>
    </h:form>
    </h:column>
    </h:dataTable>
    When using commandLinks, only the first one works (of 4). For the other 3 the page goes into error when the link is clicked and it complains that 'document.forms._id2:3:_id10._id2:3:_id10:idcl is null or not an object'. If anyone could tell me what is wrong with my code, i would be most appreciative.
    <h:dataTable value="#{Categories.categories}" var="category" >
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.deptColumnHead}"/></f:facet>
    <h:outputText value="#{category.departmentName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.categoriesColumnHead}"/></f:facet>
    <h:outputText value="#{category.categoriesList}"/>
    </h:column>
    <h:column>
    <h:form>
    <h:inputHidden id="dept" value="#{category.departmentId}"/>
    <h:commandLink action="EditCat" actionListener="#{Categories.editListener}">
    <h:outputText value="#{msgs.editSelectedButtonText}"/>
    </h:commandLink>
    </h:form>
    </h:column>
    </h:dataTable>

    1) I have had very odd behavior in JSF when ALL of the
    JSF elements on a page do not have an id attribute. If
    you do not assign an id then JSF will manufacture a
    unique id on the flag. Sometimes the unique id wasn't
    so unique and there were errors like you are seeing or
    just odd behavior on the form, buttons not generating
    events, or incorrect rendering, etc.
    By 'ALL' I mean output text, columns, anything that
    accepts an id attribute. Don't trust the code to
    generate an id correctly for you.Just want it known that while this may be necessary in the short-term to work around bugs, this is definitely not the intent of the EG! We don't want people getting in the habit of
    Also note that this behavior is not consistent
    sometimes it would not appear on a page unless the
    page was updated and more controls added to it.Ah, well that is a known issue; while developing a page, the Sun RI can have problems if you change a page's contents between two submissions. (It doesn't pick up that the .jsp has changed.) I'd recommend:
    - Use client-side state saving.
    - Make sure you're making a new request for a page (not re-POST-ing anything!) when the page's contents have changed.
    If you follow both of those rules, then you should generally be able to get away without explicit IDs everywhere as you actively develop your page.
    Explicit IDs are required if you're inside <c:if>; this is known and documented.
    2) try putting the hidden input control in it's own
    columnNo, that'll give you a bonus set of <td> elements, which isn't what you want.
    -- Adam Winer (EG member)

  • DW CS5 bugs seen

    System specs
    Mac pro Early 2009 2.66 mhz 12 gigs ddr3
    Osx 10.6.3
    I don't know if anyone else has seen any of these issues, so i will post them in hopes that there may be a fix.
    Downloaded creative suite cs5 for mac (trial)
    Installed Photoshop/Dreamweaver
    Testing how each work on Osx 10.6.3
    Observations
    1) can't always upload pages to ftp server (when clicling on file upload arrows Put and get will be grayed out) some times if I save the file before trying to upload the put/get option are available. sometimes I don't need to save the file first as the put/get option are available. And sometimes Imust click inside my page to be uploaded several time, and or save the file several times before I can get the Put/get option. I have even had to sometimes go to force quit to turn DW off and restart it to get DW working again
    2) DW will not always shut down. ( when going to Dreamweaver>Quit Dreamweaver nothing will happen)
    3) Copy paste of text inside of source code
    I have had issues with DW not pasting a peice of code in to the page I am working on correctly. If I was to put
    <hr /><br />
    <p class="datatable"><strong>Want to be a host?</strong></p>
                       </div>
                       I mught see something like
    <hr /><br />
    < ="datatable">< g>Want to be a host?</strong></ >
    This is vauge I know. I should of copied it down, but if it happens again I will add the exact code
                       </div>
    4) when adding text from a docx I will sometime get the microsoft preferences embeded in the source code. so if I try to higliht all the new text from the docx tehn tell DW to reformat the text to one I use as a standard, DW will either only remove some of the original Docs embeding, So therefore I have to go into the code manuualy and remove all the microsoft source doe manually.
    I know this is a bit, but before I decide to upgrade to cs5 I would like to know it works properly.
    Just a side not
    The Ftp bugs in cs4 have seemed to be taken care of( slow ftp transfer/files not being uploaded(even though dw said they were successfully uploaded even after several tries) would have to check each update to make sure ftp worked properly
    Dw seems to work/open much faster.
    Now I do have parallels for mac and haven't setup DW on it yet for testing, but I was hoping not to have to use two os's at once just to do my work.

    My keychain assess requests will not take my password that I know is correct and I have been in the fix problem for the issue and at first it had a problem and now I go in and it says there is no problem. This was since I installed CS5 suite.
    I worked with someone yesterday for the ftp problem because the site management would not keep the ftp information and I had to reinsert it each time. Well, that part was fixed but I can only drag and drop the files into the remote server and the "put arrow" says there is an error. He closed the case thinking it was going to work.
    Now, with another site I can't get the connection to the FTP even though I checked with the host and found out that I had all the FTP info correct.
    I haven't worked with any of the other sites as yet.
    Thanks! Elvi

  • ODBC BI Server Bug - arithmetic operation resulted in an overflow

    I am trying to write some really simple .NET code access the Oracle BI Server ODBC driver and it's not working at all.  I've connected fine, however it seems like anything I try to do related to getting database information spits up an error "arithmetic operation resulted in an overflow".
    Here is the code:
    Dim ConnectString As String
    Dim FactoryType As String
    Dim Factory As System.Data.Common.DbProviderFactory
    Dim Connection As System.Data.Common.DbConnection = Nothing
    Dim TablesData As System.Data.DataTable = Nothing
    Dim err As String = ""
    Dim nl As String = Chr(13) + Chr(10)
    Try
        ' Connect to the database via ODBC
        ConnectString = "DSN=BSODBC_7;uid=TheUser10;pwd=************"
        FactoryType = "System.Data.Odbc"
        Factory = System.Data.Common.DbProviderFactories.GetFactory(FactoryType)
        Connection = Factory.CreateConnection
        Connection.ConnectionString = ConnectString
        Connection.Open()
        ' Request a list of tables from the database
        ' ** Tried both with restrictions and without
        ' ERROR on this line:
        ' “Arithmetic operation resulted in an overflow.”
        TablesData = Connection.GetSchema("Tables")
        ' Show the list of tables on the screen in a grid
        ' If it was successful.
        OnScreenGrid.AutoGenerateColumns = True
        OnScreenGrid.DataSource = TablesData
    Catch ex As Exception
        ' Report the error
        err = ex.Message
        If Not (ex.InnerException Is Nothing) Then
            If Not (ex.InnerException.Message Is Nothing) Then
                err = err + nl + nl + ex.InnerException.Message
            End If
        End If
        MsgBox(err, MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Error")
    Finally
        ' Clean up and Close the DB Connection
        If Not (Connection Is Nothing) Then
            Connection.Close()
            Connection.Dispose()
            Connection = Nothing
        End If
    End Try
    Any Thoughts?  Is this a known bug?  Is there a fix?

    I doubt on line
    OnScreenGrid.DataSource = TablesData
    instead of array as TablesData try to take List object and assign it to OnScreenGrid.DataSource
    just in case check this
    DataGridView.AutoGenerateColumns Property (System.Windows.Forms)
    I might be wrong but just check it

  • Error due to drop down menu in the dataTable

    I have a data table which has a drop down menu in one of the table columns. When the drop down menu is disabled, every action in the page works (click on it, and it does what it does). When the drop down menu is enabled, every action (with one exception) in the page does not work (click on it, it refreshes the page, but the action is not fired). I cannot debug the thing because the action is not fired at all.
    The exception is that for buttons that is marked as immediate, it works. I created an inline message, and wire that to the dropdown menu. I do not see any error. Looking into the log file, I do not see anything.
    I was suspecting maybe conversion error. The data value for the drop down menu is integer (I try both setting the convert to integer and nothing). Even there's error in conversion, there should be error message showing up (in the inline message box).
    So, again, how do I diagnos this, and to find out what is going on?
    Thank you very much.
    Vh.

    Thank you for your attention.
    The bug link is:
    https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=51
    I thought I could add attachment afterward, but I couldn't. Please add these for me:
    //////////////////////////////////////////////////// Page3.jsp //////////////////////////////////////////////////////////////////
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <html lang="en-US" xml:lang="en-US">
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>Page3 Title</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                    <h:form binding="#{Page3.form1}" id="form1">
                        <h:dataTable binding="#{Page3.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
                            style="height: 111px; left: 60px; top: 120px; position: absolute" value="#{Page3.dataTable1Model}" var="currentRow" width="360">
                            <h:column binding="#{Page3.column1}" id="column1">
                                <h:outputText binding="#{Page3.outputText1}" id="outputText1" value="#{currentRow.c1}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Page3.outputText2}" id="outputText2" value="column1"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Page3.column2}" id="column2">
                                <h:outputText binding="#{Page3.outputText3}" id="outputText3" value="#{currentRow.c2}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Page3.outputText4}" id="outputText4" value="column2"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Page3.column3}" id="column3">
                                <f:facet name="header">
                                    <h:outputText binding="#{Page3.outputText6}" id="outputText6" value="column3"/>
                                </f:facet>
                                <h:selectOneMenu binding="#{Page3.dropdown1}" converter="#{Page3.integerConverter1}" id="dropdown1" value="#{currentRow.c3}">
                                    <f:selectItems binding="#{Page3.dropdown1SelectItems}" id="dropdown1SelectItems" value="#{Page3.dropdown1DefaultItems}" />
                                </h:selectOneMenu>
                            </h:column>
                        </h:dataTable>
                        <h:outputText binding="#{Page3.outputMesg}" id="outputMesg" style="height: 32px; left: 240px; top: 50px; position: absolute; width: 180px"/>
                        <h:outputText binding="#{Page3.outputText8}" id="outputText8" style="height: 30px; left: 60px; top: 50px; position: absolute; width: 162px" value="Message:"/>
                        <h:commandButton action="#{Page3.button1_action}" binding="#{Page3.button1}" id="button1"
                            style="height: 25px; left: 300px; top: 260px; position: absolute; width: 109px" value="Say Hello"/>
                        <h:message binding="#{Page3.inlineMessage1}" errorClass="errorMessage" fatalClass="fatalMessage" for="dropdown1" id="inlineMessage1"
                            infoClass="infoMessage" showDetail="false" showSummary="true"
                            style="height: 102px; left: 60px; top: 300px; position: absolute; width: 360px" warnClass="warnMessage"/>
                        <h:outputText binding="#{Page3.outputText5}" id="outputText5" style="height: 30px; left: 60px; top: 260px; position: absolute; width: 120px" value="Error Message:"/>
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>//////////////////////////////////////////////////// Page3.java //////////////////////////////////////////////////////////////////
    * Page3.java
    * Created on August 10, 2004, 10:35 AM
    * Copyright hovh
    package webapplication1;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import java.util.*;
    import javax.faces.component.*;
    import javax.faces.convert.*;
    public class Page3 extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlDataTable dataTable1 = new HtmlDataTable();
        public HtmlDataTable getDataTable1() {
            return dataTable1;
        public void setDataTable1(HtmlDataTable hdt) {
            this.dataTable1 = hdt;
        private DefaultTableDataModel dataTable1Model = new DefaultTableDataModel();
        public DefaultTableDataModel getDataTable1Model() {
            return dataTable1Model;
        public void setDataTable1Model(DefaultTableDataModel dtdm) {
            this.dataTable1Model = dtdm;
        private UIColumn column1 = new UIColumn();
        public UIColumn getColumn1() {
            return column1;
        public void setColumn1(UIColumn uic) {
            this.column1 = uic;
        private HtmlOutputText outputText1 = new HtmlOutputText();
        public HtmlOutputText getOutputText1() {
            return outputText1;
        public void setOutputText1(HtmlOutputText hot) {
            this.outputText1 = hot;
        private HtmlOutputText outputText2 = new HtmlOutputText();
        public HtmlOutputText getOutputText2() {
            return outputText2;
        public void setOutputText2(HtmlOutputText hot) {
            this.outputText2 = hot;
        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 HtmlOutputText outputText4 = new HtmlOutputText();
        public HtmlOutputText getOutputText4() {
            return outputText4;
        public void setOutputText4(HtmlOutputText hot) {
            this.outputText4 = hot;
        private UIColumn column3 = new UIColumn();
        public UIColumn getColumn3() {
            return column3;
        public void setColumn3(UIColumn uic) {
            this.column3 = uic;
        private HtmlOutputText outputText6 = new HtmlOutputText();
        public HtmlOutputText getOutputText6() {
            return outputText6;
        public void setOutputText6(HtmlOutputText hot) {
            this.outputText6 = hot;
        private HtmlOutputText outputMesg = new HtmlOutputText();
        public HtmlOutputText getOutputMesg() {
            return outputMesg;
        public void setOutputMesg(HtmlOutputText hot) {
            this.outputMesg = hot;
        private HtmlOutputText outputText8 = new HtmlOutputText();
        public HtmlOutputText getOutputText8() {
            return outputText8;
        public void setOutputText8(HtmlOutputText hot) {
            this.outputText8 = hot;
        private HtmlCommandButton button1 = new HtmlCommandButton();
         * Holds value of property tableData.
        private ArrayList tableData;
        public HtmlCommandButton getButton1() {
            return button1;
        public void setButton1(HtmlCommandButton hcb) {
            this.button1 = hcb;
        private HtmlSelectOneMenu dropdown1 = new HtmlSelectOneMenu();
        public HtmlSelectOneMenu getDropdown1() {
            return dropdown1;
        public void setDropdown1(HtmlSelectOneMenu hsom) {
            this.dropdown1 = hsom;
        private DefaultSelectItemsArray dropdown1DefaultItems = new DefaultSelectItemsArray();
        public DefaultSelectItemsArray getDropdown1DefaultItems() {
            return dropdown1DefaultItems;
        public void setDropdown1DefaultItems(DefaultSelectItemsArray dsia) {
            this.dropdown1DefaultItems = dsia;
        private UISelectItems dropdown1SelectItems = new UISelectItems();
        public UISelectItems getDropdown1SelectItems() {
            return dropdown1SelectItems;
        public void setDropdown1SelectItems(UISelectItems uisi) {
            this.dropdown1SelectItems = uisi;
        private IntegerConverter integerConverter1 = new IntegerConverter();
        public IntegerConverter getIntegerConverter1() {
            return integerConverter1;
        public void setIntegerConverter1(IntegerConverter ic) {
            this.integerConverter1 = ic;
        private HtmlMessage inlineMessage1 = new HtmlMessage();
        public HtmlMessage getInlineMessage1() {
            return inlineMessage1;
        public void setInlineMessage1(HtmlMessage hm) {
            this.inlineMessage1 = hm;
        private HtmlOutputText outputText5 = new HtmlOutputText();
        public HtmlOutputText getOutputText5() {
            return outputText5;
        public void setOutputText5(HtmlOutputText hot) {
            this.outputText5 = hot;
        // </editor-fold>
        public Page3() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
                dropdown1DefaultItems.setItems(new String[] {"1", "2", "3"});
            } catch (Exception e) {
                log("Page3 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e : new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
            tableData = new ArrayList();
            tableData.add(new webapplication1.TableEntry("c1_1", "c2_1", 1));
            tableData.add(new webapplication1.TableEntry("c1_2", "c2_2", 2));
            tableData.add(new webapplication1.TableEntry("c1_3", "c2_3", 3));
            this.dataTable1Model.setWrappedData(tableData);
        protected webapplication1.ApplicationBean1 getApplicationBean1() {
            return (webapplication1.ApplicationBean1)getBean("ApplicationBean1");
        protected webapplication1.SessionBean1 getSessionBean1() {
            return (webapplication1.SessionBean1)getBean("SessionBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
         * Getter for property tableData.
         * @return Value of property tableData.
        public ArrayList getTableData() {
            return this.tableData;
         * Setter for property tableData.
         * @param tableData New value of property tableData.
        public void setTableData(ArrayList tableData) {
            this.tableData = tableData;
        public String button1_action() {
            // User event code here...
            this.outputMesg.setValue("Hello world!");
            return null;
    }//////////////////////////////////////////////////// TableEntry.java //////////////////////////////////////////////////////////////////
    * TableEntry.java
    * Created on September 3, 2004, 2:38 PM
    package webapplication1;
    * @author  hovh
    public class TableEntry  {
        String c1;
        String c2;
        int c3;
        String c3Str;
        public TableEntry(String c1, String c2, int c3){
            this.c1 = c1;
            this.c2 = c2;
            this.c3 = c3;
        public String getC1() {
            return c1;
        public void setC1(String c1) {
            this.c1 = c1;
        public int getC3() {
            return c3;
        public void setC3(int c3) {
            this.c3 = c3;
        public String getC2() {
            return c2;
        public void setC2(String c2) {
            this.c2 = c2;
        public java.lang.String getC3Str() {
         return "" + c3;
        public void setC3Str(java.lang.String c3Str) {
         this.c3Str = c3Str;
         try{
             c3 = Integer.parseInt(c3Str);
         }catch(Exception e){

  • Command Link inside of datatable

    I have the following problem when I put a command link inside a datatable.
    The action or actionlisteners never get called. Now here is the funny thing.
    1. If I move the action link outside the datatable it works.
    2. if I change the scope of the bean to session it works
    3. if the datatable contains more than 1 row it works
    The last one tells me this is a bug.
    To test this I change the sql query to limit the result so 1 row would be returned.
    The sql query returns a CachedRowSetImpl
    I believe this is a bug.
    <h:dataTable rows="6" first="0" id="table" binding="#{event.eventdata}" value="#{event.eventdetails}" var="eventdetail">
    <h:column>
    <h:commandLink value="#{eventdetail.title}" action="#{event.resaveEventaction}" actionListener="#{event.resaveEventdetails}" id="test" >
    </h:commandLink>     
    </h:column>
    <h:column>
    </h:dataTable>

    Here is some additional information that makes this more confusing.
    The following code is used to populate the datatable
    public CachedRowSetImpl getEventdetails(){
         CachedRowSetImpl rs2 = null;
         String selectedeventmy = selectedevent;
         int rowcount = 0;
         try { 
              sql = "SELECT * FROM event where eventid='"+selectedeventmy+"' ";
              rs2 = RunQuery.mysql(sql);
              rowcount = rs2.size();
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         return rs2;
    where RunQuery.mysql is
    public class RunQuery {
         public static CachedRowSetImpl mysql(String sql) throws Exception {
              CachedRowSetImpl crset = null;
              InitialContext initCtx = new InitialContext();
              Context envCtx = (Context) initCtx.lookup("java:comp/env");
              try {
                   DataSource ds = (DataSource) envCtx.lookup("jdbc/associations");
                   Connection conn = null;
         Statement stmt = null;
         conn = ds.getConnection();
         stmt = conn.createStatement();
         stmt.execute(sql);
         ResultSet rs = stmt.getResultSet();
         crset = new CachedRowSetImpl();
         crset.populate(rs);
         rs.close();
         stmt.close();
         conn.close();
              } catch (Exception e) {
                   System.out.println(e.getMessage());
              return crset;
    if I replace the line
    String selectedeventmy = selectedevent;
    with String selectedeventmy = "61";
    it works properly.
    selectedevent is populated from the following triggered by another action event on another page. ? The funny thing is if the result set returns more that 1 row all works ok.
    public String viewDetails(){
         System.out.println("Running view Details");
         int selectedrow = eventlist.getRowIndex();
         Object selected = eventlist.getRowData();
         Map rowdata = (Map) selected;
         selectedevent = rowdata.get("eventid").toString();
         System.out.println("Selected Event:"+selectedevent);
         outcome="eventdetails";
         return outcome;
    }

  • ActionListener not firing within panelGrid (which is within a dataTable)

    I have a page with several forms on it:
    <h:form>
    ... commandLinks here are working
    </h:form>
    <h:form>
    <h:panelGrid>
    ...the actionListener here is firing
    </h:panelGrid>
    </h:form>
    <h:form>
    ... commandLinks here are working
    </h:form>
    <h:dataTable value="#{collection}" var="item">
    <h:column>
    <h:form>
    <h:panelGrid>
    ...actionListeners here ARE NOT FIRING!
    </h:panelGrid>
    </h:form>
    </h:column>
    </h:dataTable>
    I've tried many things to get this to work. I've checked spelling at least 10 times. I've put the whole page in a single form. Nothing seems to work. The bean associated with the actionListener is not even being instantiated unless I include a value binding expression in the form somewhere, but even then the listener is still not fired.
    So, please tell me if this is a known bug, or if it should work. I'm using JSF 1.1_1.
    All the data and form fields get displayed correctly, just the actionListeners are not firing. I've tried both methods of triggering an actionListener. Neither work.
    Why doesn't anyone from Sun post here anymore?????

    Could you please copy/paste the whole jsp page?I had to abandon the previous page structure due to time constraints. But, now I am having the same problem on another page, pasted below. In this case, the contactInfoForm.populate actionListeners are not firing:
    <?xml version="1.0" ?>
    <jsp:root version="2.0"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:x="http://java.sun.com/jstl/xml"
      xmlns:fmt="http://java.sun.com/jstl/fmt"
      xmlns:t="http://jakarta.apache.org/struts/tags-tiles"
      xmlns:htm="http://jsftutorials.net/htmLib">
      <f:subview id="content">
        <htm:div styleClass="heading">
          <htm:h2>
             <h:outputFormat value="#{msgs[heading]}">
                <f:param value="#{param.firstName}" />
                <f:param value="#{param.lastName}" />
             </h:outputFormat>
          </htm:h2>
        </htm:div>
        <htm:div styleClass="contentContainer">
        <h:messages/>
        <h:form>
          <h:commandLink id="backToPersons" styleClass="commandLink1" action="section.persons">
             <h:outputText value="#{msgs['persons.common.command.backToPersons']}"/>
          </h:commandLink>
        </h:form>
        <h:form style="padding-top: 10px">
          <h:commandLink id="newContactInfo" styleClass="commandLink1" action="/persons/contactInfo/newContactInfo">
             <h:outputText value="#{msgs['persons.person.contactInfo.list.command.new']}"/>
             <f:param name="personId" value="#{param.personId}"/>
             <f:param name="firstName" value="#{param.firstName}"/>
             <f:param name="lastName" value="#{param.lastName}"/>
          </h:commandLink>
        </h:form>
        <h:form>
           <h:dataTable value="#{contactInfoForm.contactInfoList}" var="contactInfo" cellpadding="5" cellspacing="0" styleClass="dataTable" headerClass="dataTableHeader" rendered="#{contactInfoForm.hasContactInfo}">
              <h:column>
                <f:facet name="header">
                   <h:outputText value="#{msgs['persons.person.contactInfo.list.header.contactInfoId']}"/>
                </f:facet>
                <htm:center><h:outputText value="#{contactInfo.contactInfoId}" styleClass="dataTableContent"/></htm:center>
              </h:column>
              <h:column>
                <f:facet name="header">
                   <h:outputText value="#{msgs['persons.person.contactInfo.list.header.description']}"/>
                </f:facet>
                <h:outputText value="#{contactInfo.description}" styleClass="dataTableContent"/>
              </h:column>
              <h:column>
                <f:facet name="header"></f:facet>
                <htm:center>
                   <h:commandLink styleClass="commandLink1" action="/persons/contactInfo/viewContactInfo" actionListener="#{contactInfoForm.populate}">
                      <f:param name="firstName" value="#{param.firstName}"/>
                      <f:param name="lastName" value="#{param.lastName}"/>
                      <f:param name="contactInfoId" value="#{contactInfo.contactInfoId}"/>
                      <h:outputText value="#{msgs['command.view']}"/>
                   </h:commandLink>
                </htm:center>
              </h:column>
              <h:column>
                <f:facet name="header"></f:facet>
                <htm:center>
                   <h:commandLink styleClass="commandLink1" action="/persons/contactInfo/editContactInfo" actionListener="#{contactInfoForm.populate}">
                      <f:param name="firstName" value="#{param.firstName}"/>
                      <f:param name="lastName" value="#{param.lastName}"/>
                      <f:param name="contactInfoId" value="#{contactInfo.contactInfoId}"/>
                      <h:outputText value="#{msgs['command.edit']}"/>
                   </h:commandLink>
                </htm:center>
              </h:column>
           </h:dataTable>
           <h:outputText value="#{msgs['persons.person.contactInfo.list.noRecords']}" styleClass="copy2" rendered="#{not contactInfoForm.hasContactInfo}"/>
        </h:form>
        </htm:div>
      </f:subview>
    </jsp:root>

Maybe you are looking for

  • Please help - Time Capsule Set up problems

    I bought a Time Capsule almost a year ago at the same time as my iMac, but have only tried to set it up in the last 3 weeks (so its the 6"x6"x1" version).  I followed the set up instructions numerous times but kept getting an error message in Airport

  • Re: skype to go number is not working

    It doesn't recognize ANY registered number, but sure KEEP EATING MY MONEY in the process of trying to fix it.It is so frustrating...Maybe it's time to change to Google voice!

  • External exe launched in a rectangular region drawn

    Hello, Please find an attachment. Kindly have a look on .uir file in the example. If i want to launch any external exe say e.g cmd.exe in the rectangular region drawn, what will be way of doing this as i am unable to launch .exe in the rectangular re

  • What are benefits and drawbacks of deleting cookies?

    I see articles about how to delete cookies and problems that seem to relate to having cookies or having deleted cookies but nothing (that I could find) about the benefits and drawbacks of cookies. Seems before deleting or preventing, it would be usef

  • Help: SQL query when parsed returns Invalid Identifier error

    Hi The expression posted below is the actual SQL Expression which is required in my report: ((select name from ( select loc_id,name,row_number()over(  order by r)  rn from ( SELECT 0, loc_id, Misc1_txt  NAME,'A' STATUS ,rownum r                     F