h:commandLink problem

I think I don't know how to use <h:commandLink> and <h:commandButton> correctly because I have encountered a lot of problems with this two components. Sometimes it works OK, but sometime it doesn't work.
For example:
<f:view>
               <f:loadBundle basename="edu.fudan.glee.view.bundle.MessageBundle" var="bundle" />
               <jsp:include page="/header.jsp" flush="true" />
               <h:form id="favoriteForm">
                    <h:dataTable id="favoriteTable" var="video" value="#{UserBean.favorites}">
                         <h:column>
                              <h:outputText value="#{video.chineseName}"></h:outputText>
                         </h:column>
                         <h:column>
                              <h:commandLink id="deleteFavorLink" value="#{bundle.deleteButtonLabel}" action="#{UserBean.deleteFavorite}">
                                   <f:param name="videoId" value="#{video.sid}"/>
                              </h:commandLink>
                         </h:column>
                    </h:dataTable>
                    <h:messages style="font-weight: bold; color: #FF0000;" />
               </h:form>
               <%@ include file="footer.jsp"%>
          </f:view>When I click the link, nothing happens except a "#" added to the end of URL(displayed in the borwser). If I replace <h:commandLink> with <h:commandButton>, it works(Of course, <f:param> doesn't work in commandButton).
My bean is in session scope.
Why?
Thanks!
Message was edited by:
zhlmmc

I'm not sure about the "correct" way, but I did the following:
1. go to http://myfaces.apache.org/download.html and download the jars in MyFaces core, Tomahawk and Tobago
2. copy all of the core jars into my web app, removing any duplicates of similar names that were there already (including jsf-api and jsf-impl)
3. copy the tomahawk jar into my web app
4. I also copied the commons-fileupload jar from Tobago into my web app, but I'm not sure if this is needed.
This worked for me, by trial-and-error. The information on the apache website and wiki is very obscure and contradictory, some of the links don't point to what they should, and I couldn't find the example .war they mentioned anywhere on the site.
Good luck

Similar Messages

  • Help me in CommandLink problem???

    Hi all,
    I am working with jsf framework now,I have a problem in commandLink.
    (i.e):When i use mouse right click,open in newTab or open in new window
    on the commandLink, it is not navigated to the actual page,it goes to the
    previous page of the commandLink page.
    commandLink works properly when we click it,not getting the desired
    result page on Right click open in newtab and as well as open in new
    window.
    can any one help me???
    Thanks in advance,
    sundar.

    Hi,
    <redirect/> is not a solution,still having the same problem,any other suggestions???.
    Regards,
    sundar.

  • MyFaces "columns" and "commandLink" problem

    I am having an issue with the MyFaces implementation of the the JSF "dataTable" where I am using the MyFaces "columns" tag to generate columns from a List, inside each of these generated columns is a JSF commandLink. The issue I am having is that when a commandLink is pressed I get an actionEvent for every column generated under the "columns" tag not just for the one that was clicked.
    Am I just thinking about this wrong?
    How can I identify the single commandLink that was clicked?
    Here is a code sample:
    <t:dataTable rowClasses="MenuItemRow"   value="#Bean.dmMenu}"  var="link" first="0" rows="1">
         <t:columns value="#{Bean.listLinks}" var="link">
             <h:commandLink value="#{link.value}" actionListener="#{Handler.linkPressed}">
              </h:commandLink>
         </t:columns>
    </t:dataTable>Thanks for any help.

    Hi,
    I tried with the steps you have mentioned . i was not able to reproduce your problem
    I click still the link : server sendes back page1 instead of page3.It sends back the page 3 itself.
    regards
    MJ

  • Accelerator/Access Key for commandLink problem

    I tried setting the access key for a commandLink but all it does is put the focus the command link and not trigger the action(unless enter key is pressed after pressing the access key). Is this the expected behavior or there is a way to make access keys execute action on commandLink?

    Hi Hyangelo,
    Even i am facing the same problem . I am using Jdeveoper 11.1.1.3.0 . I am having a commandLink , menu and commandNavigationItem , I am trying to access the component with accesskeys like giving ..
    <af:commandLink id="cl_onpage" partialSubmit="true"
    textAndAccessKey="#{ARUIBundle.Hello}"
    action="#{AccessBean.trigger}"></af:commandLink>
    wherein my accesskey is defined in my property file and it is 'H'. As i am using internet explorer i use alt + H as key combination . When i use the key combination , Only the focus is set to the component and the action with it is not getting triggered unless i hit the enter key.
    Can you let us know as to how you solved the issue . As you said it was taking a while for the action to be triggered. I tried the same , waited for 5 minutes but still the action did not get triggered.
    Thanks
    Vini

  • Commandlink problem

    Hi,
    i am using jsf1.1 and jdk1.6
    When i click on links ,some are working ,some are not,
    plz help me.
    <h:commandLink value="#{cdmanage.cd_title}" id="cdmangelink" action="#{viewCDBean.editCDDetails}">
         <f:param value="#{cdmanage.cd_number}" name="cd_number" id="cd_number"> </f:param>
         <f:param value="#{cdmanage.cd_contents}" name="cd_contents" id="cd_contents"> </f:param>
         <f:param value="#{cdmanage.cd_title}" name="cd_title" id="cd_title"> </f:param>
         <f:param value="#{cdmanage.license_key}" name="license_key" id="license_key"> </f:param>
         <f:param value="#{cdmanage.vendor_company}" name="vendor_company" id="vendor_company"> </f:param>
         <f:param value="#{cdmanage.vendor_name}" name="vendor_name" id="vendor_name"> </f:param>
         <f:param value="#{cdmanage.vender_contact_no}" name="vender_contact_no" id="vender_contact_no"> </f:param>
         <f:param value="#{cdmanage.remarks}" name="remarks" id="remarks"> </f:param>
         <f:param value="#{cdmanage.entered_by}" name="entered_by" id="entered_by"> </f:param>
         <f:param value="#{cdmanage.last_updated_by}" name="last_updated_by" id="last_updated_by"> </f:param>
         <f:param value="#{cdmanage.cd_dvd}" name="cd_dvd" id="cd_dvd"> </f:param>
         <f:param value="#{cdmanage.license_or_open_source}" name="license_or_open_source" id="license_or_open_source"> </f:param>
         <f:param value="#{cdmanage.serial_key}" name="serial_key" id="serial_key"> </f:param>
         <f:param value="#{cdmanage.purchase_date}" name="purchasedate" id="purchasedate" > </f:param>
         <f:param value="#{cdmanage.purchase_price}" name="purchase_price" id="purchase_price"> </f:param>
         <f:param value="#{cdmanage.status}" name="status" id="status"> </f:param>
         <f:param value="Edit CD/DVD details CDNO-" name="form_title" id="form_title"> </f:param>
         </h:commandLink>

    sorry!
    it was database problem
    not a jsf problem.

  • Problem accesing f:param Values

    I have two pages Page A and B. One can navigate from A to B by clicking a commandLink below
    <h:commandLink action="employerViewDetailPostedJobs">
    <h:outputText value="#{record.heading}"></h:outputText>
    <f:param name="*jobId*" value="#{record.jobId}"/>
    </h:commandLink>Problem is i am findind it hard to obtain the jobId in Page B by using
    FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("*jobId*")any suggestions would be appreciated

    Actually, in your original post you used ExternalContext.getRequestMap(), not ExternalContext.getRequestParameterMap(). They both exist and there is a difference.

  • Scripting in JSF pages

    Hey,
    I have 2 JSF pages: container.jsp and sub.jsp,
    container.jsp loads sub.jsp in a dynamic call like this:
    <jsp:include page='<%= pageToLoad %>' />Inside sub.jsp, I have a parameter defined for a commandLink tag:
    <h:commandLink ...>
      <f:param name="param1" value="<%= value %>" />
    </h:commandLink>Problem:
    - container.jsp fails to load and returns an error because it seems that the JSF tags within sub.jsp have execution priority over the script code (which is read literally and not executed).
    - if I remove the script and hardcode the value, it works fine
    - if I write the same code inside container.jsp, it works fine as well
    Question:
    How can I overcome this problem? Is there any alternative way for reaching the same outcome?
    Thanks,
    Mobal

    I ever wrote an article about that: http://balusc.blogspot.com/2007/01/dynamic-jsf-subviews.html

  • 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 with commandLink and commandButton

    Problem with commandLink and commandButton
    I have commandButton id="submit" action="{myActionClass.dothis}"
    When I click on the commandbutton it is not submiting to the action class rather, its submitting to the same page..
    I am tired of this ...
    I am using tiles for displaying jsf pages . Any problem because of using tiles

    yes I have the validator.
    If I open the url directly its working fine
    let say I am opening localhost:8080/test/test.jsf
    then it works fine
    If i use the same test.jsf along with tiles and open it, then its dispalying all the elements but when i click on commandbutton.. nothin is happening.
    the seems like page is reloaded.

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

  • 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

  • CommandLink / inputHidden / binding bean problem

    Hi all
    I am trying to pass form data to a backing bean via a hidden input, using the following code:
    <h:form>
    <h:commandLink action="#{reportManager.switchReport}" value="#{data}"/>
    <h:inputHidden value="#{data}" binding="#{reportManager.param0}"/>
    </h:form>Ideally i want the commandLink to call a java method with the argument #{data}. However, arguments cannot be used with the commandLink technique so i am trying to pass it via a hidden input instead.
    Unfortunately the above code gives the error:
    java.lang.IllegalArgumentException: argument type mismatch
    I do not get errors if i replace the input code with:
    <h:inputHidden value="#{reportManager.param0}"/>only this time there is no way of writing #{data} to the bean, and instead the value is taken FROM the bean, ie null! Furthermore, if i use:
    <h:inputText value="#{reportManager.param0}"/>and type the value of #{data} into the textbox before clicking the commandLink, everything works fine. The situation is very frustrating.
    Can anyone suggest how to hold a value in a hidden-input, and pass it to a bean in this way? Thanks in advance
    Rich

    Thanks for you reply
    I can't use the method you suggest because 'data' is not a property in my reportManager bean - it is simply a value (user ID) obtained from the iteration of a result set (i am displaying a table of figures based on the results of a database query). Hence the value of 'data' is only known on the jsp page and needs to be tied to another property in my backing bean.
    How does one go about using the UIInput method? I have tried adding:
    public UIInput getUserId() {
              return userId;
         public void setUserId(UIInput userId) {
              this.userId = userId;
         }to my reportManager bean, and using:
    <h:commandLink action="#{reportManager.switchReport}" value="#{data}"/>
    <h:inputHidden value="#{data}" binding="#{reportManager.userId}"/>to reference the methods. only now i get the error:
    javax.faces.el.PropertyNotFoundException: /secure/report.xhtml @105,79 binding="#{reportManager.userId}"
    Any suggestions or pointers much appreciated
    -3po

  • Problem with inputText in my custom component

    Hi, I have a custom dataTable component that I'm trying to get to work. It has to be a custom component because dataTable doesn't support rowspan, colspan, multi line headers, and a rendered attribute for rows. The problem is, that when I wrap the column tag inside my row tag then the method for the inputText tag never gets called in the UPDATE_MODEL_VALUES phase.
    I'm starting to think that JSF doesn't support 2 levels of tags between the inputText and dataTable. I'm hoping that someone can tell me what I have wrong with my components.
    Here is the JSP snippet.
    <cjsf:rptTable>
         <cjsf:data id="dataTable1" value="#{allAuthUser.tableRows}" var="myTableRow1">
              <cjsf:row>
                   <cjsf:col>
                        <h:inputText id="tableTestFld" value="#{myTableRow1.testFld}" size="5" maxlength="5"/>
                   </cjsf:col>
              </cjsf:row>
         </cjsf:data>
    </cjsf:rptTable>Here is what it renders. It looks to me like everything renders fine. So I'm guessing that there is something in a component that is causing JSF during the life cycle to not be able to process correctly.
    <table>
         <tbody>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_0:tableTestFld" name="tblmaintForm:body:dataTable1_0:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_1:tableTestFld" name="tblmaintForm:body:dataTable1_1:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_2:tableTestFld" name="tblmaintForm:body:dataTable1_2:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
         </tbody>
    </table>Note: If I leave off the row tag it renders the same way except of course the <tr> and </tr> tags are missing. If I do this, then the backing method for the inputText tag is called and everything works fine. Why doesn't it work with the row tag in place?
    Here are the components:
    public class UIRptTable extends UIComponentBase {
         public UIRptTable() {
              setRendererType("tblmaint.rptTableRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableData extends HtmlDataTable {
         public UIRptTableData() {
              setRendererType("tblmaint.rptTableDataRenderer");
         public String getFamily() {
              return "javax.faces.Data";
    public class UIRptTableRow extends UIOutput {
         public UIRptTableRow() {
              setRendererType("tblmaint.rptTableRowRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableCol extends UIColumn {
         public UIRptTableCol() {
              setRendererType("tblmaint.rptTableColRenderer");
         public String getFamily() {
              return "javax.faces.Column";
    }Here is part of the faces-config file in case you need it.
    <!-- Components -->
    <component>
         <component-type>tblmaint.rptTable</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTable</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableData</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableData</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableRow</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableRow</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableCol</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableCol</component-class>
    </component>
    <!-- Render Kits -->
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Data</component-family>
              <renderer-type>tblmaint.rptTableDataRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableDataRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRowRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRowRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Column</component-family>
              <renderer-type>tblmaint.rptTableColRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableColRenderer</renderer-class>
         </renderer>
    </render-kit>I sure hope that someone can help me out. Please let me know if you need any additional information.
    Thanks,
    Ray

    Hi, Ray!
    1) I was trying to put a button in the column header (for sorting) and I couldn't get that to work. That involved the >colhdr tag. I got that to work but I don't remember the fix. I'll look it up and reply back with that when I can.Dealing the first part of your trouble, you need NOT a custom component.
    I have looked through the implementation of RepeaterRenderer, as you advised me, and found that the multi-header possibility is included in the implementation of dataTable control.
    The code below is the part of source of repeater.jsp with only change:
    <d:data_repeater> &#61664; <h:dataTable>
    And it works fine.
    <h:dataTable id="table"
    binding="#{RepeaterBean.data}"
         rows="5"
    value="#{RepeaterBean.customers}"
    var="customer">
    <f:facet name="header">
    <h:outputText value="Customer List"/>               <!� First Header row -- >
    </f:facet>
    <h:column>
    <%-- Visible checkbox for selection --%>
    <h:selectBooleanCheckbox
    id="checked"
    binding="#{RepeaterBean.checked}"/>
    <%-- Invisible checkbox for "created" flag --%>
    <h:selectBooleanCheckbox
    id="created"
    binding="#{RepeaterBean.created}"
    rendered="false"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Account Id"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="accountId"
    binding="#{RepeaterBean.accountId}"
    required="true"
    size="6"
    value="#{customer.accountId}">
    </h:inputText>
    <h:message for="accountId"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Customer Name"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="name"
    required="true"
    size="50"
    value="#{customer.name}">
    </h:inputText>
    <h:message for="name"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Symbol"/>
    </f:facet>
    <h:inputText id="symbol"
    required="true"
    size="6"
    value="#{customer.symbol}">
    <f:validateLength
    maximum="6"
    minimum="2"/>
    </h:inputText>
    <h:message for="symbol"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Total Sales"/>
    </f:facet>
    <h:outputText id="totalSales"
    value="#{customer.totalSales}">
    <f:convertNumber
    type="currency"/>
    </h:outputText>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Commands"/>
    </f:facet>
    <h:commandButton id="press"
    action="#{RepeaterBean.press}"
    immediate="true"
    value="#{RepeaterBean.pressLabel}"
    type="SUBMIT"/>
    <h:commandLink id="click"
    action="#{RepeaterBean.click}"
    immediate="true">
    <h:outputText
    value="Click"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    You may have a look at HTML source to prove that dataTable is already what you need:
    <table id="myform:table">
    <thead>
    <tr><th colspan="6" scope="colgroup">Customer List</th></tr>
    <tr>
    <th scope="col"></th>
    <th scope="col">Account Id</th>
    <th scope="col">Customer Name</th>
    <th scope="col">Symbol</th>
    <th scope="col">Total Sales</th>
    <th scope="col">Commands</th>
    </tr>
    </thead>
    <tbody>
    2.) The second trouble is still unsettled as previously. Right now I have different task at my job, and I can�t continue investigation of this problem.
    But when you find smth., please let me know. I�ll be very grateful.
    Regards,
    Oleksa Stelmakh

  • Using commandLinks and commandButtons in dataTables

    I'm trying to create a page that displays data from a database and allows you to edit individual rows by clicking on either a commandButton or a commandLink within a dataTable that then takes you to another page where you can edit that particular row of the table.
    When using a commandButton, it works perfectly for all but the last entry in the table. But when the button in the last line is clicked, nothing happens at all, it does not seem to call the action listener and it does not perform the navigation based on the action. But with all the previous buttons it calls the actionListener and navigates perfectly. Can anyone tell me why this would be? The code is as follows:
    <h:dataTable value="#{Categories.categories}" var="category" >
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.deptColumnHead}"/></f:facet>
    <h:outputText value="#{category.departmentName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.categoriesColumnHead}"/></f:facet>
    <h:outputText value="#{category.categoriesList}"/>
    </h:column>
    <h:column>
    <h:form>
    <h:inputHidden id="dept" value="#{category.departmentId}"/>
    <h:commandButton id="editButton" action="EditCat" actionListener="#{Categories.editListener}" value="{msgs.editSelectedButtonText}"/>
    </h:form>
    </h:column>
    </h:dataTable>
    When using commandLinks, only the first one works (of 4). For the other 3 the page goes into error when the link is clicked and it complains that 'document.forms._id2:3:_id10._id2:3:_id10:idcl is null or not an object'. If anyone could tell me what is wrong with my code, i would be most appreciative.
    <h:dataTable value="#{Categories.categories}" var="category" >
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.deptColumnHead}"/></f:facet>
    <h:outputText value="#{category.departmentName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"><h:outputText value="#{msgs.categoriesColumnHead}"/></f:facet>
    <h:outputText value="#{category.categoriesList}"/>
    </h:column>
    <h:column>
    <h:form>
    <h:inputHidden id="dept" value="#{category.departmentId}"/>
    <h:commandLink action="EditCat" actionListener="#{Categories.editListener}">
    <h:outputText value="#{msgs.editSelectedButtonText}"/>
    </h:commandLink>
    </h:form>
    </h:column>
    </h:dataTable>

    1) I have had very odd behavior in JSF when ALL of the
    JSF elements on a page do not have an id attribute. If
    you do not assign an id then JSF will manufacture a
    unique id on the flag. Sometimes the unique id wasn't
    so unique and there were errors like you are seeing or
    just odd behavior on the form, buttons not generating
    events, or incorrect rendering, etc.
    By 'ALL' I mean output text, columns, anything that
    accepts an id attribute. Don't trust the code to
    generate an id correctly for you.Just want it known that while this may be necessary in the short-term to work around bugs, this is definitely not the intent of the EG! We don't want people getting in the habit of
    Also note that this behavior is not consistent
    sometimes it would not appear on a page unless the
    page was updated and more controls added to it.Ah, well that is a known issue; while developing a page, the Sun RI can have problems if you change a page's contents between two submissions. (It doesn't pick up that the .jsp has changed.) I'd recommend:
    - Use client-side state saving.
    - Make sure you're making a new request for a page (not re-POST-ing anything!) when the page's contents have changed.
    If you follow both of those rules, then you should generally be able to get away without explicit IDs everywhere as you actively develop your page.
    Explicit IDs are required if you're inside <c:if>; this is known and documented.
    2) try putting the hidden input control in it's own
    columnNo, that'll give you a bonus set of <td> elements, which isn't what you want.
    -- Adam Winer (EG member)

  • CommandLinks and CommandButtons in Datatable do not work

    I have read the threads about this issue and am aware of the fact that there is a problem, if the backing bean is in request scope. However, my backing bean is in session scope and it still does not work - my action methods are never called. What's more, I have another backing bean in session scope, where it works perfectly and I cannot see any difference between them.
    Here's the code, my backing bean is dms:
    <h:form rendered="#{dms.documents.rowCount > 0}">
    <h:dataTable rowClasses="..." headerClass="..." value="#{dms.documents}"
    columnClasses="..." var="item" border="1" cellpadding="2" cellspacing="0">
    <h:column>
    <f:facet name="header">
    <h:outputText>DocName</h:outputText>
    </f:facet>
    <h:commandLink action="#{dms.test}" value="#{item.docName}"/>
    </h:column>
    <h:column>
    <f:facet name="header"/>
    <h:commandButton id="foo" value="View" action="#{dms.test}"/>
    </h:column>
    </h:dataTable>
    <h:commandLink action="#{dms.test}" value="Clickme"/>
    </h:form>
    Here is the code in the backing bean:
    public String test() {
    System.out.println("Hooray");
    return "mainPage";
    And this in faces-config.xml:
    <managed-bean>
    <managed-bean-name>dms</managed-bean-name>
    <managed-bean-class>com.mypackage.DmsController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Only the last link, the one outside the datatable and titled "Clickme", works. I can see "Hooray" in the logfile and am redirected to the main page. If I click any of the links or buttons in the datatable, nothing is written to the log and the same page is loaded again, but only the static content is displayed, i.e. no JSF tags are evaluated, they are just dropped. There are, however, a few hidden input fields called javax.faces.ViewState, which I don't know where they are coming from.
    As I said, I have another backing bean in session scope, which is modelled exactly like that and it works there. Maybe JSF apps are supposed to have only one controller?
    Many thanks in advance for any pointers,
    Ulrich
    Edit: It doesn't change anything if I put the backing bean in application scope. I did have the same problem before with my other backing bean, but could solve it there by putting it from request scope to session scope.

    <h:dataTable value="#{dms.documents}">How do you load this list? This list should not be null during the INVOKE_APPLICATION phase.
    Try stubbing the List right in the getDocuments() method and see if it works.

Maybe you are looking for

  • In bdc if date format of records is different  do we need to hard code

    in bdc if date format of records is different  do we need to hard code or bdc will support automatically,please provide the answer.

  • QTSS broken on Yosemite

    QuickTime Streaming Server 6.0.3 (QTSS) no longer installs on Yosemite.  Is there any way to fix this? This is the first new OS release that has failed to support QTSS immediately.

  • Different versions of logic studio?

    Hi people! It's my first time posting here. I have a question to ask. You see, I bought the logic express just before the logic pro standalone version was released and I feel like I had been sucker punched hard in the guts. I'm looking to upgrade my

  • Indesign Problem CS2

    Hallo, ich habe ein Problem mit Adobe InDesign. Folgendes Szenario. Wir hatte auf einen File Server (Windows Server 2003) ein Share. Dort abgelegt waren Adobe InDesign Dateien. Die Kollegen hatten in Ihrem Arbeitsplatz (Windows XP) ein Share gemappt

  • VDI 3 , ESX 3.5, USB File Transfer from DTU failing

    Hey guys, Some users have noticed that when copying files from a USB stick in the Sun Ray (2FS) (via mapped U drive) to say a network share, the transfer fails or the contents of the file are corrupt. Anyone else had this issue or ideas on a fix? THa