OK, Thanks!! 2012/9/5 Leonardo Uribe <lu4...@gmail.com>
> Hi > > You need to specify the annotations in your custom renderer again: > > > @ResourceDependency(library="oam.custom.tabbedpane",name="defaultStyles.css") > @ListenerFor(systemEventClass=PreRenderViewAddResourceEvent.class) > > By spec, the anotations are not inherited. That should solve the problem. > > regards, > > Leonardo Uribe > > 2012/9/5 Sergio Vieira Rolanski <ser...@strategos.com.br>: > > Indeed the demo works, that is why I copied some of its web.xml > > configuration. > > > > We have our own Faces library wrapping MyFaces and Tomahawk components. > Our > > components extends MyFaces' and Tomahawk's adding some features and > setting > > the styleClass property. > > > > Anyway, I guess the code that handles the resources is not recognizing > our > > inherited PanelTab component as a Tomahawk component thus not adding the > > "dynamicTabs.js" to the response, which is weird because the > > MyFaces/Tomahawk 1.1 was doing just fine. > > > > I have workaround the problem by adding <script> with the > "dynamicTabs.js" > > to every response, not my favorite solution. > > > > Is there better way? Or a way to make resource handler to recognize my > > wrapped PanelTab as Tomahawk one? > > > > 2012/9/5 Leonardo Uribe <lu4...@gmail.com> > > > >> Hi > >> > >> Checking the code it looks ok. Note in Tomahawk 2.0, JSF 2.0 > >> ResourceHandler API was adopted, so you need to use h:head and h:body > >> or tomahawk related components to add the required resource. > >> > >> The related code that adds the resource is: > >> > >> > >> > @ResourceDependency(library="oam.custom.tabbedpane",name="defaultStyles.css") > >> @ListenerFor(systemEventClass=PreRenderViewAddResourceEvent.class) > >> public class HtmlTabbedPaneRenderer > >> extends HtmlRenderer implements ComponentSystemEventListener > >> { > >> > >> public void processEvent(ComponentSystemEvent event) > >> { > >> HtmlPanelTabbedPane tabbedPane = > >> (HtmlPanelTabbedPane)event.getComponent(); > >> if( tabbedPane.isClientSide() ) > >> { > >> FacesContext facesContext = > FacesContext.getCurrentInstance(); > >> TomahawkResourceUtils.addOutputScriptResource(facesContext, > >> "oam.custom.tabbedpane", > >> "dynamicTabs.js"); > >> > >> The demo works without problem. > >> > >> regards, > >> > >> Leonardo Uribe > >> > >> 2012/9/5 Mike Kienenberger <mkien...@gmail.com>: > >> > Please open an issue in our issue tracker with this information. > >> > > >> > If you feel up to up, feel free to provide a patch as well as that > >> > will make getting it fixed happen faster. > >> > > >> > > >> > On Wed, Sep 5, 2012 at 12:13 PM, Sergio Vieira Rolanski > >> > <ser...@strategos.com.br> wrote: > >> >> Yes, it does work. > >> >> > >> >> > >> >> 2012/9/5 Mike Kienenberger <mkien...@gmail.com> > >> >> > >> >>> If you manually specify the dynamicTabs.js script on your page, > does it > >> >>> work? > >> >>> > >> >>> On Wed, Sep 5, 2012 at 9:07 AM, Sergio Vieira Rolanski > >> >>> <sergio.strate...@gmail.com> wrote: > >> >>> > I just upgraded MyFaces/Tomahawk to version 2.0. Got it 98% > working, > >> one > >> >>> of > >> >>> > the things that is giving me problems is that PanelTabbedPane > >> component > >> >>> is > >> >>> > not doing client-side tab switching. Looking at the request and > the > >> >>> > generated HTML, noticed MyFaces is not adding the "dynamicTabs.js" > >> to the > >> >>> > response. > >> >>> > > >> >>> > My configuration for web.xml: (which I copied from the tomahawk > >> example > >> >>> WAR > >> >>> > file) > >> >>> > > >> >>> > <context-param> > >> >>> > <description>Default adicionado para evitar mensagem no > >> >>> > log</description> > >> >>> > > >> >>> <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name> > >> >>> > <param-value>true</param-value> > >> >>> > </context-param> > >> >>> > <context-param> > >> >>> > <description>Default adicionado para evitar mensagem no > >> >>> > log</description> > >> >>> > > >> <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name> > >> >>> > > >> >>> > > >> >>> > >> > <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value> > >> >>> > </context-param> > >> >>> > <context-param> > >> >>> > <description>Default adicionado para evitar mensagem no > >> >>> > log</description> > >> >>> > > >> <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name> > >> >>> > <param-value>/faces/myFacesExtensionResource</param-value> > >> >>> > </context-param> > >> >>> > > >> >>> > <!-- Servlet padrĂ£o do MyFaces --> > >> >>> > <servlet> > >> >>> > <servlet-name>FacesServlet</servlet-name> > >> >>> > > >> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> > >> >>> > <load-on-startup>1</load-on-startup> > >> >>> > </servlet> > >> >>> > > >> >>> > <servlet-mapping> > >> >>> > <servlet-name>FacesServlet</servlet-name> > >> >>> > <url-pattern>*.jsf</url-pattern> > >> >>> > </servlet-mapping> > >> >>> > > >> >>> > <servlet-mapping> > >> >>> > <servlet-name>FacesServlet</servlet-name> > >> >>> > <url-pattern>/faces/*</url-pattern> > >> >>> > </servlet-mapping> > >> >>> > > >> >>> > <!-- 5. MyFaces --> > >> >>> > <filter> > >> >>> > <filter-name>MyFacesFilter</filter-name> > >> >>> > > >> >>> > > >> >>> > >> > <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class> > >> >>> > </filter> > >> >>> > > >> >>> > <filter-mapping> > >> >>> > <filter-name>MyFacesFilter</filter-name> > >> >>> > <url-pattern>*.jsf</url-pattern> > >> >>> > </filter-mapping> > >> >>> > > >> >>> > <filter-mapping> > >> >>> > <filter-name>MyFacesFilter</filter-name> > >> >>> > <url-pattern>/faces/*</url-pattern> > >> >>> > </filter-mapping> > >> >>> > >> >