JSF datable help

Hello all.
I'm developing a web page compliant with WCAG 2.0 accessibility requirements. In this page I have a datatable and I need to include de 'id' attribute in the 'th' element, and the 'headers' attribute in each 'td' element.
But the 'h:datatable' component seems not support this feature.
Does anyone know how to include the attributes in those elements?
Thanks,
Marcelo

The thing with JSF is that it is built to focus on the back end (the server side), not the front end (the web page). If you need more control over the front end you'll have to look into the extension frameworks such as Primefaces, Richfaces and Tomahawk. Perhaps they'll have a datatable component which suits your needs.
If not, you'll just have to build your own HTML table using the facelets ui:repeat tag. Its not that hard really, you just need a decent object structure that translates easily into a HTML table (an ArrayList with a regular POJO bean usually does it for me). Alternatively, especially if you use JSF 2.0, you have the option of creating your own JSF custom component. But I would only consider that if you need to reuse the component in several pages.
Edited by: gimbal2 on Dec 15, 2011 1:54 AM

Similar Messages

  • JSF Newbie: help with forms & drop-downs

    Hi,
    I've managed to get a few simple things working with JSF using Netbeans & Visual Web pack. This is pretty sexy stuff for a grizzled old perl programmer. However, there are still a few things I'm having trouble getting through my thick head -- maybe some kind soul could point me in the right direction.
    I would like to have a couple of cascading data-bound drop-downs: dd1 provides a selection list for dd2, and the combination of dd1 and dd2, when selected, provides enough data to populate a webuijsf:table.
    The desired behaviour is that a change in dd1 repopulates the selection list for dd2 and furthermore, repopulates the table based on the selected value in dd1 plus the first value in the selection list of dd2. A change of selection in dd2 repopulates the table accordingly.
    My prerender() for the page checks if dd1.getSelected == null, and if so, sets the cursor to the first row in the bound data provider. Furthermore, it primes the rowset for dd2 with some rows from dd2's data provider based on the values in the first row for dd1.
    The first time through, everything is peachy: dd1 has the appropriate selection list, as does dd2. my webuijsf:table also has the appropriate rows (selected in the prerender()).
    My problem seems to be that when a new value is selected in dd2, dd1.getSelected == null at the next prerender(). This, of course, re-primes dd2, wiping out its selection.
    So, obviously, I don't really understand what I'm doing well enough to see how to do this. The visual web pack tutorials, where I started, really don't provide adequate explanation of what's going on, and the chapter on JSF in the J2EE tutorial is still a little abstract for me.
    I would be forever indebted if somebody could please provide a pointer to a resource (preferably something a perl programmer can afford ;-) that could help me understand, in concrete terms, how a form, and the elements on the form (and their events), are processed.
    Also, and as an aside, am I alone in thinking the whole Java thing is tremendously complex? I'm not talking about the Java language, which I find pretty intuitive, but the zillions of J* stuff around it, which seems somewhat dense. I really do want to learn this stuff, but it's pretty bewildering!
    Thanks!
    Regards,
    Mike

    Normally I would tell you to inject the PersonController bean into the PersonSelectionListener bean as a managed property. Then drill into the bean to get the data you need.
    However, in this case you are dealing with a value change listener. Value change events are fired at the end of the Process Validations phase, before the Update Model Values phase. So in this case, the PersonController bean will not contain the selected person from the request. This is not a problem however, since the new value is passed via the ValueChangeEvent object.

  • New-Buddy to JSF: Need Help and Info

    Hi,
    Today, I just started with the JSF book... and am finding it a little too hot and complex to handle.
    Specially, may be, because of experience with ASP.Net (also being a contributor to Mono project). Here I have some direct questions:
    1. Cannot I get away with yet another configuration file: The faces-config file?
    2. It is mandatory to have the scope of the bean defined in the config file?
    3. For any custom tag, do all the attributes and blah blah needs to be in the TLD file? Cannot it be loaded dynamically? I mean.. everytime I add a new class, I must update the TLD file. Don't you think that sucks?
    Cheers,
    Gaurav Vaish
    http://mastergaurav.org
    --------------------------

    just a note there is nothing wronge with it i just dont want any info she had on it.

  • JSF with in another dynamic JSF - Urgent Help Needed

    Hi,
    When i have JSF with in another dynamic JSF it worked fine in weblogic 9.2. But in weblogic 10.3.2 it is thwoing illegal state exception. Ho w can i add another JSP?
    <h:form id="frmAssignImpersonate">
         <h:inputHidden id="hiddenSoxEditPrivilege" value="#{assignImpersonate.soxEditPrivilege}"/>
         <h:inputHidden id="donotdelete" value="#{assignImpersonate.donotDelete}"/>
         <table class="TableContentWhite" style="TABLE-LAYOUT: fixed" cellSpacing="0" cellPadding="0" width="400">
              <tr>
                   <td>
                   <jsp:include page="/jsf/common/a.jsp"flush="false"/>
                   </td>
              </tr>
         </table>
         <table cellpadding="0" cellspacing="0" border="0" align="left" width="500">
              <TR class="ColorModuleHeader" height="20">
                   <TD class="rowHdr" align="left">Assign Impersonation Rights</TD>
              </TR>
              <tr>
                   <td valign="top" Class="TableContentwhite" align="left">
                   <jsp:include page="/jsf/common/b.jsp"flush="false"/>
                   </td>
              </tr>
         </table>
    </h:form>
    <%@ include file="/jsf/common/bdeFooter.jsp" %>
    Exception:
    java.lang.IllegalStateException
         at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:258)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:215)
         at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:466)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:651)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1097)
         Truncated. see log file for complete stacktrace

    wrong forum, you will not get answer here

  • JSF PhaseListener and NavigationHandler

    Some questions, while going through JSF, please help:-
    1) If I write a custom PhaseListener and add it in faces_config.xml, then will the existing phaselisteners and my phaselistener will be working in cascade ? What order?
    2) What is the exact difference between a PhaseListener and NavigationHandler ? I can see that a NavigationHandler is invoked during all "INVOKE APPLICATION" phase. But a PHASELISTENER is invoked before and after every lifecycle. So if I need to write something which is applicable to all invocations, should it be in NavigationHandler or should it be in PhaseListener? One of my colleagues told that , for some events, PhaseListener will not be called, but a NavigationHandler is called. Can you please help on this internal?
    Please help, thanks a million.
    Thanks and regards,
    Shankar

    1) If I write a custom PhaseListener and add it in
    faces_config.xml, then will the existing
    phaselisteners and my phaselistener will be working
    in cascade ? What order?The same order as they are declared in the faces-config.
    2) What is the exact difference between a
    PhaseListener and NavigationHandler ? A NavigationHandler handles, yes, navigation and a PhaseListener is kind of a Filter which can act on different phases.
    So if I need to
    write something which is applicable to all
    invocations, should it be in NavigationHandler or
    should it be in PhaseListener? One of my colleagues
    told that , for some events, PhaseListener will not
    be called, but a NavigationHandler is called. Can you
    please help on this internal?Just let the PhaseListener listen on PhaseId.INVOKE_APPLICATION.

  • Problem with how help works

    Hi;
    I have the help system up for the JSF tutorial. I then move my mouse to the tag library and click on the info icon for the "Import CSS File" two problems with this:
    1. It takes you to help for Link (which is the next item).
    2. It jumps to that page in the help window I had up for the JSF tutorial and wipes the history so I can't go back to the JSF tutorial. This is a giant PITA.
    ??? - thanks - dave

    Hi,
    #1 is not an issue; the HTML anchor tag has been named Link within Tag Libraries view. The info icon on Link tag leads you to <A> element help page.
    The CSS file (using Import CSS file) is indeed defined by <link> tag.
    An issue has been logged regarding back button navigation.
    Try the following steps to workaround this issue,
    * When you are in JSF tutorial help page, click on Bookmark Document icon
    * And when you loose the page, you can navigate back switching to "Bookmarks tab" (Synchronize from "Show in Table of Contents")
    Thanks,
    M7 Support

  • Command_link does not work outside of form

    if command_link is outside of form, it is rendered without a warning notes, but does not work correctly.

    Sorry, you did not get my point again.
    Currently, I check how JSF RI helps developer to recognize his/her mistakes.
    In case of command_link outside of the form, RI says "Everything is all right. Spend the next couple minutes (couple hours or days, depends of developer qualification) to find this trick.

  • Problems With url-pattern in a filter-mapping

    Hi!
    I need to make a filter when the clients call a jsf pages in /pages in my web application, but when i make the filter-mapping like this:
         <filter-mapping>
              <filter-name>sessionFilter</filter-name>
              <url-pattern>/pages/*.jsf</url-pattern>
         </filter-mapping>An exception appears:
    SEVERE: Parse error in application web.xml
    java.lang.IllegalArgumentException: Invalid <url-pattern> /pages/*.jsf in filter mapping
         at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
         at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
         at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.commons.digester.Digester.parse(Digester.java:1548)
         at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:263)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:624)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
         at org.apache.catalina.core.StandardService.start(StandardService.java:480)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf
    Please Help me whit this.

    "the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf"
    Yes but in the filter you can get the url from the request.getUrl() and then only process requests that contain .jsf. Simply just pass all other requests along.
    Some information on url pattern matching:
    http://edocs.bea.com/wls/docs61/webapp/components.html#113049

  • Implementing a planner  using dataTable

    Hi,
    I'm trying to implement a planner, where x-axis (columns) represents days, and y-axis (rows) doesn't have any meaning. So events on this planner "spans" generally multiple days. Let's say there are 5 events on a given interval, the longest event comes to the center row (in this case row 3), then the others find their places recursively trying to place them selves near to the center row, if not +1/-1 and so on.
    Well, I've managed to mark these events on a [eventsCount, dayInterval] matrix. Let's say there are events from A to E. The matrix is something like this on a 7 days planner:
    ----1   2   3   4   5   6   7
    --|---|---|---|---|---|---|---|
    1 |   |   |   |   |   |   |   |
    --|---|---|---|---|---|---|---|
    2 | A | A | A |   | C | C |   |
    --|---|---|---|---|---|---|---|
    3 | B | B | B | B | B | B |   |
    --|---|---|---|---|---|---|---|
    4 |   |   | D |   |   | E |   |
    --|---|---|---|---|---|---|---|
    5 |   |   |   |   |   |   |   | Now I need to transform this data to a html table. The problem is I need to use col spans for events. Richfaces DataTable have colspan's but it's for a predefined structure, all or nothing case. So,
    1) I guess there is no way to manipulate single rows in a JSF DataTable?
    2) Do I need to generate the table by hand? If so, Is there a way where jsf can help me create child components (actually not components but tags). I think of adding children to a HtmlPanelGroup by a backing bean but I don't know how? Well in fact I know (...getChildren().add(...)) but this adds UIComponents, but in my case, I guess I'll need something like:
    Totally rubbish code :
    plannerGroup = new HtmlPanelGroup();
    Child plannerTable = new Child("table");
    plannerGroup.addChild(plannerTable);
    for ( i = 0 ; i < days ; i ++ ) {
       Child plannerRow = new Child("tr");
       plannerGroup.addChild(plannerRow);
       for ( i = 0 ; i < days ; i ++ ) {
          //generate columns...
          //add to plannerRow
    }I don't know how to accomplish something like this, and will be very happy if someone can help me out.
    Thanks

    Thank you,
    I've read your articles on your blog a couple of days ago, and they really helped me a lot. And now re-reading "Customized Tables" opens new perspectives. I will certainly try. But sooner or later, I feel I'll need to manually create some table and I'm really curious about how to add <tr>'s and <td>'s to a table manually?

  • Polling in BC4J Struts

    Hi folks,
    How would I achieve a polling functionality? One of our applications is setup with the 10gR2 version which comes with BC4J and Struts(Struts was a personal choice). I understand we have an af:poll tag with jsf which helps us to achieve the polling functionality. My query is how would I go about doing the same thing through Struts and BC4j. We don't have JSF, so its kind of tricky.
    My actual requirement is as follows:-
    I basically need to call an oracle report from java. I do this by having a custom implementation of the rwservlet. The oracle report generates a PDF file locally. Which I then need to store on my Database as a BLOB.
    I know how to call the report.
    I know where the pdf is located.
    I know how to store and retrieve the pdf from the DB through Struts.
    My only issues is in instructing my application from the report side to pick up the pdf file when the report is complete. I was thinking in these lines:-
    Rather than passing the instruction from the report side,in my struts action class i would set up some polling mechanism(which i don't know how to) that would tell me to look for the report in 2 minutes(which is how long the report takes to be generated), then pick it up and store it onto the DB.
    Since i "lose control" of the handle after redirecting to a different servlet for the report call, I don't see another alternative other than polling.
    Is there an alternative approach i can adopt to achieve the above functionality?
    If not, is it possible to poll through BC4J/Struts (as against ADF/JSF)?
    If not, please help :) .
    Cheers,
    K

    There is another danger related to this security hole:
    Struts suggests to locate JSPs below the WEB-INF directory to protect them from direct access. A JSP located here cannot be accessed directly but only using the appropriate action.
    One common approach implement security in a struts framework is to perform the required checks in actions. A user not logged in might for example been forwarded to the login screen instead of the requested page.
    If an Application relies on this fact and assumes that it is not possible to call a JSP located in WEB-INF without using the appropriate actions, this bug here opens another hole:
    The "currentPath" Parameter allows a user to call any JSP on your Web-Server! Simply modify the URL to look like this:
    navigate.do?amId=...&jboViewObject=...&currentPath=WEB-INF\path\to\any\page.jsp
    and you are in!
    Frank Brandstetter

  • Set current date

    Hello guys,
    Regarding the date, how can I set the current date as default value in a inputtext .
    It seems very tricky to handle devault values with JSF.
    please help
    Thanks

    Hi Suresh,
    Setting Current Date :
    oForm.Items.Item("txt1").Specific.Value=DateTime.Today.ToString("yyyyMMdd")
    Sure, This is helpful for you!!!
    Regards,
    G.Suresh

  • MS-SQL - Like search form from a group of products.

    SELECT P.ID AS ProductID, P.Name, P.Price, P.ProdID,
    P.ShipCost,
    P.ClearSale, P.SalePrice, G.gid, G.pid AS Gpid, G.ord,
    PC.cid, PC.gid AS
    PCgid
    FROM atblProducts P INNER JOIN Groups G ON P.ID = G.pid INNER
    JOIN PCat
    PC ON G.gid = PC.gid
    WHERE (P.price IS NOT NULL AND PC.cid = 51 OR PC.cid = 52 OR
    PC.cid = 53
    OR PC.cid = 54) OR P.Name LIKE '%MMColParam3%' OR P.ID LIKE
    '%MMColParam3%'
    ORDER BY P.ProductID
    WHERE P.Price IS NOT NULL AND PC.cid = 51 OR PC.cid = 52 OR
    PC.cid = 53
    OR PC.cid = 54
    This gives me the group of products that I need but as soon
    as I add the
    '%MMColParam3%' bit to see the items searched on, it fails.
    What I am doing is pulling in the '%MMColParam3%' using a
    form to check the
    product name, and the description out of a group of 4
    categories: 51, 52,
    53, 54. I can get the 4 categories to display but as soon as
    I add the OR
    P.Name LIKE '%MMColParam3%' OR P.ID LIKE '%MMColParam3%'
    bit, it fails.

    hi
    I don't think that building a search page on a read-only View Object should be a problem.
    Maybe these screencasts by Steve Muench about creating simple search pages with ADF Business Components and ADF Faces (JSF) could help.
    - Part 1: Web-Style Search Form
    - Part 2: Oracle Forms-Style EnterQuery/ExecuteQuery Mode Page
    - Part 3: Search Form Using View Object with Named Bind Parameters
    success
    Jan Vervecken

  • Data table navigation

    if i set no of records per page and the total records are more than that, i have to provide a navigation buttons, and page no. for eg.
    if no of records per page 2 and total no of records is 10 i have to show links numbered 1to 5 and next previous buttons. how can i do this in jsf
    please help me. thanks in advance.

    yes below the table and inside table it works fine.
    but not above tableIn that case I would use the following technique. Likely the issue is that the dataScroller component must occur after the dataTable component in the JSP/facelet. But you could use CSS to cause the HTML generated by the dataScroller to be rendered above the HTML generated by the dataTable.

  • Insert a dynamic image

    hi, i'm trying to convert a swing app to JSF
    in my swing app, i have a label which displays dynamic images which are user dependent.
    this is the code for it
    lblRegImage.setIcon( new ImageIcon(image.getScaledInstance(lblRegImage.getWidth(),lblRegImage.getHeight(),Image.SCALE_DEFAULT)));where lblRegImage is a Label component
    now for my equivalent JSF, i made an Image component instead of a Labale component to display my image. but the thing is the setIcon in the Image component only accepts a String. how do i convert the above code to JSF?
    help please.
    thanks

    Hi Don,
    As I said, when I insert any field in the report, say for instance the Student ID, and then link it to a database field containing the name of the image file to display (I have to concatenate the path to this file name as well), it first shows the report with the Student ID. If I click on it, because of the hyperlink defined at design time, it opens the file (an image in this case) in Internet Explorer, not on the report.
    The same happens if I put an image as an object on the report at design time. In this case as soon as I put the image object on the report it forces me to select an initial image to show on the report. Anyway, I define an hyperlink for this image, pointing it to the image file of the Student, using the database field containing the image file name. When I show the report I see the initial image I was forced to use and when I click it, the hyperlink takes me to the right student image, but even in this case it shows me the right image opening an Internet Explorer session and not on the report. On the report the initial image is still there and never changes.
    What I actually need is a way to put the student's image on the report as soon as it shows the other student's data, as the name, age, ***, and so on, without having to click somewhere to show the student's image.
    Thanks

  • Login kontrol

    ı wanna degrees of users
    if is admin see the all pages if is a only user cannat see the all pages.
    i use user degree when they login my web pages ı set user degree.
    but ı couldnt write a code where ı write it
    ı use adf bc and jsf
    please help me.

    Him
    have a look at SRDemo that you can install vie Help --> check for updates in JDeveloper. This has a user role page access handling
    Frank

Maybe you are looking for

  • How do I change the background picture that is shown when i start my Mac?

    On the iMacs in my school they have a different name for everyone of the after for example the band Queen and then there is a picture on the inlogg screen with queen on it. So then you log in and there is another background picture after that. I Have

  • JSF: Problem during Tomcat Startup

    Hi, I am having a strange problem with a JSF-application. I am using jdk 1.3.1 (13), Tomcat 5.0.28 and the Sun JSF-Ref. implementation. On my dev-environment all is well. On the system-test environment of the customer, Tomcat would not initialize the

  • Updating payment terms from BP TCODE to MK03 TCODE

    Hi all, My requirement  was to update the payment terms in to MK03 from BP Tcod .Our business useseres will give the payment terms in BP tcode and we have to update the payment terms in to MK03.How we will update the payment frome BP to MK03. In BP 

  • Email to vendor issues

    Hi I have a situation where in am not able to send emails to a vendor from ME22N I get the following error "E-mail address incorrect or non-existent". This issue is particular to a vendor,the email id maintained for the vendor is a valid one too. Ema

  • 'The font 'Arial-BoldMT' contains bad /Widths' message

    I have created a rather extensive form using Acrobat 5.0. After creating the form, I was reading online about the new feature in Acrobat 9 that offers the ability to allow Adobe Reader users to save a copy of a filled-in form. This was very appealing