Row ice:datatable

Saludos a la comunidad. Tengo el siguiente problema. En una pagina .jspx, tengo un ice:form con determinadas dimensiones. Con un ice:datatable muestro los valores de un archivo y se visualizan por ejemplo 20 lineas (rows), pero necesito modificar la altura de las lineas para que en el mismo form se visualicen mas lineas. Esto significa que las lineas serán más angostas pero modificando el font se puede representar bien. Esto lo puedo hacer con un h:datatable pero pierdo las habilidades del ice:datatable.
¿Existe alguna forma de poder modificar la altura?, he recorrido varias paginas y no encuentro cómo hacerlo.
Desde ya muchas gracias.
Larry

Hi syllepsa,
Your coding part not display array list data assigning to htmlDataTable . Only creating moodContainer array list.
kush

Similar Messages

  • Selecting multiple rows in datatable

    Hi all,
    i want to select multiple rows in datatable using checkbox or radiobox.. after selecting more than one row, user will click on "add" button and that list will be maintained by array. but i can't figure out how do i select multiple entries...
    means how would i get to know which rows are selected ?
    please help me out..
    thanx in advance
    Venkatesh

    Pointer here is : bind datatable to a datatable object in the backing bean, get the state of the checkboxes there and perform the desired operation.
    HTH,
    Sachin

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Delete row in DataTable using JSF2 and Ajax

    Hi All,
    i am trying to delete a row in a DataTable with an Ajax call.
    I have a Bean holding an ArrayList of Articles.
    In the UI I iterate through my Articles using dataTable like this:
    <fieldset>
           <legend><b>Articles</b></legend>
            <h:dataTable value="#{bean.articles}" var="article" id="articles">
                  <h:column>
                       <h:inputText value="#{article.name}"/>
                        <h:commandButton value="delete" action="#{bean.deleteArticle}">
                                      <f:ajax render="articles"/>
                        </h:commandButton>
                    </h:column>
              </h:dataTable>
    </fieldset>When I click the delete button I want an Ajax call to remove the clicked item from the ArrayList and rerender the View.
    I do not understand how I know on the serverside bean which row to remove from the ArrayList.
    Is there a way to pass a parameter to the function bean.deleteArticle?
    Do you know an example/tutorial for this?
    Thank you!

    found a solution:
    <h:commandButton value="delete" action="#{bean.deleteArticle(article)}">
              <f:ajax render="@form"/>
    </h:commandButton>
    ...bean code:
    protected ArrayList<Article> articles;
    public void deleteArticle(final Article a){
            articles.remove(a);
    ...Edited by: halumi on Jul 28, 2010 1:45 PM

  • Asociation between Rows in GRidRows and Rows in Datatable of Grid Object

    Hi all.
    Anyone knows how to get the row number in datatable from a row in the Gridrows collection?
    I´m trying to get data from selected rows but I can`t do it.
    Thaks for the help.

    Sorry. I haven`t seen the GetDataTableRowIndex method in UI help files

  • Getting Id of the row in dataTable

    Hello everyone I have a problem.
    I have a dataTable that looks like this:
         <t:dataTable id="books1" rowOnDblClick="setSelectedRow();" value="#{listtest.list}" var="store">
              <h:column>
                   <h:inputHidden id="rowId" value="#{store.id_list}" />               
              </h:column>
              <h:column>
                  <f:facet name="header">
                        <h:outputText  value="#{listtest.label1}"/>
                   </f:facet>
                   <h:outputText value="#{store.string}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText  value="#{listtest.label2}"/>
                   </f:facet>
                   <h:outputText value="#{store.integer}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText  value="#{listtest.label3}"/>
                   </f:facet>
                   <h:outputText value="#{store.numeric}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText value="#{listtest.label4}"/>
                   </f:facet>
                   <h:outputText value="#{store.timestamp}"/>
              </h:column>
         </t:dataTable>And this code prints me some records.
    What I want is when I double click on a row then some action is starting for example delete action. To delete one record from a list i need the id of this one. And my question is: how to obtain an id from selected row using double click?
    Regards
    Tom

    Ok something is work, but i have a problem with passing this id to my manged bean.
    this my jsp page:
         <t:dataTable
              id="books1"
              rowOnClick=""
              rowOnDblClick="setSelectedRow(this,'login:frik');"
              columnClasses=""
              headerClass=""
              rowClasses=""
              styleClass=""
              value="#{listtest.list}"
              var="store"
              rowId="#{store.id_list}">
              <h:column>
                   <h:inputHidden id="rowId" value="#{store.id_list}" />               
              </h:column>
              <h:column>
                  <f:facet name="header">
                        <h:outputText value="#{listtest.label1}"/>
                   </f:facet>
                        <h:outputText value="#{store.string}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText value="#{listtest.label2}"/>
                   </f:facet>
                   <h:outputText value="#{store.integer}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText  value="#{listtest.label3}"/>
                   </f:facet>
                   <h:outputText value="#{store.numeric}"/>
              </h:column>
              <h:column>
                   <f:facet name="header">
                        <h:outputText value="#{listtest.label4}"/>
                   </f:facet>
                   <h:outputText value="#{store.timestamp}"/>
              </h:column>
         </t:dataTable>
         <h:form id="frik">     
    <h:inputText id="selectedRowId" value="#{listtest.row_id}" />     
              <security:token />
              <navigation:build
                   allRow="#{listtest.allRow}"
                   imgName="img/arrow-.gif"
                   maxPage="#{listtest.page}"
                   maxRow="#{listtest.row}"
                   classImg=""
                   classTable="dateTable"
                   classTr="dateTr"
                   classTd="dateTd"
                   classPagesOn="dateSpanOn"
                   classPagesOff="dateSpanOff"
                   classPageWith="dateSpanActiveOff"
                   leftText="#{msg['Navigation.LeftText']}"
                   midText="#{msg['Navigation.MidText']}"
                   rightText="#{msg['Navigation.RightText']}"
                   activePage="#{listtest.activePage}"
              />
         </h:form>and this is the setSelectedRow method (rowOnDblClick event)
    function setSelectedRow(elem,formName) {
         f = document.forms[formName];
         alert(f.elements[0].id);
         f.elements[0].value = elem.id;
         f.action = '/crm/conversion.jspx';
         f.submit();
    }When I double click on the row the value from the hidden filed(id from db) is passed to filed (selectedRowId) in the form below the dataTable. Than i set the action and then submit the page.
    My question is how to obtain an id from my filed in managed been? Becouse when the page is submitted next one will open and there is no interaction with managed bean.
    Regards
    Tom

  • Minimum Rows in DataTable?

    Greetings.
    I know it's possible to set the maximum number of rows to display in a DataTable, but is it possible to have it display an assigned maximum but leave the rows blank?
    For example, I have created a printer-friendly page that has a DataTable assigned to a parts list. While the maximum number of parts per page is 20, I would like to set the minimum number of rows to display to 20 as well, simply for the sake of having it look better.
    So... is there a way?

    Or, alternatively, is there a way to add a second footer or something that looks like a footer for the output of static information that will be located at the final line of the table no matter what size it is?

  • How to set the rows of dataTable using loadBundle tag?

    Hi,
    Can i set the rows property of a <h:dataTable> using the value from a <f:loadBundle> tag?
    I tried the following code
    <f:loadBundle basename="com.message.NumberOfRows" var="numRows"/>
    I have NumberOfRows.properties file with the following entry
    rows=5
    The dataTable code
    <h:dataTable value="#{mastData.list}" rows="#{numRows.rows}" align="center" var="mastBean">
    </h:dataTable>
    This code is generating ClassCast Exception.
    Please comment on this issue.
    Thanks,
    Renju

    Hi,
    Exactly Reymond, See Renju you already using mastData bean for datatable. In that create a bean method something like rows & create a getter/setter method returning int. In getter method try this code as
    ResourceBundle bundle = ResourceBundle.getBundle("ur resource bundle");
    rows = Integer.parseInt(bundle.getString("rows_to_display"));
    return rows.
    Hope you can now get some clear idea i guess
    Regards,
    A.

  • How to loop through rows in datatable?

    Hi,
    I have a datatable component with a few columns bound to a database table but I have also added a new textfield column to the datatable. The purpose of this datatable is to present the user with a list of products from the database and then allow the user to enter a quantity value into the textfield for each product (ie datatable row).
    This all works fine until i need to capture the quantity values the user has entered. It seems the datatable component can only provide the current row details. However what I want to do is when the user finishes entering the quantities for all the products they click a button and then I loop through each row in the datatable from start to end and find out what quantities were entered for each product.
    I can find no documentation or threads on how to do this. It seems like a very basic concept but perhaps is not possible to achieve. Can anyone help?
    Also I entered a default value of "0" in the value expression (ie text) property of the new textfield in the datatable but this value never appears (ie the textfields are always empty). However the text property seems to work ok for normal textfield components not within a datatable. Any ideas?
    Thanks.

    thanks, I am able to iterate through the datatable rows now and get the values, however I still have one (actually two) big problem...
    1. I cannot get the textfields to be prepopulated with a value when the page first loads. I have the text property of the textfield set to a value but this makes no difference, the textfields are always blank.
    2. After a user enters values and clicks the button to calculate the page reloads and again all entered values are gone (ie the damn textfields are empty again). Is this normal behaviour for textfields within a datatable....surely not.
    So, I added some code to my prerender method to specifically populate the textfields and although it loops through each textfield only the last textfield gets populated. I cannot work this one out. Datatables should be easy to work with, but like most things Creator turns an easy job into an impossible one.
    Please help.

  • How can I delete a row in datatable!

    This is my code:
    com.sun.jsfcl.data.DataCache.Row row =
    dataTable1Model.getDataCache().get(dataTable1.getRowIndex());
    row.setDeleted(true);
    dataTable1Model.commit();
    dataTable1Model.execute();
    we use msSQLServer2000.

    Another way, to do this (here's a snippet from AppModel)
    http://developer.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    if your in your DataTable you have a column of
    checkboxes. If you click on the checkbox and outside your
    datatable, you have a delete button. Note, sel is the id of
    the checkbox.
    for (int rowIndex = dataTable1.getFirst();
    rowIndex < (dataTable1.getFirst() + dataTable1.getRows());
    rowIndex++) {
    log("OnePage: check row " + rowIndex + " for deletion");
    dataTable1.setRowIndex(rowIndex);
    if (!dataTable1.isRowAvailable()) {
    log("OnePage: no data available for row " + rowIndex);
    break;
    if (sel.isSelected()) {
    log("OnePage: mark row " + rowIndex + " for deletion");
    com.sun.jsfcl.data.DataCache.Row row = dataTable1Model.getDataCache().get(rowIndex);
    row.setDeleted(true);
    count++;
    sel.setSelected(false);
    // Perform the actual delete transaction and report results
    try {
    dataTable1Model.commit();
    info("Total rows deleted: " + count);
    } catch (Exception e) {
    log("OnePage: Delete commit exception", e);
    error("OnePage: Delete commit exception: " + e);
    // Re-execute the query to pick up new results
    try {
    dataTable1Model.execute();
    } catch (SQLException e) {
    log("OnePage: Delete reselect exception", e);
    error("OnePage: Delete reselect exception: " + e);
    Refer to the AppModel for more info
    Thanks
    John B
    JSC QA

  • Need advice for dispalying multiple rows with datatable.

    Hi All,
    We have to design a conference booking search form which contains nX48 table.
    n -> indicates the conference rooms and 48 are the time slots(30 mins gap).
    While booking a conference room user enteres from time and to-time and from and to dates.
    In our search form, user searches with in the range of dates and times.
    We give a option for user to view according to date wise or room wise.
    Now main prblm is that we are capturing from and to times but how do we represent in data table.
    out of 48 columns assume only 4 slots are booked i.e 1200 hrs to 1400 hrs. so we need to display an image in that columns and up on clicking on that cell we have to produce data regarding that booking.
    In our pojo we have to and from time variables , but how can we display in datatable..should have to take a 48 column pojo.., if so how can I get the data at intersection point?
    Please do help me...
    Regards,
    Kranthi Kiran

    You could certainily create a 48 or 96 column grid. I would assume a simple "bar" image would go into that grid. You can create a method that gets called to determine if the image is rendered or not. Use a stylesheet (inline style) to set the width of the grid.
    While making a table with 48 column definitions is somewhat messy it is certainly no harder than cut and paste. The messy part is how to implement the boolean getter (DI) call to determine if a cell image is rendered as this would require 48 or 96 unique method definitions (one for each time slot). If you are will to do this then the solution is straight forward with a table.
    As for clicking on the image cell that is not an issue and easily handled.
    You have not mentioned what component suite you want to use. May I recommend that you take a look at Apache Trinidad (MyFaces project) or Oracle's ADF offering.
    If not you could do this with two tag iterators (e.g. tr:iterator) but fussing with trying to make sure you get cell alignment might be hard to do since you would not have a "master" grid in which you would be rendering your data.
    Could also write your own component ... but suspect you don't want to go there.
    You will find that they provide a robust table implementation that also supports the concept of "details", sort of a drill down capability that you can add to see additional information associated with a summary line in a table.

  • Ice:dataTable binding

    Hi
    I have got problem with dataTable. If I add binding attribute (binding="#{moodContainer.htmlDataTable}") to my view the table isn't displayed.
    import com.icesoft.faces.component.ext.HtmlDataTable;
    public class MoodContainer {
    private HtmlDataTable htmlDataTable;
    private int myRowIndex;     
    private List<MoodVO> moodContainer = new ArrayList<MoodVO>();
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO, Weather.SUNNY, true, true, false, true, true, "1234"));
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO, Weather.SUNNY, true, true, false, true, true, "1234"));
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO,
         public List<MoodVO> getMoodContainer() {
              return moodContainer;
             public int getMyRowIndex() {
             return htmlDataTable.getRowIndex();
             public void setMyRowIndex(int myRowIndex) {
             this.myRowIndex = myRowIndex;
         public HtmlDataTable getHtmlDataTable() {
              return htmlDataTable;
         public void setHtmlDataTable(HtmlDataTable htmlDataTable) {
              this.htmlDataTable = htmlDataTable;
         }I also tried to use UIData instead of HtmlDataTable but it doesn't work for me.
    Do you know what I am doing wrong?
    Thanks in advance
    Mariusz
    P.S. I am using facelets and ICEfaces 1.8.0
    Edited by: syllepsa on Jun 24, 2009 11:49 PM
    Edited by: syllepsa on Jun 24, 2009 11:50 PM

    Hi syllepsa,
    Your coding part not display array list data assigning to htmlDataTable . Only creating moodContainer array list.
    kush

  • How to use h:selectBooleanCheckbox in a datatable to select multiple rows

    One way here is set a Boolean property like "isSelected" in the javaBean, and binding it with EL in jsp page which like this:
    *<h:selectBooleanCheckbox value="#{var.isSelected}"/>*
    but this break the a well EntityBean construction cause there is a null-meaning property in this bean just for getting data easily. So, if there is any other solutions for this? i use to think use EL like this:
    *<h:selectBooleanCheckbox value="#{backBean.isSelected}">*
    which bind the value to a Boolean type in the backBean ? but the problem here is there is only one boolean, how can it represent all those rows selected?
    the second way is to get the whole view tree from FacesContext, and find all the checkbox component with findComponent() method,but i don't know how connect this to the rows in datatable,which means how to get a object from the checkbox componentID?
    thanks,sorry for my english.

    Here is a copy:
    JSF<h:form>
        <h:dataTable value="#{myBean.dataList}" var="dataItem">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Select" />
                </f:facet>
                <h:selectBooleanCheckbox value="#{myBean.selectedIds[dataItem.id]}" />
            </h:column>
        </h:dataTable>
        <h:commandButton value="Get selected items" action="#{myBean.getSelectedItems}" />
    </h:form>MyBeanpackage mypackage;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    public class MyBean {
        // Init --------------------------------------------------------------------------------------
        private Map<Long, Boolean> selectedIds = new HashMap<Long, Boolean>();
        private List<MyData> selectedDataList;
        // Actions -----------------------------------------------------------------------------------
        public String getSelectedItems() {
            // Get selected items.
            selectedDataList = new ArrayList<MyData>();
            for (MyData dataItem : dataList) {
                if (selectedIds.get(dataItem.getId()).booleanValue()) {
                    selectedDataList.add(dataItem);
                    selectedIds.remove(dataItem.getId()); // Reset.
            // Do your thing with the MyData items in List selectedDataList.
            return "selected"; // Navigation case.
        // Getters -----------------------------------------------------------------------------------
        public Map<Long, Boolean> getSelectedIds() {
            return selectedIds;
        public List<MyData> getSelectedDataList() {
            return selectedDataList;
    }Where each MyData item (dataItem) has an unique 'id' property.

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

  • How to: window confirmation in a datatable row

    Hi.
    I would like to know if it possible to open a window confirmation (Yes,No) from a row selector in a datatable. The columns of the datatable are h:outputText, but the examples I have seen use always h:commandLink and h:commandButton.
    I want to stop the process when I select a row in datatable in case you select No and let the process in case Yes.
    if this possible??
    Thanks

    For better user experience you need to use standard html interaction tags (links or buttons) .
    You can't use onclick attribute on h:outputText as it haven't.

Maybe you are looking for

  • My  iTunes Library cleared out after the forced shutdown, how to recover it?

    So here is the thing, yesterday as usual, i was adding songs to my 10,000 tracks library's super organized as i do most of the time. Then i decided to shut down the computer  instead of just putting in of just hibernating him as i always do.. So my h

  • Huge iMovie file size.

    I made 3 movies in Quicktime from Keynote presentations, sizes 4, 24 and 48 MB, but when I import them into iMovie, the project file grows up to 7+ GB. Could somebody tell me why this happens, and is there a way to make it smaller or am I doing somet

  • Bug in Mail's handling of missing font for creating a "Note"

    I try to keep my font library trimmed down to a minimum, since i don't use many fonts, and don't like to see cluttered font menus. However I apparently disabled one too many fonts, and now Mail refuses to create "notes". When I go to create a new not

  • Is there a way to not include zero values in sums and an average?

    I'm working on a new performace evaluation & would like to sum the score of each line, then get an average of the total scores. example:  stength (1 value), Solid Performer (2 value), Performer (3 value), Recommend Development (4 value), N/A (zero va

  • My thunderbolt display makes a noise when plugged into my macbook pro laptop

    my thunderbolt display makes a noise when plugged into my macbook pro laptop. It sounds like an electronic noise which doesn't come through the speakers. Any advice how to eliminate this?