By "page template" I meant like a jspx page that could be re-used over an
over (sort of like page templates in word processing programs).

For now, I think for now you really want to take a use the panelPage
component.  It has a facet for each of the navigation levels (e.g.
navigationGlobal, navigation1, etc. ...and location for breadCrumbs).
Inside of those facet, you'll put a navigationPane and specify level="1",
etc. so that it will consume a particular level of the Menu Model, e.g.
something along the lines of:

<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page";
         xmlns:f="http://java.sun.com/jsf/core";
         xmlns:t="http://myfaces.apache.org/trinidad";
         version="1.2">
 <jsp:directive.page contentType="text/html;charset=utf-8"/>
 <f:view>
   <t:document>
     <t:form>
       <t:panelPage>
         <f:facet name="branding">
           <t:panelGroupLayout layout="horizontal">
             <t:icon name="logo"/>
             <t:outputText value="Toy Store"/>
           </t:panelGroupLayout>
         </f:facet>
         <f:facet name="navigationGlobal">
           <t:navigationPane
             var="node"
             value="#{menuModel.model}"
             level="0"
             hint="buttons">
             <f:facet name="nodeStamp">
               <t:commandNavigationItem
                 text="#{node.label}"
                 action="#{node.getOutcome}"
                 rendered="#{node.type=='global'}"/>
             </f:facet>
           </t:navigationPane>
         </f:facet>
         <f:facet name="navigation1">
           <t:navigationPane
             var="node"
             value="#{menuModel.model}"
             level="0"
             hint="buttons">
             <f:facet name="nodeStamp">
               <t:commandNavigationItem
                 text="#{node.label}"
                 action="#{node.getOutcome}"
                 rendered="#{node.type!='global'}"/>
             </f:facet>
           </t:navigationPane>
         </f:facet>
         ...
       </t:panelPage>
     </t:form>
   </t:document>
 </f:view>
</jsp:root>

However, there is one problem with this... today, the navigationPane doesn't
fully support stamped commandNavigationItem components, instead, it only
supports indexed children like this:

<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page";
         xmlns:f="http://java.sun.com/jsf/core";
         xmlns:t="http://myfaces.apache.org/trinidad";
         version="1.2">
 <jsp:directive.page contentType="text/html;charset=utf-8"/>
 <f:view>
   <t:document>
     <t:form>
       <t:panelPage>
         <f:facet name="branding">
           <t:panelGroupLayout layout="horizontal">
             <t:icon name="logo"/>
             <t:outputText value="Toy Store"/>
           </t:panelGroupLayout>
         </f:facet>
         <f:facet name="navigationGlobal">
           <t:navigationPane
             hint="buttons">
             <t:commandNavigationItem
               text="Global 1"
               action="global1"/>
             <t:commandNavigationItem
               text="Global 2"
               action="global2"/>
           </t:navigationPane>
         </f:facet>
         <f:facet name="navigation1">
           <t:navigationPane
             hint="buttons">
             <t:commandNavigationItem
               text="Primary 1"
               action="primary1"/>
             <t:commandNavigationItem
               text="Primary 2"
               action="primary2"/>
           </t:navigationPane>
         </f:facet>
         <t:outputText value="Hello world"/>
       </t:panelPage>
     </t:form>
   </t:document>
 </f:view>
</jsp:root>

Unfortunately, it appears that there isn't an easy solution for what you are
looking for right now until navigationPane is enhanced to support stamping.

Regards,
Matt

On 10/31/06, d sanders <[EMAIL PROTECTED]> wrote:

Hi,

Thanks for the info.  One option might be to make the
global buttons defined using a separate facet and then
have the nodeStamp facet represent the tabs as the
root of the navigation tree.

What do you mean by 'page template'?  Is this a
component or just a standard way of using individual
components together?

David


--- Matt Cooper <[EMAIL PROTECTED]> wrote:

> Hi David,
>
> I believe there were two reasons for this.  The
> first being complexity:
> since the model is in a tree structure, the default
> layout should keep the
> that tree structure.  The second is that the page
> component is not very
> flexible.  Instead, a page template solution would
> be much better because it
> would be much more flexible and thus could allow
> page developers to emulate
> the consumption of the MenuModel so that it matches
> the ADF Faces
> 10.1.3format (through EL bindings on the rendered
> attribute,
> e.g. rendered="#{node.type=='global'}" or
> rendered=#{node.type!='global'})
> or whatever special format they want.  I expect that
> if Trinidad were to
> provide sample page templates in the demo WAR then
> the transition for page
> developers going from ADF Faces 10.1.3 to Trinidad
> would be minimal.  If
> that sounds like something valuable, please log an
> issue.
>
> Thanks,
> Matt
>
> On 10/30/06, d sanders <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,
> >
> > My reply to your message did not get put under the
> > right thread level (I am new to this mailing list
> > stuff).  Do you know why they decided to change
> the
> > behavior, and whether or not they understood the
> > consequences to the page component?  Are they
> phasing
> > out the page component for something that does the
> > same thing, only better?  (See my other reply via
> the
> > archive as to why the new way does not work.)
> >
> > Regards,
> >
> > David
> >
> >
> > --- Matt Cooper <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> > >
> > > Please correct me if I'm wrong, but I believe
> > > (regardless of type) that
> > > Trinidad treats top level of the MenuModel as
> global
> > > nodes and the next
> > > level down is for the tabs.  Whereas the ADF
> Faces
> > > 10.1.3 model treated the
> > > global nodes and tabs as items from the same
> level
> > > of the MenuModel
> > > (distinguished by that type setting as you
> > > mentioned).
> > >
> > > Regards,
> > > Matt
> > >
> > > On 10/27/06, d sanders <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > Hello,
> > > >
> > > > ADF Faces used the 'type' attribute on the
> > > nodeStamp
> > > > facet's commandMenuItem to determine whether
> or
> > > not
> > > > the nodeStamp represented a global button when
> > > > rendering a page component.  From the oracle
> docs:
> > > >
> > > > "
> > > > Instead of a menuGlobal facet, the page
> component
> > > > supports global menu buttons from the menu
> model
> > > only.
> > > > Items to be rendered as global buttons are
> added
> > > to
> > > > the menu model as peers of the menu tab items,
> and
> > > in
> > > > the JSF page the type attribute of the
> associated
> > > menu
> > > > item component should return  global. Suppose
> you
> > > have
> > > > a menu hierarchy where a1, a2 are top-level
> nodes
> > > with
> > > > various children subnodes, and a3, a4 are
> > > standalone
> > > > nodes with no children subnodes (as shown in
> the
> > > > illustration below)."
> > > >
> > > >
> > > >
> > >
> >
> >
>

http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtAnchor.global/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_alay_pagecomponent%7Ehtml/
> > > >
> > > > It looks like trinidad gets rid of the type
> > > attribute
> > > > (and renames the commandMenuItem to
> > > > commandNavigationItem).  So there is no way to
> > > tell
> > > > the renderer that you don't want the item to
> be a
> > > > global button.  Am I missing something?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > http://mail.yahoo.com
> > > >
> > >
> >
> >
> >
> >
> >
> >
>

____________________________________________________________________________________
> > Get your email and see which of your friends are
> online - Right on the New
> > Yahoo.com
> > (http://www.yahoo.com/preview)
> >
> >
>





____________________________________________________________________________________
Everyone is raving about the all-new Yahoo! Mail
(http://advision.webevents.yahoo.com/mailbeta/)


Reply via email to