View Single Post
  #3 (permalink)  
Old December 24th, 2007, 08:47 AM
ismailc ismailc is offline
Friend of Wrox
 
Join Date: Jan 2007
Location: durban, Africa, South Africa.
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi, Thank You for the assist, I found via the net a workaround for a tooltip 'alt' but it timesout.
i want to incorporate the below code to an existing xslt file where i get rid of the alt on the TOOLTIP & replace it by href.

[u]Workaround 'Alt' in HTML</u>
[code]
<style type="text/css" media="all">
@import "css/global.css";
</style>

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jtip.js" type="text/javascript"></script>

<a id="one" href="ajax.htm" class="jTip">?</a>


[u]Existing XSLT FILE </u>[code]
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove">
<xsl:output omit-xml-declaration = "yes" />
<xsl:template match="/">
<table width="100%" class="tbDetail">

    <tr>
        <td>
            <SCRIPT TYPE='text/javascript'>
                function hideHist()
                {
                    if (typeof fcHist != 'undefined')
                    {
                        fcHist.style.display = 'none';
                    }
                }
            </SCRIPT>
        </td>
    </tr>
    <xsl:variable name="cHist" select="count(Activity/myTracking/Activity[ DateResolved != '0' ])" />
    <xsl:if test="$cHist &gt; '0'">
        <tr width="100%">
            <td colspan="6" class="row1">
                <SCRIPT TYPE='text/javascript'>
                    function toggleHist(srcElement, srcArrow) {
                        if (srcElement.style.display == 'none')
                        {
                            srcElement.style.display = '';
                            srcArrow.src = 'images/expand.gif';
                        } else
                        {
                            srcElement.style.display = 'none';
                            srcArrow.src = 'images/collapse.gif';
                        }
                    }
                </SCRIPT>
                <span id='fcHistMain' style='cursor:hand;' onclick='toggleHist(fcHist, fcExpand)'>
                    <span style="vertical-align:middle;">
                        <img src='images/collapse.gif' id='fcExpand' align="middle" />#160;Expand to view the History
                    </span>
                </span>
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <div id='fcHist'>
                    <table width='100%' class='tbList'>
                    <xsl:for-each select="Activity/myTracking/Activity[ DateResolved != '0' ]">
                        <xsl:sort select='@id' />
                        <tr>
                            <td width='5%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute><xsl:value-of select="position()" />.#160;</td>
                            <td width='55%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
                                <xsl:if test="TrackValues = 'False'">
                                    <xsl:value-of select="Description" />
                                </xsl:if>
                                <xsl:if test="TrackValues = 'True' or TrackValues = ''">
                                    <a>
                                        <xsl:attribute name='href'>myTrackingPage.aspx?type=a&amp;id=<xsl :value-of select="@id" /></xsl:attribute>
                                        <xsl:attribute name='class'>bn</xsl:attribute>
                                        <xsl:value-of select="Description" />
                                    </a>
                                </xsl:if>
                            </td>
                            <td width='20%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
                                <xsl:if test="CreatorEMail[. = '']"><xsl:value-of select="Creator" /></xsl:if>
                                <xsl:if test="CreatorEMail[. != '']">
                                <a>
                                    <xsl:attribute name='class'>bn</xsl:attribute>
                                    <xsl:attribute name='href'>mailto:<xsl:value-of select="CreatorEMail" />?Subject=<xsl:value-of select="Description" /></xsl:attribute>
                                    <xsl:value-of select="Creator" />
                                </a>
                                </xsl:if>
                            </td>
                            <td width='20%'>
                                <xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
                                <xsl:value-of select="substring(DateResolved,1,4)"/>/<xsl:value-of select="substring(DateResolved,5,2)"/>/<xsl:value-of select="substring(DateResolved,7,2)" />#160;
                                <xsl:value-of select="substring(TimeResolved,1,2)" />:<xsl:value-of select="substring(TimeResolved,3,2)" />:<xsl:value-of select="substring(TimeResolved,5,2)" />
                            </td>
                        </tr>
                    </xsl:for-each>
                    </table>
                </div>
            </td>
        </tr>
    </xsl:if>


    <xsl:for-each select="Activity/ObjectGroup[@type='default']/Object">
    <xsl:sort select="@index" data-type="number" />
    <xsl:variable name="index" select="@index" />
    <xsl:variable name="nextNode" select="../Object[ @index > $index ][1]" />
    <xsl:variable name="nextCol" select="$nextNode/@columnNo" />
    <xsl:variable name="vis" select="string(Attributes/Attribute[ @name='visible'])" />
    <xsl:variable name="visNextCol" select="string($nextNode/Attributes/Attribute[ @name='visible'])" />
    <xsl:if test="($vis != 'False') or ($nextCol = '2' and ($vis != 'False' or $visNextCol != 'False'))">
    <xsl:if test="(@columnNo != '2')">
    <tr class="rowDetail">


        <xsl:choose>
        <xsl:when test="(string(Attributes/Attribute[ @name='visible']) = '') or (Attributes/Attribute[ @name='visible'] != 'False')">

            <td width='15%' align='left' class='rowDet'>
                <xsl:value-of select="Description" disable-output-escaping="yes" />#160;
                <xsl:if test="Mask[. != '']">(<xsl:value-of select="Mask" />)#160;</xsl:if>

        <xsl:if test=" @required[. = 'true']"></xsl:if>#160;
            </td>
            <td valign="middle">
                <xsl:if test="($nextCol != '2') or (count(following-sibling::*) = 0) or ($nextCol = '2' and $visNextCol = 'False')">
                    <xsl:attribute name='colspan'>4</xsl:attribute>
                    <xsl:attribute name='width'>70%</xsl:attribute>
                </xsl:if>
                <xsl:call-template name="CreateObject">
                    <xsl:with-param name="Object" select="." />
                </xsl:call-template>
                <xsl:if test="Tooltip != ''">
                #160;
                <xsl:element name="asp:image">
                    <xsl:attribute name='id'>ttip_<xsl:value-of select='@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:attribute name='imageurl'>images/tooltip.gif</xsl:attribute>
                    <xsl:attribute name='alt'><xsl:value-of select="Tooltip" /></xsl:attribute>
                </xsl:element>
                </xsl:if>
            </td>
            <td width='5%' align="right">
      <!--
            <xsl:if test="@dynamic='true'">
                <xsl:element name="asp:imageButton">
                    <xsl:attribute name='id'>reload_<xsl:value-of select='@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:attribute name='imageurl'>images/reload.gif</xsl:attribute>
                    <xsl:attribute name='alt'>Reload <xsl:value-of select="Description" /></xsl:attribute>
                </xsl:element>
            </xsl:if>
      -->
            </td>

        </xsl:when>
        <xsl:otherwise>
            <td width='15%' align='right' class='rowDet'>#160;</td>
            <td valign="middle">#160;</td>
            <td width='5%' align="right">#160;</td>
        </xsl:otherwise>
        </xsl:choose>

        <xsl:if test="($nextCol = '2') and $visNextCol != 'False'">

            <td width='15%' align='left' class='rowDet'>
                <xsl:value-of select="$nextNode/Description" disable-output-escaping="yes" />#160;
                <xsl:if test="$nextNode/Mask[. != '']">(<xsl:value-of select="$nextNode/Mask" />)#160;</xsl:if>

        <xsl:if test=" @required[. = 'true']"></xsl:if>#160;
            </td>
            <td width='30%' valign="middle">
                <xsl:call-template name="CreateObject">
                    <xsl:with-param name="Object" select="$nextNode" />
                </xsl:call-template>
                <xsl:if test="$nextNode/Tooltip != ''">
                #160;
                <xsl:element name="asp:image">
                    <xsl:attribute name='id'>ttip_<xsl:value-of select='$nextNode/@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:attribute name='imageurl'>images/tooltip.gif</xsl:attribute>
                    <xsl:attribute name='alt'><xsl:value-of select="$nextNode/Tooltip" /></xsl:attribute>
                </xsl:element>
                </xsl:if>
            </td>
            <td width='5%' align="right">
            <!--
       <xsl:if test="$nextNode/@dynamic='true'">
                <xsl:element name="asp:imageButton">
                    <xsl:attribute name='id'>reload_<xsl:value-of select='$nextNode/@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:attribute name='imageurl'>images/reload.gif</xsl:attribute>
                    <xsl:attribute name='alt'>Reload <xsl:value-of select="$nextNode/Description" /></xsl:attribute>
                </xsl:element>
            </xsl:if>
      -->
            </td>
        </xsl:if>
    </tr>
    </xsl:if>
    </xsl:if>
    </xsl:for-each>


    <xsl:for-each select="Activity/ObjectGroup[@type='group'][ @visible='true' ]">
    <xsl:sort select="@name" />
    <xsl:variable name="tmpGroup" select="@id" />
    <tr>
        <td colspan='6' width='100%'>
            <table width='100%' cellpadding='0' cellspacing='0' style='border: 1 solid #000000'>
                <tr>
                    <td width='80%' class='rowDet'><b><xsl:value-of select="Description" /></b></td>
                    <td class='rowDet' align='right'>
                        <xsl:if test="count(Object[ @dynamic='true' ]) &gt; 0">
                            <xsl:element name="asp:imageButton">
                                <xsl:attribute name='id'>reloadGroup_<xsl:value-of select='@id' /></xsl:attribute>
                                <xsl:attribute name='runat'>server</xsl:attribute>
                                <xsl:attribute name='imageurl'>images/reloadGroup.gif</xsl:attribute>
                                <xsl:attribute name='alt'>Reload <xsl:value-of select="Description" /></xsl:attribute>
                            </xsl:element>
                        </xsl:if>#160;
                        <xsl:if test="@allowadd[ .='true']">
                            <xsl:element name="asp:imageButton">
                                <xsl:attribute name='id'>lia_<xsl:value-of select='@id' /></xsl:attribute>
                                <xsl:attribute name='runat'>server</xsl:attribute>
                                <xsl:attribute name='src'>images/add.gif</xsl:attribute>
                                <xsl:attribute name='alt'>Add <xsl:value-of select="Description" /></xsl:attribute>
                            </xsl:element>
                        </xsl:if>#160;
                        <xsl:if test="@allowdelete[ .='true']">
                            <xsl:element name="asp:imageButton">
                                <xsl:attribute name='id'>lid_<xsl:value-of select='@id' /></xsl:attribute>
                                <xsl:attribute name='runat'>server</xsl:attribute>
                                <xsl:attribute name='src'>images/delete.gif</xsl:attribute>
                                <xsl:attribute name='alt'>Delete <xsl:value-of select="Description" /></xsl:attribute>
                            </xsl:element>
                        </xsl:if>
                    </td>
                </tr>

                <tr>
                    <td colspan='2' width='100%'>
                        <table cellspacing='1' cellpadding='3'>
                            <tr>
                                <xsl:if test="@count &gt; 0">

                                    <td></td>
                                    <xsl:for-each select="Object">
                                    <xsl:sort select="@index" data-type="number" />
                                        <xsl:if test="(string(Attributes/Attribute[ @name='visible']) = '') or (Attributes/Attribute[ @name='visible'] != 'False')">
                                            <td class='rowdet'>
                                                <xsl:attribute name='align'>center</xsl:attribute>
                                                <b><xsl:value-of select="Description" disable-output-escaping="yes" /></b>
                                            </td>
                                        </xsl:if>
                                    </xsl:for-each>
                                    <td></td>
                                </xsl:if>
                                <xsl:if test="@count = 0">
                                    <td>( No items found )</td>
                                </xsl:if>
                            </tr>

                            <xsl:if test="@count &gt; 0">

                                <xsl:variable name="obj" select="Object[ position()=1 ]/@name" />
                                <xsl:for-each select="Object[ @name=$obj ]/Value/@instance">
                                    <xsl:variable name="line" select="." />
                                    <tr>

                                        <xsl:choose>
                                                <xsl:when test="//ObjectGroup[@id=$tmpGroup][@allowadd='true']">
                                                    <td>
                                                        <xsl:element name="asp:CheckBox">
                                                            <xsl:attribute name='id'>__linecheck_<xsl:value-of select='$tmpGroup' />_<xsl:value-of select='$line' /></xsl:attribute>
                                                            <xsl:attribute name='runat'>server</xsl:attribute>
                                                        </xsl:element>
                                                    </td>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <td></td>
                                                </xsl:otherwise>
                                        </xsl:choose>


                                        <xsl:for-each select="//ObjectGroup[@id=$tmpGroup]/Object">
                                        <xsl:sort select="@index" data-type="number" />
                                        <xsl:variable name="name" select="concat('li_',concat($tmpGroup,concat('_',c oncat($line,concat('_',@name)))))" />
                                        <xsl:choose>
                                        <xsl:when test="(string(Attributes/Attribute[ @name='visible']) = '') or (Attributes/Attribute[ @name='visible'] != 'False')">
                                        <td>
                                            <xsl:call-template name="CreateLineItemObject">
                                                <xsl:with-param name="Object" select="." />
                                                <xsl:with-param name="name" select="$name" />
                                                <xsl:with-param name="line" select="$line" />
                                                <xsl:with-param name="tmpGroup" select="$tmpGroup" />
                                            </xsl:call-template>
                                        </td>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:call-template name="ReferenceLabel">
                                                <xsl:with-param name="Name" select="$name" />
                                                <xsl:with-param name="Attributes" select="Attributes" />
                                                <xsl:with-param name="Value" select="Value[ @instance=$line ]" />
                                            </xsl:call-template>
                                        </xsl:otherwise>
                                        </xsl:choose>
                                        </xsl:for-each>
                                    </tr>
                                </xsl:for-each>
                            </xsl:if>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    </xsl:for-each>

    <!--
        Now dump in the ungrouped invisible objects, if any.
        Invisible objects will always be output as labels, cause we're
        simply after an Object Name / Object Value pairing.
    -->
    <tr>
        <td colspan="6">
            <xsl:for-each select="Activity/ObjectGroup[@type='default']/Object[ ./Attributes/Attribute[ @name='visible' ] = 'False' ]">
                <xsl:call-template name="ReferenceLabel">
                    <xsl:with-param name="Name" select="@name" />
                    <xsl:with-param name="Attributes" select="Attributes" />
                    <xsl:with-param name="Value" select="Value" />
                </xsl:call-template>
            </xsl:for-each>
        </td>
    </tr>

    <xsl:variable name="cTrigger" select="count(Activity/ObjectGroup[@type='trigger']/Object)" />

    <xsl:if test="$cTrigger='1'">
        <xsl:for-each select="Activity/ObjectGroup[@type='trigger']/Object">
        <tr>

            <td width='30%' align='right' class='rowTrg'>
                <xsl:value-of select="Description" disable-output-escaping="yes" />#160;
            </td>
            <td colspan="4">
                <xsl:element name="asp:CheckBox">
                    <xsl:attribute name='id'><xsl:value-of select='@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:if test="Value[. = 'on']">
                        <xsl:attribute name='Checked'>True</xsl:attribute>
                    </xsl:if>
                </xsl:element>
            </td>
            <td>
            </td>
        </tr>
        </xsl:for-each>
    </xsl:if>

    <xsl:if test="$cTrigger &gt; '1'">
        <xsl:for-each select="Activity/ObjectGroup[@type='trigger']/Object">
        <tr>

            <td width='30%' align='right' class='rowTrg'>
                <xsl:value-of select="Description" disable-output-escaping="yes" />#160;
            </td>
            <td colspan="4">
                <xsl:element name="asp:RadioButton">
                    <xsl:attribute name='id'><xsl:value-of select='@name' /></xsl:attribute>
                    <xsl:attribute name='runat'>server</xsl:attribute>
                    <xsl:attribute name='GroupName'>triggers</xsl:attribute>
 &nbs
Reply With Quote