Page 1 of 1

Drop down menu page refresh problem!!!!

Posted: Wed Sep 03, 2008 4:13 am
by leathem
Hello all,
i have a page that updates every minute, i want to save the state of the onClickdrop down menu when it refreshes so the menu will stay opened where the user clicks after it refreshes, this is the code of the menu,(the page is implemented using xsl, php, property doc etc.)

<!-- creates a drop down menu to display the projects-->
<span onClick="document.all.list2.style.display = 'block'">
<div id = "title"><font size="3"><img src="plus.gif"/> Software - </font></div></span>
<span id="list2" onClick="document.all.list2.style.display = 'none'">


<span class="summary">
<table border="1">
<tr>
<th><img src="line.gif"/>Project</th>
<th>Current Status</th>
<th>Latest Attempt</th>
<th>Latest Success</th>
<th>Latest Label</th>
<th>Latest Result</th>
<th>Artifacts</th>
<xsl:if test="/projectinfo/config/property[@name='jmx.enabled']/@value='true'">
<th>Actions<img src="line.gif"/></th>
</xsl:if>
</tr>

<xsl:for-each select="/projectinfo/summary/group/project">


<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="contains(status, 'paused')">paused-build</xsl:when>
<xsl:when test="position() mod 2 = 1">a</xsl:when>
<xsl:when test="position() mod 2 = 0">b</xsl:when>
<xsl:otherwise>a</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td>
<a href="#{name}"></a><a href="?project={name}&log={latestlog}"><xsl:value-of select="name"/></a>
</td>
<td>
<xsl:value-of select="status"/>
</td>
<td>
<xsl:value-of select="latestattempt"/>
</td>
<td>
<xsl:value-of select="latsuccess"/>
</td>
<td>
<xsl:value-of select="lattlabel"/>
</td>
<td class="{latestresult}" align="center">
<xsl:value-of select="latestresult"/>
</td>
<td>
<center><a href="?project={name}&a=artifacts" title="Build artifacts of the latest successful build">Browse</a></center>
</td>

<xsl:if test="/projectinfo/config/property[@name='jmx.enabled']/@value='true'">
<td>
<xsl:choose>
<xsl:when test="contains(status, 'pause')">
<a class="button" href="JavaScript:force('resume','{name}')" title="Resumes the continuous integration loop for this project">Resume</a>
</xsl:when>
<xsl:otherwise>
<a class="button" href="JavaScript:force('build','{name}')" title="Forces a build even if there are no changes">Build</a>
<a class="button" href="JavaScript:force('pause','{name}')" title="Disables the continuous integration loop for this project">Pause</a>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</span> <!--list2-->
</span>
<br>

</br>

Re: Drop down menu page refresh problem!!!!

Posted: Wed Sep 03, 2008 1:39 pm
by starram
keep the selected option value in session or pass that to the link.

Then use if condition if they are set and match the value, if value is equal to option value then echo selected.

Re: Drop down menu page refresh problem!!!!

Posted: Thu Sep 04, 2008 3:21 am
by leathem
Thanks but i don't really understand can u explain more, legend.

Re: Drop down menu page refresh problem!!!!

Posted: Thu Sep 04, 2008 4:20 am
by starram
Please email me I will send you a sample link for reference.