myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Hackemesser <k...@gmx.de>
Subject commandLink in datalist not working
Date Tue, 13 Feb 2007 10:35:06 GMT
Hi there,

I'm currently facing a problem: I have a datalist component with a 
commandLink inside in my jsf page. The action in the commandLink is 
never invoced. The page is redisplayed. I'm using Exacel Phasetracker to 
search for problems, but the output is clean:

[13.02.07 10:55:19:156 CET] 0000001d helper        I   BEFORE RESTORE_VIEW 1
[13.02.07 10:55:19:172 CET] 0000001d helper        I   AFTER RESTORE_VIEW 1
[13.02.07 10:55:19:188 CET] 0000001d helper        I   BEFORE 
APPLY_REQUEST_VALUES 2
[13.02.07 10:55:19:188 CET] 0000001d helper        I   AFTER 
APPLY_REQUEST_VALUES 2
[13.02.07 10:55:19:188 CET] 0000001d helper        I   BEFORE 
PROCESS_VALIDATIONS 3
[13.02.07 10:55:19:234 CET] 0000001d helper        I   AFTER 
PROCESS_VALIDATIONS 3
[13.02.07 10:55:19:250 CET] 0000001d helper        I   BEFORE 
UPDATE_MODEL_VALUES 4
[13.02.07 10:55:19:250 CET] 0000001d helper        I   AFTER 
UPDATE_MODEL_VALUES 4
[13.02.07 10:55:19:250 CET] 0000001d helper        I   BEFORE 
INVOKE_APPLICATION 5
[13.02.07 10:55:19:250 CET] 0000001d helper        I   AFTER 
INVOKE_APPLICATION 5
[13.02.07 10:55:19:297 CET] 0000001d helper        I   BEFORE 
RENDER_RESPONSE 6
[13.02.07 10:55:19:328 CET] 0000001d               I 
de.szb.pt.ManagedBean <init> ManagedBean - sie lebt!
[13.02.07 10:55:19:328 CET] 0000001d               I 
de.szb.pt.ManagedBean getClients Client count: 3
[13.02.07 10:55:19:344 CET] 0000001d helper        I   AFTER 
RENDER_RESPONSE 6


Following some code fragments - faces-config.xml:

<navigation-rule>
    <from-view-id>/index2.jsp</from-view-id>
    <navigation-case>
       <from-outcome>displayDetails</from-outcome>
       <to-view-id>/displayDetails.jsp</to-view-id>
       <redirect/>
    </navigation-case>
</navigation-rule>
<managed-bean>
    <managed-bean-name>managedBean</managed-bean-name>
    <managed-bean-class>de.szb.pt.ManagedBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
</managed-bean>

ManagedBean.java:
....
    public String displayMandant() {
       try {
          setMandantID(Long.valueOf(FacesContext.getCurrentInstance()
             .getExternalContext().getRequestMap().get(
             "mandantID").toString()));
       } catch (Exception e) {
          Logger.getAnonymousLogger().throwing(
             this.getClass().getName(), "displayMandant", e);
          return "invalid mandant ID";
         }
         Logger.getAnonymousLogger().info("Mandant ID gesetzt: "
            + getMandantID());
         return "displayDetails";
     }


index2.jsf:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://jsftutorials.net/htmLib" prefix="htm"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
...
<f:view>
    <f:loadBundle basename="de.szb.pt.i18n.View" var="View" />
...
       <h:messages layout="list" errorStyle="background-color: red" 
warnStyle="background-color:yellow"/>
    <h:form>
       <t:dataList value="#{managedBean.clients}" var="client" 
layout="simple" >
          <f:verbatim>
              <htm:table style="margin-left:5mm; width: 500px; 
background-color: #F4F4F4; border-style: solid; border-width: 1px; 
page-break-after: auto; margin-bottom: 10pt; border-collapse: collapse; 
border-color: #B42F40">
                   <htm:tr>
...
                         <htm:th style="text-align: left; color:white; 
background-color:#B42F40">
                              <h:commandLink 
action="#{managedBean.displayMandant}" immediate="true" >
                                   <f:param value="#{client.id}" 
name="mandantID" />
                                   <h:outputText value="#{client.name}" />
                                    </h:commandLink>
				</htm:th>
			</htm:tr>
...

rendered output index2.jsf:

form id="_id5" method="post" action="/cashmanagement/index2.jsf" 
enctype="application/x-www-form-urlencoded">
<table style="..."><tr><th style="...">....<a href="#" 
onclick="document.forms['_id5']['__LINK_TARGET__'].
disabled=false;document.forms['_id5']['__LINK_TARGET__'].value='_id5:_id6:0:_id13';
document.forms['_id5']['mandantID'].value='829'; 
document.forms['_id5'].submit();document.forms['_id5']['__LINK_TARGET__'].disabled=true; 
return false;">xxx</a>...

No errors in the javascript-console, too.
Environment: Websphere 6.0.1 on XP, Firefox 2, JSF-Extensions are latest 
releases.
My searches in the internet and in the newsgroups haven't found a 
solution yet. Any suggestions?

Kind regards,
Kai


Mime
View raw message