myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Hodges <>
Subject Possible bug jsf.js (or error on my pat)
Date Mon, 14 Mar 2011 17:24:54 GMT
To all,

I'm new to web coding (especially JSF).  I'm looking at Trinidad as my
component library of choice.  I'm trying out simple samples from the web and
this sample is not working once I include the Trinidad settings in web.xml
(it works without Trinidad being defined)

Scenario:  		Simple ajax example for a counter.  Count works, but
reset does not, reset also increments the count

Container:		tomcat 7.x
JSF Version:	2.0
Trinidad:		2.0.0 Beta 2

============================= Bean =======================================

package com.example.<deleted>;


import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;

@ManagedBean(name = "count")
public class Count implements Serializable {
	private static final long serialVersionUID = 1L;

	Integer count = 0;

	public Integer getCount() {
		System.out.println("Incrementing Count");
		return count++;

	public void reset(ActionEvent ae) {
		System.out.println("Resetting Count");
		count = 0;

=========================== web page ===================================

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns=""
	xmlns:f="" xml:lang="en" lang="en"

		<meta http-equiv="Content-Type"
			content="text/html; charset=iso-8859-1" />
		<title>JSF Test</title>
		<h:form id="form1">
			<h:outputScript> name="jsf.js" library="javax.faces"
			<br />
			<!-- Increment the counter on the server, and the
client -->
			<h:outputText id="out1" value="#{count.count}" />
			<br />
			<h:commandButton id="button1" value="Count"
				onclick="jsf.ajax.request(this, event,
{execute:, render: 'out1'}); return false;" />
			<br />
			<br />
			<!-- Resets the counter -->
			<h:commandButton id="reset" value="reset"
				onclick="jsf.ajax.request(this, event,
{execute:'reset', render: 'out1'}); return false;"
				actionListener="#{count.reset}" />

========================= generate page source ==========================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en"><head>
&#9;&#9;<meta http-equiv="Content-Type" content="text/html;
&#9;&#9;<title>JSF Test</title></head><body><script
type="text/javascript">var _AdfWindowOpenError='A popup window blocker has
been detected in your browser. Popup blockers interfere with the operation
of this application. Please disable your popup blocker or allow popups from
this site.';</script><script type="text/javascript"
id="form1" name="form1" method="POST" onkeypress="return
_submitOnEnter(event,'form1');" action="/CounTest/index.xhtml"><script
type="text/javascript"> name="jsf.js" library="javax.faces"
&#9;&#9;&#9;<!-- Increment the counter on the server, and the client
--><span id="form1:out1">9</span>
&#9;&#9;&#9;<br><input id="form1:button1" name="form1:button1" type="submit"
value="Count" onclick="return _chain('jsf.ajax.request(this, event,
{execute:, render: \'out1\'}); return
&#9;&#9;&#9;<!-- Resets the counter --><input id="form1:reset"
name="form1:reset" type="submit" value="reset" onclick="return
_chain('jsf.ajax.request(this, event, {execute:\'reset\', render:
\'out1\'}); return
false;',this,event,true)"><input type="hidden"
name="org.apache.myfaces.trinidad.faces.FORM" value="form1"><input
type="hidden" name="_noJavaScript" value="false"><span
id="tr_form1_Postscript"><input type="hidden" name="javax.faces.ViewState"
value="!10n0ruibcq"><script type="text/javascript">function
_form1Validator(f,s){return _validateInline(f,s);}var


My thanks,

Bob Hodges

View raw message