Solved

hyperlink action not calling managed bean method

Posted on 2007-04-04
3
2,749 Views
Last Modified: 2013-11-24
when the page is loaded Data will be displayed from SummaryMBean managed bean;when i click hyperlink on one of the recods its not calling
loadDetails HeaderMBean managed bean.i put system.out.println in HeaderMBean constructor its not going there;why?



<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>


<body>
      <f:view>
      <h:form id="form1">
        
            
            <h:panelGrid style="width:100%" styleClass="TABLEBORDER">
              <t:dataTable var="list" rowClasses="ROW1,ROW2" border="0" cellspacing="2" cellpadding="0" width="100%" value="#{SummaryMBean.itemsList}" id="table">
                <t:column width="2%" id="column1">
                        <f:facet name="header">
                              <h:outputLabel dir="ltr" styleClass="COLHEAD"  for="info_image" style="width:100%" value=""></h:outputLabel>
                        </f:facet>
                        
                </t:column>
               
               
                <t:column width="6%" id="column2">
                        <f:facet name="header">
                              <h:outputText styleClass="COLHEAD" value="Line" />
                         </f:facet>
                           <h:outputText value="#{list.lineNo}" style="width:100%">
                        </h:outputText>
                  </t:column>
                  
                  
             
              <t:column width="6%"  id="column3" >
                        <f:facet name="header">
                              <h:outputLabel dir="ltr" styleClass="COLHEAD" for="edit_image" style="width:100%" value="">
                              </h:outputLabel>
                        </f:facet>
                        <h:commandLink       action="#{HeaderMBean.loadDetails}">
                              
                                       <h:graphicImage style="border:0px;" id="edit_image" value="edit.gif"></h:graphicImage>
                        </h:commandLink>
                                
              </t:column>
              </t:dataTable>
            </h:panelGrid>
            </h:form>
            
      </f:view>
</body>
</html>
0
Comment
Question by:chaitu chaitu
  • 2
3 Comments
 
LVL 8

Expert Comment

by:mnrz
ID: 18849111
in my experience when you click on a hyperlink and nothing happen, it seems that an exception or a problem occurs during the request lifecycle and this problem prevent request to reach to the respected managed bean.

and unfortunately, there is no exception message.

so I recommend you remove all columns, or if you have any other component in this page remove them and add them one by one, and after adding each one test to see whether it has problem or not and you will find the component cause this problem.

sometimes it is because of conversion a value in client when to the relative manage bean instance variable.

hope this help
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 18856501
In the dataTable one we mention preserveDataModel="true" then its working fine;

what  preserveDataModel will do?
0
 
LVL 8

Accepted Solution

by:
mnrz earned 500 total points
ID: 18856529
well if you read the documents of Tomahawk, it is said:

When this attribute is "true", the data behind the current DataModel is saved after the render response phase and restored in the restore component tree phase

Whenever you use a DataModel backed by a database connection you could run into problems, when the data in the database has changed since the last request. All Lifecycle phases prior to the render response phase iterate the DataModel and assume that the DataModel is unchanged since the last request. At least the row count must not have changed, because all children of UIData that are bound to the DataModel rely on it. But even if you can assure that row count never changes, a change in the data can have unintentional sideeffects.
Using the preserveDataModel feature prevents such problems. The DataModel (to be more exact: the currently visible part of the DataModel given by the first and the rows attribute) is freezed right after rendering and you can be sure that all lifecycle actions during the next request happen on exactly the same data.

you can find these in following links:

http://wiki.apache.org/myfaces/Working_With_DataTable_And_PreserveDataModel

http://myfaces.apache.org/tomahawk/extDataTable.html

But
I think it's not resolved your problem, it seems some of your data are invalid or make problem and by setting that attribute to true you just ignore the problem.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to determine if a string is a valid SHA value 7 43
Chrome and Firefox Java 5 67
Problem to Alipay 10 70
What browser will run Java? 7 125
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question