You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andrew Robinson <an...@gmail.com> on 2007/08/06 19:31:35 UTC

Trinidad ppr from Tomahawk control?

I am having a look at the Trinidad and Tomahawk code and trying to see
if I can get the tomahawk controls to use the Trinidad PPR
functionality so I can mix Trinidad and Tomahawk controls.

The control I was looking first at was t:panelNavigation2 and
t:commandNavigation2. I prefer their implementation over the trinidad
functionality as it allows the menus to be more flexible (it allows
for backing bean menus as well as items defined in the view).

t:commandNavigation2 creates a submitForm call in the on click:

submitForm('_id4',1,{source:'_id7:_id9'});return false;

If I am able to reproduce this functionality using Trinidad's JS code
then I can get them to work together. The challenge is that, on the
client at least, the JS is obfuscated and not formatted, making it
very hard to read. Has anyone attempted to replace this functionality
with trinidad code?

Re: Trinidad ppr from Tomahawk control?

Posted by Andrew Robinson <an...@gmail.com>.
Thanks,

It doesn't look like the navigationPane supports nesting either. I
tried, but only the top level nodes were rendered

tr:navigationPane
  tr:commandNavigationItem (rendered)
    tr:commandNavigationItem (was not rendered)

This would be great to support, or have navigationTree support
children of type "tr:commandNavigationItem" instead of just using
model. (basically support the same functionality as that of tomahawk).


On 8/6/07, Adam Winer <aw...@gmail.com> wrote:
> I've filed:
>
> https://issues.apache.org/jira/browse/TRINIDAD-142
>
> against at least one of the doc problems with navigationPane.
> I think that you can mix static items with the model, but
> only either prepending or appending (and I don't think it's
> doc'd which happens), so not exactly the solution you're looking
> for.  Though you could have:
>
>    tr:navigationPane
>      tr:commandNavigationItem
>      tr:forEach
>        tr:commandNavigationItem
>      tr:commandNavigationItem
>
> -- Adam
>
>
> On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> > I see that the navigation pane does, but the documentation is very
> > light on the navigation pane. The demo only shows one level of
> > tr:commandNavigationItem, and I couldn't find any information on it
> > supporting nesting. Also, can you mix the model an
> > tr:commandNavigationItem?
> >
> > What I am looking to do:
> >
> > menu
> > static
> > static
> > static (*)
> >   static child
> >   dynamic children
> > static
> >
> > In tomahawk the asterisked node looked like:
> > <t:commandNavigation2
> >   value="#{messages.MenuBean_calendars}"
> >   actionListener="#{menuBean.onMainAction}"
> >   action="mainMenu_calendars">
> >   <t:commandNavigation2
> >     value="#{messages.MenuBean_createCalendar}"
> >     actionListener="#{menuBean.onMainAction}"
> >     action="mainMenu_createCalendar"
> >     rendered="#{s:hasRole('calendar-admin')}" />
> >   <t:navigationMenuItems value="#{mainMenuCalendarItems}" />
> > </t:commandNavigation2>
> >
> > Where there is a hard-coded menu for calendar administrators and then
> > a list of all the calendars for the current user below that but under
> > a parent "Calendars" menu. Result:
> >
> > Calendars
> >   Create new calendar
> >   Main calendar
> >   Other calendar
> >   Etc.
> >
> > -Andrew
> >
> >
> > On 8/6/07, Adam Winer <aw...@gmail.com> wrote:
> > > On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> > > > I am having a look at the Trinidad and Tomahawk code and trying to see
> > > > if I can get the tomahawk controls to use the Trinidad PPR
> > > > functionality so I can mix Trinidad and Tomahawk controls.
> > > >
> > > > The control I was looking first at was t:panelNavigation2 and
> > > > t:commandNavigation2. I prefer their implementation over the trinidad
> > > > functionality as it allows the menus to be more flexible (it allows
> > > > for backing bean menus as well as items defined in the view).
> > >
> > > Trinidad allows this too with its navigationPane, which can
> > > take a model value.
> > >
> > > -- Adam
> > >
> > >
> > > >
> > > > t:commandNavigation2 creates a submitForm call in the on click:
> > > >
> > > > submitForm('_id4',1,{source:'_id7:_id9'});return false;
> > > >
> > > > If I am able to reproduce this functionality using Trinidad's JS code
> > > > then I can get them to work together. The challenge is that, on the
> > > > client at least, the JS is obfuscated and not formatted, making it
> > > > very hard to read. Has anyone attempted to replace this functionality
> > > > with trinidad code?
> > > >
> > >
> >
>

Re: Trinidad ppr from Tomahawk control?

Posted by Adam Winer <aw...@gmail.com>.
I've filed:

https://issues.apache.org/jira/browse/TRINIDAD-142

against at least one of the doc problems with navigationPane.
I think that you can mix static items with the model, but
only either prepending or appending (and I don't think it's
doc'd which happens), so not exactly the solution you're looking
for.  Though you could have:

   tr:navigationPane
     tr:commandNavigationItem
     tr:forEach
       tr:commandNavigationItem
     tr:commandNavigationItem

-- Adam


On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> I see that the navigation pane does, but the documentation is very
> light on the navigation pane. The demo only shows one level of
> tr:commandNavigationItem, and I couldn't find any information on it
> supporting nesting. Also, can you mix the model an
> tr:commandNavigationItem?
>
> What I am looking to do:
>
> menu
> static
> static
> static (*)
>   static child
>   dynamic children
> static
>
> In tomahawk the asterisked node looked like:
> <t:commandNavigation2
>   value="#{messages.MenuBean_calendars}"
>   actionListener="#{menuBean.onMainAction}"
>   action="mainMenu_calendars">
>   <t:commandNavigation2
>     value="#{messages.MenuBean_createCalendar}"
>     actionListener="#{menuBean.onMainAction}"
>     action="mainMenu_createCalendar"
>     rendered="#{s:hasRole('calendar-admin')}" />
>   <t:navigationMenuItems value="#{mainMenuCalendarItems}" />
> </t:commandNavigation2>
>
> Where there is a hard-coded menu for calendar administrators and then
> a list of all the calendars for the current user below that but under
> a parent "Calendars" menu. Result:
>
> Calendars
>   Create new calendar
>   Main calendar
>   Other calendar
>   Etc.
>
> -Andrew
>
>
> On 8/6/07, Adam Winer <aw...@gmail.com> wrote:
> > On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> > > I am having a look at the Trinidad and Tomahawk code and trying to see
> > > if I can get the tomahawk controls to use the Trinidad PPR
> > > functionality so I can mix Trinidad and Tomahawk controls.
> > >
> > > The control I was looking first at was t:panelNavigation2 and
> > > t:commandNavigation2. I prefer their implementation over the trinidad
> > > functionality as it allows the menus to be more flexible (it allows
> > > for backing bean menus as well as items defined in the view).
> >
> > Trinidad allows this too with its navigationPane, which can
> > take a model value.
> >
> > -- Adam
> >
> >
> > >
> > > t:commandNavigation2 creates a submitForm call in the on click:
> > >
> > > submitForm('_id4',1,{source:'_id7:_id9'});return false;
> > >
> > > If I am able to reproduce this functionality using Trinidad's JS code
> > > then I can get them to work together. The challenge is that, on the
> > > client at least, the JS is obfuscated and not formatted, making it
> > > very hard to read. Has anyone attempted to replace this functionality
> > > with trinidad code?
> > >
> >
>

Re: Trinidad ppr from Tomahawk control?

Posted by Andrew Robinson <an...@gmail.com>.
I see that the navigation pane does, but the documentation is very
light on the navigation pane. The demo only shows one level of
tr:commandNavigationItem, and I couldn't find any information on it
supporting nesting. Also, can you mix the model an
tr:commandNavigationItem?

What I am looking to do:

menu
static
static
static (*)
  static child
  dynamic children
static

In tomahawk the asterisked node looked like:
<t:commandNavigation2
  value="#{messages.MenuBean_calendars}"
  actionListener="#{menuBean.onMainAction}"
  action="mainMenu_calendars">
  <t:commandNavigation2
    value="#{messages.MenuBean_createCalendar}"
    actionListener="#{menuBean.onMainAction}"
    action="mainMenu_createCalendar"
    rendered="#{s:hasRole('calendar-admin')}" />
  <t:navigationMenuItems value="#{mainMenuCalendarItems}" />
</t:commandNavigation2>

Where there is a hard-coded menu for calendar administrators and then
a list of all the calendars for the current user below that but under
a parent "Calendars" menu. Result:

Calendars
  Create new calendar
  Main calendar
  Other calendar
  Etc.

-Andrew


On 8/6/07, Adam Winer <aw...@gmail.com> wrote:
> On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> > I am having a look at the Trinidad and Tomahawk code and trying to see
> > if I can get the tomahawk controls to use the Trinidad PPR
> > functionality so I can mix Trinidad and Tomahawk controls.
> >
> > The control I was looking first at was t:panelNavigation2 and
> > t:commandNavigation2. I prefer their implementation over the trinidad
> > functionality as it allows the menus to be more flexible (it allows
> > for backing bean menus as well as items defined in the view).
>
> Trinidad allows this too with its navigationPane, which can
> take a model value.
>
> -- Adam
>
>
> >
> > t:commandNavigation2 creates a submitForm call in the on click:
> >
> > submitForm('_id4',1,{source:'_id7:_id9'});return false;
> >
> > If I am able to reproduce this functionality using Trinidad's JS code
> > then I can get them to work together. The challenge is that, on the
> > client at least, the JS is obfuscated and not formatted, making it
> > very hard to read. Has anyone attempted to replace this functionality
> > with trinidad code?
> >
>

Re: Trinidad ppr from Tomahawk control?

Posted by Adam Winer <aw...@gmail.com>.
On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> I am having a look at the Trinidad and Tomahawk code and trying to see
> if I can get the tomahawk controls to use the Trinidad PPR
> functionality so I can mix Trinidad and Tomahawk controls.
>
> The control I was looking first at was t:panelNavigation2 and
> t:commandNavigation2. I prefer their implementation over the trinidad
> functionality as it allows the menus to be more flexible (it allows
> for backing bean menus as well as items defined in the view).

Trinidad allows this too with its navigationPane, which can
take a model value.

-- Adam


>
> t:commandNavigation2 creates a submitForm call in the on click:
>
> submitForm('_id4',1,{source:'_id7:_id9'});return false;
>
> If I am able to reproduce this functionality using Trinidad's JS code
> then I can get them to work together. The challenge is that, on the
> client at least, the JS is obfuscated and not formatted, making it
> very hard to read. Has anyone attempted to replace this functionality
> with trinidad code?
>

Re: Trinidad ppr from Tomahawk control?

Posted by Simon Lessard <si...@gmail.com>.
Hello Andrew,

You can disable JavaScript compression with the following context-param
(Trinidad JS that is):

    <context-param>
      <param-name>org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT</param-name>
      <param-value>true</param-value>
    </context-param>

Regards,

Simon


On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
>
> I am having a look at the Trinidad and Tomahawk code and trying to see
> if I can get the tomahawk controls to use the Trinidad PPR
> functionality so I can mix Trinidad and Tomahawk controls.
>
> The control I was looking first at was t:panelNavigation2 and
> t:commandNavigation2. I prefer their implementation over the trinidad
> functionality as it allows the menus to be more flexible (it allows
> for backing bean menus as well as items defined in the view).
>
> t:commandNavigation2 creates a submitForm call in the on click:
>
> submitForm('_id4',1,{source:'_id7:_id9'});return false;
>
> If I am able to reproduce this functionality using Trinidad's JS code
> then I can get them to work together. The challenge is that, on the
> client at least, the JS is obfuscated and not formatted, making it
> very hard to read. Has anyone attempted to replace this functionality
> with trinidad code?
>

Re: Trinidad ppr from Tomahawk control?

Posted by Andrew Robinson <an...@gmail.com>.
I found the code in
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlLinkRendererBase:

if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm())) {
    onClick.append("submitForm('");
    onClick.append(formInfo.getForm().getClientId(facesContext));
    onClick.append("',1,{source:'");
    onClick.append(component.getClientId(facesContext));
    onClick.append("'});return false;");
}

It is hard-coded to use a full Trinidad submit and does not look like
it supports PPR at all.

-Andrew

On 8/6/07, Andrew Robinson <an...@gmail.com> wrote:
> I am having a look at the Trinidad and Tomahawk code and trying to see
> if I can get the tomahawk controls to use the Trinidad PPR
> functionality so I can mix Trinidad and Tomahawk controls.
>
> The control I was looking first at was t:panelNavigation2 and
> t:commandNavigation2. I prefer their implementation over the trinidad
> functionality as it allows the menus to be more flexible (it allows
> for backing bean menus as well as items defined in the view).
>
> t:commandNavigation2 creates a submitForm call in the on click:
>
> submitForm('_id4',1,{source:'_id7:_id9'});return false;
>
> If I am able to reproduce this functionality using Trinidad's JS code
> then I can get them to work together. The challenge is that, on the
> client at least, the JS is obfuscated and not formatted, making it
> very hard to read. Has anyone attempted to replace this functionality
> with trinidad code?
>