• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Display group wierdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display group wierdness


  • Subject: Re: Display group wierdness
  • From: John Larson <email@hidden>
  • Date: Wed, 12 Jul 2006 06:27:58 -0500

Sorry, typo. Chuck had already pointed out that queryMatch isn't an instance variable and has to be accessed via queryMatch(). I was suffering from too much dinner too late at night. I hope Don didn't suffer too much from trying to get my typo to work.

On Jul 12, 2006, at 2:22 AM, Paul Lynch wrote:


On 12 Jul 2006, at 03:46, John Larson wrote:

As is the custom, Chuck is right here. Since queryMatch is of type NSMutableDictionary, it doesn't have a field named agent_person that the compiler can decode. Enter key-value coding, the typecasting nightmare, but quick and dirty coding dream. agentDisplayGroup.queryMatch.takeValueForKeyPath("Agent Name", "agent_person.surname"); should do the trick. If there is still an error with your key path, you will get a run time error.

As Art points out, this won't work.

However, you can use the behaviour of KVC and key paths to get around this, for example:

takeValueForKeyPath("Agent Name", "agentDisplayGroup.queryMatch.agent_person.surname");

Remember that your components are KVC compliant too.

Paul


On Jul 11, 2006, at 6:01 PM, Chuck Hill wrote:

Caveat: I am not much of a Display Group user and I am not at all sure of what you are trying to do...

On Jul 11, 2006, at 2:32 PM, Don Lindsay wrote:

Hello;
The code was created by Web objects by using Add | New File from the popup (right click menu) then selecting new display group component. I have tried to access agentDisplayGroup from within constructor, appendtoresult, an custom public functions.


// Generated by the WebObjects Assistant Sun Jul 09 20:32:32 US/ Eastern 2006
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
import com.webobjects.examples.utilities.*;


public class agentDisplay extends WOComponent {

/** @TypeInfo Agent */
protected EOEnterpriseObject agent;
// This WODisplayGroup is initialized from the .woo archive in the component's constructor method
protected WODisplayGroup agentDisplayGroup;
public String errorMessage;
public Person selectedPerson;
public String sOrderBy;
public Agent newAgent;
public NSArray PersonList;
public Person aPerson;
public WeaponAssignment agentWeapon;
public String searchAgent;
public String searchSerial;
protected String orgListing;
public Organization anOrganization;


    public agentDisplay(WOContext context) {
        super(context);
    }

public void appendToResponse(WOResponse response, WOContext context) {
WXDebug.println(25,"**appendToResponse(): Entered");
this.agentDisplayGroup.queryMatch.agent_person.surname = "Agent Name"; //results in cannot resolve symbol



"Cannot resolve symbol" is a compiler error. It means that you typed something wrong. In this case, the wrong thing is
this.agentDisplayGroup.queryMatch
queryMatch is a method (or function) that returns a NSMutableDictionary value, not an instance variable. As such, you refer to it as
this.agentDisplayGroup.queryMatch()


That will leave you with another error at .agent_person as this is not an instance variable (or a method) on NSMutableDictionary.

Beyond that I am not sure if you want to update agentDisplayGroup.queryMatch(), or call setQualifier(), or something else entirely. But it does look like you are doing more work that what should be needed.

Chuck


this.agentDisplayGroup.queryMatch.agent_weapons.serial = "Serial"; // results in cannot resolve symbol
super.appendToResponse(response,context);
WXDebug.println(25,"**appendToResponse(): Done");
}
}


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Display group wierdness (From: Don Lindsay <email@hidden>)
 >Re: Display group wierdness (From: Chuck Hill <email@hidden>)
 >Re: Display group wierdness (From: John Larson <email@hidden>)
 >Re: Display group wierdness (From: Paul Lynch <email@hidden>)

  • Prev by Date: Re: webobjects 5.3 and tomcat
  • Next by Date: [OT] Laptop leasing at WWDC
  • Previous by thread: Re: Display group wierdness
  • Next by thread: RE: Error Deserializing EOGlobalID via Web Services (SOLVED)
  • Index(es):
    • Date
    • Thread