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

  • SEARCH
  • Home
  • 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 8981351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:18:52+00:00 2026-06-15T20:18:52+00:00

Rather than using Bean model objects, my data model is built on Key-Value pairs

  • 0

Rather than using Bean model objects, my data model is built on Key-Value pairs in a HashMap container.

Does anyone have an example of the GXT’s Grid ValueProvider and PropertyAccess that will work with a underlying Map?

  • 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-15T20:18:54+00:00Added an answer on June 15, 2026 at 8:18 pm

    It doesn’t have one built in, but it is easy to build your own. Check out this blog post for a similar way of thinking, especially the ValueProvider section: http://www.sencha.com/blog/building-gxt-charts

    The purpose of a ValueProvider is to be a simple reflection-like mechanism to read and write values in some object. The purpose of PropertyAccess<T> then is to autogenerate some of these value/modelkey/label provider instances based on getters and setters as are found on Java Beans, a very common use case. It doesn’t have much more complexity than that, it is just a way to simply ask the compiler to do some very easy boilerplate code for you.

    As that blog post shows, you can very easily build a ValueProvider just by implementing the interface. Here’s a quick example of how you could make one that reads a Map<String, Object>. When you create each instance, you tell it which key are you working off of, and the type of data it should find when it reads out that value:

    public class MapValueProvider<T> implements 
                ValueProvider<Map<String, Object>, T> {
        private final String key;
        public MapValueProvider(String key) {
            this.key = key;
        }
    
        public T getValue(Map<String, Object> object) {
            return (T) object.get(key);
        }
        public void setValue(Map<String, Object> object, T value) {
            object.put(key, value);
        }
    
        public String getPath() {
            return key;
        }
    }
    

    You then build one of these for each key you want to read out, and can pass it along to ColumnConfig instances or whatever else might be expecting them.

    The main point though is that ValueProvider is just an interface, and can be implemented any way you like.

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

Sidebar

Related Questions

Rather than using WMI to obtain the last boot time, I wanted to calculate
rather than using a textnode to show content im trying to figure out how
This question is related to this SO post Rather than using a recursive CTE
I'm trying to find open source profilers rather than using one of the commercial
I have all my content pre-escaped, so rather than using the triple stash everywhere
I want to access solr from within java programmatically, rather than using it as
I have a schema called application. Is there a way that, rather than using
im using an adapter to be able to plug interfaces rather than concrete types
I want to write an application using openstreetmaps rather than mkmapview, but I'm not
From the MSDN Article I read I should be using the StringBuilder rather than

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.