cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beya! <and...@jibeya.com>
Subject Cform widget not being displayed
Date Mon, 15 Nov 2004 00:20:36 GMT
Hi,
I am having problems with a widget which is not rendering a text box to 
the browser.

In my login.js file I have:

function login() {
	var form = new Form("forms/definition.xml");
	
	while (true) {
		
		//Check form integrity
		form.showForm("unprotected.xml", {"msg":msg, 
"userGlobal":userGlobal});
		var model = form.getModel();
		
		//Check user exists
		try {
			userGlobal = newUser.getUser(model.username,model.password);
			break;
		}catch(e) {
			msg = "Incorrect username or password. Please re-enter.";
		}
	}
............

In my login.jx file I have specified the following:

<page
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
 >
	<login_fields>
		<jx:choose>
		  <jx:when test="${userGlobal==null}">
			<ft:form-template name="Form1" id="Form1" method="post" 
action="${cocoon.continuation.id}.kont">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td width="55" valign="bottom"><img src="images/user.gif" 
width="55" height="16" /></td>
						  <td width="100" valign="top">
						  	<ft:widget id="username">
						  		<fi:styling size="30" class="keyinbox"/>
						  	</ft:widget>
						  </td>

In my definition.xml file I have specified the following:

<?xml version="1.0"?>

<fd:form
xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">

   <fd:widgets>
     <fd:field id="username" required="true">
	  <fd:label>Username:</fd:label>
       <fd:datatype base="string"/>
       <fd:validation>
         <fd:length min="2"/>
       </fd:validation>
     </fd:field>

     <fd:field id="email" required="true">
       <fd:label>Email address:</fd:label>
       <fd:datatype base="string"/>
       <fd:validation>
         <fd:email/>
       </fd:validation>
     </fd:field>

     <fd:field id="password" required="true">
       <fd:label>Password:</fd:label>
       <fd:datatype base="string"/>
       <fd:validation>
         <fd:length min="5" max="20"/>
       </fd:validation>
     </fd:field>
</fd:widgets>

</fd:form>


When the page is rendered as html the widget label name appears but not 
the textbox element. What am I doing wrong here?

regards


Andrew
Mime
View raw message