• 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
Using objectMatchingKeyAndValue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using objectMatchingKeyAndValue


  • Subject: Using objectMatchingKeyAndValue
  • From: Paul Marvine <email@hidden>
  • Date: Sat, 30 Jun 2007 08:16:01 -0500

Hello,

I have an entity "XPages" and one record has an attribute of "home" with a value "1" (all others are marked "0"). When a WoHyperlink  is clicked the record should be returned. How does one do this?

I am using the code below, but there is a "cannot be applied to (com.webobjects.eocontrol.EOEnterpriseObject)" error on the build." below is a simplified version of the page.



Java-----
//
// myTestPage.java: Class file for WO Component 'myTestPage'
// Project ContentDB05
//
// Created by paul on 6/29/07
//

import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
import java.math.*;

public class myTestPage extends WOComponent {
public XPage xPage;

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

    public EditPage2 doFindMyMarkedPage()
    {
        EditPage2 nextPage = (EditPage2)pageWithName("EditPage2");



        // Initialize your component here
EOEditingContext ec = session().defaultEditingContext();
EOEnterpriseObject xPage = EOUtilities.objectMatchingKeyAndValue( ec, " XPage", "home", (new Integer(1)) );
nextPage.setXPage( xPage );


        return nextPage;
    }

}


Error Message ----
/Application Server.build/JavaFileList' 
myTestPage.java:33: setXPage(xPage) in EditPage2 cannot be applied to (com.webobjects.eocontrol.EOEnterpriseObject)
nextPage.setXPage( xPage );
                        ^
1 error



HTML -----
<html>
    <head>
        <meta name="generator" content="WebObjects 5.3.1">
        <title>Untitled</title>
    </head>
    <body><webobject name="Hyperlink1">FindTheMarkedPage</webobject></body>
</html>



WOD ------
Hyperlink1: WOHyperlink {
action = "">
}

 _______________________________________________
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

  • Follow-Ups:
    • Re: Using objectMatchingKeyAndValue
      • From: Jean-François Veillette <email@hidden>
  • Prev by Date: Re: [Wonder-disc] ERSelenium without ERExtensions
  • Next by Date: Re: Using objectMatchingKeyAndValue
  • Previous by thread: Re: PayPal sdk and Java Classpath.
  • Next by thread: Re: Using objectMatchingKeyAndValue
  • Index(es):
    • Date
    • Thread