H:datatable vs x:datatable

in myfaces i can do this after the user clicks on a link inside the table to get the row they clicked on.
(CastValue)request.getAttribute("domainNameTable");
I am starting a new project and it wont work, im wondering.... you cant do this with the reference implementation ?

public class Email {
    private String email;
    public Email(String email) {
        this.email = email;
    public String getEmail() {
        return email;
    public void setEmail(String email) {
        this.email = email;
}For the one that uses the Email class, I use this:
<h:dataTable value="#{emailTestBean.emails}"
                              var="email">
     <h:column>
          <f:facet name="header">
               <h:outputText value="Email Address" />
          </f:facet>
          <h:inputText value="#{email.email}" />
     </h:column>
     <f:facet name="footer">
          <h:commandButton value="Submit" />
     </f:facet>
</h:dataTable>Otherwise I don't need the extra ".email":
<h:dataTable value="#{emailTestBean.emails}"
                              var="email">
     <h:column>
          <f:facet name="header">
               <h:outputText value="Email Address" />
          </f:facet>
          <h:inputText value="#{email}" />
     </h:column>
     <f:facet name="footer">
          <h:commandButton value="Submit" />
     </f:facet>
</h:dataTable>

Similar Messages

  • JSF Datatable inside a datatable problems

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

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

  • How do I get the rowid or the DataModel from a DataTable inside a DataTable

    Hi,
    I have a simple application which I cannot get to work.
    I have two entity classes: Parent and Child.
    I want to create a page which lists all of the Parents, and in a column of the Parent row has an inner dataTable which displays the Children of the Parent. I then want to click on the Child and link to a view of that Child. What is happening is that I cannot resolve which child was clicked inside my row. I don't seem to be able to get the datamodel for the List children, so it always defaults to the first child in the list.
    Goal: drill down to a specific child from a list of parents with a sublist of children belonging to each parent.
    I have tried creating a new method called prepareChildView() in ParentController like this below but it always returns the first child. I figure I need to create the DataModel earlier but cannot figure out how to do this. Perhaps the auto generated pattern makes it difficult to achieve what I want to - not sure.
    public String prepareChildView() {
            current = (Parent)getItems().getRowData();
            DataModel d = new ListDataModel(current.getChildren());
            Child child = (Child)d.getRowData();
            //child is always the first child!
            return "\children\View";
        }I may be going about this completely wrong so am open to suggestions. I am using JSF2, Glassfish3.0.
    Parent.java
    @Entity
    public class Parent implements Serializable {
        @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
        private List<Child> children;
        public List<Child> getChildren() {
            return children;
        public void setChildren(List<Child> children) {
            this.children = children;
    }Child.java
    @Entity
    public class Child implements Serializable {
        @ManyToOne
        @JoinColumn(name = "parent")
        private Parent parent;
        public Parent getParent() {
            return parent;
        public void setParent(Parent parent) {
            this.parent = parent;
    }ParentFacade and ChildFacade are auto generated from NetBeans, as are ParentController and ChildController.
    ParentController:
    Code doen't fit in the post.
    List.xhtml
    <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListParentEmpty}" rendered="#{parentController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{parentController.items.rowCount > 0}">
                    <h:outputText value="#{parentController.pagination.pageFirstItem + 1}..#{parentController.pagination.pageLastItem + 1}/#{parentController.pagination.itemsCount}"/> 
                    <h:commandLink action="#{parentController.previous}" value="#{bundle.Previous} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasPreviousPage}"/> 
                    <h:commandLink action="#{parentController.next}" value="#{bundle.Next} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasNextPage}"/> 
                    <h:dataTable value="#{parentController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Id"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Name"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Children" />
                            </f:facet>
                            <h:dataTable value="#{item.children}" var="child" >
                                <h:column>
                                    <h:commandLink action="#{parentController.prepareView}" value="#{child.name}" />
                                </h:column>
                            </h:dataTable>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value=" "/>
                            </f:facet>
                            <h:commandLink action="#{parentController.prepareView}" value="#{bundle.ListParentViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.prepareEdit}" value="#{bundle.ListParentEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.destroy}" value="#{bundle.ListParentDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{parentController.prepareCreate}" value="#{bundle.ListParentCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListParentIndexLink}" action="/index" immediate="true" />
            </h:form>

    Hi,
    It will help to resolve your issue:
        public String processChildView(){
            UIComponent component = null;
            String  componentId = null;
            Parent parent = null; //Bean class
            Child child = null; //Bean Class
            FacesContext context = FacesContext.getCurrentInstance();
            UIViewRoot root = context.getViewRoot();
            String childView = "childView";
            //Parent Table UIData
            componentId = "parentChildTable";
            component = findComponent(root, componentId);               
            UIData parentTable = (UIData) component;
            //Child Table UIData
            componentId = "childTable";
            component = findComponent(root, componentId);               
            UIData childTable = (UIData) component;
            //Perform Parent Child operation
            if(parentTable != null && childTable != null){
                if(parentTable.getRowData() instanceof Parent){
                    //Get Parent Object from parentTable
                    parent = (Parent) parentTable.getRowData();
                    //Get child object by parent object using childTable's Row Index
                    parent = (Parent) parentTable.getRowData();
                    child = (Child) parent.getChild().get(childTable.getRowIndex());
                    System.out.println("Parent Name " + parent.getName() + "Child Name " + child.getName());
            return childView;
        //Utility method to get component by passing component id in requested view
        public static UIComponent findComponent(UIComponent c, String id) {
             if (id.equals(c.getId())) {
               return c;
             Iterator kids = c.getFacetsAndChildren();
             while (kids.hasNext()) {
               UIComponent found = (UIComponent) findComponent((UIComponent)kids.next(), id);
               if (found != null) {
                 return found;
             return null;
      } Regards,
    Manish Paliwal
    "Life is beautifull."

  • Using non-h:dataTable and h:dataTable tags

    I have the following.
    A JSF JSP with h:inputText tags. The tags are bound to properties of my bean (named ProductApprovalBean) which accesses the database. This code works ok.
    I want to add a h:dataTable tag to the same JSF JSP but the combinations I have tried cause runtime errors. Is it possible to mix them? If so, how would you recommend I do it?

    Do not use an h:panelGrid, instead make five h:column instances, each containing what goes in one cell of the table.

  • Save dates from a dataTable inside another dataTable

    Hello!
    I have in my code more or less this...
    <h:dataTable  value="#{page.labels}" var="dataR">
         <h:column id="tableNames">
                   <h:dataTable value="#{dataR.getNames}" var="dataR2">
                        <h:column id="column1">
                             <h:outputText styleClass="outputText" value="#{dataR2.name}"\>
                        </h:column>
                   </h:dataTable>
         </h:column>                    
    </h:dataTable>The names appears correctly... but when I try to save this names, the code doesn't get my page.save function. The page seems only be refreshed... :(
    Any idea?
    Thanks in advance.

    Hello!
    I have in my code more or less this...
    <h:dataTable  value="#{page.labels}" var="dataR">
         <h:column id="tableNames">
                   <h:dataTable value="#{dataR.getNames}" var="dataR2">
                        <h:column id="column1">
                             <h:outputText styleClass="outputText" value="#{dataR2.name}"\>
                        </h:column>
                   </h:dataTable>
         </h:column>                    
    </h:dataTable>The names appears correctly... but when I try to save this names, the code doesn't get my page.save function. The page seems only be refreshed... :(
    Any idea?
    Thanks in advance.

  • How To Install Invoke-SQLcmd2, Write-DataTable and Out-DataTable

    I found Chad Miller's SQL Server PowerShell scripts Write-DataTable, Out-DataTable and Invoke-SQLcmd2. I can't find any information regarding how to install them though - everywhere I look they're referred to as a script and not a module so add-module wouldn't
    work unless I'm missing something. Is there a module pack containing all three cmdlets available?
    Thanks in advance
    Adam

    $profile
    Will show you the loction
    test-path $profile
    Will give you a true or false if you actually have a file in there
    new-item $profile -itemtype file -force
    if false use the above to create one, from there you can open it up in notepad and edit it to include what you need.
    THIS IS FOR ANYONE IN THE FUTURE WHO COMES A CROSS THIS THREAD AND DOESN'T KNOW HOW TO DO PROFILES
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • 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

  • 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

  • How to add multiple datatable into a report

    Hello!
    I have a little issue. I'm creatring a report with one dataset containing multiple datatables
    lets call them datatable1 and datatable2.
    I have a separate program that's going to collect the data I need, and then export the report into a pdf file.
    During runtime my other program collects the data into it's own datatable1 and datatable2 (simular names). And then sent to the program binding the information together This is achieved using the following code. Example1
      private void SetDataTables(ReportDocument rpt, ref System.Collections.Specialized.NameValueCollection nmCheckAllTablesSet)
                Tables tbls = rpt.Database.Tables;  //The tables from the report is collected
                foreach (DataTable table in dataTable) //The tables retrieved from other program is looped throught
                    foreach (Table tbl in tbls) //For each table that exists in the report
                        if (table.TableName == tbl.Name) //If the table from the report is a match with the one from the program
                            tbl.SetDataSource(table); //If matched the table is combined using the SetDataSource
                            nmCheckAllTablesSet.Set(table.TableName, "true"); //Used later to check if all tables it bound.
    The code works fine if I remove one of the datatables, this have to be done in both the report and the calling program. When I use multiple datatable with setdatasource the pdf is created but no data is added. I have debugged the code to see if the data somehow gets lost on the way but no, the data gets transfered to the report but is somehow not bound.
    Example2:
    CrystalReport contaning Crtable1 and Crtable2.
    CallingProgram containging Cptable1 and Cptable2.
    1. CallingProgram fills the tables with data.
    2. Then sends the data to the report.
    3. The tables from the Report is collected and a SetDataSource is attempted.
    CrTable1.SetDataSource(CpTable1)
    CrTable2.SetDataSource(CpTable2)
    4.The report is exported to PDF.

    Hi,
    It seems that you are having issue with Crystal reports .Net SDK's.
    Post your question in Crystal Reports .NET SDK forum.
    That forum is monitored by qualified technicians and you will get a faster response there. Also, all .NET SDK queries remain in one place and thus can be easily searched in one place.
    Thank you for your understanding,
    Regards,
    Amit

  • Comboboxes are not set  on the 1st time a row is clicked in the dataTable

    I have somewhat the following setup:
    I have a DataTable that is filled with a listof objects, a actionListener is handeled when a row is clicked.
    Under the Table there are two ComboBoxes (lets call them Category and Item) that get their values from lists of Objects. The values of the list that backs the Item combo depend on the selected value of the Category combo.
    Lets assume the values look like this:
    CategoryA
    ---ItemA1
    ---ItemA2
    CategoryB
    ---ItemB1
    ---ItemB2
    Together with some textboxes, they should represent the values of the clicked row in the Table.
    Now the problem:
    When the comboboxes have a different value than the row that is be&iuml;ng selected the values of the comboboxes and textboxes are not set correctly until the 3rd time the row is clicked.
    It also doesn't go into the onClickMehod in the backing bean before the 3rd click. This is checked by a logger.
    an example:
    before clicking, the category combo is set to "CategoryB", the Item combo is set to "ItemB1" and the textboxes are empty. The row that is going to be clicked has as its category "CategoryA" and as its Item "ItemA1"
    1st click:
    the form still shows the values like they were before clicking, the log doesn't show that the method is triggered
    2nd click:
    the Item combo is set to "ItemA1", the category is still set to "CategoryB", the textBoxes are still empty. The log still doesn't show that the method is triggered
    3rd click:
    the Category combo is set to "CategoryA", the Item combo is set to "ItemA1", the textboxes also have their correct values.
    the code is as followed:
    JSP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head></head>
    <body>
    <f:view>
    <h:form binding="#{backingBean.pageLoad}">
    <h:dataTable binding="#{backingBean.dataTable}" columnClasses="COL1, COL1, COL2, COL2, COL3" value="#{backingBean.myObjects}" var="myObject" width="100%" headerClass="HEADING" rowClasses="ROW1, ROW2" rows="10">
    <h:column>
    <f:facet name="header">
    <h:commandLink actionListener="#{backingBean.sortDataList}" styleClass="rowHeader">
    <f:attribute name="sortField" value="getItemCategory" />
    <h:outputText value="Category"/>
    </h:commandLink>
    </f:facet>
    <h:commandLink shape="rect" styleClass="rowtext" value="#{myObject.item.itemCategory.description}" actionListener="#{backingBean.rowSelect}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:commandLink actionListener="#{backingBean.sortDataList}" styleClass="rowHeader">
    <f:attribute name="sortField" value="getItem" />
    <h:outputText value="Item"/>
    </h:commandLink>
    </f:facet>
    <h:commandLink shape="rect" styleClass="rowtext" value="#{myObject.item.name}" actionListener="#{backingBean.rowSelect}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:commandLink actionListener="#{backingBean.sortDataList}" styleClass="rowHeader">
    <f:attribute name="sortField" value="getDescription" />
    <h:outputText value="Certification"/>
    </h:commandLink>
    </f:facet>
    <h:commandLink shape="rect" styleClass="rowtext" value="#{myObject.description}" actionListener="#{myObject.description}"/>
    </h:column>
    <f:facet name="footer">
    <h:panelGroup style="text-align:right">
    <h:commandButton value="first" action="#{backingBean.pageFirst}" disabled="#{backingBean.dataTable.first == 0}" />
    <h:commandButton value="prev" action="#{backingBean.pagePrevious}" disabled="#{backingBean.dataTable.first == 0}" />
    <h:commandButton value="next" action="#{backingBean.pageNext}" disabled="#{backingBean.dataTable.first + backingBean.dataTable.rows >= backingBean.dataTable.rowCount}" />
    <h:commandButton value="last" action="#{backingBean.pageLast}" disabled="#{backingBean.dataTable.first + backingBean.dataTable.rows >= backingBean.dataTable.rowCount}" />
    <h:commandButton value="Append New" action="#{backingBean.ClearFields}" />
    </h:panelGroup>
    </f:facet>
    </h:dataTable>
    <h:inputHidden value="#{backingBean.sortField}"/>
    <h:inputHidden value="#{backingBean.sortAscending}"/>
    <h:inputHidden value="#{backingBean.myObjectId}"/>
    <br />
    <br />
    <table style="border-collapse: collapse; width:100%" cellpadding="3" border="1">
    <tr>
    <td style="text-align:left; width:20%; background-image:url('images/lbar.gif'); font-family:Arial; font-size:smaller; font-weight:bold" colspan="3">Detail</td>
    </tr>
    <tr>
    <td style="text-align:right; width:20%; background-color:#CCCCCC; font-family:Arial; font-size:smaller; font-weight:bold">Category </td>
    <td style="width:80%; background-color:#CCCCCC;font-weight:bold">
    <h:selectOneMenu value="#{backingBean.selectedCategory}" onchange="submit();" valueChangeListener="#{backingBean.CategoryChange}">
    <f:selectItems value="#{backingBean.selectedCategories}"/>
    </h:selectOneMenu>
    </td>
    </tr>
    <tr>
    <td style="text-align:right; width:20%; background-color:#CCCCCC; font-family:Arial; font-size:smaller; font-weight:bold">Item id </td>
    <td style="width:80%; background-color:#CCCCCC;font-weight:bold">
    <h:selectOneMenu value="#{backingBean.selectedItem}">
    <f:selectItems value="#{backingBean.selectedItems}"/>
    </h:selectOneMenu>
    </td>
    </tr>
    <tr>
    <td style="text-align:right; width:20%; background-color:#CCCCCC; font-family:Arial; font-size:smaller; font-weight:bold">Item Description </td>
    <td style="width:80%; background-color:#CCCCCC;font-weight:bold"> <h:inputTextarea value="#{backingBean.description}" cols="60" rows="5"/></td>
    </tr>
    </table>
    </h:form>
    </f:view>
    </body>
    </html>the backing bean:
    public class BackingBean{
    -- Declaration of properties --
    public void rowSelect(ActionEvent event) {
    // Get selected MyData item to be edited.
    logger.debug("Select row");
    FacesContext context = FacesContext.getCurrentInstance();
    try
    if ((sortField != null) && (myObjects != null)) {
    Collections.sort(myObjects, new DTOComparator(sortField, sortAscending));
    dataTable.saveState(context);
    catch(Exception e){
    logger.error(e.getLocalizedMessage(), e);
    context.addMessage("ERROR", new FacesMessage(e.toString()));}
    logger.debug("Setting fields");
    myObject = (MyObject) dataTable.getRowData();
    description = myObject.getDescription();
    itemCategory = myObject.getItem().getItemCategory();
    item = myObject.getItem();
    docDisabled = !certified;
    selectedCategory = itemCategory.getId();
    myObjectId = myObject.getId();
    logger.debug("Fields set");
    public void sortDataList(ActionEvent event) {
    String sortFieldAttribute = getAttribute(event, "sortField");
    // Get and set sort field and sort order.
    if (sortField != null && sortField.equals(sortFieldAttribute)) {
    sortAscending = !sortAscending;
    } else {
    sortField = sortFieldAttribute;
    sortAscending = true;
    // Sort results.
    if (sortField != null) {
    Collections.sort(myObjects, new DTOComparator(sortField, sortAscending));
    public void CategoryChange(ValueChangeEvent vce){
    try {
    logger.debug("SelectedIndexChange: Category: {}",vce.getNewValue().toString());
    selectedCategory = Integer.parseInt(vce.getNewValue().toString());
    logger.debug("SelectedIndexChange: Category");
    itemCategory = itemCategoryService.retrieveItemCategoryById(selectedCategory);
    logger.debug("Showing Category: {}", itemCategory.getDescription());
    } catch (Exception e) {
    logger.error("Error occured: {}",e.toString());
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage("ERROR", new FacesMessage(e.toString()));
    public List<SelectItem> getSelectedItems() {
    selectedItems = new ArrayList<SelectItem>();
    try
    logger.debug("selectedCategory: {}",selectedCategory);
    if (itemCategory!=null)
    logger.debug("Category Object: {}",itemCategory.getId());
    items.clear();
    items.addAll(itemCategoryService.retrieveItemCategoryById(selectedCategory).getItems());
    logger.debug("items recieved: {}",items.size());
    for (int count = 0; count < items.size(); count++) {
    selectedItems.add(new SelectItem(items.get(count).getSeq(),items.get(count).getName()));
    catch (Exception e){
    logger.error("Error occured: {}",e.toString());
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage("ERROR", new FacesMessage(e.toString()));
    return selectedItems;
    public List<SelectItem> getSelectedCategories() {
    selectedCategories = new ArrayList<SelectItem>();
    try{
    for (int count = 0; count < itemCategories.size(); count++) {
    if (itemCategories.get(count).getItems().size() != 0)
    selectedCategories.add(new SelectItem(itemCategories.get(count).getId(),itemCategories.get(count).getDescription()));
    if (selectedCategory == 0)
    selectedCategory = itemCategories.get(0).getId();
    catch (Exception e){
    logger.error("Error occured: {}",e.toString());
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage("ERROR", new FacesMessage(e.toString()));
    return selectedCategories;
    -- other getters and setters --
    }I've already tried to use the action attribute instead of the actionlistener attribute, also tried to add immediate="true" to all fields and columns.
    Did try to add onclick="submit();" to the rows.
    What can be done to fix it??
    ps: the enviroment is JSF + Spring + Hibernate

    The <h:messages/> tag is where the validation exception is shown, but no validation is used on the form, no other exeptions are sown.
    the List<Categories> is filled at a setPageLoad method which is bound to the form by <h:form binding="#{backingBean.pageLoad}">.
    The List<SelectedItem> of the categories box is filled in its getter and filled with the values of the List<Categories>
    And both the List<SelectedItem> of the items box and the List<Item> are filled in the getter of the List<SelectedItem> of the items box
    so instead of that i should rewrite it to something like this:
    public BackingBean() {
        selectedCategories = new List<SelectedItem>();
        selectedItems = new List<SelectedItem>();
        categories = CategoryService.retrieveCategories(); //gets all categories
        items = ItemService.retrieveItemsByCategory(selectedCategory); //gets the items
        for (int count = 0; count < categories.size(); count++) {
            selectedCategories.add(new SelectItem(categories.get(count).getId(),categories.get(count).getDescription()));
        if (selectedCategory == 0){
            selectedCategory = categories.get(0).getId();
        for (int count = 0; count < items.size(); count++) {
            selectedItems.add(new SelectItem(items.get(count).getId(),items.get(count).getDescription()));
        if (selectedItem == 0){
            selectedItem = items.get(0).getId();
    public void CategoryChange(ValueChangeEvent vce){
            try {
                if (vce.getPhaseId() != PhaseId.INVOKE_APPLICATION) {
                    vce.setPhaseId(PhaseId.INVOKE_APPLICATION);
                    vce.queue();
                } else {
                    FacesContext.getCurrentInstance().renderResponse();
                    selectedCategory = Integer.parseInt(vce.getNewValue().toString());
                    category = CategoryService.retrieveCategoryById(selectedCategory); // gets the category Object
            } catch (Exception e) {
                logger.error("Error occured: {}",e.toString());
                FacesContext context = FacesContext.getCurrentInstance();
                context.addMessage("ERROR", new FacesMessage(e.toString()));
    public List<SelectItem> getSelectedCategories() {
        return selectedCategories;
    public void setSelectedCategories(List<SelectItem> selectedCategories) {
        this.selectedCategories = selectedCategories;
    public List<SelectItem> getSelectedItems() {
        return selectedCategories;
    public void setSelectedItems(List<SelectItem> selectedItems) {
        this.selectedItems = selectedItems;
    }The bean is request scoped.

  • DataGridCellStyle: Set Background of DataGridCell based on value in a Different DataGrid / DataTable

    Hi everyone
    I am trying to set the background of a cell in a datagrid based on a value in a different datagrid. Is it possible to specify this in the XAML through binding? I'm using the MVVM pattern and would like to minimise code in the code behind. Please note that
    the datagrids are the same dimension, but the dimension is unknown until runtime.
    I've copied an image of the two datagrids. Essentially, the second datagrid will contain values of 0 or 1. I would then like to color the cells in the first datagrid a different color based on these values. 
    CODE:
    <DataGrid Style="{StaticResource Style1}" ItemsSource="{Binding Table1, StringFormat=n}" AutoGenerateColumns="True" >
    <DataGrid.InputBindings>
    <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CommandWithParameter}" CommandParameter="{Binding .}"/>
    </DataGrid.InputBindings>
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="Background" Value="{Binding Table2, Converter={StaticResource WeightConverter} }"/>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    Thanks!

    You could use a DataTrigger that binds to a column of a row of the other DataGrid like this:
    <DataGrid x:Name="datagrid"></DataGrid>
    <DataGrid x:Name="datagrid2">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Style.Triggers>
    <DataTrigger Binding="{Binding Path=Items[0].num, ElementName=dataGrid}" Value="abc">
    <Setter Property="Foreground" Value="Red"/>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    DataTable dt = new DataTable();
    dt.Columns.Add(new DataColumn("num") { DataType = typeof(string) });
    dt.Rows.Add("abc");
    datagrid.ItemsSource = dt.DefaultView;
    datagrid2.ItemsSource = new List<string> {"a", "b", "c" };
    Hope that helps.
    Please also remember to mark all helpful posts as answer to close your threads and please start a new thread if you have a new question.

  • How to change the row position in a datatable

    I am storing my list of lists in a datatable :
    DataTable table = new DataTable();
    for(int i = 0; i < info.Count; i++)
    table.Columns.Add(names[i]);
    for(int col = 0; col < info.Count; col++)
    for(int rows = 0; rows < info[col].Count; rows++)
    DataRow r = table.Rows.Add();
    r[names[col]] = info[col][rows];
    However the problem is that it is stored diagonally. Meaning that the first column is shown on rows 0-3, the second column 4-7 and so on. I want all the columns to be stored in positions 0-3. How can I do that ?

    "What would you suggest instead of datatable? I just want to show info of my lists that's all."
    Show in a control such as the WinForms's DataGridView or something similar?
    If you do not known the number and type of columns in advance then yes, using DataTable is a convenient way to do that as binding the grid to the list of lists won't work. Well, if the number of rows you can consider populating the grid control directly.
    If you do know the number and type of columns it's in general preferable to create a class to hold the information that corresponds to a row and then use a list of objects of that class. That list can easily be displayed in a grid control.

  • SelectOneMenu inside h:dataTable gives conversion error

    Hi guys,
    I'm enduring quite alot of misery attempting to put selectOneMenu UI components in my h:dataTable. Due to the 30000 character restriction, I can only submit my view and backing bean and DTO and the converter (even though the total characters of my files is only 26,583? [cat * | wc -c]). Perhaps you can figure out a way I can send me all my files and you'll be able to test it much easier.
    The jist of the problem is that I get a conversion error between the selectOneMenu and the backing DTO of the <h:dataTable>. After I define a converter I get a ClassCastException.
    My BIGGEST question is "Why do I even need a converter?", the selectItem(s)/options are hardcoded label/value Strings and so is the the property of the dataTable row's backing DTO!!!
    Here's the files, any assistance will be greatly appreciated.
    P.S. I'm running JDeveloper 10.1.3.3.
    Thanks.
    (All these files are in the same package so you can just put them all in a directory named "example"):
    My DTO BudgetEquipmentListVO.java:
    package example;
    import java.util.Date;
    import java.util.List;
    public class BudgetEquipmentListVO {
        private Integer rowNo = new Integer("0");               //Row number for paging thru dataTables.
        private String equipmentListId = new String("0");                        //From equipment_list table.
        private Integer equipmentCodeId = new Integer("0");         //From equipment_codes table
        private String objectCode = "0730";                     //So far, 0730,0735 are possible.
        private Integer budgetId = new Integer("0");            //fed_budget_id from fed_budget table.
        private String  description = "";
        private String  equipNo = "";                           //Alphanumeric
        private Date    dateAcquired = new Date();  
        private Integer estimatedCost = new Integer("0");       //Used for Stimulus Application
        private Integer actualCost = new Integer("0");          //Used for EOY expenditures.  Disable for stimulus application
        private String  bldgLocation = "";                      //Address where equipment is at.
        private String  approvedInd = "N";                      //Whether item's been approved or not. Y/N
        private Integer amountApproved = new Integer("0");      //Gets set on approval page.
        private StringBuffer comment = new StringBuffer(4000);  //Currently max 4000 chars
        private String  suppInstInd = "I";            //Support or Instruction item, S or I
        private Integer approvedById = new Integer("0");        //User id of approver.
        private Date    approvedDate = null;                    //Date approved
        private List<BudgetEquipmentListVO> innerList;
        public BudgetEquipmentListVO() {
        public void setObjectCode(String objectCode) {
            this.objectCode = objectCode;
        public String getObjectCode() {
            return objectCode;
        public void setBudgetId(Integer budgetId) {
            this.budgetId = budgetId;
        public Integer getBudgetId() {
            return budgetId;
        public void setDescription(String description) {
            this.description = description;
        public String getDescription() {
            return description;
        public void setEquipNo(String equipNo) {
            this.equipNo = equipNo;
        public String getEquipNo() {
            return equipNo;
        public void setDateAcquired(Date dateAcquired) {
            this.dateAcquired = dateAcquired;
        public Date getDateAcquired() {
            return dateAcquired;
        public void setEstimatedCost(Integer estimatedCost) {
            this.estimatedCost = estimatedCost;
        public Integer getEstimatedCost() {
            return estimatedCost;
        public void setActualCost(Integer actualCost) {
            this.actualCost = actualCost;
        public Integer getActualCost() {
            return actualCost;
        public void setBldgLocation(String bldgLocation) {
            this.bldgLocation = bldgLocation;
        public String getBldgLocation() {
            return bldgLocation;
        public void setApprovedInd(String approvedInd) {
            this.approvedInd = approvedInd;
        public String getApprovedInd() {
            return approvedInd;
        public void setAmountApproved(Integer amountApproved) {
            this.amountApproved = amountApproved;
        public Integer getAmountApproved() {
            return amountApproved;
        public void setComment(StringBuffer comment) {
            this.comment = comment;
        public StringBuffer getComment() {
            return comment;
        public void setSuppInstInd(String suppInstInd) {
            this.suppInstInd = suppInstInd;
        public String getSuppInstInd() {
            return suppInstInd;
        public void setApprovedById(Integer approvedBy) {
            this.approvedById = approvedBy;
        public Integer getApprovedById() {
            return approvedById;
        public void setApprovedDate(Date approvedDate) {
            this.approvedDate = approvedDate;
        public Date getApprovedDate() {
            return approvedDate;
        public void setRowNo(Integer rowNo) {
            this.rowNo = rowNo;
        public Integer getRowNo() {
            return rowNo;
        // Helpers ------------------------------------------------------------------------------------
         // Getters ------------------------------------------------------------------------------------
         public String getKey() {
             return equipmentListId;
         public BudgetEquipmentListVO getValue() {
             return this;
        // This must return true for another Foo object with same key/id.
        public boolean equals(Object other) {
            return other instanceof BudgetEquipmentListVO && equipmentListId != null && equipmentListId.equals(((BudgetEquipmentListVO) other).getEquipmentListId());
        // This must return the same hashcode for every Foo object with the same key.
        public int hashCode() {
            return equipmentListId != null ? this.getClass().hashCode() + equipmentListId.hashCode() : super.hashCode();
        // Override Object#toString() so that it returns a human readable String representation.
        // It is not required by the Converter or so, it just pleases the reading in the logs.
        public String toString() {
            return "BudgetEquipmentListVO[" + equipmentListId.toString() + ", " + equipmentCodeId.toString() + ", " + objectCode + ", " + approvedInd + ", " + suppInstInd + "]";
        public void setEquipmentListId(String equipmentListId) {
            this.equipmentListId = equipmentListId;
        public String getEquipmentListId() {
            return equipmentListId;
        public void setEquipmentCodeId(Integer equipmentCodeId) {
            this.equipmentCodeId = equipmentCodeId;
        public Integer getEquipmentCodeId() {
            return equipmentCodeId;
        public void setInnerList(List<BudgetEquipmentListVO> innerList) {
            this.innerList = innerList;
        public List<BudgetEquipmentListVO> getInnerList() {
            return innerList;
    The View, equipmentList.jspx:
    <?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"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <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>
      <f:loadBundle basename="myBundle" var="myBundle"/>
        <afh:html>
          <afh:head title="ARRA - Equipment List (0730, 0735)">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
            <link rel="stylesheet" type="text/css" href="/css/crud.css" />
            <script type="text/javascript" src="/js/global.js"></script>
          </afh:head>
          <afh:body>
            <h:form id="equipmentForm">
              <afh:tableLayout width="100%">
                <afh:rowLayout width="100%" halign="center">
                  <afh:cellFormat columnSpan="1" width="100%" halign="center"
                                  rowSpan="1">
                    <h:dataTable value="#{backing_equipmentScreen.dataList}"
                                 binding="#{backing_equipmentScreen.dataTable}"
                                 styleClass="dataTable" rowClasses="rowOdd,rowEven"
                                 var="dataItem" id="table" border="2"
                                 bgcolor="#C2DFFF" width="100%"
                                 rows="#{backing_equipmentScreen.numItems}">
                    <f:facet name="header">
                        <af:outputText value="#{myBundle.headerTable}"
                                       inlineStyle="font-size:small;"/>
                      </f:facet>
                        <h:column>
                            <f:facet name="header">
                                <af:outputText value="#{myBundle.headerColumnRowNumber}"
                                         inlineStyle="font-size:small;"/>
                            </f:facet>
                            <af:outputText value="#{backing_equipmentScreen.dataTable.rowIndex + 1}"
                                       inlineStyle="font-size:small;"/>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDesc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:outputText value="#{dataItem.description}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEquipNo}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.equipNo}"
                                           />
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDateAcquired}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <af:selectInputDate value="#{dataItem.dateAcquired}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnObjCode}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.objectCode}" binding="#{backing_equipmentScreen.objCodeMenu}">
                                <f:selectItem id="item1" itemLabel="0730" itemValue="0730"/>
                                <f:selectItem id="item2" itemLabel="0735" itemValue="0735"/>
                                <f:converter converterId="selectOneMenuConverter"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnInsSuppInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.suppInstInd}" binding="#{backing_equipmentScreen.suppInstMenu}">>
                                <f:selectItem id="supportitem1" itemLabel="Support" itemValue="S"/>
                                <f:selectItem id="supportitem2" itemLabel="Instruction" itemValue="I"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEstCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.estimatedCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnActualCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.actualCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnBldgLoc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.bldgLocation}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnApprovedInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.approvedInd}" binding="#{backing_equipmentScreen.yesNoMenu}">>
                                <f:selectItem id="yesnoitem1" itemLabel="Yes" itemValue="Y"/>
                                <f:selectItem id="yesnoitem2" itemLabel="No" itemValue="N"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnComments}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.comment}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                        <f:facet name="footer">
                            <h:panelGrid columns="4">
                                <h:outputLabel for="rows" value="#{myBundle.labelRowsPage}:" />
                                <h:panelGroup>
                                    <h:inputText id="rows" value="#{backing_equipmentScreen.dataTable.rows}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                                    <h:commandButton value="#{myBundle.buttonSet}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" />
                                </h:panelGroup>
                                <h:outputText value="#{myBundle.labelPaging}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonFirst}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonPrevious}" action="#{backing_equipmentScreen.pagePrevious}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonNext}" action="#{backing_equipmentScreen.pageNext}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:commandButton value="#{myBundle.buttonLast}" action="#{backing_equipmentScreen.pageLast}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:outputText value="#{myBundle.labelPage}: #{backing_equipmentScreen.currentPage} / #{backing_equipmentScreen.totalPages}" />
                                </h:panelGroup>
                                <h:outputLabel for="add" value="#{myBundle.labelAddRows}:" />
                                <h:panelGroup>
                                    <h:inputText id="add" value="#{backing_equipmentScreen.addCount}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                            <af:commandButton action="#{backing_equipmentScreen.actionAdd}"
                                              styleClass="input"
                                              text="#{myBundle.buttonAdd}"/>
                          </h:panelGroup>
                                <h:outputText value="#{myBundle.labelActions}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonSelectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and !backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonUnselectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonEdit}" action="#{backing_equipmentScreen.actionEdit}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonDelete}" action="#{backing_equipmentScreen.actionDelete}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton id="save" value="#{myBundle.buttonSave}" action="#{backing_equipmentScreen.actionSave}" rendered="#{backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonRefresh}" action="#{backing_equipmentScreen.actionRefresh}" immediate="true" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonReset}" action="#{backing_equipmentScreen.actionReset}" immediate="true" styleClass="input" />
                                </h:panelGroup>
                            </h:panelGrid>
                        </f:facet>
                    </h:dataTable>
                    <h:panelGroup rendered="#{empty backing_equipmentScreen.dataList and !backing_equipmentScreen.message}">
                        <h:panelGroup rendered="#{!backing_equipmentScreen.searchMode}">
                            <h:outputText value="#{myBundle.textNoData}" />
                            <h:commandButton value="#{myBundle.buttonAdd}" action="#{backing_equipmentScreen.actionAdd}" styleClass="input" />
                        </h:panelGroup>
                        <h:outputText value="#{myBundle.textRefineSearch}" rendered="#{backing_equipmentScreen.searchMode}" />
                    </h:panelGroup>
                    <h:panelGroup rendered="#{backing_equipmentScreen.message}">
                        <h:outputText value="#{myBundle.textErrors}" styleClass="error" />
                        <h:messages styleClass="error" />
                    </h:panelGroup>
                  </afh:cellFormat>
                </afh:rowLayout>
              </afh:tableLayout>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>

    Hi evryone,
    I have following piece of code
    <?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"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:messages/>
    <af:form>
    <af:selectOneChoice>
    <f:selectItem itemLabel="ABC" itemValue="ABC"/>
    <f:selectItem itemLabel="DEF" itemValue="DEF"/>
    <f:selectItem itemLabel="GHI" itemValue="GHI"/>
    <f:selectItem itemLabel="JKL" itemValue="JKL"/>
    <f:selectItem itemLabel="MNO" itemValue="MNO"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    When I run this program , I get following compiler error:
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Anyone has any ideas? Where could be problem?

Maybe you are looking for

  • Keynote created in 6.5 won't open in 6.1

    Anyone else encountering this issue? A Keynote presentation created in version 6.5 (Yosemite) cannot be opened on another mac with keynote version 6.1 (Mavericks).  Attempts are met with "Cannot be opened" and prompts to update to Yosemite.  I work a

  • What does a spinning question mark mean?

    When I turned my iPad on this morning, I get only a spinning question mark  (small question mark in a blue circle) when i try to go on the internet.  IPad comes on fine....but I can't get on the internet.  Mail is working though.  I reset it, nothing

  • Weblogic template directory structure.

    I was looking at the weblogic portal personalization template and I found that there is a project with a build.xml on it. If i run it manually I don't see the script been invoked but I can see it whenever I use the configuration wizard. How can I tri

  • What happened to my app icons

    ever since upgrading to the new yosemite some of my icons have gone weird   and do not display  pictures just a grey box with an A made out of a pencil, ruler and paintbrush. its really annoying can anyone help and this page won't let me up load a pi

  • Would I be able to print wirelessly from my Macbook Pro to an HP1606dn printer?

    Would I be able to print wirelessly from my Macbook Pro to an HP1606dn?