shale-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eggert" <regg...@proteus-technologies.com>
Subject Strange Behavior with inputTextarea component
Date Mon, 12 Feb 2007 02:55:26 GMT
I've been trying to teach myself how to use Clay (despite the atrocious lack of available documentation).
 In the process of doing this, I put together a very simple "hello world" style application.
 However, the behavior is not as expected, and I'm not sure whether I'm doing something wrong
or there's an actual bug in Clay.

My welcome page, index.jsp, contains a redirect to /test.faces.

test.faces maps to test.jsp, which looks like this:

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="sh" uri="http://shale.apache.org/clay" %>
<f:view>
	<sh:clay 
		id="testPage" 
		jsfid="/test.html" 
	/>
</f:view>


test.html itself looks like this:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
	<head>
		<title>This is a test</title>
	</head>
	<body>
		<form>
			<textarea jsfid="textAreaTest">This is a mockup.</textarea>
		</form>
	</body>
</html>


When viewed in a browser or the "Preview" pane of the Amateras HTML editor, the HTML file
is (correctly) rendered as a single TEXTAREA entity with the text "This is a mockup." as its
contents.

My clay-config.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE view PUBLIC
	"-//Apache Software Foundation//DTD Shale Clay View Configuration 1.0//EN"
	"http://shale.apache.org/dtds/clay-config_1_0.dtd"
>
<view>
	<component jsfid="textAreaTest" extends="inputTextarea" id="textAreaTest">
		<attributes>
			<set name="value" value="Test was successful." />
		</attributes>
	</component>
</view>


When I deploy the application and load the page in my browser, the TEXTAREA is rendered with
the text "Test was successful." as its contents (as expected), but the text "This is a mockup."
also appears AFTER the TEXTAREA element as regular text, which seems like incorrect behavior.
 Doing a "View Source" on the page yields the following:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
	<head>
		<title>This is a test</title>
	</head>
	<body>
		<form id="_id2" name="_id2" method="post" action="/squadBB/test.faces" enctype="application/x-www-form-urlencoded">
			<textarea name="_id2:textAreaTest" id="_id2:textAreaTest">Test was successful.</textarea>This
is a mockup.
		<input type="hidden" name="_id2_SUBMIT" value="1" /><input type="hidden" name="jsf_sequence"
value="1" /></form>
	</body>
</html>


Is this a bug, or am I doing something wrong?  It doesn't seem like Clay should be moving
the contents of a TEXTAREA such that it is rendered after the tag (causing it to appear as
regular text).

I'm using Shale v1.04 with MyFaces 1.1.4 on Tomcat 5.5.




Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message