Custom Tag in JSF Data Table

I would like to do the equivalent of a custom tag within a JSF data table. How is this done? Custom tags don't seem to work within a JSF data table.

There's a decent tutorial here, Priyo:
http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf
Hope it helps,
Illu

Similar Messages

  • Jsf data table component + print null cell

    I am using the jsf data table component and binding the column values to a backing bean.
    <h:dataTable binding="#{backing_showDifferences.dataTable2}"
    id="dataTable2">
    <h:column binding="#{backing_showDifferences.userColumn1}"/>
    <h:column binding="#{backing_showDifferences.userColumn2}"/>
    <h:column binding="#{backing_showDifferences.userColumn3}"/>
    </h:dataTable>
    - some code from my showDifferences.java
    HtmlOutputText column1Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.uclass}");
    column1Text.setValueBinding("value", vb);
    usercolumn1.getChildren().add(column1Text);
    HtmlOutputText column2Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.ue1}");
    column2Text.setValueBinding("value", vb);
    usercolumn2.getChildren().add(column2Text);
    HtmlOutputText column3Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.ue2}");
    column3Text.setValueBinding("value", vb);
    usercolumn3.getChildren().add(column3Text);
    ResultSetDataModel dataModel = new ResultSetDataModel();
    dataModel.setWrappedData(rs);
    dataTable2.setValue(dataModel);
    The raw HTML:
    <table id="form1:dataTable2" class="iuptable" border="1">
    <thead>
    <tr>
    <th scope="col">Heading 1</th>
    <th scope="col">Heading 2</th>
    <th scope="col">Heading3</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>some data in this column</td>
    <td>X</td>
    <td></td>
    </tr>
    <tr>
    <td>Some more data in this row</td>
    <td>X</td>
    <td></td>
    </tr>
    </tbody>
    </table>
    My problem is this...in the raw HTML the <td></td> tag is not formatted nicely on my table output. I have lines around my entire table and each cell within it. When the <td></td> prints there are no lines. I am new to the JSF table data component, but if I were writing some JSP or servlet code I would check that if value was null I would append an &nbsp to the <td> tag (ex. <td>&nbsp</td>) and the table would be formatted properly. The backing bean that I am binding to is pulling the data from a database table...so my sql looks like this:
    SELECT uclass, ue1, ue2 from table1; my problem is when ue1 or ue2 is a null value.
    Any ideas would be greatly appreciated!

    Hi,
    the h:dataTable belongs to the JSF Reference Implementation from Sun, not to Oracle ADF Faces. The rendering is within this component set and I suggest to report your issue on one of the SUN forums (http://forum.java.sun.com/forum.jspa?forumID=427) as we have no handle to e.g. fix an issue if it exists in the component set.
    Frank

  • How to create a new custom tag in JSF 1.2

    Hi there,
    In JSF 1.2, all the classes (CommandButtonTag, CommandLinkTag, DataTableTag,...) in package com.sun.faces.taglib.html_basic are defined as final class. In JSF 1.1, we can create a custom tag that extends the tag in JSF taglib; it save us lots of time.
    Could anybody know how to create a new custom tag in JSF 1.2?
    Many thanks,
    Emily

    If I recall, it was done because how tags were to be handled in 1.2 was very different from 1.1 and it was felt that developers shouldn't rely on implementation specific classes (unless they were SPI) for several other reasons (application portability being the big one here).
    If it's felt that this was the wrong decision, please feel free to log an issue [1] against the RI (to date, no one has).
    As to the 'borked' dependency URLs, please log an issue [1] if you find these. We have nightly builds going that work from a clean workspace and checking today's result, it seems ok.
    [1] https://javaserverfaces.dev.java.net/issues

  • How To create a custom tag in jsf

    I'm trying to create a custom tag in jsf.what should be the approach to create it.it would be better if somebody will explain me from the skretch.

    There's a decent tutorial here, Priyo:
    http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf
    Hope it helps,
    Illu

  • Taglib problem: Cannot parse custom tag with short name table

    Hello!
    I am having problems deploying a jsp tag in web as. The same war file works fine on websphere, jboss. SAP web as seems to be complaining about the short name in the tld.
    Can any body me to any known web as issues with jsp tags?
    Thanks
    [code]
    Application error occurs during processing the request.
    Details: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException: Internal error while parsing JSP page /usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/dispear/servlet_jsp/disp/root/test.jsp.
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:85)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.getClassName(JSPServlet.java:207)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.compileAndGetClassName(JSPServlet.java:369)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:164)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Cannot parse custom tag with short name table.
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:129)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.ElementCollection.action(ElementCollection.java:52)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.initParser(JSPParser.java:307)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:74)
         ... 18 more
    Caused by: com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Unknown class name java.lang.Object.
         at com.sap.engine.services.servlets_jsp.lib.jspparser.taglib.TagBeginGenerator.convertString(TagBeginGenerator.java:365)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.taglib.TagBeginGenerator.generateSetters(TagBeginGenerator.java:187)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.taglib.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:212)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.taglib.TagBeginGenerator.generate(TagBeginGenerator.java:269)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:127)
         ... 21 more
    [/code]

    Hi Ray,
    I am facing similar kind of issue.
    Can you please help to resolve it?
    Thanks in advance.
    Logs are as below [Here I am using standard tag lib]::
    Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Cannot parse custom tag with short name [out].
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:183)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspIncludeDirective.action(JspIncludeDirective.java:51)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspElement.customTagAction(JspElement.java:994)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspElement.action(JspElement.java:228)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:69)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.GenerateJavaFile.generateJavaFile(GenerateJavaFile.java:72)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:270)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.generateJavaFile(JSPProcessor.java:194)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:126)
         at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassName(JSPChecker.java:319)
         at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.compileAndGetClassName(JSPChecker.java:248)
         at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassNameForProduction(JSPChecker.java:178)
         at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.processJSPRequest(JSPChecker.java:109)
         at com.sap.engine.services.servlets_jsp.jspparser_api.JspParser.generateJspClass(JspParser.java:154)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:193)
         ... 47 more
    Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Attribute [value] of [<c:out>] can accept only static values.
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.calculateAttributeValue(TagBeginGenerator.java:476)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateSetters(TagBeginGenerator.java:394)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:562)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generate(TagBeginGenerator.java:678)
         at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:181)
         ... 64 more
    Regards,
    Sankalp

  • Can I write Design-time for JSP custom tag(not JSF components)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Display Tag use with JSF Data Tables

    Has Anyone got to work the Display tag with JSF
    I have got soo far to display the table by using Display tag with JSF dataTables but unable to have a link or command button to navigate
    Theirs a online hack available for the same .....But i am unable to get to run it
    Has anybody got the solution for the same

    Hi ,
    I am trying to do the same but I have no success.
    My code is
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:c="urn:jsptld:http://java.sun.com/jstl/core"
         xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8" />
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag" />
         <h:dataTable value="#{sessionScope.users}" var="user" style=""/>
         <display:table name="sessionScope.users" class="" id="user">
              <display:column property="username"/>
              </display:table>
    </html>
    where users is a List Obj in the session. In output I receive just this page.
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="urn:jsptld:http://java.sun.com/jstl/core" xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8"></jsp:directive.page>
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag"></jsp:directive.page><table style="">
    <tbody>
    <tr>
    </tr>
    <tr>
    </tr>
    </tbody>
    </table>
         <display:table name="sessionScope.users" id="user">
              <display:column property="username"></display:column>
              </display:table>
    </html>
    It seems to that display tags are not parsed...
    Do zou have an idea?
    Thanks a lot in advance
    beppoz

  • JSF Data Table extension using sun's RI

    How do i modify the iteration logic of datatable in JSF? I need for 3 iteration the data table has to insert one row. How do i create custom component for these type of business logic?
    It should iterate horizontally,

    lets say you have a mainCollection and displayCollection.
    Iterator mainIter  = mainCollection.iterator();
    MainObject mainObj = null;
    DisplayObject dispObject = new DisplayObject();
    int counter = 1;
    while(mainIter.hasNext()){
        mainObj = (MainObject)mainIter.next();
        dispObject.setSomething1(mainObject.getSomething1());
        dispObject.setSomething2(mainObject.getSomething2());
        dispObject.setSomething3(mainObject.getSomething3());
       if(counter%3==0){   // add the object to the list and create a new instance
           displayCollection.add(dispObject);
           dispObject = new DisplayObject();
    counter =counter +1;
    if(dispObject !=null && dispObject.getSomething1()!=null){
           displayCollection.add(dispObject);  // add if this object is not added as the size of the list was not divisible by 3
    }Map this displayCollection in your JSP for display. You can have a single data table which will iterate over this collection.

  • JSF-Data Table displaying all data in a single row

    Hi Guys,
    Im new to JSF, im trying to display the details from a List in a data table, but all the details are getting displayed in a single cell instead of displaying as rows, can someone help me with this problem?

    You need post your code so that we can view it.
    This is an example of dataTable
    <h:dataTable border="1" id="qresults" cellpadding="4" styleClass="subjectQRTbl" cellspacing="4" value="#{wormingList.worming}" var="bbr" first="#{wormingList.firstRowIndex}" rows="#{wormingList.noOfRows}" rowClasses="evenRow,oddRow">
    <h:column>
    <f:facet name="header">
         <h:outputText escape="false" value="Vaccination Date" />
    </f:facet>
    <h:commandLink id="locnum" action="#{appAction.getWormingRecord}" title="Update Worming History Record">
    <h:outputText value="#{bbr.dateWormed}">
    <f:convertDateTime pattern="MM/dd/yyyy"/>
    </h:outputText>
    <f:param name = "recordId" value ="#{bbr.id}" />
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header" >
    <h:outputText escape="false" value="Vaccination Type" />
    </f:facet>
    <h:outputText value="#{bbr.type}" styleClass="readOnly" />
    </h:column>
    <h:column>
    <f:facet name="header" >
    <h:outputText value="Vaccination Dosage" />
    </f:facet>
    <h:outputText value="#{bbr.dosage}"styleClass="readOnly"/>
    </h:column>
    </h:dataTable>
    Hope this helps

  • JSF 1.2 style facelets custom tags in JSF 2.0

    Ahoy.
    Using facelets with JSF 1.2, one could create a custom tag in an xhtml file along the lines of:
    labelledInput.xhtml:
    <ui:component>
        <h:outputLabel value="#{label}: ">
            <h:inputText value="#{value}"/>
        </h:outputLabel>
    </ui:component>
    ...You could register it in faces-config.xml or somewhere and then use it with <custom:labeledInput label="Type Something: " value="#{bean.value}"/>.
    Alternatively, one could use <ui:composition> instead of <ui:component> in which case the tag wouldn't be considered as a component.
    I think it could possibly be done with composite components, but they're not quite the same, and their documentation is pretty limited (at least until some of the books come out this year).
    I want to use these more as shortcuts to reduce code duplication rather than adding functionality and they seemed to work well in the past for this.
    If they can't be used, is there a way of creating a composite component that doesn't act as a component?
    In particular, I want to make a tag that contains two components:
    - a label
    - a panel group containing an input and a message for that input
    Then I can add a bunch of these to a 2-column panel grid for a nicely formatted form. Doing it with composite components forces each tag to be a single component, which I don't want. Old-facelets <ui:composition> based tags would let me do this (I think.)

    Hello,
    You posted in the wrong forum. This one is dedicated to the Oracle Forms product.
    Francois

  • Adding custom column to a Data Table (bound to database table)

    Hello,
    I've added an additional "Output Text" column to an existing "Data Table" component, which is pulling a database table and rendering it. It's actually called "OutputText5". What I want to do, is set the value of the "OutputText5" dynamically, depending on a Date comparison between the system date, and one of the currentRow field values, which is actually an Oracle Date data type. basically I'm trying to use the Date.after() comparison and put different content in there depending on true or false evaluation.
    Seems simple enough .. but.. I'm trying to do this without using vim and JSP Beans (how I'd usually do this). I'm not experienced with JSF components and how this would be done using JSC - can I iterate over currentRow or something inside the "Page1.java" source? Is there an easy way to create dynamic value bindings like this in Data Table components in general? Maybe using expressions in "OutputText5" properties or something? I figure I should ask about doing this the easy way, before I spend lots of time and start teaching myself bad habbits.
    I apologise in advance if this is a repeat post. I spent some time searching ,but came up empty handed.
    Thanks in advance.
    David Basham

    Hi David,
    Here's some ideas to try on:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=49459
    hth,
    v

  • JSF Data Table in Sequential Level

    Hi All,
    Assume i have a List and it contains 2 records. I need to display in Sequential Level in Frontend,
    When i use the below code
    <h:dataTable value="#{emp.detailList}" var="empVO" headerClass="tableheader" columnClasses="tablecell">
    <h:column>
              <f:facet name="header">
              <h:outputText value="Emp No" />
              </f:facet>
              <h:outputText value="#{empVO.empNumber}" />
    </h:column>
    <h:column>
              <f:facet name="header">
              <h:outputText value="First Name" />
              </f:facet>
              <h:outputText value="#{empVO.firstName}" />
    </h:column>
    </h:dataTable>
    The above is showing as Tabel Level
    Tabel Level Mean
    Emp No First Name Last Name Age
    10 Rahul Jain 30
    20 Sunil Shetty 32
    In above all column are showing in Table Header and multiple row are displaing in Tabel Level.
    Sequential Level Mean
    Emp No 10 First Name Rahul
    Last Name Jain Age 30
    Emp No 20 First Name Sunil
    Last Name Shetty Age 31
    I want to display the above by using <h:dataTable>
    Anybody can help me in this regards.
    Thanks and Regards
    Srikanth

    Can you tell me sample code how to do that.
    Assume I have 1 arraylist and arraylist contains the 2 Value Object (it mean 2 records)
    1 Value object will have emp no, first name, last name and age
    and 2 value object will also have emp no, first name, last name and age
    both are different data.
    Thanks and Regards
    Srikanth

  • JSF Data Table

    I have the following requirement.
    I have DataTable with the following columns. |Status | Institution | State | Country | Major |Degree | Date
    status is drop down with values " ' ','completed', 'attended' " (note one of the values is empty).
    Each of these columns in binded to a corresponding UIInput data type
            private UISelectOne grad_status = new UISelectOne();
         private HtmlInputText institution = new HtmlInputText();
         private HtmlInputText state = new HtmlInputText();
         private HtmlInputText country = new HtmlInputText();
         private HtmlInputText major  = new HtmlInputText();
         private HtmlInputText degree = new HtmlInputText();
         private HtmlInputText date  = new HtmlInputText();I want the user to either enter the fields in the row completely or leave them alone.
    I have written an EL for each fields required attribute. The problem here is that it is not being evaluated for UISelectOne. but for the rest of the fields it is being evaluated correctly.
    required="#{!empty AP4b.institution.value  || !empty AP4b.state.value || !empty AP4b.country.value || !empty AP4b.degree.value ||!empty AP4b.major.value || !empty AP4b.date.value}"
    requiredMessage="status required"
    required="#{!empty AP4b.grad_status.value  || !empty AP4b.state.value || !empty AP4b.country.value || !empty AP4b.degree.value ||!empty AP4b.major.value || !empty AP4b.date.value}"
    requiredMessage="Institution required"
         required="#{!empty AP4b.grad_status.value  || !empty AP4b.institution.value ||      !empty AP4b.country.value || !empty AP4b.degree.value ||!empty AP4b.major.value || !empty AP4b.date.value}"
         requiredMessage ="State required"
    required="#{!empty AP4b.grad_status.value  || !empty AP4b.institution.value ||      !empty AP4b.state.value || !empty AP4b.degree.value ||!empty AP4b.major.value || !empty AP4b.date.value}"
      requiredMessage = "Country required"
      required="#{!empty AP4b.grad_status.value  || !empty AP4b.institution.value || !empty AP4b.state.value || !empty AP4b.degree.value ||!empty AP4b.country.value || !empty AP4b.date.value}"
      requiredMessage="Major required"
       required="#{!empty AP4b.grad_status.value  || !empty AP4b.institution.value || !empty AP4b.state.value || !empty AP4b.major.value ||!empty AP4b.country.value || !empty AP4b.date.value}"
      requiredMessage="Degree required"
       required="#{!empty AP4b.grad_status.value  || !empty AP4b.institution.value || !empty AP4b.state.value || !empty AP4b.degree.value ||!empty AP4b.country.value || !empty AP4b.major.value}"
      requiredMessage="Date required"Help is really appreciated.
    Regards
    Sandeep
    Edited by: sgatl2 on Aug 5, 2008 8:25 AM
    Edited by: sgatl2 on Aug 5, 2008 8:32 AM

    Hi,
    For the same dataTable above I have a boolean check box for which required should be set to false if the user has checked it.
    I have the following expression language but I cannot get it evaluated properly. Please suggest where I am doing the error.
    <h:dataTable value="#{AP4b.al_AcadAttend}" var="dt" id="dt1" styleClass="entryTable_nomargin"
                                  binding="#{AP4b.table}" headerClass="tableHeading3"
                                  columnClasses="tableData2,tableData2,tableData2,tableData2,tableData2,tableData2,tableData2">
              <h:column id="col_status">
              <f:facet name="header">
                   <h:outputText value="Status" id="ot_status"></h:outputText>
              </f:facet>
                   <h:panelGrid columns="1" style="width:7em" id="pgrd_status">
                        <h:selectOneMenu value="#{dt.graduationStatus}"      binding="#{AP4b.grad_status}"
                                  id="grad_status" required="#{AP4b.delete.selected != true && (!empty AP4b.institution.submittedValue ||
                                  !empty AP4b.state.submittedValue || !empty AP4b.country.submittedValue ||
                                  !empty AP4b.major.submittedValue ||     !empty AP4b.degree.submittedValue ||
                                  !empty AP4b.date.submittedValue)  }" requiredMessage="Status Required">
                                  <f:selectItems id="fselStatusItems" value="#{AP4b.gradStatusItems}" />
                        </h:selectOneMenu>
                        <h:message for="grad_status" errorClass="requiredMessage" id="msg_gstatus">
                        </h:message>
                   </h:panelGrid>
              </h:column>
                   <h:column id="col_inst">
                        <f:facet name="header">
                             <h:outputText value="Institution" id="ot_inst"></h:outputText>
                        </f:facet>
                        <h:panelGrid columns="1" style="width:13em" id="pgrd_inst">
                             <h:inputText value="#{dt.institution}" maxlength="60" size="20"
                                  style="width:13em" id="institution" binding="#{AP4b.institution}"
                                  required="#{AP4b.delete.selected != true && (AP4b.grad_status.localValue == 'Graduated' || AP4b.grad_status.localValue  =='Classes Taken'||
                                  !empty AP4b.state.submittedValue || !empty AP4b.country.submittedValue ||!empty AP4b.major.submittedValue ||
                                  !empty AP4b.degree.submittedValue || !empty AP4b.date.submittedValue)  }"
                                  requiredMessage="Insitution Required">
                             </h:inputText>
                             <h:message for="institution" errorClass="requiredMessage" id="msg_inst"></h:message>
                        </h:panelGrid>
                   </h:column>
                   <h:column id="col_state">
                        <f:facet name="header">
                             <h:outputText value="State" id="ot_state"></h:outputText>
                        </f:facet>
                        <h:panelGrid columns="1" style="width:2em" id="pgrd_state">
                             <h:inputText value="#{dt.state}" id="state" binding="#{AP4b.state}"
                                  style="width:2em"
                                  required="#{AP4b.delete.selected != true &&  (!empty AP4b.grad_status.localValue  || !empty AP4b.institution.value ||
                                  !empty AP4b.country.submittedValue || !empty AP4b.major.submittedValue ||
                                  !empty AP4b.degree.submittedValue || !empty AP4b.date.submittedValue)}"
                                  requiredMessage="State Required">
                             </h:inputText>
                             <h:message for="state" errorClass="requiredMessage" id="msg_state"></h:message>
                        </h:panelGrid>
                   </h:column>
                   <h:column id="col_country">
                        <f:facet name="header">
                             <h:outputText value="Country" id="ot_country"></h:outputText>
                        </f:facet>
                        <h:panelGrid columns="1" style="width:7em" id="pgrd_country">
                             <h:inputText value="#{dt.country}" id="country" style="width:7em"
                                  binding="#{AP4b.country}" required="#{AP4b.delete.selected != true && (!empty AP4b.grad_status.localValue  ||
                                  !empty AP4b.institution.value || !empty AP4b.state.value ||!empty AP4b.major.submittedValue
                                   || !empty AP4b.degree.submittedValue || !empty AP4b.date.submittedValue)  }"
                                  requiredMessage="Country Required">
                             </h:inputText>
                             <h:message for="country" errorClass="requiredMessage" id="msg_country"></h:message>
                        </h:panelGrid>
                   </h:column>
    </h:dataTable> Thanks Sandeep

  • JSF data table and commandLink

    Hi,
    Is the bug of using commandLink with datatable resolved for a request scope bean. The google search is not very helpful.
    I have already tried tomhawk datatable with preserveDataModel. Unfortunatelyy does not work.
    I am sure in JSF 2.0 it would have been resolved. Any help appreciated.
    Thanks
    Edited by: bhavin_monani on Nov 12, 2009 7:09 AM

    Problem #1
    I think commandLink will always forward all requests back to the JSF controller. If you do not have any actionListener on your commandLink (or do not use a backing bean's method as the action), you can use <h:outputLink> instead.
    Problem #2
    <link rel="stylesheet" href="<%=request.getServletPath()%>/css/coa.css"/>or
    <t:stylesheet path="/css/coa.css" />where <t:stylesheet> is from MyFaces Tomahawk.

  • JSF Data Table help

    I have the following dataTable columns
    Completed Status | Course |Period| YearCompleted | Course Name and Number| Institution | Credits | Grade |
    suppose there are 10 rows underneath this table. I want the user to fill all the fields except grade. I achieve this by placing the "required = true" attribute underneath every field. But for Grade I have special situation.
    The Completed Status is a drop down. with 2 options - 'completed', and 'in progress'.
    If Completed Status = completed then the Grade is required,
    but if completed status = 'in progress' then grade is not required.
    How can I achieve this. If I can do this only at the backing bean then how can I get the missed row id of the field "Grade" and put a new FacesMessage.
    Any help is really appreciated.
    Regards
    Sandeep

    Thanks for the suggestion and I tried implementing the same.I dont know why i am not getting the <h:message.> for Grade.am I missing any configuration settings.
    I have the following info for completedStatus and Grade.
    <h:dataTable value="#{Bean.ArrayList}" var="dt" styleClass="entryTable"  border="1" >
    <h:column headerClass="tableHeading2">
    <f:facet name="header">
    <h:outputText value="Completed Status"></h:outputText>
    </f:facet>
    <h:panelGrid columns="1">
    <h:selectOneMenu id="status" value="#{dt.completedStatus}" required="true" requiredMessage="Please select a status">
    <f:selectItems value="#{AP3b.statusItems}"/>
    </h:selectOneMenu>
    <h:message for="status" style="color:red" ></h:message>
    </h:panelGrid>
    </h:column>and for Grade I put the following code
    <h:column headerClass="tableHeading2">
    <f:facet name="header">
    <h:outputText value="Grade"></h:outputText>
    </f:facet>
    <h:panelGrid columns="1">
    <h:inputText value="#{dt.grade}" maxlength="4" size="4"  id ="grade"
    required = "#{dt.completedStatus eq 'completed'}" requiredMessage="Grade is required"></h:inputText>
    <h:message for="grade"  style="color:red"></h:message>
    </h:panelGrid>
    </h:column>Regards
    Sandeep

Maybe you are looking for

  • Displaying Report name in the PDF File.

    HI, I want to print the report in the PDF format. I executed one report and i am trying to print that report in PDF format. But in that PDF format it is not showing any report name. Can any body suggest me how can i get the report name in the PDF fil

  • Changing Songs in the iTunes Store

    Hello, When I am playing a song from a list in the iTunes store, and I use the arrow key to play the next song, the song stops playing entirely. Is this a new feature in iTunes 9, or is this just my computer having problems with the program? Thanks f

  • Change In Clock Time

    Hello All, We are working in UK. We have SAP for a system running on  ECC6 on AIX with TL07 SP1, and another running on 4.7 on AIX with TL08 SP3. We have to plan to change the clock by this month end. Last time we had an issue for the same and were g

  • Help. I can't open any of my project files,"Project file version not recognized". Whats going on?

    After uninstalling and reinstalling Prelude CC none of my project files will open. I get the notice "This version of the project file is not recognized!" I have no idea how to troubleshoot this. Any help would be greatly appreciated.

  • Firefox will open but not load any new tabs or windows after a set amount of time.

    After about a day of my computer running, Firefox will stop being able to browse the web at all. Any attempt to open a new window, tab, or refresh an old tab will result in the program not doing anything, or opening a new window/tab with (Untitled) i