Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 11th, 2008, 07:14 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default Incorporate HTML Code in XSLT (Drop down border)

Hi, I want to add the foll HTML DHTMLXCombo code to XSLT code dropdown!

It is not possible to change the drop down border style in IE so i found the following code downloaded from a site: http://dhtmlx.com/docs/download.shtml
Downloaded the DHTMLXCombo!

[u]In HTML with the scripts downloaded it changes the border style:</u>
<html>
<script src="./codebase/dhtmlxcommon.js"></script>
<script src="./codebase/dhtmlxcombo.js"></script>
<link rel="STYLESHEET" type="text/css" href="./codebase/dhtmlxcombo.css">
<script>
window.dhx_globalImgPath="./codebase/imgs/";
</script>
<select style='width:200px;' id="combo_zone1" name="alfa1">
  <option value="1">a00</option>
  <option value="2">a01</option>
</select>
<script>
  var z=dhtmlXComboFromSelect("combo_zone1");
</script>
</html>

[u]I now want to add it to the existing xslt code for drop downs:</u>

<xsl:when test="$Object/@type[.='drop down' or .='lookup' or .='team select']">
<xsl:call-template name="ListValueType">
<xsl:with-param name="Name" select="$Object/@name" />
<xsl:with-param name="Attributes" select="$Object/Attributes" />
<xsl:with-param name="Options" select="$Object/Options" />
<xsl:with-param name="Value" select="$Object/Value" />
</xsl:call-template>
</xsl:when>
<xsl:template name="ListValueTypeOld">
<xsl:param name="Name" />
<xsl:param name="Attributes" />
<xsl:param name="Options" />
<xsl:param name="Value" />
<xsl:element name="asp:dropdownlist">
<xsl:attribute name='id'><xsl:value-of select='$Name' /></xsl:attribute>
<xsl:attribute name='runat'>server</xsl:attribute>
<xsl:for-each select="$Attributes/Attribute">
<xsl:attribute name='{@name}'><xsl:value-of select='.' /></xsl:attribute>
</xsl:for-each>
<xsl:for-each select='$Options/Option'>
<xsl:element name="asp:ListItem">
<xsl:attribute name='Value'><xsl:value-of select='.' /></xsl:attribute>
<xsl:if test="@selected[. = 'true']"><xsl:attribute name='selected'>true</xsl:attribute></xsl:if>
<xsl:value-of select='.' />
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>

Please is it possible, canyone please have a look at the code or the download sample DHTML - I posted a ques on their site too!

Regards

 
Old January 11th, 2008, 03:52 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

As XSLT outputs HTML, just add your html code to your XSLT


 
Old January 14th, 2008, 07:51 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi, Thank You - i got it going!

2 things:
How do i force it to close on loose focus, becuase when i select it the drop down, i must select in order for it close?

It also moves everything after it to a new line etc... image
meaning the dropdown on one line & image that is surpose to be next to it - is at the bottom?

  <xsl:template name="ListValueType">
      <xsl:param name="Name" />
      <xsl:param name="Attributes" />
      <xsl:param name="Options" />
      <xsl:param name="Value" />
      <xsl:element name="asp:dropdownlist">
        <xsl:attribute name='id'>
          <xsl:value-of select='$Name' />
        </xsl:attribute>
        <xsl:attribute name='runat'>server</xsl:attribute>
        <xsl:for-each select="$Attributes/Attribute">
          <xsl:attribute name='{@name}'>
            <xsl:value-of select='.' />
          </xsl:attribute>
        </xsl:for-each>
        <xsl:for-each select='$Value/Options/Option'>
          <xsl:element name="asp:ListItem">
            <xsl:attribute name='Value'>
              <xsl:value-of select='.' />
            </xsl:attribute>
            <xsl:if test="@selected[. = 'true']">
              <xsl:attribute name='selected'>true</xsl:attribute>
            </xsl:if>
            <xsl:value-of select='.' />
         </xsl:element>
        </xsl:for-each>

      </xsl:element>
    <script TYPE='text/javascript'>
      var z=dhtmlXComboFromSelect("<xsl:value-of select='$Name' />");
    </script>
</xsl:template>


Regards



 
Old January 14th, 2008, 09:18 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default


These are now HTML questions rather than XSLT questions. You need to find an HTML forum.

>2 things:
How do i force it to close on loose focus, becuase when i select it the drop down, i must select in order for it close?

It also moves everything after it to a new line etc... image
meaning the dropdown on one line & image that is surpose to be next to it - is at the bottom?


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to incorporate an html code in xslt ismailc XSLT 22 January 16th, 2008 05:22 AM
incorporate javascript, works in html but not xslt ismailc XSLT 2 December 12th, 2007 03:32 AM
Change Drop down Border style ismailc XSLT 2 December 10th, 2007 07:25 AM
HTML for XSLT tarunm XSLT 1 November 14th, 2005 11:29 PM
static HTML table border problem Robin1 HTML Code Clinic 4 August 12th, 2004 04:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.