I call /stylesheets/general.xsl which <xsl:include>'s perform_html.xsl.
I am using the perform_html.xsl that comes with PerForm but with slight
modification. I've added 2 attributes to the PerForm tags, tdlabel and
calendar. Since I couldn't wrap the perform tags in a table in the XSP, and
adding the table in XSL didn't allow me to know the display name of each
field, I've got tdlabel. This turns:

    <f:textfield name="test" tdlabel="This is a test" />

into
    <tr>
        <th>This is a test: </th>
        <td><input type="text" name="test"></td>
    </tr>

And the entire thing is always wrapped in a uniform table. This suits my
needs for the type of intranet site I'm building.

The calendar attribute is applied only to textfield's and simply tells the
stylesheet to tie a javascript popup calendar to that textfield. I've
attached the perform_html.xsl stylesheet.

----- Original Message ----- 
From: "Matt Sergeant" <[EMAIL PROTECTED]>
To: "Riley James" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 23, 2002 12:36 PM
Subject: Re: PerForm *too* sticky


> On Monday, Sep 23, 2002, at 17:06 Europe/London, Riley James wrote:
> 
> > I've been experiencing an issue where PerForm seems to be 
> > hyper-sticky, reprocessing the same form parameters over and over even 
> > though they're being entered differently.
> >
> > This is happening inconsistently (it'll work long enough to make me 
> > think it's not a problem, then I come back in a couple hours).
> >
> > For instance, I have an XSP page which is a very simple search. The 
> > form posts to itself, and I'm using AxKit::XSP::IfParam along with 
> > AxKit::XSP::AttrParam in the body to test for submission and output 
> > the matching rows. The problem is that once I post the first time, 
> > that's it. This persists when I leave the page and come back, but I 
> > haven't tested it methodically enough to determine an actual pattern.
> >
> > I'm not using any session handling AxKit libraries.
> > I'm not getting any errors with AxLogLevel at 10.
> > All is from CVS, 3 days old.
> >
> > Has anyone else experienced this?
> >
> > -- Ryan
> >
> > <?xml version="1.0"?>
> > <?xml-stylesheet href="." type="application/x-xsp"?>
> > <?xml-stylesheet href="/stylesheets/general.xsl" type="text/xsl"?>
> 
> Are you also using the included XSLT that comes with PerForm?
> Matt.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
<?xml version="1.0"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    version="1.0"
>

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

<xsl:template match="form">
<table class="form" cellspacing="2">
	<form>
		<xsl:for-each select="@*">
			<xsl:attribute name="{name()}">
				<xsl:value-of select="." />
			</xsl:attribute>
		</xsl:for-each>
		<xsl:apply-templates />
	</form>
</table>
</xsl:template>

<xsl:template match="formerrors">
    <xsl:apply-templates select="..//error"/>
</xsl:template>

<xsl:template match="error">
  <span class="form_error"><xsl:value-of select="."/></span>
</xsl:template>

<xsl:template match="textfield">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <input
        type="text"
        name="{@name|name}{@index|index}"
        value="{@value|value}"
        size="{@width|width}"
        maxlength="{@maxlength|maxlength}" />

    <xsl:if test="./calendar">
    	<a>
			<xsl:attribute name="href">
				<xsl:text>javascript:show_calendar('</xsl:text>
				<xsl:value-of select="../@name|../name" />
				<xsl:text>.</xsl:text>
				<xsl:value-of select="./@name|./name" />
				<xsl:text>');</xsl:text>
			</xsl:attribute>
			<img src="/images/calendar.gif"  ALT="Choose a date" BORDER="0" ALIGN="ABSMIDDLE" />
		</a>
	</xsl:if>
    <xsl:apply-templates select="error"/>
    </td>
</tr>
</xsl:template>

<xsl:template match="password">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <input
        type="password"
        name="{@name|name}{@index|index}"
        value="{@value|value}"
        size="{@width|width}"
        maxlength="{@maxlength|maxlength}" />
    <xsl:apply-templates select="error"/>
   	</td>
</tr>
</xsl:template>

<xsl:template match="checkbox">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <input
        type="checkbox"
        name="{@name|name}{@index|index}"
        value="{@value|value}">
      <xsl:if test="@checked = 'checked' or checked = 'checked'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
    </input>
    <xsl:apply-templates select="error"/>
    </td>
</tr>
</xsl:template>

<xsl:template match="submit_button">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <input
        type="submit"
        name="{@name|name}{@index|index}"
        value="{@value|value}"
        class="button" />
    <xsl:apply-templates select="error"/>
    </td>
</tr>
</xsl:template>

<xsl:template match="hidden">
    <input
        type="hidden"
        name="{@name|name}{@index|index}"
        value="{@value|value}" />
</xsl:template>

<xsl:template match="options/option">
  <option value="{@value|value}">
    <xsl:if test="selected[. = 'selected'] | @selected[. = 'selected']">
      <xsl:attribute name="selected">selected</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="@text|text"/>
  </option>
</xsl:template>

<xsl:template match="single_select">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <select name="{@name|name}">
        <xsl:apply-templates select="options/option"/>
    </select>
    <xsl:apply-templates select="error"/>
    </td>
</tr>
</xsl:template>

<xsl:template match="multi_select">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
  <select multiple="multiple" name="{@name|name}">
    <xsl:apply-templates select="options/option"/>
  </select>
  <xsl:apply-templates select="error"/>
  </td>
</tr>
</xsl:template>

<xsl:template match="textarea">
<tr>
	<th valign="top"><xsl:value-of select="./tdlabel" /> </th>
	<td>
    <textarea name="{@name|name}{@index|index}" cols="{@cols|cols}" rows="{@rows|rows}">
    <xsl:if test="@wrap|wrap"><xsl:attribute name="wrap">physical</xsl:attribute></xsl:if>
    <xsl:value-of select="@value|value"/>
    </textarea> <br />
    <xsl:apply-templates select="error"/>
   	</td>
</tr>
</xsl:template>

<xsl:template match="file_upload">
<tr>
	<th><xsl:value-of select="./tdlabel" /> </th>
	<td>
	<input type="file">
		<xsl:for-each select="@*">
			<xsl:attribute name="{name()}">
				<xsl:value-of select="." />
			</xsl:attribute>
		</xsl:for-each>
	</input>
	<xsl:apply-templates select="error" />
	</td>
</tr>
</xsl:template>

</xsl:stylesheet>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to