Ok Guys,

I have just had a look informs-field-styling.xsl and seen that the convention for form-template is <fi:form-template /> and not <ft:form-template /> ! SO why in the doc examples do you see ft:form-template? Which one is correct? When I use fi for all form elements, none of them are transformed and the html output is:

<form-template
 action="login.kont" name="Form1" method=
"POST" ajax="true">
<continuation-id />
<div id="output">
<table border ="0" cellspacing="0" cellpadding= "0">
<tr>
<td width="55" valign="bottom"><img src="images/user.gif" width="55" height="16" /></ td>
<td width="220" valign= "top">
<group>
<styling type="tabs" />
<state>
</state>
<items>
<widget id="username">
<styling size="30" type="text" class="keyinbox" />
</ widget>
</items>
</group>
</td>
</tr>
</ table>

but when I use ft for certain form elements, the html output is:

<form-template action=
"login.kont" ajax="true" name="Form1" 
method="POST">
<continuation-id>2a3a7b7c4d375249848a141a70702c45462d6333</ continuation-id>
<div id="output">
<table border="0" cellspacing="0" cellpadding= "0">
<tr>
<td width="55" valign="bottom"><img src="images/user.gif" width="55" height="16" /></ td>
<td width="220" valign= "top">
<group>
<styling type="tabs" />
<state>
<field id="activetab" state="active" required="false"><datatype type="integer" />
</field>
</state>
< items>
<field id="username" state= "active" required="true"><datatype type= "string" />
<styling size="30" type="text" class="keyinbox" />
</ field>
</group>
</td>
</tr>
</table>

Can someone PLEASE let me know what is going on here?

regards

Andrew

On 20/07/06, Andrew <[EMAIL PROTECTED]> wrote:
Hi,
I am having problems understanding why I am getting html output as follows:

        <form-template
 action="login.kont" ajax="true" name=
"Form1" method="POST">
<continuation-id>5885482d2522194f47888e4f4269021f22172563</
continuation-id>
        <table border=
"0" cellspacing="0" cellpadding="0">

<tr>
<td width="55" valign ="bottom"><img src="images/user.gif" width="55" height="16" /></ td>
<td width="220" valign= "top">
<group>
<styling type="tabs" />
<state>
<field id="activetab" state="active" required="false">
<datatype
type="integer" />
</field>
</ state>
<items>
<field id="username" state="active" required="true">
<datatype
type="string" />
< styling size="30" type="text" class= "keyinbox" />
</field>
</items>
</group>

</td>
</tr></ table>

As you can see, the form and widgets are not being rendered properly at all, why is this?


My sitemap is as follows:

<map:match pattern="**viewform-*">
<map:generate type="jx" src=""
<map:transform type="browser-update"/>
<map:transform type="cinclude"/>
<map:transform type="xslt-saxon" src=""><map:transform type="cinclude"/>
<map:transform type="i18n">

<map:parameter name="locale" value="en-US"/>
</map:transform>
<map:transform src=""><map:transform type="i18n">

<map:parameter name="locale" value="en-US"/>
</map:transform>
<map:select type="ajax-request">
<map:when test="true">
<map:serialize type="xml"/>

</map:when>
<map:otherwise>
<map:serialize type="xhtml"/>
</map:otherwise>
</map:select>
</map:match>

jx/{2}.jx is:
<?xml version="1.0" encoding="ISO-8859-1"?>

<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">

<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
macros.xml" />
<login_fields>
<jx:choose>
<jx:when test="${userGlobal==null}">
<ft:form-template action="" name="Form1" method="POST" ajax="true">

<ft:continuation-id />
<div id="output">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55" valign="bottom"><img src="" width="55" height="16" /></td>

<td width="220" valign="top">
<fi:group>
<fi:styling type="tabs" />
<fi:state>
<ft:widget id="activetab" />

</fi:state>
<fi:items>
<ft:widget id="username">
<fi:styling size="30" type="text" class="keyinbox" />

</ft:widget>
</fi:items>
</fi:group>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">

<tr>
<td width="55" valign="bottom"><img src="" width="89" height="16" /></td>
<td width="220" valign="top">

<fi:group>
<fi:styling type="tabs" />
<fi:state>
<ft:widget id="activetab" />
</fi:state>
<fi:items>

<ft:widget id="password">
<fi:styling size="30" type="password" class="keyinbox" />
</ft:widget>
</fi:items>

</fi:group>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="6" align="right"><img src="" width="2" border="0" height="5" /></td>
</tr>
<tr>

<td><img src="" width="3" border="0" height="1" /></td>
<td width="55" valign="bottom" class="indextext"><img src=""
captcha.jpeg" /></td>
<td width="220" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>

<td><img src="" width="3" border="0" height="1" /></td>
<td valign="top">
<fi:group>
<fi:styling type="tabs" />
<fi:state>
<ft:widget id="activetab" />
</fi:state>
<fi:items>
<ft:widget id="captcha_code">

<fi:styling listbox-size="30" type="text" class="keyinbox" />
</ft:widget>
</fi:items>
</fi:group>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td colspan="6" align="right"><img src="" width="2" border="0" height="10" /></td>
</tr>

<tr>
<td align="right">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="bottom" class="indextext"><a href=""
sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten your Password?</a></td>
<td align="right"><img src="" width="8" height="14" /></td>

</tr>
</table>
</td>
<td width="8" align="left"><img src="" width="8" height="14" /></td>

<td width="42" align="left"><a href=""
over.gif',1)"><img src="" alt="sumit" name="sumit" width="42" height="15" border="0" /></a></td>
<td width="42" align="center" valign="middle"><a href=""
document.Form1)" src="" alt="cancel" name="cancel" width="42" height="15" border="0" /></a></td>

<td width="20" align="center" valign="middle"><img src="" width="20" height="8" /></td>
</tr>
</table>

</div>
</ft:form-template>
</jx:when>
<jx:otherwise>
..... more code here ........
</jx:otherwise>
</jx:choose>
</login_fields>


style/{2}.xsl is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" http://www.w3.org/1999/XSL/Transform
"
xmlns:cinclude="http://apache.org/cocoon/include/1.0 "
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance
"
xmlns:ft=" http://apache.org/cocoon/forms/1.0#template"
exclude-result-prefixes="ft fi cinclude">
<xsl:template match="/">

<page>
<html>
<head>

</head>

<body leftmargin="0" marginheight="0" topmargin="0" marginwidth="0"
over.gif','images/cancel-over.gif','images/emaillink-over.gif')">
<table width="261" border="0" cellspacing="0" cellpadding="0">
... more code .....
<tr>
<td><xsl:apply-templates select="//login_fields"/></td>
</tr>
</table></td>
...... more code ......

</body>
</html>
</page>
</xsl:template>

<xsl:template match="login_fields">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="*">

<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|xmlns|node()"/>
</xsl:element>
</xsl:template>

<xsl:template match="@*|text()">

<xsl:copy/>
</xsl:template>


</xsl:stylesheet>

regards

Andrew


Reply via email to