Project

General

Profile

« Previous | Next » 

Revision 4391

use regular hyperlink to viewing question (item) details - nested form elements were causing grief after being included with ajax calls.

View differences:

lib/style/skins/first/first-item-resultset.xsl
39 39
	<xsl:template match="/">
40 40
		<script language="JavaScript">
41 41
          <![CDATA[
42
          submitform = function(action,form_ref) {
42
          submitItemForm = function(action,docid,formId) {
43
          		var form_ref = document.getElementById(formId);
43 44
              form_ref.action.value=action;
44
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
45
              form_ref.docid.value=docid;
46
              //form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
45 47
              //form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
48
              form_ref.qformat.value="first";
46 49
              form_ref.submit();
47 50
          }
48 51

  
......
57 60
			if there are not then don't show the query results -->
58 61
		<xsl:if test="count(resultset/document) &gt; 0">
59 62

  
63
			<form action="{$contextURL}/metacat" method="POST">
64
				<xsl:attribute name="id">assessmentForm</xsl:attribute>
65
				<input type="hidden" name="qformat" value="first"/>
66
				<input type="hidden" name="sessionid">
67
					<xsl:attribute name="value">
68
						<xsl:value-of select="$sessid" />
69
					</xsl:attribute>	
70
				</input>
71
				<input type="hidden" name="action" value="read" />
72
				<input type="hidden" name="docid"/>
73
			</form>
60 74
			<table width="95%" align="left" border="0" cellpadding="0"
61 75
				cellspacing="0">
62 76

  
......
71 85
						</xsl:attribute>
72 86

  
73 87
						<td class="text_plain">
88
							<!--
74 89
							<a>
75
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
90
								<xsl:attribute name="href">javascript:submitItemForm('read','<xsl:value-of select="./docid" />', 'assessmentForm')</xsl:attribute>
76 91
								<xsl:text>&#187;&#160;</xsl:text>
77 92
								<xsl:value-of select="./param[@name='item/@title']" />
78
								<!-- <xsl:value-of select="./param[@name='item/@ident']" />-->
79 93
							</a>
94
							-->
95
							<a>
96
								<xsl:attribute name="href">
97
									<xsl:value-of select="$contextURL" />
98
									<xsl:text>/metacat?action=read</xsl:text>
99
									<xsl:text>&amp;docid=</xsl:text>
100
									<xsl:value-of select="./docid" />
101
									<xsl:text>&amp;qformat=first</xsl:text>
102
									<xsl:text>&amp;sessionid=</xsl:text>
103
									<xsl:value-of select="$sessid" />
104
								</xsl:attribute>	
105
								<xsl:value-of select="./param[@name='item/@title']" />
106
							</a>
80 107
							(<xsl:value-of select="./docid" />)
81
							<form action="{$contextURL}/metacat" method="POST">
82
								<xsl:attribute name="name">
83
									<xsl:value-of select="translate(./docid, '()-.', '____')" />
84
								</xsl:attribute>
85

  
86
								<input type="hidden" name="qformat" value="first"/>
87
								<input type="hidden" name="sessionid" />
88
								<xsl:if	test="$enableediting = 'true'">
89
									<input type="hidden"
90
										name="enableediting" value="{$enableediting}" />
91
								</xsl:if>
92
								<input type="hidden" name="action" value="read" />
93
								<input type="hidden" name="docid">
94
									<xsl:attribute name="value">
95
										<xsl:value-of select="./docid" />
96
									</xsl:attribute>
97
								</input>
98
								<xsl:for-each select="./relation">
99
									<input type="hidden" name="docid">
100
										<xsl:attribute name="value">
101
											<xsl:value-of select="./relationdoc" />
102
										</xsl:attribute>
103
									</input>
104
								</xsl:for-each>
105
							</form>	
108
								
106 109
						</td>
107 110
						
108 111
						<td class="text_plain">

Also available in: Unified diff