• 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: D2W Noob Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: D2W Noob Question


  • Subject: Re: D2W Noob Question
  • From: David Holt <email@hidden>
  • Date: Wed, 17 Nov 2010 10:21:01 -0800

Hi Joe,

On 2010-11-17, at 9:15 AM, Joe Kramer wrote:

Hi All,

I'm trying my first D2W app... This should be easy to find, and I'm almost embarrassed to ask, but I need to get this working ASAP.

Never be embarrassed to ask anything related to D2W :-) It is a complex topic that will take you awhile to get your head around.  What follows assumes you are using ModernLook and Wonder.

 I'm wondering how to make it so that you can create new entities from the list page.

This may not be quite as easy as you might think. Where do you imagine the button going? In the list itself or above or below the table?

 What rule should I add to make that happen?

From fastest to hardest:

1. The fastest way to handle it (and it is the one of the ways ERModernMoviesDemo and BugTracker demonstrate), is to make the action a link in your ERXNavigationMenu with the code for entity creation in the Navigation Controller class.

public WOComponent createMovieAction() {
return newObjectForEntityName(MOVIE);
}

    public WOComponent newObjectForEntityName(String entityName) {
        WOComponent nextPage = null;
        try {
            EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(entityName, session());
            epi.setNextPage(session().context().page());
            nextPage = (WOComponent) epi;
        } catch (IllegalArgumentException e) {
            ErrorPageInterface epf = D2W.factory().errorPage(session());
            epf.setMessage(e.toString());
            epf.setNextPage(session().context().page());
            nextPage = (WOComponent) epf;
        }
        return nextPage;
    }

2.  You could create a custom component that would be repeated in the list that has similar code to that in the Navigation Controller class. You name a placeholder propertyKey such as "createLink", set it to display a custom component, then name the custom component. If you choose this route and need help, please let the list know.

3. You can use ERDActionBar and a delegate for your entity that has a createAction. This component is supported in the ModernLook list page template. This took me a couple of days to wrap my head around. To get an idea of what is involved see this page:

ERDBranchDelegate & ERDControllerButton

http://wiki.objectstyle.org/confluence/display/WO/D2W+Flow+Control

4. You could place your custom component from item 2 above or below your list, but then you'd need to muck with the list page template to support your custom component.

I have been using the first option in my D2W apps.

David


Thanks,

Joe Kramer
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: D2W Noob Question
      • From: Joe Kramer <email@hidden>
References: 
 >D2W Noob Question (From: Joe Kramer <email@hidden>)

  • Prev by Date: Re: WebObjects scalability question - WOSession?
  • Next by Date: Re: Sessions not being collected
  • Previous by thread: Re: D2W Noob Question
  • Next by thread: Re: D2W Noob Question
  • Index(es):
    • Date
    • Thread