• 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
Exception with pageForConfigurationNamed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exception with pageForConfigurationNamed


  • Subject: Exception with pageForConfigurationNamed
  • From: Ângelo Andrade Cirino <email@hidden>
  • Date: Thu, 06 Sep 2012 15:56:32 -0300

Hi all,

I would like to be more useful to the list, contributing with answers more than I ask for help, but I must ask for help again.

I am trying to implement a D2W application as much as possible reusable and tried the following code in my MainNavigationController:

    public WOComponent listAnEntityAction() {
      return listPageForEntityName(AnEntity.ENTITY_NAME);
    }
…
    private WOComponent listPageForEntityName(String entityName) {
      ListPageInterface newListPage = (ListPageInterface)D2W.factory().pageForConfigurationNamed("List" + entityName, session());
      EODataSource ds = new EODatabaseDataSource(ERXEC.newEditingContext(), entityName);
      newListPage.setDataSource(ds);
      return (WOComponent) newListPage;
    }

But the end result is an exception that I was not able to track to D2WContext:

ClassCastException: java.lang.String cannot be cast to com.webobjects.eoaccess.EOEntity
  at com.webobjects.directtoweb.D2WContext.entity(D2WContext.java:394)
  at com.webobjects.directtoweb.ERD2WContext.setDynamicPage(ERD2WContext.java:103)
  at er.directtoweb.ERD2WFactory.pageForConfigurationNamed(ERD2WFactory.java:169)
  at com.visionar.administraAgencia.app.MainNavigationController.listPageForEntityName(MainNavigationController.java:95)
  at com.visionar.administraAgencia.app.MainNavigationController.listAgênciasAction(MainNavigationController.java:32)

I have already implemented a navigation menu with page configurations but with a lengthier code, but I think this style is more reusable and concise. I searched the examples and was able to see that the BugTracker and ERMovies examples implement actions and page configurations in this style, so I think I'm not doing something overly wrong.

Cheers,

Angelo
 _______________________________________________
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: Exception with pageForConfigurationNamed
      • From: Ramsey Gurley <email@hidden>
  • Prev by Date: Re: D2W Displaying (running) totals underneath lists
  • Next by Date: Re: Exception with pageForConfigurationNamed
  • Previous by thread: Can't add Webobjstcs Library to new Eclipse Project
  • Next by thread: Re: Exception with pageForConfigurationNamed
  • Index(es):
    • Date
    • Thread