• 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
Joshua Marker's book: chapter 7
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Joshua Marker's book: chapter 7


  • Subject: Joshua Marker's book: chapter 7
  • From: Jeremy Matthews <email@hidden>
  • Date: Fri, 4 Jun 2004 23:30:23 -0400

For some odd reason, I just can't get the project to compile
correctly..not sure where I'm messing things up. I've nailed it down to
a single error. When I run my version of the "WebPublisher" app, I hit
the following error:

Error:
  com.webobjects.appserver._private.WODynamicElementCreationException:
Missing 'list' or 'count' attribute.

  Reason:
  <com.webobjects.appserver._private.WORepetition> Missing 'list' or
'count' attribute.

Here's my main code; I know I'm missing something small, but I've
checked the bindings for all my keys and actions to WOElements. I must
be missing something small

//
// Main.java: Class file for WO Component 'Main'
// Project WebPublisher
//
// Created by jeremym on Fri Jun 04 2004
//

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

public class Main extends WOComponent {

     /** @TypeInfo Author */
     public NSArray authorList;
     public Author anAuthor;
     public String newAuthorName;
     public Main(WOContext context) {
         super(context);
     }

     public WOComponent deleteAuthor()
     {
		EOEditingContext ec = session().defaultEditingContext();
		ec.deleteObject(anAuthor);
		ec.saveChanges();
         return null;
     }

     public WOComponent addAuthor()
     {
		Author newAuthor = new Author();
		EOEditingContext ec = session().defaultEditingContext();
		ec.insertObject(newAuthor);
		newAuthor.setAuthorName(newAuthorName);
		ec.saveChanges();
         return null;
     }
	public void
		appendToResponse (WOResponse response, WOContext context)
		{
		EOFetchSpecification fetchSpec;
		EOEditingContext ec = session().defaultEditingContext();
		fetchSpec = new EOFetchSpecification ("Author", null, null);
		authorList = ec.objectsWithFetchSpecification(fetchSpec);
		super.appendToResponse(response, context);

}
     public AuthorEdit editAuthor()
     {
         AuthorEdit nextPage = (AuthorEdit)pageWithName("AuthorEdit");
		nextPage.setTheAuthor(anAuthor);
         return nextPage;
     }
     public ArticleEdit addArticle()
     {
         ArticleEdit nextPage = (ArticleEdit)pageWithName("ArticleEdit");
		Article newArticle = new Article();
		session().defaultEditingContext().insertObject(newArticle);
		nextPage.setAnArticle(newArticle);
         // Initialize your component here
         return nextPage;
     }

}
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Joshua Marker's book: chapter 7
      • From: wojingo <email@hidden>
    • Re: Joshua Marker's book: chapter 7
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: restart the JVM?
  • Next by Date: Re: Joshua Marker's book: chapter 7
  • Previous by thread: Re: restart the JVM?
  • Next by thread: Re: Joshua Marker's book: chapter 7
  • Index(es):
    • Date
    • Thread