Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8320259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:35:50+00:00 2026-06-08T22:35:50+00:00

I have a java web application. I have an entity class which (after transformation

  • 0

I have a java web application. I have an entity class which (after transformation of course) i would like to use in a combobox with ExtJs. My problem is as follows:

There can be entries having html code in the displayField. Because of that during the serialization with flexjson.JSONSerializer i used the flexjson.HTMLEncoder to make the entries visible in the dropdown (before it made the screen died because of unterminated String literal). So far so good.

editor.myCombo = new Ext.form.ComboBox({
    mode: 'local',
    editable: false,
    forceSelection: true,           
    triggerAction: 'all',
    store: new Ext.data.JsonStore({
        fields: ['myId', 'myName'],
        emptyItem: {'myName' : '...'},
        data: <c:out value="${form.json['myList']}" escapeXml="false"/>         
    }),
    disabled: isEditorDisabled,
    width: 75,
    listWidth: 160,
    displayField: 'myName',
    valueField: 'myId'
});

But when i select an item from the dropdown (all displayed properly like Alfred </script>) the display field will show it as: Alfred &lt;/script&gt;.

How do i make this work? Why it is showing the encoded version (that is retrieved on the json request) and not as HTML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:35:53+00:00Added an answer on June 8, 2026 at 10:35 pm

    Try including an overridden getDisplayValue method in your config. Just set it up to return the decoded value, like this:

    editor.myCombo = new Ext.form.ComboBox({
        mode: 'local',
        editable: false,
        forceSelection: true,           
        triggerAction: 'all',
        store: new Ext.data.JsonStore({
            fields: ['myId', 'myName'],
            emptyItem: {'myName' : '...'},
            data: <c:out value="${form.json['myList']}" escapeXml="false"/>         
        }),
        disabled: isEditorDisabled,
        width: 75,
        listWidth: 160,
        displayField: 'myName',
        valueField: 'myId',
    
        // this should return the decoded string instead
        getDisplayValue: function() {
            return Ext.String.htmlDecode(this.value);
        }
    });
    

    The reason it has to be done this way is because the actual field part of the Ext.form.field.Combo really is an HTML input element and that will only display the straight text, it will not generate the HTML from it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java-JSF Web Application on GlassFish, in which I want to use
I have a java web application which I can debug using IntelliJ or Eclipse
I have a Java web application at my work and I'd like simplify how
I have a Java Web-Start-based application, which utilizes several native ".exe" utilities. All jars
I have a JAVA web application application, which exposes RESTful apis. My requirement is
I have a Java web application that currently uses Log4J for logging. I'd like
i have three java based web application app1,app2 and app3 at production. All 3
I have a Java EE web application (WebSphere 7). The code looks up EJBs
I have a Java based web-application using Java Server Faces and Facelets. I am
I have a Java Web Start application. I specify the resource (jars, images, etc)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.