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 = doFindMyMarkedPage;
}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to