On 2012-10-10, at 7:48 AM, Flavio Donadio wrote:

On 10/10/2012, at 10:17, Theodore Petrosky wrote:

so it was not a 'virgin' new D2W app.

Well... Depends on what you mean by "virgin"... :) I made just a couple changes that shouldn't create serious problems, IMO.


i would try that. select new D2W wonder app. then run. do nothing else. do not add any other frameworks, nor models.

I tried a new app and ran it right away. No problem at all!

But, when I try to edit NavigationMenu.plist to add "sub tabs", i get the same error as before.

Here's my plist:

(
{
name = Root;
directActionClass = DirectAction;
directActionName = default;
children = "session.navigationRootChoice";

Comment out this "children" line


childrenChoices = {
home = (
"Produtos",
"Fabricantes",
);
};

Change childrenChoices to:

children = ( "Produtos", "Fabricantes" );

The problem is that you are setting up conditionally displaying different sets of tabs, but then not providing the method in the session class to do so. Since you are only using one set of tabs, you really don't need that line.

If you want to see how "session.navigationRootChoice" is used, there is an example in SimpleBlog that sets up simple Role based conditions for displaying sets of tabs. 

You'll see the method returns "adminuser" if the administrator logs in and "home" otherwise. You have already provided the "home" choices in your existing plist, so you would now have to add the "adminuser" choices.

From your example it would be along the lines of: 

childrenChoices = {
home = (
"Produtos",
"Fabricantes",
);
adminuser = (
"Produtos",
"Fabricantes",
"AdminFunctions",
);
};

The method on session looks like this:

  public String navigationRootChoice() { 
    Person user = (Person) user();
    if(user != null ) {
      if(user.isAdmin()==true) {
        return"adminuser";
      }
      return "home";
    }
    return "none";
  }

},
{
name = "Produtos";
action = "";
children = ("CreateProduto","SearchProdutos");
},
{
name = "CreateProduto";
action = "";
},
{
name = "SearchProdutos";
action = "";
},
{
name = "Fabricantes";
action = "";
children = ("CreateFabricante","SearchFabricantes");
},
{
name = "CreateFabricante";
action = "";
},
{
name = "SearchFabricantes";
action = "";
}
)

See, it doesn't complain about the missing actions... If I take out the "offending" line (children = "session.navigationRootChoice";) and run it again, the tabs are not drawn, but there's no crash.

It's important to notice that a "virgin" Wonder D2W App returns:

D2W.factory().defaultPage(session())

from DirectAction.loginAction(), not:

((Session) session()).navController().homeAction()

as indicated in the tutorial. No matter which of these I return, i get the same error.

Error page is attached.


Cheers,
Flavio

<WebObjects Error.html> _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com

This email sent to programming...@mac.com

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

This email sent to arch...@mail-archive.com

Reply via email to