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

Re: D2W - Problem with navigation


  • Subject: Re: D2W - Problem with navigation
  • From: Flavio Donadio <email@hidden>
  • Date: Wed, 10 Oct 2012 15:00:24 -0300

On 10/10/2012, at 13:59, email@hidden wrote:

> 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.


Now I understand why there is that "home = (...)" inside childrenChoices. And I will use this feature in the near future, so I won't change the plist like you advised...

The tutorial doesn't say *I* have to implement Session.navigationRootChoice(). Aside from that, my inexperience is also a serious issue: I still can't trust myself to know when something is "WOMagic" or something I have to do myself.

The tutorial, as it is, may be confusing to beginners like me. Pascal, I suggest you include that or simplify the plist.

> 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";
>   }


I made a simple "hack". I implemented the method like this:

public String navigationRootChoice() {
      return "home";
}

And it worked, indeed!

I think it's "case closed" for now. Thanks go to David Holt, David LeBer, Pascal and Theodore for the huge help again!


Cheers,
Flavio
 _______________________________________________
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

References: 
 >Re: D2W - Problem with navigation (From: email@hidden)

  • Prev by Date: Re: D2W - Problem with navigation
  • Next by Date: WOLips default binding definitions
  • Previous by thread: Re: D2W - Problem with navigation
  • Next by thread: Re: D2W - Problem with navigation
  • Index(es):
    • Date
    • Thread