2 Replies Latest reply on Aug 19, 2009 10:40 PM by Dean Hiller

    feature request on navigation

    Dean Hiller Expert

      Does anyone else find that the navigation rules behave very weird in that they can be for both entering the page and leaving the page both.  I would much rather see something like this...


      (Then just deprecate use of action).


          <page view-id="/web/zlogin/login.xhtml">
              <seamaction execute="#{identity.isLoggedIn()}">
                   <navigation>
                             <rule if="#{bean.dontWantLogin}">
                           <redirect view-id="/web/somepage.xhtml"/>
                           </rule>
                   </navigation>           
              </seamaction>
              <navigation>
                  <rule if="#{s:hasRole('script_admin')}">
                      <redirect view-id="/secure/client/scripter/admin/scripts.xhtml"/>
                  </rule>
              </navigation>
           </page>



      Above it is very clear now that actions are just actions unless I nest navigation in them in which case those are the rules I want tried on entry and the other rules are for EXIT only.  I personally have never wanted to reuse navigations for entering and leaving the page both and have ran into a few times where developers here could not figure out their bug and it was simply the navigations were executing ONLY because they added a page action...talk about bizarre.  I think it should be more consistent....many times we just want to add an action but that always changes the behavior of the navigation in hat rules when requesting the page start getting executing....all in all, very confusing.


      thanks for listening...but awesome awesome product overall.  This is just one pet peeve I keep running into and teaching people.


      later,
      Dean

        • 1. Re: feature request on navigation
          Dean Hiller Expert

          hmmm, maybe add a reuse exit rules option on seamaction element as well like so(for those rare instances where I want the same rules on entry and exit to/from a page....


              <page view-id="/web/zlogin/login.xhtml">
                  <seamaction reuseExitRules="true" execute="#{identity.isLoggedIn()}"/>
                  <navigation>
                      <rule if="#{s:hasRole('script_admin')}">
                          <redirect view-id="/secure/client/scripter/admin/scripts.xhtml"/>
                      </rule>
                  </navigation>
               </page>



          At least then, I don't have to train people on the fact that adding an action to a page changes seam's behavior in that entry into the page will result in execution of the navigation rules...take the action away and the navigation rules stop executing on entry.  ie. it makes it more obvious I think.  well, that is my 2 cents at least.

          • 2. Re: feature request on navigation
            Dean Hiller Expert

            one more thing as I want to be very very clear on the user confusion that I have seen practically everyone have that has come onto our project......


            1. add a page action and navigation rules magically start getting executed when you don't want them too.  all they wanted was an init page action


            2. take away the page action and it fixes it(in fact, we usually embed the action at the top of the xhtml page to avoid navigation rules from accidentally going off).


            Would much prefer a way to add actions in a page where navigation rules were not executed(or my own personal ones are executed instead of the ones used for exiting the page).