dynamic tag creation

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default dynamic tag creation

    Looking for a way to dynamically evaluate a tag from a string. eg:

    <cfset tmp = '<cfset myRslt = "Hello">'>

    <cfoutput>
    #tmp#
    </cfoutput>

    this prints <cfset myRslt = "Hello"> after compilation.

    [i want to be able to see the result of: #myRslt# -- but it ends up undefined

    throwing evaluate() around it doesn't help either.

    Anyone know a way to evaluate the tag, pre-compilation. I'm thinking I might
    have to write the string to separate file, then call it as a ctag or include
    it. I'm also thinking that's more trouble than it's worth. Does mach-ii
    implement something like this?

    thanks in advance for any advice.

    -jacob




    JJBBDD Guest

  2. Similar Questions and Discussions

    1. dynamic xml creation
      How can I make XML dynamically inside tha Flash using AS? Basicly i need to make structure like these one: <root> <item></item> ......
    2. Dynamic DataGridRow creation
      Dear all, I am working with a datagrid populated by an XML via a WebService and I would like to populate my dataGrid dynamicaly (as I browse the...
    3. Dynamic content creation
      I'm rather a newbie to flex, at the stage of considering it it is worth my time to get to know to it (or maybe laszlo...). I have this question:...
    4. Dynamic columns creation
      Hi. I have a stored procedure that among other things returns a column with values that will be used to compose a temporary table. The number of...
    5. dynamic object creation
      If I have something like this: s="Array" How whould I get something like this: aObject=s.new In "plain" english I am asking if I have a...
  3. #2

    Default Re: dynamic tag creation

    How come you're trying to store a CF "tag string"? Is this what you're trying
    to do?

    <cfscript>
    myRslt = "Hello";
    tmp = "myRslt";
    WriteOutput( Evaluate( tmp ) ); //Outputs 'Hello'
    </cfscript>
    <cfabort>


    BSterner Guest

  4. #3

    Default Re: dynamic tag creation

    that's the idea, but I want to dynamically write the code for a <cfchart... >
    tag then execute it. so it's more complicated than evaluating a variable.

    the crux of the issue is that i need the option to include the SCALETO and
    SCALEFROM attributes in a <CFCHART..> tag. i think the best way to solve this
    is with an if/else switch but that leads to redundant code which drives me nuts.


    JJBBDD 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