• 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: ERModern Navigation Menu question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERModern Navigation Menu question


  • Subject: Re: ERModern Navigation Menu question
  • From: ISHIMOTO Ken <email@hidden>
  • Date: Wed, 13 Oct 2010 06:37:16 +0200

Hi Daniel,

Yes I got that too.

The Code in MenuHeader

// ERXModernNavigationMenu Support

public NSKeyValueCoding navigationContext() {

NSKeyValueCoding context = (NSKeyValueCoding)session().objectForKey("navigationContext");



if (context().page() instanceof D2WPage) {
context = ((D2WPage)context().page()).d2wContext();
}


if(context == null) {
context = new NSMutableDictionary<Object, String>();
session().setObjectForKey(context, "navigationContext");
}


ERXNavigationState state = ERXNavigationManager.manager().navigationStateForSession(session());
return context;
}

didn't work for me. Only in D2W App, but not in Hybrid App's. The design above won't work with second or third Layer.
I also was debugging much, because it really didn't work. 

I changed it like below, and now it works great in Hybrid App's too.


//********************************************************************
// Navigation
//********************************************************************

/**
* Rule : Set "navigationState" to update ERXNavigationState
*/
public NSKeyValueCoding navigationContext() {
NSKeyValueCoding context = (NSKeyValueCoding)session().objectForKey("navigationContext");


if (context().page() instanceof D2WPage) {
/* D2W Page */
return ((D2WPage)context().page()).d2wContext();
} else if(context instanceof NSMutableDictionary<?,?> || context instanceof NSDictionary<?,?>) {
/* not an D2WContext, but Normal Page NSDictionary */
} else if(context == null) {
context = new NSMutableDictionary<Object, String>();
}


ERXNavigationState state = ERXNavigationManager.manager().navigationStateForSession(session());


NSMutableDictionary<String,String> mdic = new NSMutableDictionary<String,String>(1);
mdic.setObjectForKey(state.stateAsString(), "navigationState");
context = mdic;


session().setObjectForKey(context, "navigationContext");


return context;
}


Hope this help, and maybe that has to be fixed in the Demo as well.



On 2010/10/12, at 23:23, Daniel Beatty wrote:

Greetings gurus,
I was experimenting with ERModernLook and making a custom navigation list.  I noticed that for menu items not named Home, Movie, Tab, etc that I got an unexpected behavior.  Namely, those pretty tabs that Dave took care to make disappeared and my tabs look pretty sad.  After that, I proceeded to look at the rule files, the component, and for some CSS entries to determine what is controlling this behavior.   Since my first glance has come up empty, I am forced to seek a better source of knowledge about these things than what I personally have.    I image it is a simple thing, and I could be working too hard.  Thus if any of you gurus can point out the “snake under my nose” I would appreciate it.

Thank you,
 
Daniel Beatty
Computer Scientist, Detonation Sciences Branch
Code 474300D
2401 E. Pilot Plant Rd. M/S 1109
China Lake, CA 93555
email@hidden
(760)939-7097

Thank you

--------------------------------------------------------
K's ROOM      (ISHIMOTO Ken)
--------------------------------------------------------
[E-Mail]  <email@hidden>
[iChat:]   <email@hidden>
[HP]          http://www.ksroom.com/
_____________________________________________________________________
This e-mail has not been scanned for viruses because it was written on an Mac,
and there are NO Viruses on an Apple Computer.
For further information visit http://www.apple.com



 _______________________________________________
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: 
 >ERModern Navigation Menu question (From: Daniel Beatty <email@hidden>)

  • Prev by Date: Re: Threads, was Re: Why doesn't this rule work?
  • Next by Date: Fwd: ERModern Navigation Menu question
  • Previous by thread: Re: ERModern Navigation Menu question
  • Next by thread: Fwd: ERModern Navigation Menu question
  • Index(es):
    • Date
    • Thread