Problems in JSF t:commandlink

Hello,
I am facing a problem with JSF Command link
I have three JSP pages with one backing bean in session scope.The property defined in the backing bean is an Object type which contains fields mapped to the database.
The navigation between pages is through hyperlinks.
I enter data on page 1 and move to page 2.Again due to some reasons if I come back to first page I dont see values restored on the textfields on page 1.It is again reset when page 1 loads.I have to restore values and I have to do it using command links.I do not want button to navigate between two pages.
How can I restore data
I set the data on textfields as #{BackingBean.property.property_field}
I am new to JSF.can anyone suggest how to restore values while navigating.
[email protected]
Thankyou,
Pankaj Shirke

on the commandLink tag are you using the immediate = "ture" if so remove it or set it to false

Similar Messages

  • Very big problem with JSF about FORM and "id=" for HTML form's elements and

    I have discovered a very big problem with JSF about FORM and "id=" for HTML form's elements and java instruction "request.getParameterNames()".
    Suppose you have something like this, to render some datas form a Java Beans :
    <h:dataTable value="#{TablesDb2Bean.myDataDb2ListSelection}" var="current" border="2" width="50%" cellpadding="2" cellspacing="2" style="text-align: center">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:outputText id="nameTableDb2" value="#{current.db2_name_table}"/>
    </h:column>
    </h:dataTable>
    Everything works fine...
    Suppose you want to get the name/value pairs for id="nameTableDb2" and #{current.db2_name_table} to process them in a servlet. Here is the HTML generated :
    <td><span <span class="attribute-name">id=<span class="attribute-value">"j_id_jsp_1715189495_22:0:nameTableDb2">my-table-db2-xxxxx</span></td>
    You think you can use the java instructions :
    Enumeration NamesParam = request.getParameterNames();
    while (NomsParam.hasMoreElements()) {
    String NameParam = (String) NamesParam.nextElement();
    out.println("<h4>"++NameParam+ "+</h4>);
    YOU ARE WRONG : request.getParameterNames() wants the syntax *name="nameTableDb2" but JSF must use id="nameTableDb2" for "<h:outputText"... So, you can't process datas in a FORM generated with JSF in a Servlet ! Perhaps I have made an error, but really, I wonder which ?
    Edited by: ungars on Jul 18, 2010 12:43 AM
    Edited by: ungars on Jul 18, 2010 12:45 AM

    While I certainly appreciate ejb's helpful responses, this thread shows up a difference in perspective between how I read the forum and how others do. Author ejb is correct in advising you to stay inside JSF for form processing if form processing is what you want to do.
    However, I detect another aspect to this post which reminds me of something Marc Andreesen once said when he was trying to get Netscape off the ground: "there's no such thing as bad HTML."
    In this case, I interpret ungar's request as a new feature request. Can I phrase it like this?
    "Wouldn't it be nice if I could render my nice form with JSF but, in certain cases, when I REALLY know what I'm doing" just post out to a separate servlet? I know that in this case I'll be missing out on all the nice validation, conversion, l10n, i18n, ajax, portlet and other features provided by JSF".
    If this is the case, because it really misses the point of JSF, we don't allow it, but we do have an issue filed for it
    https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=127
    If you can't wait for it to be fixed, you could decorate the FormRenderer to fix what you want.
    I have an example in my JSF book that shows how to do this decoration. http://bit.ly/edburnsjsf2
    Ed

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • Problem with jsf DataTable

    when data is fetch using user criteria:
    i have a problem with jsf DataTable. I use e request bean to populate the datatable and i insert a commandButton column. The data dispay successfully into the datatable, but when a push the button on the row...the page simply refresh and notinhg else
    when data is fetch using constants:
    The data dispay successfully into the datatable, when a push the button on the row...the action execute OK

    Hi,
    I don't think that with this description only anybody on this list is able to help you.
    I use e request bean to populate the datatable and i insert a commandButton column
    What is a command button column and what does it do ?
    but when a push the button on the row...the page simply refresh and notinhg else
    What did you do to debug the problem ?
    when data is fetch using constants
    What does this mean ?
    Frank

  • Navigation Problem in JSF - Urgent, pls help

    hi,
    I have a problem while navigating into a popup using a custom commandLink which opens the popup.The problem is that when i close the popup and return to the parent JSF and click any button or link in the parent, the page navigates to the page that was shown in the popup. This is my custom component:
    <hl:helplink id="alternateIdHelpLink" rendered="true" actionListener="#{helpBean.handleEvent}" value="Help" action="helpNeeded" target="NewWin" onclick="javascript:openPopup();"></hl:helplink>I have specified the navigation 'helpNeeded' inside the faces-config file which navigates to the page that is shown in the popup. So the problem is that i am unable to navigate to any other page after i open the popup(even after closing it).Can anyone pls find a solution for this problem.
    thanks and regards
    soorejkumar

    Thanks Sergey.Smirnov for the code..but its not working :-(...
    This is my javascript for opening the popup in my help.js file:
    function openPopup() {
        var windowDefn = "width=800, height=400, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=yes";
        win=window.open('',"NewWin", windowDefn);
    }On clicking the Custom Command Link the popup is opened. But then when i return back to the parent and click any other link or button the contents inside the popup is being displayed.
    <hl:helplink id="alternateIdHelpLink" rendered="true"  value="Help"  onclick="openPopup()" action="#{helpBean.execute}" target="NewWin" actionListener="#{helpBean.handleEvent}" ></hl:helplink>I tried to hard code the path of the jsf file into the popup but that gave an error that 'Page Cannot be Displayed'.
    I tried to get the path of the JSF using the contectPath as follows:
    var path= <%= renderResponse.encodeURL(renderRequest.getContextPath() + "/pages/epsHelp.jsp" %>;
    window.open('"+path+"','helpPopup','height=200,width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');",null);When i viewed the source of the parent page the javascript was showing the correct context path ie "/help/pages/myjsf.jsp". What might be the issue.Can you please help..
    Thanks
    soorejkumar

  • Problems in tag h:commandLink

    i use this tag in the test.jsp like this:
    <h:commandLink action="details">
    <h:outputText value="Details" />
    </h:commandLink>
    faces-config.xml like this:
    <navigation-rule>
    <from-view-id>test.jsp</from-view-id>
    <navigation-case>
    <from-outcome>details</from-outcome>
    <to-view-id>details.jsp</to-view-id>
    <redirect />
    </navigation-case>
    But when i click "Details",the routing doesn't work.
    if i change the tag <h:commandLink> into <h:commandButton> like this:
    <h:commandButton value="Details" action="details" />
    then it works.
    What's the problem with the tag <h:commandLink>?

    this is the example from "Java Server Face in Action"
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
         <html>
              <head>
                   <title>
                        <h:outputText value="ProjectTrack - Inbox" />
                   </title>
                   <link rel="stylesheet" type="text/css" href="../stylesheet/stylesheet.css" />
              </head>
              <body class="page-background">
                   <jsp:include page="header.jsp"/>
                   <h:form>
                        <h:panelGrid headerClass="page-header" styleClass="table-background"
                                  columns="1" cellpadding="5">
                             <f:facet name="header">
                                  <h:outputText value="Inbox -approve or reject projects" />
                             </f:facet>
                             <h:outputText value="Application messages."
                                       styleClass="errors" />
                             <h:panelGrid columns="6" styleClass="table-background"
                                       rowClasses="table-odd-row,table-even-row"
                                       cellpadding="3">
                                  <h:commandLink styleClass="table-header">
                                       <h:outputText value="Project name" />
                                  </h:commandLink>
                                  <h:commandLink styleClass="table-header">
                                       <h:outputText value="Type" />
                                  </h:commandLink>
                                  <h:commandLink styleClass="table-header">
                                       <h:outputText value="Status" />
                                  </h:commandLink>
                                  <h:panelGroup/>
                                  <h:panelGroup/>
                                  <h:panelGroup/>
                                  <h:outputText value="Inventory Manager v2.0"/>
                                  <h:outputText value="Internal Desktop Application" />
                                  <h:outputText value="Requirements/Analysis" />
                                  <h:commandButton action="approve" value="Approve" >
                                  </h:commandButton>
                                  <h:commandLink action="reject">
                                       <h:outputText value="Reject" />
                                  </h:commandLink>
                                  <h:commandLink action="details">
                                       <h:outputText value="Details" />
                                  </h:commandLink>
                                  <h:outputText value="TimerTracker"/>
                                  <h:outputText value="Internal Web Application" />
                                  <h:outputText value="Requirements/Analysis" />
                                  <h:commandLink action="approve" value="Approve" immediate="true">
                                  </h:commandLink>
                                  <h:commandLink action="reject">
                                       <h:outputText value="Reject" />
                                  </h:commandLink>
                                  <h:commandLink action="details">
                                       <h:outputText value="Details" />
                                  </h:commandLink>
                             </h:panelGrid>
                        </h:panelGrid>
                   </h:form>
              </body>
         </html>
    </f:view>

  • JSF and commandlink, strange comportment (for a newbie)

    Hello everybody, and excuse me for my bad english...
    I am actually working (or learning) JSF. But i'm actually in front of a very strange thing:
    When I have got two commandlinks on a jsp page pointing to the same method bean, the second sems not to be active!
    Maybe my english is not clear, so the following code should be more clear:
    My home.jsp:
    <html>
         <head>
              <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
              <title>home</title>
         </head>
         <body>
              <f:view>
                   <f:subview id="header">
                        <jsp:include page="links.jsp"/>
                   </f:subview>
                   <f:subview id="login">
                        <h:outputText
                             value="A really simple test for login/logout
                                     and display products     for logged in poeple"
                             id="presentation"/>
                        <h:form id="loginForm" rendered="#{userBean.loggedIn=='false'}">
                             <h:outputText value="Username"/><br>
                             <h:inputText value="#{userBean.name}" id="username" required="true"/><br>
                             <h:outputText value="Password"/><br>
                             <h:inputSecret value="#{userBean.password}" id="userpassword" required="true"/><br>
                             <h:commandButton value="Login" action="#{userBean.loginAction}"  />
                             <br>
                        </h:form>
                   </f:subview>
                   <f:subview id="footer">
                        <h:form id="testlink" >
                             <h:outputText value="You can aloso see the user list here:"/>
                             <h:commandLink id="hometousers" action="#{userBean.getAllUserAction}" value="go" />
                           </h:form>
                   </f:subview>
              </f:view>
         </body>
    </html>my links.jsp:
    <f:subview id="header">
         <h:form id="linksform">
              <table>
                   <tr>
                        <td>
                             <h:outputLink id="headertohome"  value="home.jsf">
                                  <f:verbatim> home </f:verbatim>
                             </h:outputLink>
                             <h:commandLink id="headertoproducts"
                                               action="#{productListBean.productsAction}"
                                               rendered="#{userBean.loggedIn=='true'}">
                                  <h:outputText value=" products "/>
                             </h:commandLink>
                             <h:commandLink id="headertousers"
                                               action="#{userBean.getAllUserAction}"
                                               rendered="#{userBean.loggedIn=='true'}">
                                  <h:outputText value=" users "/>
                             </h:commandLink>
                        </td>
                   </tr>
              </table>
         </h:form>
    </f:subview>As you can see, home.jsp include links.jsp, and "idtousers" has the same action than "headertousers".
    When I logg in with the "loginForm", the links included are visible and works fine.
    But, always when I am logged in, the link at the bottom of home.jsp ("testlink") is unusable, it does absolutely nothing (just the # character appears in the url...).
    And when i'm not logged in, the include links does not appear (normal), and the link at the bottom functions well.
    I have tested several things like use several views, subviews, forms... but without results...
    I hope I am clear.
    Have you got any idea?
    Thanks by advance.

    Ok, this is the more simple example possible for this problem.
    I have only two jsp(jsf) files, the first file (just below) caontains two commandlinks used to go on the second (by using the navigation rules with a managed bean).
    The first commandlink works well, but the second doesn't do anything... (I just see the '#' character at the end of the url but nothing happens).
    I use the 1.1 jsf implementation.
    The first jsp file:
              <f:view>
                   <h:form>
                        <h:commandLink action="#{simpleBean.createMsgAction}" value="destination" />
                   </h:form>
                   <h:form>
                        <h:commandLink action="#{simpleBean.createMsgAction}" value="destination" />
                   </h:form>
              </f:view>The second jsp file:
              <f:view>
                   <h:dataTable value="#{simpleBean.msgs}" var="row">
                        <h:column>
                             <f:facet name="header" >
                                  <h:outputText value="string" />
                             </f:facet>
                             <h:outputText value="#{row.msg}"/>
                        </h:column>
                   </h:dataTable>
              </f:view>I was thinking it's maybe a bug of this JSF version, but i haven't had the time to test with the 1.2 .
    Thank you by advance for your help. (I always hope I am clear)

  • Problems in JSF t:dataTable /t:dataTable

    hi
    i am using <t:dataTable> to create jsf table.In the datatable each column has one <h:commandLink>.i had action methods to each and every column.At the same Jsf page,i am having some textfields using <h:inputText>.
    My problem is when i click the datatable colume link,it goes to the same jsf page,but there is no textfields at the same page.i am not expected to same jsf page.i wants to navigate to some other jsf pages.i had one solution i.e,i used binding method for each and every Link.The problem was solved temporarly.eventhough i am having solution using binding method.it is not applicable for huge data as i have large data.so what should i do to have exact solution .At the same time,i don't need binding methods.
    Advance thanks
    rgds
    OasisDeserts

    Hi.
    J solve the problem partly and here is the problem and solution:
    Problem - JDeveloper 10.1.3 have problem in showing table when code look like this:
    <h:dataTable width="350" value="#{infoBean.popular}" var="popular_">
    <h:column>
    <f:facet name="header">
    <h:panelGroup>
    <h:commandLink action="POPULAR">
    <h:outputText value="Najpopularnije"/>
    </h:commandLink>
    </h:panelGroup>
    </f:facet>
    <h:commandLink>
    <h:outputText value="#{popular_}" converter="ProductTitle"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    Solution - When J change code to this 'Design' tab shows the table but not the text in 'outputText'(here #{popular_}):
    <h:outputText value="#{popular_}">
    <f:converter converterId="ProductTitle"/>
    </h:outputText>
    Please try this!

  • Problem passing parameters to commandLink in a column

    Hi.
    I'm using JDeveloper 11.1.1.7.0
    I'm having this problem and I can't understand what I'm doing wrong.
    I have a table like this:
    <af:table value="#{bindings.myView.collectionModel}"
                var="row"
                rows="#{bindings.myView.rangeSize}"
                emptyText="#{bindings.myView.viewable ? 'No data to display.' : 'Access Denied.'}"
                fetchSize="#{bindings.myView.rangeSize}"
                rowBandingInterval="0"
                binding="#{backingBeanScope.myBean.t1}"
                id="t1"
                rowSelection="single"
                contentDelivery="immediate">
        <af:column sortProperty="#{bindings.myView.hints.PrId.name}"
                   sortable="false"
                   headerText="Nro. Proc."
                   id="c2" width="50">
          <af:outputText value="#{row.PrId}" id="ot5"/>
        </af:column>
        <af:column id="c8" headerText="Check" align="center" width="70">
          <af:commandLink text="rowCheck" id="cl1" partialSubmit="true">
            <f:attribute name="rowKey" value="#{row.rowKey}"/>
            <af:serverListener type="serverAction" method="#{backingBeanScope.myBean.linkEvaluacionServerAction}"/>
            <af:clientListener type="action" method="clientAction"/>
          </af:commandLink>
        </af:column>
    </af:table>
    After lot of tests, serverListener + clientListener is the only way to run some code after clicking the link. I don't know why, but actionListener in the link only works the first time. The second time and so on, actionListener did not fire.
    My problem is how to pass rowKey parameter to linkEvaluacionServerAction method:
      public void linkEvaluacionServerAction(ClientEvent ce){
        Object key1 = ce.getComponent().getAttributes().get("rowKey");
         // actions with key1
    I don't know why, but rowKey link attribute only takes its related value the first time I clicked on a link.
    From the second and so on, key1 values null
    How can I solve this? Any help is very appreciated.
    Regards

    Well, I rethink (again) the approach and solve it in  this way:
    <af:column id="c9" headerText="Evaluación">
                      <af:commandLink text="Evaluar Procedimiento" id="cl3"
                                      partialSubmit="true"
                                      actionListener="#{bindings.setCurrentRowWithKey.execute}"
                                      action="#{backingBeanScope.myBean.linkEvaluacionAction}"/>
                    </af:column>
    Parameter for setCurrentRowWithKey is #{row.rowKeyStr}
    In my method linkEvaluacionAction I do some additional checks.
    Hope this helps. Regards

  • Problem in JSF with Swing in a web application

    hi
    i am using jsf for my online projects.my problem is that when i use Swing concept ,the server is closed automatically when i click the swing dialog option 'OK', how can i protect server being closed automatically when user click the the options of Swing dialog box.it is so tedious because my application is going to integrate
    with online server?
    my swing java file is
    * FileExistsDialog.java
    package com.obs.ftw.util.alert;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.Rectangle2D;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.plaf.metal.MetalLookAndFeel;
    * FileExistsDialog: A JOptionPane-like dialog that displays the message
    * that a file exists.
    public class FileExistsDialog extends JDialog {
    * The component that gets the focus when the window is first opened
    private Component initialFocusOwner = null;
    * Command string for replace action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_REPLACE = "OK"/*NOI18N*/;
    * Command string for a cancel action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_CANCEL = "CANCEL"/*NOI18N*/;
    // Components we need to access after initialization
    private JButton replaceButton = null;
    private JButton cancelButton = null;
    public FileExistsDialog(){
         System.out.println("INSIDE THE FILE EXIST DIALOG");
         JFrame frame = new JFrame() {
         public Dimension getPreferredSize() {
         return new Dimension(200,100);
         frame.setTitle("Debugging frame");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.pack();
         frame.setVisible(false);
    FileExistsDialog dialog = new FileExistsDialog(frame, true);
         dialog.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
         System.exit(0);
         public void windowClosed(WindowEvent event) {
         System.exit(0);
         dialog.pack();
         dialog.setVisible(true);
    * Creates a new FileExistsDialog
    * @param parent parent frame
    * @param modal modal flag
    public FileExistsDialog(Frame parent,boolean modal) {
    super(parent, modal);
         //initResources();
         System.out.println("INSIDE THE FILE EXIST DIALOG CONSTRUCTOR");
    initComponents();
    pack();
    * Determines the locale, loads resources
    /* public void initResources() {
         Locale locale = Locale.getDefault();
    resources = ResourceBundle.getBundle(
              "samples.resources.bundles.FileExistsDialogResources", locale);
    imagePath = resources.getString("images.path");
    }*/ // initResources()
    * Sets all of the buttons to be the same size. This is done
    * dynamically after the buttons are created, so that the layout
    * automatically adjusts to the locale-specific strings.
    private void equalizeButtonSizes() {
         System.out.println("INSIDE THE equalizeButtonSizes()");
    String[] labels = new String[] {
    replaceButton.getText(),
         cancelButton.getText()
         // Get the largest width and height
         Dimension maxSize= new Dimension(0,0);
         Rectangle2D textBounds = null;
         Dimension textSize = null;
    FontMetrics metrics =
              replaceButton.getFontMetrics(replaceButton.getFont());
         Graphics g = getGraphics();
         for (int i = 0; i < labels.length; ++i) {
         textBounds = metrics.getStringBounds(labels, g);
         maxSize.width =
         Math.max(maxSize.width, (int)textBounds.getWidth());
         maxSize.height =
         Math.max(maxSize.height, (int)textBounds.getHeight());
    Insets insets =
         replaceButton.getBorder().getBorderInsets(replaceButton);
    maxSize.width += insets.left + insets.right;
    maxSize.height += insets.top + insets.bottom;
    // reset preferred and maximum size since BoxLayout takes both
         // into account
    replaceButton.setPreferredSize((Dimension)maxSize.clone());
    cancelButton.setPreferredSize((Dimension)maxSize.clone());
    replaceButton.setMaximumSize((Dimension)maxSize.clone());
    cancelButton.setMaximumSize((Dimension)maxSize.clone());
    } // equalizeButtonSizes()
    * This method is called from within the constructor to
    * initialize the dialog.
    private void initComponents() {
         System.out.println("INSIDE THE initComponents()");
         // Configure the window, itself
    Container contents = getContentPane();
    contents.setLayout(new GridBagLayout ());
    GridBagConstraints constraints = null;
    setTitle("Waring");
         // accessibility - all applets, frames, and dialogs should
         // have descriptions
         this.getAccessibleContext().setAccessibleDescription("Descriptions");
         addWindowListener(new WindowAdapter() {
         public void windowOpened(WindowEvent event) {
              // For some reason the window opens with no focus owner,
              // so we need to force the issue
         if (initialFocusOwner != null) {
              initialFocusOwner.requestFocus();
              // Only do this the 1st time the window is opened
              initialFocusOwner = null;
         public void windowClosing(WindowEvent event) {
         System.out.println("INSIDE THE windowClosing");     
         // Treat it like a cancel
              windowAction(CMD_CANCEL);
         // image
    JLabel imageLabel = new JLabel();
    imageLabel.setIcon(
    new ImageIcon("/images/degraded_large.gif"));
    // accessibility - set name so that low vision users get a description
    imageLabel.getAccessibleContext().setAccessibleName("OK");
    constraints = new GridBagConstraints ();
    constraints.gridheight = 2;
    constraints.insets = new Insets(12, 33, 0, 0);
    constraints.anchor = GridBagConstraints.NORTHEAST;
    contents.add(imageLabel, constraints);
    // header
    JLabel headerLabel = new JLabel ();
    headerLabel.setText("SAMPLE");
    headerLabel.setForeground(
         new Color(MetalLookAndFeel.getBlack().getRGB()));
    constraints = new GridBagConstraints ();
    constraints.insets = new Insets(12, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(headerLabel, constraints);
         // Actual text of the message
         JTextArea contentTextArea = new JTextArea();
    contentTextArea.setEditable(false);
    contentTextArea.setText("SAMPLE");
    contentTextArea.setBackground(
              new Color(MetalLookAndFeel.getControl().getRGB()));
    // accessibility -- every component that can have the
         // keyboard focus must have a name. This text area has no
         // label, so the name must be set explicitly (if it had a
         // label, the name would be pulled from the label).
    contentTextArea.getAccessibleContext().setAccessibleName(
              "CONTENTNAME");
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.insets = new Insets(0, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(contentTextArea, constraints);
         // Buttons
         JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout (new BoxLayout(buttonPanel, 0));
         replaceButton = new JButton();
         replaceButton.setActionCommand(CMD_REPLACE);
    replaceButton.setText("OK");
    replaceButton.setToolTipText("TO OK");
         replaceButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(replaceButton);
    // spacing
    buttonPanel.add(Box.createRigidArea(new Dimension(5,0)));
         cancelButton = new JButton();
         cancelButton.setActionCommand(CMD_CANCEL);
    cancelButton.setText("CANCEL");
    cancelButton.setNextFocusableComponent(replaceButton);
         cancelButton.setToolTipText("TO CANCEL");
         cancelButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(cancelButton);
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.insets = new Insets(12, 12, 11, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(buttonPanel, constraints);
         // Equalize the sizes of all the buttons
         equalizeButtonSizes();
         // For some reason, the dialog appears with no input focus.
         // We added a window listener above to force the issue
         initialFocusOwner = replaceButton;
    } // initComponents()
    * The user has selected an option. Here we close and dispose the dialog.
    * If actionCommand is an ActionEvent, getCommandString() is called,
    * otherwise toString() is used to get the action command.
    * @param actionCommand may be null
    private void windowAction(Object actionCommand) {
         System.out.println("INSIDE THE WINDOW ACTION");
         String cmd = null;
    if (actionCommand != null) {
         if (actionCommand instanceof ActionEvent) {
         cmd = ((ActionEvent)actionCommand).getActionCommand();
         } else {
         cmd = actionCommand.toString();
         if (cmd == null) {
         // do nothing
         } else if (cmd.equals(CMD_REPLACE)) {
         System.out.println("your replace code here...");
         } else if (cmd.equals(CMD_CANCEL)) {
         System.out.println("your cancel code here...");
         setVisible(false);
         dispose();
    } // windowAction()
    * This main() is provided for debugging purposes, to display a
    * sample dialog.
    // main()
    } // class FileExistsDialog
    and calling java function is
    public String fileDialog(){
         return "Success";
    public void processFile(ActionEvent event){
         System.out.println("INSIDE THE FILE DIALOG");
         FileExistsDialog file     = new FileExistsDialog();
         System.out.println("SUCCESS");
    called from
         <h:commandButton action="#{userLogin.fileDialog}" actionListener="#{userLogin.processFile}"></h:commandButton>
    pls help me as soon
    advance thanks
    rgds
    oasisdeserts

    Swing is GUI library for use in desktop applications.
    JSF is a web application framework which runs on an application server and is accessed by clients via web browsers.
    To fully understand what you have done, try accessing your application from a different machine than the server.
    To answer your question, don't invoke System.exit() if you would like the process to continue. But that is the least of your problems.

  • Problem with JSF 1.2 and Tomcat 6

    Hello guys,
    I have here:
    Tomcat 6.0.10
    JSF 1.2_04_b10_p01
    I followed these steps without success:
    http://forum.java.sun.com/thread.jspa?threadID=787962
    http://forum.java.sun.com/thread.jspa?threadID=5156242
    Here what I did:
    1) Removed the following line in $TOMCAT_HOME/conf/server.xml
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />2) Add the following lines to $TOMCAT_HOME/conf/web.xml
         <context-param>
         <param-name>com.sun.faces.expressionFactory</param-name>
         <param-value>org.apache.el.ExpressionFactoryImpl</param-value>
         </context-param>3) Add the following libs to $TOMCAT_HOME/lib
    jsf-api.jar
    jsf-impl.jar
    jstl-1.2.jar
    4) Add the following lines to $MYAPP/WEB-INF/web.xml
         <listener>
              <listener-class>
                   com.sun.faces.config.ConfigureListener
              </listener-class>
         </listener>
         <listener>
              <listener-class>
                   com.sun.faces.application.WebappLifecycleListener
              </listener-class>
         </listener>And here is "the final product":
    INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context '/protocolo'
    10/04/2007 08:18:47 com.sun.faces.config.ConfigureListener registerELResolverAndListenerWithJsp
    SEVERE: Error Instantiating ExpressionFactory
    java.lang.ClassCastException: org.apache.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:1563)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:419)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
         at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
         at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)What I need to do? Someone can help me?
    Thank you.

    Thank you for the answer rlubke,
    Well this happened because I had compiled the project with the jstl-1.1
    The workaround to make jsf 1.2 run on tomcat 6 really works.
    But now I have a problem because the JNDI tree in tomcat is read-only ( ro )
    and I need to bind a object in the JNDI so an exception happens:
    WARNING: Ocorreu um erro inexperado:
    javax.naming.NamingException: Context is read only
             at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
             at org.apache.naming.NamingContext.bind(NamingContext.java:831)
             at org.apache.naming.NamingContext.bind(NamingContext.java:171)
             at org.apache.naming.NamingContext.bind(NamingContext.java:187)
             at org.apache.naming.SelectorContext.bind(SelectorContext.java:171)
             at javax.naming.InitialContext.bind(InitialContext.java:400)Here is the code:
    try{
         Context newContext = new InitialContext();
         newContext.bind( dataSourceWrappedID, wrappedDs );
         newContext.close();
    }catch(NameAlreadyBoundException nabe){
         // ok no problem..
    }catch(NamingException ne){
         if ( log.isWarnEnabled() ){
              log.warn("Ocorreu um erro inexperado:", ne);
    }You know how to make the JNDI tree in tomcat read-write ?
    Thank you a ton. :-)

  • Problem in JSF action mapping for ZOHOwrter

    Hello Every one,
    I am struggling with a problem by using zohowriter in JSF Frame work, my problem is..
    I have developed an application to open and edit a Document which resides in server and save it in server in another path, for this purpose we are using ZohoWriter. For this application the Struts frame work is working fine.
    I have designed xhtml page by using struts framework as bellow,
    <body>
    <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor" target="_self">
    <input type="hidden" name="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc">
    <input type="hidden" name="saveurl" value="http://localhost:8080/Struts/zoho.do">
    <input type="hidden" name="filename" value="mydocument.doc">
    <input type="hidden" name="id" value="12345678">
    <input type="hidden" name="format" value="doc">
    <input type="hidden" name="persistence" value="true">
    <input type="submit" value="Edit" class="divbutton" name="submit">
    </form>
    By using above code that editor is calling the "saveurl" attribute value while saving the document, that is automatically executing the Action class and saving the Document in specified server path.
    But,
    In my application we are following JSF framework,
    In my application I have written the xhtml page like,
    <form id="myform" method="post" enctype="multipart/form-data" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor">
         <h:commandButton value="Edit" />
         <h:inputHidden id="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc" />
         <h:inputHidden id="filename" value="TestPlan.doc" />
         <h:inputHidden id="id" value="12345678" />
         <h:inputHidden id="saveurl" value="http://customers.info-sun.com/itrack/zoho.fileDownload" />
         <h:inputHidden id="format" value="doc" />
    </form>
    in the page designing if I use <h:form> this tag is not containing action attribute , so I am giving by command button but it is not working.
    So, I continued with html form.
    also, if I specify the "saveurl" attribute mapped with backing been , it is executing in page load only , So My actual intention means after editing it needs to call but it is not happening, while loading this method is calling so other problems are raising.
    Can any one please guide me that, what is my mistake and how to over come.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 9, 2009 7:37 AM

    Hi,
    I got solution for the above problem.
    I am calling a servlet instead of calling jsf flow, I got that, the zohowriter calling only lifecycle method for saveurl attribute.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 12, 2009 6:32 AM

  • DATE field problem in JSF code

    Hi,
    I am a newbie on JSF and working with a JSF application development. I have a problem with a data type: DATE. Here is what had happened; I tried to write a new record to a table, in my "write" paragraphs I have the following codes:
    tabelOneDataProvider.setValue("joindate", rowKey, joinDate1.getSelectedDate());
    tableOneDataProvider.commitChanges();
    The problem is when I was running the program to write a record, I got the following error:
    Cannot append new tableOne data: java.lang.RuntimeException: Number of conflicts while synchronizing: 1 SyncResolver.INSERT_ROW_CONFLICT row 1 Can't infer the SQL type to use for an instance of java.util.Date. Use setObject() with an explicit Types value to specify the type to use.
    At that point, I was trying to write a DATE value from a "calendar' component (joinDate1 field with MM/dd/yyyy format) into a field name: "joindate' (data type is DATE) in tableOne file.
    Any advice on resolving this problem? Please help me to get more knowledge on this. Thanks!

    Hi,
    You must use sql type. So instead of:
    tabelOneDataProvider.setValue("joindate", rowKey, joinDate1.getSelectedDate());
    tableOneDataProvider.commitChanges();try something like:
    java.util.Date date = joinDate1.getSelectedDate();
    java.sql.Date dateToInsert = new java.sql.Date(date.getTime());
    tabelOneDataProvider.setValue("joindate", rowKey, dateToInsert);
    tableOneDataProvider.commitChanges();best regards
    Grzegorz

  • Getting a problem in JSF - Spring Integration

    Hi,
    We have a web application in which we are working on JSF using MyEclipse. I am now trying to integrate spring framework into the project for having IOC for middle layer.
    well I am getting problem in setting class attribute through Spring.
    How I did is I added a class First.java initialized by application.xml The code is
    <beans>
         <bean id="first" class="com.model.service.impl.first"
              abstract="false" singleton="false" >
         <property name="name">
              <value type="java.lang.String">to enter</value>
         </property></bean>
    </beans>In web.xml I did the following change for Spring
         <servlet>
                 <servlet-name>SpringContextServlet</servlet-name>
                 <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>      
                <load-on-startup>1</load-on-startup>
         </servlet>I added this first class in backing bean as a property. My faces-config.xml code is
              <managed-bean>
              <managed-bean-name>EducInfo</managed-bean-name>
              <managed-bean-class>
                   com.view.beans.StudentEducInfo
              </managed-bean-class>
                    <managed-property>
                   <property-name>ft</property-name>
                   <value>#{first}</value>
              </managed-property>and I called it from jsp(JSF) page as
    <h:outputText value="#{EducInfo.tstFirst}" />the function tstFirst in EducInfo (backing bean) is
         private first ft;
         public String getTstFirst() {
              tstFirst=ft.getName();
              return tstFirst;
    I am getting error 'Expression Error: Named Object: 'first' not found.'
    Any idea? Any workaround would also be appreciated.
    Thanks,
    Arsalan

    Your server is not able to find anything matching the requested file.
    Well, just explore your archive file (possibly your .war file) and look at the path of the index file.
    Please post your url. If pro11 is your project name (the root) then ensure that the index file is by itself ie the path should be shown as blank in your war file.
    Or mention the exact path of your index file in the url.

  • File Upload Problem in JSF

    Hi all,
    I have a problem in file upload. I have a file upload third party component which uploads the file with the filter action depending on the url. My requirement is to trace the uploaded filename for addressing it with the database record. So I need the filename in my backing bean to store it in the database. Ho can i get the filename from view page to backing bean. Any Ideas and help please.
    Many thanx,
    vijaycanaan

    Mr BalusC,
    Yes Iam talking about a custom made upload component. The fileupload tutorials u send are good but my requirement is not meeting them. Among my requirements one is mutilple file uploads in the single view page. This is possible at present with my custom upload componet. Only if the problem gets solved. Any way once again please think on my problem and give your solution on it.
    Here is my problem:
    The problem is I have to access the components from view page which this kind of requirement possible in jsp by request parsing which results the key value pairs of the form components. This same thing/way I should get in backing bean from JSF view page.
    The solution I want may like as follows.
    Note this code is incorrect and wrong but for to understand my requirement.
    someobject.getComponentIdValue("clientID"); which returns a string value as d:\images\Tutle.jpg
    The clientID is upload file component' Id . In the request it may be the key associated with value as file complete path. By this kind of way my upload filter is able to get the orignal file. Ok i need this in my  backing bean to get the orignal filename to insert into the database. Please for this give the solution or reply.many thanx,
    vijaycanaan.

Maybe you are looking for

  • IChatUSB Cam no longer works

    I used to use iChatUSB Cam on my Mac, for use with iChat AV, as there was no way I could get a Firewire camera, and had a USB camera from when I used a PC (thought the switch campaign would be easy)... All was good, until 10.4.3, and now it no longer

  • My iphone wont keep a signal and settings app crashs when i go to cellular

    Hi there im new to this i recently reset network settings on my iPhone 4S running iOS 7.0.4 since then my phone won't keep a signal it will say the operater name for 10 sec then lose 3G and just show signal bars then it says searching then it starts

  • How do I delete TV shows off my ipad?

    I have bought various episodes of different tv shows and I need to delete them for space. I have tried to swipe to the left and to press on the shows name to get the "x" but neither of those work. Is there another way?

  • Won't automatically print received faxes?

    Hi all, I turned on the fax option on my powerbook G4 today. I can send and receive faxes fine. The problem is that when I receive a new fax, it doesn't print. I checked off the box in fax and print setup to automatically print any received faxes, bu

  • I can't see the vidoe picture on itunes

    i bought lots of videos on itunes now i can't see the picture all there is are static i need help if anyone can help me just reply back thank you