That explains it, thanks! I created Jira issue SHALE-364 for this.
----- Original Message -----
From: "Gary VanMatre" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, December 17, 2006 4:59 PM
Subject: Re: Clay, Tomahawk and jscookmenu
>From: "Steve Olson" <[EMAIL PROTECTED]>
Thanks for the info. I looked at both the code below and your site, and
have a couple questions. It looks like you had to essentially render your
own menu, as if the jscookmenu renderer wasn't used. Also the call to
cmDrawFromText - the jscookmenu.js that comes with the tomahawk 1.1.3 jar
doesn't seem to define cmDrawFromText. I can see on the jscook site that
this is a valid function so are you using a newer jscook version than the
tomhawk jar does, or am I just missing something?
Also, it looked like you had to extract the resources (.js, .gif, etc)
for
jscookmenu from the tomahawk jar into your own directories and explicitly
include them, as if org.apache.myfaces.webapp.filter.ExtensionsFilter
also
wasn't working. Is that what you had to do? Am I understanding things
correctly here?
I was hoping to get html something like this working, but this just
renders
a default submit Query button as an input control (!?):
> theme="ThemeOffice">
> itemValue="#{messages['menu1']}" action="#{homePage.menu1}"/>
> itemValue="#{messages['menu2']}" action="#{homePage.menu2}"/>
It'd be nice if this would rely on the tomahawk infastructure to provide
the
same rendering it does without using Clay. Is there a conflict/bug here
between Clay and tomahawk with how it renders jscookmenu controls?
If this is a bug or an RFE, I don't see anything listed in the Shale
Jira.
I'm also assuming this is a Clay issue, since it works in JSP, but maybe
that's a bad assumption :-). Anyway, I have some time available and would
be interested in contributing a patch (assuming I can figure one out :-)
if
that would be useful.
Do you agree that this is a Clay bug? Do you know of anyone else already
looking into this? Should this be a new clay Jira issue?
It looks like there are a couple issue here. The first is that the
renderType
of the jscookMenu is lost. Some of the myfaces tomahawk components
don't return / override the renderType. In this case it's picking up a
default
button renderType.
This can be easily fixed by overriding it in the Clay conifg. We will
need
to change this in the base tomahawk 1.3 config but consider the following
example:
<component jsfid="t:myJscookMenu" extends="t:jscookMenu">
<attributes>
<set name="rendererType" value="org.apache.myfaces.JSCookMenu" />
</attributes>
</component>
The next problem is that the javascript is not being added. I tracked
this
down to the myfaces ExtensionsFilter. The filter injects javascript into
the
response but it's insistent that the response's contentType is set so it
can
determine if it should process the resource for insertion. The
ClayViewHander is not explicitly setting the response's content type.
You have uncovered a couple bugs here. Please create a JIRA ticket
on this one (http://shale.apache.org/issue-tracking.html). I'd like to
get
a fix in before the next shale release.
Gary