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 9042417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:29:06+00:00 2026-06-16T10:29:06+00:00

I’m creating a grid with a variable number of columns. I’m almost done but

  • 0

I’m creating a grid with a variable number of columns. I’m almost done but only one thing left… I cant access attribute Address (PersonProperties interface). I dont know how to write @Path properly. If anyone has any idea, Please give me advice.

I have this JSON: [ {
"FirstName": "John",
"LastName": "Doe",
"Age": 23,
"Details": [
{
"Address": "Apt R113",
"City": "Boston",
"ZipCode": "30523"
},
{
"Address": "ABC 22",
"City": "Paris",
"ZipCode": "51112"
}
]
}
]

and then PropertyAccess interface:

public interface PersonProperties extends PropertyAccess<PersonDTO> {

ModelKeyProvider<PersonDTO> key();

ValueProvider<PersonDTO, String> FirstName();

ValueProvider<PersonDTO, String> LastName();

ValueProvider<PersonDTO, Integer> Age();

@Path("Details???Address")
ValueProvider<PersonDTO, String> Address();

}

  • 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-16T10:29:07+00:00Added an answer on June 16, 2026 at 10:29 am

    Assuming your PersonDTO object is the object representation of the JSON, I would assume you have an interface model (for using AutoBeans) which looks something like this:

    // I'm leaving the setters out for brevity
    public interface PersonDTO {
      @PropertyName(value="FirstName")
      String getFirstName();
      @PropertyName(value="LastName")
      String getLastName();
      @PropertyName(value="Age")
      Integer getAge();
      @PropertyName(value="Details")
      List<Details> getDetails();
    }
    
    public interface Details {
      @PropertyName(value="Address")
      String getAddress();
      @PropertyName(value="City")
      String getCity();
      @PropertyName(value="ZipCode")
      String getZipCode();
    }
    

    Assuming this maps to the interface model you are using (or closely approximates it), then to answer your question, that @Path annotation is used to specify the object attribute names to access a property (not the JSON names). So for single attributes, the path annotation can be used if your PropertyAccess value is not the same as the name of the attribute. In your example, your PersonProperties attributes are capitalized, so you can use something like this:

    @Path("firstName")
    ValueProvider<PersonDTO, String> FirstName();
    

    If your Details object was just a single object then you could use notation similar to what you wrote (remember the @Path annotation is implicity specifying the getters to use to access the property from the object shim):

    @Path("details.address")
    ValueProvider<PersonDTO, String> address(); 
    // would return the address if Details was a single object
    

    However the Details values are a little different as your JSON example indicates that the Details values are actually a collection of Details. As a result your grid won’t know how to display Details because there are multiple Details objects for every PersonDTO object. But I’m guessing that was already clear to you so let’s assume that you are trying to display an address in a given row when certain conditions apply. In a case like that, you can implement your own ValueProvider. For example (dervied from a Sencha example I think):

    public class AddressByCityValueProvider implements ValueProvider<PersonDTO, String> {
      public final String cityKey;
    
      public AddressByCityValueProvider(String specifiedKey) {
        this.cityKey = specifiedKey;
      }
    
      // we will display their Address if the city is Boston
      @Override
      public String getValue(PersonDTO person) {
        if (null != person.getDetails()) {
          for (Details detail : person.getDetails()) {
            if (detail.getCity().equalsIgnoreCase(cityKey)) {
              return detail.getAddress();
            }
          }
        }
        return ""; // no address for specified city in object, return a blank String
      }
    
      @Override
      public String getPath() {
        return key;
      }
    

    Then where you were using the ValueProvider from your PropertyAccess class you will substitute your own ValueProvider and specify the key to use. For a Column Configuration, you could use this ValueProvider to return the street address when the city is Boston:

    ColumnConfig<PersonDTO, String> addressColumn = 
       new ColumConfig<PersonDTO, String>(new AddressByCityValueProvider("Boston"), 100, "Address");
    

    Obviously this is just one example but hopefully you get the idea.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I
I need to clean up various Word 'smart' characters in user input, including but

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.