From: David H. <pro...@ma...> - 2008-11-04 00:45:17
|
Rather than fighting the ERXNavigationManager I am turning the components being switched into page level components. Thanks guys, David On 3-Nov-08, at 4:22 PM, David Holt wrote: > Hi all, > > Anjo, thanks for pointing out the dangers of users opening multiple > tabs. It was a case I hadn't considered. > > I figured out the mistake I was making that Anjo pointed out below. > If several pages are opened in multiple browser tabs and the user > reloads any individual one, the nav state of the page gets reset to > the most recent tab that was opened but the page content stays the > same. > > I can set the nav state for a page level component in the awake() > method. > > One page has a switch component with 10 possible choices. I don't > know how to set the value of the selection variable and call awake() > at the page level with the proper value for the nav tab. How can I > set the nav state of the page based on the selection variable of the > switch component? > > Thanks guys, > > David > > > On 27-Oct-08, at 12:57 AM, Anjo Krank wrote: > >> Do NOT use ERXNavManager for pushing the context. You will end up >> with >> totally fragged navigation when your user opens pages in tabs. Pull >> the string from the session or current page or whereever. >> >> Cheers, Anjo >> >> Am 25.10.2008 um 00:04 schrieb David Holt: >> >>> Hi Josh, >>> >>> ERMovies is easier to digest. The key is the CSS. You have to create >>> CSS for the different states and it will be picked up automatically. >>> >>> Here are the essentials. I hope they're enough to get/keep you >>> going: >>> >>> In Application.java >>> // initialize the navigation >>> >>> public void finishInitialization() { >>> super.finishInitialization(); >>> ERXNavigationManager.manager().configureNavigation(); >>> NSLog.debug.appendln("finishInitialization called."); >>> } >>> >>> Example actions in Session: >>> // Don't forget to set the navigation state for every action >>> // (setSelection() is used in the WOSwitchComponent in MainSurvey) >>> >>> public WOComponent toUserPage() { >>> >>> ERXNavigationManager >>> .manager().navigationStateForSession(session()).setState(new >>> NSArray(new Object[] { >>> "my profile" >>> })); >>> // ... do real action... >>> return context().page().pageWithName(UserProfile.class.getName()); >>> } >>> public WOActionResults toSurvey() { >>> >>> ERXNavigationManager >>> .manager().navigationStateForSession(session()).setState(new >>> NSArray(new Object[] { >>> "my survey", >>> "instructions" >>> })); >>> return context().page().pageWithName(MainSurvey.class.getName()); >>> } >>> >>> >>> >>> public WOActionResults toSurvey1() { >>> >>> ERXNavigationManager >>> .manager().navigationStateForSession(session()).setState(new >>> NSArray(new Object[] { >>> "my survey", >>> "section I" >>> })); >>> MainSurvey nextPage = >>> (MainSurvey)context().page().pageWithName(MainSurvey.class.getName >>> ()); >>> nextPage.setSelection("Survey1"); >>> return nextPage; >>> } >>> >>> Navigation.plist: >>> // there are more options than I am using below. See the docs for >>> more examples >>> >>> { >>> name = "Root"; >>> children = ("my profile","my survey"); >>> }, >>> { >>> name = "my profile"; >>> action = session.toUserPage; >>> }, >>> { >>> name = "my survey"; >>> children = ("instructions","section I"); >>> action = session.toSurvey; >>> }, >>> { >>> name = "instructions"; >>> action = session.toSurvey; >>> }, >>> { >>> name = "section I"; >>> action = session.toSurvey1; >>> }, >>> >>> HTML Source you'll see generated by ERXNavigationMenu when the app >>> is run >>> >>> <div class="ERXNavigationMenu"> >>> <ul class="Level1Items"> >>> <li nowrap="nowrap" class="Nav1" id="id1"><a href="/cgi-bin/ >>> WebObjects/MyApp.woa/wo/ >>> 49YrOFk9VT0wc2WYDlZ8b0/5.0.11.0.0.1.1.2.1.0.0.1.1.0.0">my profile</ >>> a></li> >>> >>> <li nowrap="nowrap" class="Nav1Selected" id="id2"><a href="/cgi-bin/ >>> WebObjects/MyApp.woa/wo/ >>> 49YrOFk9VT0wc2WYDlZ8b0/5.0.11.0.0.1.1.2.1.1.0.1.1.0.0">my survey</ >>> a></li> >>> </ul> >>> <ul class="Level2Items"> >>> <li nowrap="nowrap" class="Nav2" id="id3"><a href="/cgi-bin/ >>> WebObjects/MyApp.woa/wo/ >>> 49YrOFk9VT0wc2WYDlZ8b0 >>> /5.0.11.0.0.1.1.2.3.1.0.0.1.1.0.0">instructions</a></li> >>> >>> <li nowrap="nowrap" class="Nav2Selected" id="id4"><a href="/cgi-bin/ >>> WebObjects/MyApp.woa/wo/ >>> 49YrOFk9VT0wc2WYDlZ8b0/5.0.11.0.0.1.1.2.3.1.1.0.1.1.0.0">section I</ >>> a></li> >>> </ul> >>> >>> >>> </div> >>> >>> CSS items that I defined in my application: >>> >>> .ERXNavigationMenu { >>> } >>> .Level1Items { >>> } >>> .Level1Items li { >>> } >>> .Level1Items a { >>> } >>> .Level1Items .Nav1Selected a { >>> >>> } >>> .Level1Items li.Nav1 a:hover { >>> } >>> .Level2Items { >>> } >>> .Level2Items li { >>> } >>> .Level2Items a { >>> } >>> >>> .Level2Items .Nav2Selected a, .Level2Items li.Nav2 a:hover { >>> >>> } >>> >>> >>> On 24-Oct-08, at 2:31 PM, Josh Paul wrote: >>> >>>> Thanks. >>>> >>>> I looked at bugtracker, and it's still a little bit much to digest. >>>> I think I'm getting there, though. >>>> >>>> On Oct 24, 2008, at 2:29 PM, David Holt wrote: >>>> >>>>> Yes! >>>>> >>>>> I'll write up a little tutorial for you this weekend. In the >>>>> meantime, you can look at bugtracker and ermovies for examples of >>>>> its use. >>>>> >>>>> David >>>>> >>>>> >>>>> On 24-Oct-08, at 2:02 PM, Josh Paul wrote: >>>>> >>>>>> Thanks! After looking at the documentation, I still have a few >>>>>> questions... >>>>>> >>>>>> Does anyone have an example of usage outside of a D2W app? >>>>>> >>>>>> On Oct 24, 2008, at 9:22 AM, David Holt wrote: >>>>>> >>>>>>> Hi Josh, >>>>>>> >>>>>>> I'd use ERXNavigationMenu which automatically takes care of >>>>>>> changing >>>>>>> the css on the current link for you. I am using it to track >>>>>>> users >>>>>>> through a multipage form. The only caveat I have is that you'll >>>>>>> need >>>>>>> to do some tinkering if you want to submit the form with the >>>>>>> hyperlinks (I don't bother). >>>>>>> >>>>>>> Another option might be a tabbed component which could give the >>>>>>> user >>>>>>> an indication where they are in the process as well. >>>>>>> >>>>>>> A final option might be something as simple as a >>>>>>> WOSwitchComponent >>>>>>> where the links change their css class depending on which >>>>>>> component >>>>>>> is being displayed. >>>>>>> >>>>>>> David >>>>>>> >>>>>>> >>>>>>> On 23-Oct-08, at 3:44 PM, Josh Paul wrote: >>>>>>> >>>>>>>> I'd like to provide an indicator to clients in regard to where >>>>>>>> they >>>>>>>> are in a specific workflow. Each step relates to >>>>>>>> (essentially) a >>>>>>>> page, >>>>>>>> and I'd like to highlight the current step they are on in the >>>>>>>> flow >>>>>>>> through an html style. I've done this before by doing some >>>>>>>> comparison >>>>>>>> of the current page name to an item in the array of steps, but >>>>>>>> I'm >>>>>>>> wondering if there's a more efficient or "correct" way to do >>>>>>>> it. >>>>>>>> >>>>>>>> For example, assume there are 4 steps. The "trail" would look >>>>>>>> like >>>>>>>> this, if the user was on Step 02: >>>>>>>> >>>>>>>> Step 01 | *Step 02* | Step 03 | Step 04 >>>>>>>> >>>>>>>> Thoughts? >>>>>>>> >>>>>>>> --------------------------------------------------------------- >>>>>>>> - >>>>>>>> --------- >>>>>>>> This SF.Net email is sponsored by the Moblin Your Move >>>>>>>> Developer's >>>>>>>> challenge >>>>>>>> Build the coolest Linux based applications with Moblin SDK & >>>>>>>> win >>>>>>>> great prizes >>>>>>>> Grand prize is a trip for two to an Open Source event >>>>>>>> anywhere in >>>>>>>> the world >>>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>>>>>> _______________________________________________ >>>>>>>> Wonder-disc mailing list >>>>>>>> Won...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>>>>> >>>>>> >>>>>> >>>>>> ----------------------------------------------------------------- >>>>>> - >>>>>> ------- >>>>>> This SF.Net email is sponsored by the Moblin Your Move >>>>>> Developer's challenge >>>>>> Build the coolest Linux based applications with Moblin SDK & win >>>>>> great prizes >>>>>> Grand prize is a trip for two to an Open Source event anywhere in >>>>>> the world >>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>>>> _______________________________________________ >>>>>> Wonder-disc mailing list >>>>>> Won...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>>> >>>> >>> >>> -------------------------------------------------------------------- >>> - >>> ---- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win >>> great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in >>> the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Wonder-disc mailing list >>> Won...@li... >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> >> >> --------------------------------------------------------------------- >> - >> --- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Wonder-disc mailing list >> Won...@li... >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > > > ---------------------------------------------------------------------- > --- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |