HTML tag in Coldfusion string not appearing

Hey guys I'm wondering what I'm doing wrong when trying to
store an html tag in a string. Basically I'm dynamically creating a
list for use in a javascript menu, so when building the menu, I do
this:
menu = "< ul id = """ & mainID & """
><br>";
to generate a list (of course thats only part of the list
code). This line produces < ul id = "mainID" >
What I need is for the spaces to be removed, so it would
produce <ul id="mainID">
But in my Coldfusion function, if I write:
menu = "<ul id=""" & mainID & """><br>";
nothing shows up! A space between < and ul works fine, but
once I delete them, nothing! Any help would be really appreciated,
thanks.

actually found the answer elsewhere, I declared a variable
open = &lt; now instead of using the <, i just write open,
which generates the list fine.
but a followup, the list is being generated now, but on the
page instead of the javascript/css menu catching it and formatting
it, it just displays the whole list, tags and all. I tried
htmlEditFormat( ), that only changed all the symbols to their I
guess ASCI couterparts. Any ideas why its showing the list as text
rather than creating a menu??
also I tried it without the menu, which should have shown a
bulleted list, but that didn't work either...

Similar Messages

  • Integrate html tags in a string and display it in a multiline text area

    Hi ABAPers!!
    First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.
    I'm working on an ALV OO, the program consists on creating an ALV using OO, In my selection screen there's a parameter of type ddobjname I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM: 'DDIF_FIELDINFO_GET' then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar, the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table(MySQL) in the generated script are only the selected ones by cheking the checkbox in the ALV.
    I store my script in a string.
    My problem is that I want to show my script in a text area, but I don't know how to create a multiline text area!!
    And I want to use HTML tags in my string.
    I don't want to my string like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown like  this:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    Thanks in advance
    Regards
    SMAALI Achraf
    Edited by: SMAALI90 on May 11, 2011 7:12 PM

    Hi again!!
    You know what!! let's forget the HTML and focuse on what I want to show.
    As I told you, I've a string which contains my script.
    I don't want that it will be shown as a simple line like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown as follows:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    and finally I want to show it in a multiline text area.
    Plz what shud I do?!!! If possible I need a piece of code.
    PS : I create a HTML Viewer using this code :
    DATA : go_conteneur          TYPE REF TO cl_gui_docking_container,
                 go_controle_html    TYPE REF TO cl_gui_html_viewer.                 
      CREATE OBJECT go_conteneur                     
        EXPORTING                                    
          repid     = sy-repid                       
          dynnr     = '0100'                         
          side      = go_conteneur->dock_at_bottom   
          extension = 1000                           
          name      = 'CONTENEUR'                    
        EXCEPTIONS                                   
          OTHERS    = 1.                             
      CREATE OBJECT go_controle_html                 
        EXPORTING                                    
          parent = go_conteneur                      
        EXCEPTIONS                                   
          OTHERS = 1.
    But when it's shown my ALV disappears!!!

  • How to remove HTML tags from a String ?

    Hello,
    How can I remove all HTML Tags from a String ?
    Would you please to give me a simple example ?
    Best regards,
    Eric

    Here's some code I cooked up. I have created an object that processes code so that it can be incorporated directly into a project. There is some redundancy so that the it can be used in more than one way. Depending on your situation you might have to make the condition statement a little more sophisticated to catch stray ">" tags.
    I have also included a Tester application.
    //This removes Html tags from a String either by submitting the String during construction and then
    // calling getProcessedString() or
    // by simply calling " stringwithoutTags=removeHtmlTags(stringWithTagsSubmission); "
    //Note: This code assumes that all"<" tags are accompanied by a ">" tag in the proper order.
    public class HtmlTagRemover
         private String stringSubmission,processedString,stringBeingProcessed;
         private int indexOfTagStart,indexOfTagEnd;
         public HtmlTagRemover()
         public HtmlTagRemover(String s)
              removeHtmlTags(s);          
         public String removeHtmlTags(String s)
              stringSubmission=s;
              stringBeingProcessed=stringSubmission;
              removeNextTag();
              return processedString;
         private void removeNextTag()
              checkForNextTag();
              while((!(indexOfTagStart==-1||indexOfTagEnd==-1))&<indexOfTagEnd)
                   removeTag();
                   checkForNextTag();
              processedString=stringBeingProcessed;
         private void checkForNextTag()
              indexOfTagStart=stringBeingProcessed.indexOf("<");
              indexOfTagEnd=stringBeingProcessed.indexOf(">");
         private void removeTag()
              StringBuffer sb=new StringBuffer("");
              sb.append(stringBeingProcessed);
              sb.delete(indexOfTagStart,indexOfTagEnd+1);
              stringBeingProcessed=sb.toString();
         public String getProcessedString()
              return processedString;
         public String getLastStringSubmission()
              return stringSubmission;
    public class HtmlRemovalTester
         static void main(String[] args)
              String output;
              HtmlTagRemover h=new HtmlTagRemover();
              output="The processed String: "+h.removeHtmlTags("<Html tag>This is a test<another Html tag> string<yet another Html tag>.");
              output=output+"\n"+" The original string:"+h.getLastStringSubmission();
              System.out.print(output);

  • Stripping HTML Tags from a String

    What's the best way to remove html tags from a string (i.e. user input)?

    Can you give an example? You can do substring, if your passing spaces between pages you can do a trim to the variable. Also look at the indexOf(). Look at methods relating to java.lang.String.

  • HTML tags in Hidden Item not displaying correctly

    I have created a HTML Text Region which includes a Javascript function. The function references a Hidden Item also created and linked to the region. The Hidden item returns a text field from the database with concatenates multiple rows together into a single string with HTML tag -br- between each row.
    The tags are not been recognised as HTML tags and is displayed :-
    -br-Record 1-br-Record 2-br-Record 3-br-'
    I want the page to display :-
    Record 1
    Record 2
    Record 3
    Any ideas?
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley
    Message was edited by:
    pjturley

    Hello,
    Check to make sure you don't have those items set to escape html.
    Past that are you sure your javascript is putting in the &lt;br /&gt; tags correctly? before you submit fire a alert that shows the value of the hidden item and make sure it's correct there.
    Carl

  • Method to Format a string column containing HTML tags as simple string.

    Hello,
    I am working with formating a string column which holds Html tags.
    I want to remove these tags from the actual data which has to be shown on the BI Publisher report.
    Can you suggest how can we format this in the DataSet designer of BI publisher so that my data is recognised on the Layout designer.
    I have been trying to create an expression using the "Add Element by Expression" option to format this html tag data as normal string without the tags.
    Can you suggest if this is the correct method to do this.
    I found this below code being used in an existing DateSet but i am not able to recreate a similar formating on this kind of data column.
    <![CDATA' || '['|| TO_CLOB(SUCCESS_CRITERIA) || ']' || ']>
    Kindly suggest if you have any idea on the above mentioned issue.
    Thanks,
    Shweta

    And read this:
    Navigate yourself around pitfalls related to the Runtime.exec() method
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Why does one tag out of four not appear for users accessing a single Thunderbird account via multiple computers?

    Four users share a single Thunderbird email account (version 24.5.0) on their four respective computers. Each user is represented by a tag color to designate which emails they are responsible for. One user is having trouble seeing when their tag is used by the other three users, the email appears untagged. However, the other three users see it as tagged. Likewise, when that one person uses the tag, the other three cannot see the email as being tagged. This is not an issue when the other three tags are used between the four people.
    We have checked that we are all using the exact same color to represent the tag, and that we are all using the same IMAP settings. Does anyone know why this might be happening?

    Are you sure the odd one out is IMAP? sounds like it is pop to me.

  • Remove HTML tags from a string

    I have a string that contains a couple of HTML or XHTML tag, for example
    lv_my_string = '<p style="something">Hello <strong>World</strong>!</p>'.
    For a special use case, I want to remove all HTML from that string and process only the plain text
    lv_my_new_string = 'Hello World!'.
    Is there any method, function module, XSLT or anything else for that already?

    Hi Daniel,
    I tried using the FM (SWA_STRING_REMOVE_SUBSTRING) but I guess it is expecting a particular pattern which is not so apparent in your case. Iu2019ve written a small piece of code which you can try using in a FM or a PERFORM and that should do the trick. Please let me know if you have any questions.
    PARAMETER: P_LINE(100).
    TYPES: BEGIN OF TY_LINE,
             LINE(100),
           END OF TY_LINE.
    DATA: T_LINE TYPE STANDARD TABLE OF TY_LINE,
          WA_LINE LIKE LINE OF T_LINE.
    DATA: W_LINE(100),
          W_LEN(100),
          W_COUNT TYPE I,
          W_FLAG,
          W_FLAG1,
          W_I TYPE I.
    W_COUNT = STRLEN( P_LINE ).
    DO W_COUNT TIMES.
      IF P_LINE+W_I(1) = '<'.
        W_FLAG = 1.
        W_I = W_I + 1.
        IF NOT WA_LINE-LINE IS INITIAL.
          APPEND WA_LINE-LINE TO T_LINE.
          CLEAR WA_LINE.
        ENDIF.
        CONTINUE.
      ELSEIF P_LINE+W_I(1) = '>'.
        W_FLAG = 0.
        W_I = W_I + 1.
        CONTINUE.
      ENDIF.
      IF W_FLAG = 1.
        W_I = W_I + 1.
        CONTINUE.
      ELSE.
        CONCATENATE WA_LINE-LINE P_LINE+W_I(1) INTO WA_LINE-LINE.
        W_I = W_I + 1.
      ENDIF.
    ENDDO.
    LOOP AT T_LINE INTO WA_LINE.
      CONCATENATE W_LINE WA_LINE-LINE INTO W_LINE SEPARATED BY SPACE.
    ENDLOOP.
    SHIFT W_LINE LEFT DELETING LEADING SPACE.
    WRITE: W_LINE.
    Input:
    <p style="something">Hello <strong>World</strong>!</p>
    Output:
    HELLO WORLD !
    Regards,
    Pritam

  • Masked HTML tags in substitution strings after upgrade to Apex 2.2

    Hello,<br>
    <br>
    in my application developed with htmldb 2.0 I had the following scenario which worked fine until upgrade to 2.2:<br>
    <br>
    Requirement: a multiline text should be displayed as entered on a html report page.<br>
    My solution:<br>
    - a onload page process of the form <br>
    select replace(description,chr(10),'&lt;br&gt;') into :P1_DESCRIPTION from mytable where id = :P1_ID;<br>
    - and a page template containing <br>
    ...<br>
    <td>&P1_DESCRIPTION.</td><br>
    ...<br>
    <br>
    This worked in HTML DB 2.0.<br>
    <br>
    My problem: After upgrade to Apex 2.2 the report doesn't display the carriage returns anymore. Instead of interpreted BR tags I get masked BR tags printed as text:<br><br>
    <br>this is the first line&lt;br&gt;this is the second line<br><br>
    It's quite obvious that the substitution mechanism changed in Apex 2.2. Any ideas how to change my app ?

    Take a look at this thread:
    Computed Region TItles being Escaped in Apex 2.2
    You may have to change the type of your P1_DESCRIPTION item.

  • The html validator tool icon does not appear on my web site, bottom right.

    It appeared at first. When I clicked on the incon it disappeared. All the Mozzilla settings appear to be correct for the tool.

    Any luck after this?
    https://sites.google.com/site/appleclubfhs/support/advice-and-articles/airplay-i os-and-mac#not_appearing

  • Personas button does not appear in HTML

    Personas button does not appear in HTML
    Hi! I installed Personas 2.0 and finished most of the configuration. The Sliverlight component is working fine but when I switch to html component the personas button not appear.
    I did all the settings. User have SAPALL and /PERSOS/ADMIN_ROLE with /PERS/AUTH and /PERS/AOBJ full authorizations. I use sap-ie=edge as part of the URL: http://xxxxxxxxxxxx:8000/sap/bc/gui/sap/its/webgui?sap-ie=edge&sap-client=100&sap-language=EN
    Is there any other settings I can do?
    I've SAP_BASIS 740 level 05 and Kernel 741 level 11 in Personas 200 SP 02.
    Thanks,
    Juan Manuel.

    Hi Tamas! Does this mean that in SAP_BASIS 740 level 05 HTML is disabled and button never appears? Do you have any note or link where talk about it? I just need to access HTML for comparison with Silverlight.
    thank you very much!

  • Remove HTML tag

    Hi all,
    Given a string consist of string encoded in HTML. Any standard Function Module to remove the HTML code?
    eg, Change "<HTML><B>Sample Text</B></HTML>" to "Sample Text"
    Any suggestion/comments are welcome!
    Thanks
    Best regards,
    Prakesh.

    Hi Prakesh,
    To remove the HTML tags from a string, use the following sample formula:
    whileprintingrecords;
    stringvar sample := {table.stringfield};
    numbervar counter := ubound(split(sample,"<"))-1;
    numbervar i;
    for i := 1 to counter do(
    numbervar openbracket := instr(sample,"<");
    numbervar closebracket := instr(sample,">");
    sample := left(sample,openbracket-1) & mid(sample,closebracket+1));
    sample;
    ====================
    NOTE:
    This formula removes all text between the '<' and '>' characters. Adjustments may be required if only some tags should be removed, or if the '<' or '>' characters appear by themselves in the original string.
    ====================
    Thanks & Regards,
    Sarita Singh Rathour
    Edited by: Sarita Rathour on Jul 24, 2009 6:06 AM
    Edited by: Sarita Rathour on Jul 24, 2009 6:07 AM
    Edited by: Sarita Rathour on Jul 24, 2009 6:09 AM

  • HTML Tags in HTMLB or How to shrink HTMLB ?

    Hi,
    I have a JSP page using HTMLB tags, which works fine in EP5. I am migrated this JSP in EP6 SP6 and now it gives me the following message:
    Error in executing a process for compilation, C:/usr/sap/EP6/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.suncor.ci.continuousimprovement/work/pagelet/_sapportalsjsp_recordinputform.java:5262: code too large for try statement } catch(IOException jspioex) {} ^ C:/usr/sap/EP6/JC00/j2ee/cluster/server0/apps/sap.com/irj/servletjsp/irj/root/WEB-INF/portal/portalapps/com.suncor.ci.continuousimprovement/work/pagelet/_sapportalsjsp_recordInputForm.java:4303: code too large for try statement try { ^ ...
    INF/portal/portalapps/com.suncor.ci.continuousimprovement/work/pagelet/_sapportalsjsp_recordInputForm.java:133: code too large for try statement try { ^ C:/usr/sap/EP6/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.suncor.ci.continuousimprovement/work/pagelet/_sapportalsjsp_recordinputform.java:22: code too large public void doContent(IPortalComponentRequest componentRequest, IPortalComponentResponse aResponse) ^ 57 errors .
    The error is because of intense use of HTMLB.
    The whole JSP page is one form.
    I did some research and found out that the Servletsize is limited to 65k Byte.
    Indeed, when i removed some HTMLB tags, it was working fine....
    The suggestions was to use the Include Directive
    <@ include page="other.jsp" > This will load the other jsp at Runtime.
    When i did this, the content of the HTMB was not converted to HTML, but it only copied the HTMLB tags directly after the <body>. (I included the <%@ taglib uri="tagLib" prefix="hbj" %>)
    When writing <tr> or <td> directly (to compress the HTML lines) using the JSPWriter (out) instead of the HTMLB tags, my HTML was ignored and did not appear in the HTML output.
    My question is: How can I add HTML in HTML or how can I shrink a huge HTMLB form ?
    Any ideas are welcome...
    Kai

    Hallo Kai,
    Asking about JSP in the BSP forum is about 66% correct. Both have SP in the name. Unfortunately the B is very important for us, and we are shy when it gets to gets about J. BSP is an environment similar to JSP, but based on ABAP. We also have a rendering library called HTMLB. But after that, the similarities stop.
    Unfortunately, we can not help you more, and would recommend any of the Java programming forums.

  • Showing HTML tags in JList

    Hello
    My problem is quite simple but have not found any answer so far... I have a JList component where I store the contents of a file (one text line corresponds to a JList entry). Everything works fine, except when I have a line with HTML tags, since these are not made visible inside the JList entry. For example: if a file has a "<HTML><Body>example" line, then the JList entry displays just "example" instead of the full line. Any way to disable this HTML rendering and presenting only the raw text?
    Thank you!

    Fudge: prepend a space to each String that you place
    in the list, or munge the string in some other way
    that it looks similar/identical but prevents JLabel
    thinking it's HTML
    Proper fix: implement ListCellRenderer to return an
    overridden JLabel which doesn't implement a
    half-assed interpretation of HTML, or another
    component - JTextArea might workOr, in the renderer call:
    putClientProperty("html.disable", Boolean.TRUE);See:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4652898

  • Java Regular Expression to grab html tags

    Dear all,
    I have written a regular expression in java to grab the pairs of html tags in a String. It worked fine except that it cannot handle space or new line. What have I done wrong?
    My regular expression (I would use <tr></tr> as an example):
    <tr[^>]*>(.*?)</tr>
    It would work for <tr><one>two<three></tr>
    but not <tr ><one>two<three></tr>
    or <tr> <one> two <three></tr>
    or <tr>
    <one>two<three>
    </tr>
    Thanks a lot in advance

    I have written a regular expression in java to grab the pairs of html tags in a String. I'll make one last-ditch suggestion that you grab a decent HTML parser, as the HTML specification allows for HTML tags that don't come in pairs. While I'm sure you will be able to eventually write regexes to handle this, it may be easier (depending on your requirements) to use tools to parse the HTML.
    Good luck!

Maybe you are looking for

  • Multi Org Access Problem in Oracle Alerts

    Hi All, I created one Alert for sending an email through Oracle Alert, after sending the mail I need to update one column in the table to indicate that alert has been sent for this particular row. Alert is sending mail correctly but it goes to update

  • Photo Gallery/Portfolio

    Hey! Been trying to figure this out for a while when I came across this question that was/wasn't answered in 2008 - wondering if it is possible today using CS5? "I want to have a portfolio page so that one sample of work will be displayed at a time (

  • Varience in prod order

    Dear All , pl refer the following total tgt cost     total act cost    tgt/act varience     component 239,943.56     262,573.01      22,629.45              R M Consumed    0.00                  362,340.00-      362,340.00-          COGM 1,254.00     

  • Reverting to version 1.0

    Well I gave Lightroom 1.1 a pretty fair shot, and I do like the new features. But the image quality at ISO 800 and above is just unacceptable to me. I like my photos to look like photographs, not posterized watercolor paintings. The aggressive noise

  • Rules problem and sluggishness in Gmail IMAP

    I just plugged in my Gmail IMAP settings into Mail, and it is not listening to rules set to move all of my sent mail into a sent folder (into either the "on my mac" or the "gray globe" folders). The mail from me just sits obstinately in the "all mail