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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:35:33+00:00 2026-05-18T22:35:33+00:00

I am trying to use an EditorGrid in a project that I am working

  • 0

I am trying to use an EditorGrid in a project that I am working on. I am using
EditorGrid grid = new EditorGrid (…)

ClassGrade is an object that contains the name, grade (as a Grade object), and credit hours for a class.

However, ClassGrade must implement ModelData. When I tried to implement the interface, there are a few methods that I am not sure how to correctly implement.

@Override
public <X> X get(String property) {
    if (property.equals("name"))
        return this.getClassName();
    if (property.equals("hours"))
        return this.getHours();
    if (property.equals("grade"))
        return this.getGrade();
    return null;
}

@Override
public Map<String, Object> getProperties() {
    Map<String, Object> propMap = new HashMap<String, Object>();
    propMap.put("grade", this.getGrade());
    propMap.put("hours", this.getHours());
    propMap.put("name", this.getClassName());
    return propMap;
}

@Override
public Collection<String> getPropertyNames() {
    ArrayList<String> props = new ArrayList<String>();
    props.add("grade");
    props.add("hours");
    props.add("name");
    return props;
}

@Override
public <X> X remove(String property) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public <X> X set(String property, X value) {
    // TODO Auto-generated method stub
    return null;
}

I dont know what to do for the get, remove, and set methods, because I do not know what the X means. I tried using

   @Override
public <X> X get(String property) {
    if (property.equals("name"))
        return this.getClassName();
    if (property.equals("hours"))
        return this.getHours();
    if (property.equals("grade"))
        return this.getGrade();
    return null;
}

but that didn’t work because the return was not of type X. What am I doing wrong and how do I get this to work?

  • 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-05-18T22:35:33+00:00Added an answer on May 18, 2026 at 10:35 pm

    I also use grids etc. and use BeanModel class for stores which wants modelData. I implement as below.

    public class dto implements IsSerializable, BeanModelTag  {
    
    ....//attributes and setter getters.
    
    }
    

    and

    convert this object to model as below;

    public static <E> BeanModel toModel(E e) {
        BeanModelFactory factory = BeanModelLookup.get().getFactory(e.getClass());
        return factory.createModel(e);
    }
    

    I hope it is useful for you.

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

Sidebar

Related Questions

I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
trying to use the preferred on method call but the code is not working
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
Anyone know how to create a cvCreateStructuringElementEx using a image? I'm trying use opencv.cv.cvCreateStructuringElementEx()
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
I am trying use the new server side plug-in feature for TFS 2010. (I
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a

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.