Solved

hyperlink action not calling managed bean method

Posted on 2007-04-04
3
2,744 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now