Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

hyperlink action not calling managed bean method

Posted on 2007-04-04
3
Medium Priority
?
2,755 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

610 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