Extension only works once

Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Extension only works once

    Hi, I have been toying with creating my own extensions and have created a
    simple one that creates one line of VBScript code from a single variable. I
    have two problems. The first one is that it only will place the code in the
    "Body" of the web page. i.e. not between the <% %> ASP tags and two it only
    works once. If you try and use it a second time it doesn't work, yet if you
    wait for 10 minutes or so, it works again.

    lfirth Guest

  2. Similar Questions and Discussions

    1. DM6.0 Extension Manager v1.2.107 not d/l newer extension
      Hi Folks, I have not been on line due to back surgery and recovery (ouch, yes it still hurts) I have tried to down load some newer navigation aids...
    2. #39370 [NEW]: $_GET no longer works under FastCGI but works under CGI.
      From: trustpunk at gmail dot com Operating system: Windows PHP version: 6CVS-2006-11-04 (snap) PHP Bug Type: CGI related Bug...
    3. #26240 [Opn->Bgs]: Functions of XSL-extension didn't loaded, however itself extension was loaded.
      ID: 26240 Updated by: chregu@php.net Reported By: igor_udintsev at mail dot ru -Status: Open +Status: ...
    4. #26240 [NEW]: Functions of XSL-extension didn't loaded, however itself extension was loaded.
      From: igor_udintsev at mail dot ru Operating system: Linux Red Hat 9 PHP version: 5.0.0b2 (beta2) PHP Bug Type: XSLT related...
    5. Is .dcr extension = Director file extension ?
      I'm a newbie and saw some files on a website ending in .dcr... 1 - Is the .dcr file type a Macromedia Director file? 2 - Does it take the...
  3. #2

    Default Re: Extension only works once

    lfirth wrote:
    > Hi, I have been toying with creating my own extensions and have created a
    > simple one that creates one line of VBScript code from a single variable. I
    > have two problems. The first one is that it only will place the code in the
    > "Body" of the web page. i.e. not between the <% %> ASP tags and two it only
    > works once. If you try and use it a second time it doesn't work, yet if you
    > wait for 10 minutes or so, it works again.
    As for inserting it the BODY, we'd have to see that code you're using to
    perform the insert.

    Do you restart DW inbetween it working again? Anyway, please show your
    code and we'll get it figured out.


    --
    Danilo Celic
    | Extending Knowledge Daily : [url]http://CommunityMX.com/[/url]
    | Team Macromedia for Dreamweaver : [url]http://macromedia.com/go/team/[/url]
    danilocelic *TMM* Guest

  4. #3

    Default Re: Extension only works once

    Here is the code

    <script language="JavaScript">
    function objectTag(form) {

    var strformvar="";
    var strMethod="";
    var strType="";
    var strBracketsLeft="";
    var strBracketsRight="";

    // Selects the value of the form method.
    if (document.formvariables.method[0].checked == true){
    strmethod = document.formvariables.method[0].value;
    }
    else {strmethod = document.formvariables.method[1].value;}

    // Selects value of the variable type.
    if (document.formvariables.StringType[0].checked == true){
    strType = document.formvariables.StringType[0].value;
    }

    else if (document.formvariables.StringType[1].checked == true){
    strType = document.formvariables.StringType[1].value;
    }

    else if (document.formvariables.StringType[2].checked == true){
    strType = document.formvariables.StringType[2].value;
    }
    else {strType = document.formvariables.StringType[3].value;}

    // This displays the form field contents.
    if (document.formvariables.FormField.value != ""){
    strformvar=document.formvariables.FormField.value;
    }
    else {strformvar='';}

    if (document.formvariables[0].Brackets.checked) {
    strBracketsLeft="<%";
    strBracketsRight="%>";
    }

    return (strBracketsLeft + ' ' + strType + strformvar + ' = Request.' +
    strmethod + '("' + strformvar + '") ' + strBracketsRight);
    }

    </script>
    <form name="formvariables" method="post" action="">
    <table width="394">
    <tr>
    <td width="137"><div align="left"><strong>Method</strong></div></td>
    <td width="95"><strong>Varable Type </strong></td>
    <td width="146"><strong>Form Field Name </strong></td>
    </tr>
    <tr>
    <td width="137"><input name="method" type="radio" value="Form"
    checked>Form</td>
    <td><input name="StringType" type="radio" value="str" checked> String
    </td>
    <td rowspan="4"><input name="FormField" type="text"></td>
    </tr>
    <tr>
    <td width="137"><input name="method" type="radio"
    value="QueryString">QueryString</td>
    <td><input name="StringType" type="radio" value="int"> Integer </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input name="StringType" type="radio" value="boo"> Boolean</td>
    </tr>
    <tr>
    <td><input name="Brackets" type="checkbox"> Include '<% %>'</td>
    <td><input name="StringType" type="radio" value="dat"> Date </td>
    </tr>
    </table>
    </form>

    lfirth Guest

  5. #4

    Default Re: Extension only works once

    lfirth wrote:
    > Here is the code
    Playing around a bit, and it seems that when you try to insert outside
    of the body without adding in the <% %> delimiters, then it woudln't
    insert, but other wise would. If within the body, it would insert with
    and without <%%>, but if I tried above the opening <html> or above the
    <head>, it wouldn't. I think this is how Objects are made, they "assume"
    that anything that doesn't belong outside the body (that is "bare" text
    whcih is what is inserted when you don't include the delimters) it tries
    to place into the body.

    A way around that woudl be to convert it into a Command and then use
    dom.insertHTML to place the code into the page.
    > <td><input name="Brackets" type="checkbox"> Include '<% %>'</td>
    FWIW: If you want tte < to appear, then you need to use &lt; instead.

    --
    Danilo Celic
    | Extending Knowledge Daily : [url]http://CommunityMX.com/[/url]
    | Team Macromedia for Dreamweaver : [url]http://macromedia.com/go/team/[/url]
    danilocelic *TMM* Guest

  6. #5

    Default Re: Extension only works once

    danilocelic *TMM* wrote:
    > A way around that woudl be to convert it into a Command and then use
    > dom.insertHTML to place the code into the page.
    One way to do that would be to convert to what i call a Pass through
    Object. You can read about it here:
    [url]http://www.communitymx.com/abstract.cfm?cid=0E9AD[/url]

    or by reading up on the runCommand API function.

    HTH
    --
    Danilo Celic
    | Extending Knowledge Daily : [url]http://CommunityMX.com/[/url]
    | Team Macromedia for Dreamweaver : [url]http://macromedia.com/go/team/[/url]
    danilocelic *TMM* Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139