Buggy dataTable

I've been fighting with dataTable for several days now. It looks like its implementation is EXTREMLY buggy. Here is a code snippet which reproduces the bug:
<h:form>
     <h:dataTable value="#{broker.list}" var="data" border="1">
          <h:column>
              <f:facet name="header">
                    <h:outputText value="Id" />
              </f:facet>
              <h:commandLink actionListener="#{broker.initDetails}" action="details">
                  <h:outputText value="#{data.id}"/>
                  <f:param name="id" value="#{data.id}"/>
              </h:commandLink>
          </h:column>
     </h:dataTable>
     <h:commandLink action="#{broker.reload}">
          <h:outputText value="More values"/>
     </h:commandLink>
</h:form>In short, this code displays a table of item ids. Upon clicking on an item a new page is displayed detailing the selected item. Also there's More Values button allowing to select more values from the DB. This is the initDetails method from broker:
public void initDetails(ActionEvent actionevent) throws AbortProcessingException {
       FacesContext facesContext = FacesContext.getCurrentInstance();
       Integer id = null;
       for (Iterator it = actionevent.getComponent().getChildren().iterator(); it.hasNext(); )
             UIComponent child = (UIComponent)it.next();
             if (child instanceof UIParameter)
                  String name = ((UIParameter)child).getName();
                  if (name.equals("id"))
                        id = (Integer)((UIParameter)child).getValue();
       if (id == null)
            throw new AbortProcessingException("No id parameter given.");
       setId(id.intValue());
}Now what happens is when I click on an item just after loading the page for the first time, I get the details page with the correct item. However, if I first click More Values button to see the next items and then click on an item, I get the details of a wrong item! More precisely I get the details of the item that was on this place before clicking More Values. Even more pricesely: if I have 2 items per page than clicking on the item
3 (on the second subset) I get the details for the item 1, clicking on the item 4 I get the details for the item 2.
After digging into sources for several days, I decided that dataTable caches its first set of values and then restores it after each subsequent restoreView phase until I go to another page and its state is lost. It is only after the state is lost, does the dataTable refresh its contents from the source.
Also there's another sad side effect of this buggy implemntation: When I click on the item the dataTable tries to restore its values from the source during the restoreView phase even though its not needed to display the details of this item.
As far as I have been able to understand from the sources, this bug has something to do with storing and restoring valueBindingMap. After restoration it retains links to the previous list of items.
MyFaces has its own dataTable implementation which can explicitly store items in the stateManager. It works fine except for the fact that it increases the amount of data send to/from the client.
I haven't found a solution to this problem. Reports of this bug has been here several times, but in other circumstances.
I'd LOVE to see a general solution to this problem, not just a walkaround in this particular case, because this example is intended to reproduce the bug only. I've faced it in other cases for several times!

There are no validation errors nor conversion errors, because there's just nothing to validate or convert! The page consists only of the list of items. These are the methods:
private boolean showFirst = true;
public String reload() {
       showFirst = !showFirst;
       return "";
public Vector getList() throws SQLException {
       Vector list = new Vector();
       Connection con = null;
       PreparedStatement st = null;
       ResultSet r = null;
       try {
             con = getGlobals().getCon();
             if(showFirst)
                st = con.prepareStatement("select * from `faces_students` where `id`<=2");
             else
                st = con.prepareStatement("select * from `faces_students` where `id`>2");
             r = st.executeQuery();
             while(r.next()) {
                   Data d = new Data();
                   d.setId(r.getInt("id"));
                   list.add(d);
       } finally {
             try {
                r.close();
             } catch(Exception e) {
             try {
                    st.close();
              } catch(Exception e) {
       return list;
}The Data object contains only member variables and accessors.

Similar Messages

  • JSF 1.2 DataTable management during view creation

    Hi all, I have a question on how JSF 1.2 manages DataTable exactly. Consider this table (suppose that tableList.persone has 3 items):
    <h:dataTable id="tablePersone" value="#{tableList.persone}" var="item">
    <h:column>
              <f:facet name="header">
              <h:outputText value="STATO" />
              </f:facet>
              <h:inputText value="#{item.stato}" />
         </h:column>
         <h:column>
              <f:facet name="header">
              <h:outputText value="CODICE" />
              </f:facet>
              <h:inputText value="#{item.codice}" />
         </h:column>
    </h:dataTable>
    I read that jsf iterates over the items of the list during the render response phase, in fact, "item" is not available when the view is built.
    Does it means that jsf does not duplicate the content of the table for each item in the list when creating the tree component?
    In the table above, each row has 2 inputText. If jsf does not create a couple of inputText objects for each row, how jsf handles all the 6 request parameters when the form is submitted (in particular during the apply request values phase).
    Thanks a lot,
    Nico

    I could be really mean right now in my answer.
    I did not even have to post anything, i choose to use MyFaces 1.2.1 and scraped JSF 1.2_06 SUN RI out of my projects lib folder.
    Sorry dude that's the reality, the exceptions the SUN RI threw does not help me in trying to work on real life applications.
    You know i have read that Sun RI implementation is probably best out there since work began on the 1.2 spec way before Apache MyFaces started, hence potentially less buggy.
    I picked up the latest code from SUN RI and encountered at least 3 exceptions that are very low level and hard to mitigate.
    While without any JSF pages modifications i plugged in MyFaces 1.2.1-Snapshot and not a single NullPointerException or a failure.
    I just want to reflect here on this situation because i have been always defending SUN and it's work against other packages
    but my situation with upgrading from 1.1 to JSF 1.2 really puts a dent in my conviction
    specially where UI is such a risky business for us developers in the Web industry.
    this Forum probably is taking me longer then if i just logged the issue against RI.
    But my point is that when such frameworks are being developed they should be tested against real large applications under many industry problems.
    I am after getting this point across, because right now i don't care if you these exceptions are being fixed i dumped your packages anyway.
    Now i know MyFaces have their own problems, but at this moment they are not my issues, my project works using their implementation and that's the story .

  • How can i use one datatable inside the other?

    Hi all,
    i need help ... i have this page that shows information from a relational table... for example a mapped table "Countries" that has a java.util.Set inside named "Cities" and i would like 2 know how can i do this using jsf...
    The display would be like this:
    Brasil
    Rio de Janeiro
    Sao Paulo
    USA
    New York
    Washington
    New Orleans
    And Goes on... So i guess it would be a dataTable inside the other, right? but i dunno how to do it...
    Thanks for any info. cya

    this is somehow a messy example. But just focus on the var attribute of outer datatable and how value attribute of inner datatable is referencing it.
    <h:dataTable id="table1" value="#{pc_City_state.listofstates.states}" var="varstates" styleClass="dataTable">
                   <h:column id="column1">
                        <f:facet name="header">
                             <h:outputText styleClass="outputText" value="StateName" id="text2"></h:outputText>
                        </f:facet>
                        <h:outputText id="text3" value="#{varstates.stateName}" styleClass="outputText">
                        </h:outputText>
                   </h:column>
                   <h:column id="column3">
    <f:facet name="header">
    </f:facet>
              <h:dataTable id="table2" value="#{varstates.cities}" var="varcities" styleClass="dataTable">
                                       <f:facet name="footer">
                                       </f:facet>
                                       <h:column id="column4">
              <f:facet name="header">
              <h:outputText styleClass="outputText" value="CityName" id="text6"></h:outputText>
              </f:facet>
              <h:outputText id="text7" value="#{varcities.cityName}" styleClass="outputText">
              </h:outputText></h:column>
              </h:dataTable>
    </h:column>
    </h:dataTable>

  • Bridge buggy opening file in photoshop CS3

    I have totally uninstalled (removing every bit!), re-installed, deleted prefs ad nauseum. If I start CS3 from the application icon (yes it is still in the default folder where I installed it *again* yesterday) all is well. If I try to open a photo from Bridge by right clicking I get two choices: open in Photoshop 10.0.1, or open in Photoshop 10.0.1 (default)
    Why does the right click on either choice open a buggy problem? First I'm told the application moved (it didn't and deleting the prefs didn't help) then, whether I chose repair or not, it opens but tells me that all my filters didn't load and it lines my menu bar with at least a half dozen "onOne" menus. Then when I close I get the message that it quit unexpectedly.
    I just had to go through a long process (thank you Adobe for the knowledge base!) getting my license to work again. Now I find there is some kind of communication problem between Bridge and CS3.
    Maybe that's why Adobe stopped supporting older versions. The program has gotten too big and buggy?
    If I drag the file from Bridge to the opened Photoshop (from the application folder) it opens perfectly. Since I have a work around, this isn't crucial, but I really wonder if anyone can explain the communication bug? Not much chance I'll spend the money for an upgrade to CS4. Especially since support will stop as soon as CS5 comes out. CS3 is buggy enough for me.

    Anne, with all respect, I differ with you. It's easy to blame the user when problems happen. I happen to be paranoid about maintaining my computer and so far, after switching to my Mac, it is mainly Adobe programs that cause problems, no matter how careful I am. Of course I might avoid problems by never installing useful plugins (and sometimes it is the plugin that causes a problem). Possibly my installation of the OnOne plugins (I really love these) caused this problem with Bridge.
    Computers are almost essential; for me one main enjoyment in life is working with my photos. I usually can figure out my problems on my own --learned to do that when I was running Windose :-) but in all fairness there are quirks and bugs that are NOT the user's doing. I figure if I'm not having problems it's luck as well as being careful.
    Hoping you won't take offense. The few times I have visited the forums you have been kind and helpful.
    Ramón, I will be checking out the Bridge forums from now on. This discussion has probably run it's course. Thank you again.

  • View images in a datatable from byte[]

    I am trying to view images in a datatable where the image is
    a byte[]. This is what I tried... doesn't work.
    <h:dataTable rows="5" value="#{AirportList.airportList}" var="airport" binding="#{AirportList.airportData}">
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportCode"/>
                </f:facet>
                <h:outputText value="#{airport.airportCode}"/>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportMap"/>
                </f:facet>
                  <h:inputHidden id="ole" value="#{airport.airportMap}"/>
                  <h:outputText value="#{AirportList.myMap}"/>
                 <div>
                 <!--
                      try
                        byte[] pic = (byte[])request.getAttribute("AirportList.myMap");
                        response.setContentType("image/jpeg");
                        OutputStream os = null;
                        os = response.getOutputStream() ;
                       // os.write(pic);
                        os.close();
                        os = null;
                      catch (Exception ex)
                        out.println("Exception: " + ex.getMessage());
                        ex.printStackTrace();
                   -->
                  </div>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportSugBook"/>
                </f:facet>
                <h:outputText value="#{airport.airportSugBook}"/>
              </h:column>
            </h:dataTable>

    my backing code
    public class Airport
      Collection AirportList;
      private UIData AirportData;
      byte[] MyMap;
      public Airport()
      public Collection getAirportList()
        try{
          InitialContext context = new InitialContext();
          AirportLOBLocalHome home =  (AirportLOBLocalHome)context.lookup("java:comp/env/ejb/local/AirportLOBLocal");
          AirportLOBLocal local = home.create();
          AirportList = local.showAirports();
          Iterator it = AirportList.iterator();
          while(it.hasNext())
            ((OtnAirportLobDetailsLocalDTO)it.next()).getAirportMap();
          return AirportList;
        catch(Throwable e)
          e.printStackTrace();
        return null;
      public void setAirportList(Collection AirportList)
        this.AirportList = AirportList;
      public UIData getAirportData()
        return AirportData;
      public void setAirportData(UIData AirportData)
        this.AirportData = AirportData;
      public byte[] getMyMap()
        OtnAirportLobDetailsLocalDTO ap = (OtnAirportLobDetailsLocalDTO)AirportData.getRowData();
        return ap.getAirportMap();
       // return null;
      public void setMyMap(byte[] MyMap)
        this.MyMap = MyMap;
    }

  • I can't view dataTable in JSF

    Hi, anyone who can help me with java server faces, i want to put data from a resultset to dataTable, i made everithing but my table is not visible.
    My code is:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>Consultas</title>
    </head>
    <body><h:form binding="#{backing_Consultas.form1}" id="form1">
    <h:commandButton value="commandButton1"
    binding="#{backing_Consultas.commandButton1}"
    id="commandButton1"
    action="#{backing_Consultas.commandButton1_action}"/>
    </p>
    <p>
    <h:dataTable border="1" var="#{backing_Consultas.dataTable1}"
    id="dataTable1">
    <h:column binding="#{backing_Consultas.column1}"/>
    <h:column binding="#{backing_Consultas.column2}"/>
    <h:column binding="#{backing_Consultas.column3}"/>
    <h:column binding="#{backing_Consultas.column4}"/>
    </h:dataTable>
    </h:form></body>
    </html>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Consultas-->
    </jsp:root>
    This es a JSPX page.
    Please any idea
    thanks
    alex

    Try to disable the hardware acceleration in the Flash Player.
    See [[Cannot view full screen Flash videos]]
    Flash "Display settings" window:
    * http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html

  • 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/

  • Is there a way to add a column after a filled DataTable from SQL with the same rows?

    My problem is that not to add rows like filled by SQLDataAdapter at the same row in DataGridView. How to make that? I showed below the details with my code also a screen shot, which shows the rows differences from the origin one.
    I don't want to add an expression as column behave in my sql script to get what I need with query result. I don't want to obtain that way.
    using (SqlConnection c = new SqlConnection(ConnStrMSSQL))
    c.Open();
    // 2
    // Create new DataAdapter
    using (SqlDataAdapter a = new SqlDataAdapter("SELECT SIPNO, SERINO, TARIH FROM SNOHAREKETLER WHERE Cast(TARIH as DATE) BETWEEN '2015/03/20' AND '2015/03/20' AND (TEZNO = 'T23' OR TEZNO = 'T31') AND CIKTI is null", c))
    // 3
    // Use DataAdapter to fill DataTable
    DataTable t = new DataTable();
    a.Fill(t);
    t.Columns.Add("MyColumn", typeof(string));
    DataRow workRow;
    int iGetCount = t.Rows.Count;
    for (int i = 0; i <= iGetCount - 1; i++)
    workRow = t.NewRow();
    workRow["MyColumn"] = i;
    t.Rows.Add(workRow);
    dataGridView1.DataSource = t;

    The extra column isn't applied to only certain rows.  The columns of a table identify what data each row will contain.  Hence adding a column to the table automatically adds them to the rows.  What you're seeing is that all the initial rows
    aren't being assigned a value so they retain their default value of null.  Later you enumerate the rows of the existing table and call AddRow which adds new rows.  This isn't adding columns, but rows.
    To generate values for the existing rows you should ideally simply pass the data back from the database.  DT computed columns can be difficult to set up as it is limited to what it can do.  If you want to use a computed column on the Datatable
    itself then define the column as a computed column and every row will calculate its own value.
    DataTable data = GetData();
    //Add elapsed time column
    var col = new DataColumn("ElapsedTime", typeof(TimeSpan), "expr");
    data.Columns.Add(col);
    dataGridView1.DataSource = data;
    The issue you will run into however is that calculating a diff on DateTime doesn't work in a computed column as the expression doesn't support the necessary functions.  You can google for how people solved this if you are interested in alternatives. 
    Most people just tend to add the column and then hook into the various change events to update the value as needed.

  • How can I display one of two DataTables based on criteria

    I have two DataTables. One DataTable should be displayed or the other DataTable should be displayed in the same JSP based on some criteria. I wish I could put an if statement in the JSP page but how else can I do this? Is there a JSF tag that is like an if statement?

    Hi
    Try to use rendered attribute.
    Create boolean variable in your bean ie private boolean showTab1And in jsp type
    <h:dataTable id="tab1" value="..." var="..."  rendered="#{myBean.showTab1}">
    </h:dataTable>
    <h:dataTable id="tab2" value="..." var="..."  rendered="#{!myBean.showTab1}">
    </h:dataTable>if showTab1 is true, first dataTable shows, otherwise second dataTable is shown.
    Hope it helps
    Martin
    ps. You can combine value of rendered :
    rendered="#{myBean.boolVar1 && myBean.boolVar2 && !myBean.boolvar3}"

  • DateField not getting copy in the matrix using Datasource & Datatable

    Hello All,
    I have tried to copy data From Purchase Order Tables to my own created User Defined Form matrix columns using DBDatasource & Datatables ,Instead of Document Date all other data are getting copied but that document date field is not
    getting the data plus it is not showing any error message as such.
    Following is the code which i have written :-
    =====================================
    oPurchase_Amend.DataSources.DataTables.Add("oMatrixDT" )
    oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).Clear()
    Dim sSQL As String = "SELECT T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price],(Select InvntryUoM From OITM Where ItemCode=T1.ItemCode) as 'UoM',T1.LineNum,T0.DocNum  as 'FrmDate' FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocNum] ='1' and T0.CardCode='C0001'
    oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).ExecuteQuery(sSQL)
    oMatrix = oPurchase_Amend.Items.Item("mtx_0").Specific
    oMatrix.Clear()
    Dim oDBDataSource As SAPbouiCOM.DBDataSource = oPurchase_Amend.DataSources.DBDataSources.Item("@OSL_POAMD")
    Dim oDataTable As SAPbouiCOM.DataTable = oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" )
    oDBDataSource.Clear()
    For row As Integer = 0 To oDataTable.Rows.Count - 1
    Dim offset As Integer = oDBDataSource.Size
    oDBDataSource.InsertRecord(row)
    oDBDataSource.SetValue("U_ItemCode", offset, oDataTable.GetValue("ItemCode", row).ToString())
    oDBDataSource.SetValue("U_ItemName", offset, oDataTable.GetValue("Dscription", row).ToString())
    oDBDataSource.SetValue("U_UoM", offset, oDataTable.GetValue("UoM", row).ToString())
    oDBDataSource.SetValue("U_OldQty", offset, oDataTable.GetValue("Quantity", row).ToString())
    oDBDataSource.SetValue("U_OldRate", offset, oDataTable.GetValue("Price", row).ToString())
    > Line For Copying Document Date Data to the matrix datasource
    oDBDataSource.SetValue("U_OldDate", offset, oDataTable.GetValue("FrmDate", row))
    oDBDataSource.SetValue("U_LineId", offset, oDataTable.GetValue("LineNum", row))
      Next
    '--- Rebinding the datasource to the matrix columns -
    oMatrix.Columns.Item("col_0").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemCode")
    oMatrix.Columns.Item("col_1").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemName")
    oMatrix.Columns.Item("col_3").DataBind.SetBound(True, "@OSL_POAMD", "U_OldQty")
    oMatrix.Columns.Item("col_5").DataBind.SetBound(True, "@OSL_POAMD", "U_OldRate")
    oMatrix.Columns.Item("col_7").DataBind.SetBound(True, "@OSL_POAMD", "U_OldDate")
    oMatrix.Columns.Item("col_9").DataBind.SetBound(True, "@OSL_POAMD", "U_LineId")
    oMatrix.LoadFromDataSource()
    But i am not able to get the document date in the column of the matrix .
    Please suggest what changes i have to meke in this code to get the desired output.
    Thanks & Regards,
    Amit
    Edited by: AmitSharma_061985 on Dec 17, 2009 12:24 PM

    Hi Michael,
    FrmDate is the Document date of the purchase order which i am fetching through sql query and trying to copy that in the matrix
    through datasource .
    Edited by: AmitSharma_061985 on Dec 18, 2009 7:07 AM

  • Iphone 5s ios 7.1 siri male voice buggy

    After upgrade to 7.1 Siri British male voice is buggy, low quality sound, mispelling. I had to change it into female voice! Anyone else?

    -> Find My iPhone Activation Lock: Removing a device from a previous owner’s account
    At top right of the page, select the language you want haa.

  • 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)

  • How do I fill an Excel spreadsheet with the contents of a DataTable? (C#, OleDb)

    The following fills a DataTable with the contents of an Excel spreadsheet.
        oledbCmd.CommandText = "SELECT * FROM [" + stSheetName + "$]";
        DataTable dtDataTable = new DataTable();
        using (OleDbDataAdapter oledbAdapter = new OleDbDataAdapter(oledbCmd))
        oledbAdapter.Fill(dtDataTable);
    How do I fill an Excel spreadsheet with the contents of a DataTable?
    bhs67

    You can try this Excel library, it can help u to
    export datatable to excel to Database.
    After add the reference to your project ,add the following code:
    private void button1_Click(object sender, EventArgs e)
    //connect database
    OleDbConnection connection = new OleDbConnection();
    connection.ConnectionString @"Provider=""Microsoft.Jet.OLEDB.4.0"";Data Source=""demo.mdb"";User Id=;Password="
    OleDbCommand command = new OleDbCommand();
    command.CommandText = "select * from parts";
    DataSet dataSet = new System.Data.DataSet();
    OleDbDataAdapter dataAdapter = new OleDbDataAdapter(command.CommandText,connection);
    dataAdapter.Fill(dataSet);
    DataTable t = dataSet.Tables[0];
    //export datatable to excel
    Workbook book = new Workbook();
    Worksheet sheet = book.Worksheets[0];
    sheet.InsertDataTable(t, true, 1, 1);
    book.SaveToFile("insertTableToExcel.xls");
    System.Diagnostics.Process.Start("insertTableToExcel.xls");
    http://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Data-Export-/Import-Export-Datatable-to-Excel-from-Database.html

  • Weblogic 10.3.2 Icefaces 2.0 error for dataTable-sortable

    Hi All:
    I am using weblogic 10.3.2 and JSF 2.0, ICEFACES 2.0. I ran the example
    dataTable-sortable and I get the following error:
    jar files in the war file:
    commons-collections-2.1.1.jar
    commons-logging-1.0.4.jar
    icefaces-ace.jar
    icefaces-compat.jar
    icefaces.jar
    icepush.jar
    javax.faces-2.1.4-sources.jar
    javax.faces-2.1.4.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    log4j-1.2.11.jar
    In the weblogic.xml:
    I added the following statement but still get the error below:
    <wls:jsp-descriptor><wls:encoding>UTF-8</wls:encoding></wls:jsp-descriptor>
    error from the console:
    java.lang.IllegalStateException
    at com.sun.faces.application.ViewHandlerResponseWrapper.getWriter(ViewHandlerResponseWrapper.java:192)
    at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:723)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:930)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:376)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:159)
    at jsp_servlet.__index._jspService(__index.java:79)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
    at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364)
    at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Any help or hint would be greatly appreciate it!!!

    Hi All:
    I am using weblogic 10.3.2 and JSF 2.0, ICEFACES 2.0. I ran the example
    dataTable-sortable and I get the following error:
    jar files in the war file:
    commons-collections-2.1.1.jar
    commons-logging-1.0.4.jar
    icefaces-ace.jar
    icefaces-compat.jar
    icefaces.jar
    icepush.jar
    javax.faces-2.1.4-sources.jar
    javax.faces-2.1.4.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    log4j-1.2.11.jar
    In the weblogic.xml:
    I added the following statement but still get the error below:
    <wls:jsp-descriptor><wls:encoding>UTF-8</wls:encoding></wls:jsp-descriptor>
    error from the console:
    java.lang.IllegalStateException
    at com.sun.faces.application.ViewHandlerResponseWrapper.getWriter(ViewHandlerResponseWrapper.java:192)
    at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:723)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:930)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:376)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:159)
    at jsp_servlet.__index._jspService(__index.java:79)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
    at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364)
    at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Any help or hint would be greatly appreciate it!!!

  • CommandLinks and CommandButtons in Datatable do not work

    I have read the threads about this issue and am aware of the fact that there is a problem, if the backing bean is in request scope. However, my backing bean is in session scope and it still does not work - my action methods are never called. What's more, I have another backing bean in session scope, where it works perfectly and I cannot see any difference between them.
    Here's the code, my backing bean is dms:
    <h:form rendered="#{dms.documents.rowCount > 0}">
    <h:dataTable rowClasses="..." headerClass="..." value="#{dms.documents}"
    columnClasses="..." var="item" border="1" cellpadding="2" cellspacing="0">
    <h:column>
    <f:facet name="header">
    <h:outputText>DocName</h:outputText>
    </f:facet>
    <h:commandLink action="#{dms.test}" value="#{item.docName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"/>
    <h:commandButton id="foo" value="View" action="#{dms.test}"/>
    </h:column>
    </h:dataTable>
    <h:commandLink action="#{dms.test}" value="Clickme"/>
    </h:form>
    Here is the code in the backing bean:
    public String test() {
    System.out.println("Hooray");
    return "mainPage";
    And this in faces-config.xml:
    <managed-bean>
    <managed-bean-name>dms</managed-bean-name>
    <managed-bean-class>com.mypackage.DmsController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Only the last link, the one outside the datatable and titled "Clickme", works. I can see "Hooray" in the logfile and am redirected to the main page. If I click any of the links or buttons in the datatable, nothing is written to the log and the same page is loaded again, but only the static content is displayed, i.e. no JSF tags are evaluated, they are just dropped. There are, however, a few hidden input fields called javax.faces.ViewState, which I don't know where they are coming from.
    As I said, I have another backing bean in session scope, which is modelled exactly like that and it works there. Maybe JSF apps are supposed to have only one controller?
    Many thanks in advance for any pointers,
    Ulrich
    Edit: It doesn't change anything if I put the backing bean in application scope. I did have the same problem before with my other backing bean, but could solve it there by putting it from request scope to session scope.

    <h:dataTable value="#{dms.documents}">How do you load this list? This list should not be null during the INVOKE_APPLICATION phase.
    Try stubbing the List right in the getDocuments() method and see if it works.

Maybe you are looking for

  • Search help to filter plants based on company code

    Hi folks,              I have to create a search help for plants based on the company code value. can I get any pointer to a search help exit for a similar requirement? Thanks Abhi

  • Removing keywords from multiple images when the keyword isn't in the list?

    So, I know that the method for removing a keyword from multiple images is to select the images, type the keyword in the inspector and press Shift-Return. However, that doesn't seem to work if the keyword I want to remove is not in the keyword databas

  • Haswell E benchmarks

    Hello all. It's is once again time for some benchmarks with the new release. I will also include the previous X79 4930K clocked at 4.4GHz and Dual Xeon 10 Core as reference to these. I will add them as I get them done. Please let me know if you have

  • Publishing  Site

    I just need to know where to go in Dreamweaver to FTP my site. I can't find it anywhere!

  • HT1369 can i locate my lost 3g iphone with my computer?

    i lost my phone in my house. i dont have a locator app on my phone. is there something i can do from my laptop to find it?