setting rowStyleClass
Hi, I seem to have an error when setting the rowStyleClass attribute of a table. I'm trying to set the row class dynamically so I can have certain rows highlighted based on a bean variable. Here's my widget, which extends MyFaces Tomahawk DataTable: component jsfid=callHistoryTable extends=t:dataTable allowBody=false attributes set name=value value=[EMAIL PROTECTED] / set name=var value=call / ... set name=rowStyleClass value=#{call.cost eq 0 ? 'freecalls' : 'chargedcalls'} / /attributes element renderId=0 jsfid=dateTimeColumn / element renderId=1 jsfid=callerIdColumn / element renderId=2 jsfid=numberCalledColumn / element renderId=4 jsfid=durationColumn / element renderId=5 jsfid=moneyCostColumn / /component But no class at all is set in the rendered table. Viewing page source of the final page gives: ... trtd.../td/tr ... If I try to set a rowStyleClass in my html as follows (I also remove the ref to rowStyleClass in the widget): table jsfid=callHistoryTable rowStyleClass=freecalls All I get is an empty class declaration in my tr tag: tr class=td... Has anyone managed to get this working? Cheers, Ian.
RE: Shale + Facelets + Tomahawk [OT?]
I do have that setting and I should mention that Facelets + Shale are working great together. The problem I'm having is only with the addition of myfaces tomahawk. In the absence of any obvious conflict, I'll run off to bother the myfaces mailing list for a change :) Thanks for the suggestion and have a great day! On 1/26/07, Reynolds, James [EMAIL PROTECTED] wrote: I'm having trouble configuring myfaces tomahawk components to work with Facelets and I'm wondering if there is a conflict with Shale. Is anyone else using this combination successfully? I've seen people say they did, but can't point directly at a mail thread for you. One critical link for Facelets to work is setting the default suffix context init parameter. Did you do that as well? context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value !-- Or whatever your pages use -- /context-param Without this setting, JSF is going to assume the extension is .jsp Craig Based on instructions at the facelets wiki, this is what I've done so far: I've created a file named tomahawk.taglib.xml under /WEB-INF: ?xml version=1.0? !DOCTYPE facelet-taglib PUBLIC -//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN http://java.sun.com/dtd/facelet-taglib_1_0.dtd; facelet-taglib !-- Just in case my email client removes them for me, note that the namespace tags are included below -- namespacehttp://myfaces.apache.org/tomahawk/namespace tag tag-namecommandLink/tag-name component component-typeorg.apache.myfaces.component.html.ext.HtmlCommandLink/c omponent-type renderer-typeorg.apache.myfaces.renderkit.html.HtmlLinkRenderer/rende rer-type /component /tag /facelet-taglib I've registered the file in my web.xml: ... context-param param-namefacelets.LIBRARIES/param-name param-value/WEB-INF/tomahawk.taglib.xml/param-value /context-param ... I've referenced the namespace declared in the taglib file in the root html element of my page as such: xmlns:t=http://myfaces.apache.org/tomahawk; Is there something else I need to do on the Shale side to make this work? Thanks E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized. E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.
RE: setting rowStyleClass
From: Ian.Priest [EMAIL PROTECTED] See https://issues.apache.org/jira/browse/TOMAHAWK-523 for problem and work-around. Hey, what do you know, facelets has the same problem :--). Thanks for reporting the work around. Cheers, Ian. Gary -Original Message- From: Ian.Priest [mailto:[EMAIL PROTECTED] Sent: 26 January 2007 15:30 To: user@shale.apache.org Subject: setting rowStyleClass Hi, I seem to have an error when setting the rowStyleClass attribute of a table. I'm trying to set the row class dynamically so I can have certain rows highlighted based on a bean variable. Here's my widget, which extends MyFaces Tomahawk DataTable: allowBody=false value=[EMAIL PROTECTED] / ... But no class at all is set in the rendered table. Viewing page source of the final page gives: ... ... ... If I try to set a rowStyleClass in my html as follows (I also remove the ref to rowStyleClass in the widget): All I get is an empty class declaration in my tag: ... Has anyone managed to get this working? Cheers, Ian.
Re: How to display exception thrown by beans during a dialog?
On 1/26/07, Paul Spencer [EMAIL PROTECTED] wrote: Rahul, So, if I want to display information from the exception to the user: 1) I need to maintain the exception in the bean, #{venderDialog}. 2) The view displaying the exception would reference a property in the bean, #{venderDialog.caughtException}? snip/ I meant com.foo.Vendor in your earlier example below: dialogs dialog name=addVendor scxmlconfig=dialogs/addVendor.xml dataclassname=com.foo.Vendor / /dialogs This is because: * The dialog data is maintained for us, so we don't need to worry about scoping, the information will exist for as long as the dialog is active, and no more than that * IMO, if the exception message (or some other bits) are meaningful to the user interaction, then the message (or other bits) belong to the location where we store all data associated with the user interaction (such as form field values etc.) Probably the easiest way to populate the dialog data in v1.0.4 is by setting the value on the appropriate ValueBinding expression, i.e. updated snippet: } catch (NotConfiguredException nce) { FacesContext ctx = FacesContext.getCurrentInstance(); ValueBinding vb = ctx.getApplication(). createValueBinding(#{dialog.data.cfgErrMsg}); // or a better prop name vb.setValue(ctx, nce.getMessage()); return notconfigured; } Again, the DialogHelper will help eliminate the grunt work [1] of the catch block in future releases. Whereby in the subsequent view (for vendor/noconfig state ID), we can have: h:outputText value=No configuration: #{dialog.data.cfgErrMsg}/ -Rahul [1] https://issues.apache.org/struts/browse/SHALE-401 public class VendorDialog { private Exception caughtException; // .. public String setup() { // no throws clause // ... try { // line(s) that can throw NotConfiguredException } catch (NotConfiguredException nce) { caughtException = nce; return notconfigured; } // ... return success; } Exception getCaughtException() { return caughtException; } } Thank you, Paul Spencer snap/
Re: How to end a SCXML dialog in an action?
On 1/26/07, Paul Spencer [EMAIL PROTECTED] wrote: Rahul Akolkar wrote: snip/ As mentioned above, that would be inside the method called by the MB, if at all we wanted to stop an active dialog and delegate to the faces-config navigation. What is the name of the method, or where do I configure it, that is called when the outcome, does is not configured? In the above example page's header/footer define the outcomes home, logout, and menu. These outcomes are currently handled by faces-config.xml, and I agree with your statement about avoiding the modeling of global site navigation in each dialog. snap/ Lets say outcome home is actually a commandLink, so simplistically: h:commandLink action=home value=Home / This, by itself, would mess with an active dialog. Instead: h:commandLink action=#{globals.home} value=Home / would ensure that we clean up correctly if there is an active dialog, where: // In the managed bean globals -- public String home() { stopActiveDialogIfAny(); // the two lines of code from before return home; // faces-config nav rules takes over here } Similarly for logout and menu. Also may want to check with user via onclick or suitable event handlers before wiping out the dialog. -Rahul
Re: ADF faces with shale tiger
On 1/26/07, amjad Shahrour [EMAIL PROTECTED] wrote: Hi there, I am trying to utilize only shale-tiger with ADF faces. I am interested only in using only the view controller services (callbacks). i created a simple (adf) jsf page and used the @View @Preprocess @Init @Prerender @Destroy on the page's backing bean. but nothing seems to take effect (no callbacks are being called). A couple of quick questions: * Is the backing bean also registered as a managed bean in faces-config.xml? If not, you will also want to use the @Bean annotation. * Does the name you assign the matching bean match the view id so that the matching algorithm will find it? * Have you tried this with just standard components to temporarily reduce the complexity of all the stuff being combined? Craig following is the web.xml file content ?xml version = '1.0' encoding = 'windows-1252'? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 descriptionEmpty web.xml file for Web Application/description context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param context-param param-nameoracle.adf.view.faces.USE_APPLICATION_VIEW_CACHE /param-name param-valuefalse/param-value /context-param context-param param-nameCpxFileName/param-name param-valuesystemsettings.DataBindings/param-value /context-param !-- Commons Chain Configuration Resources -- filter filter-nameadfFaces/filter-name filter-classoracle.adf.view.faces.webapp.AdfFacesFilter /filter-class /filter filter filter-nameadfBindings/filter-name filter-classoracle.adf.model.servlet.ADFBindingFilter /filter-class /filter filter filter-nameCustomSecurityFilter/filter-name filter-classcom.openaspects.comms.commons.CustomSecurityFilter /filter-class /filter filter filter-nameshale/filter-name filter-class org.apache.shale.application.faces.ShaleApplicationFilter /filter-class /filter !-- Shale Application Controller Filter Mapping -- filter-mapping filter-nameadfFaces/filter-name servlet-namefaces/servlet-name /filter-mapping filter-mapping filter-nameadfBindings/filter-name url-pattern*.jsp/url-pattern /filter-mapping filter-mapping filter-nameadfBindings/filter-name url-pattern*.jspx/url-pattern /filter-mapping filter-mapping filter-nameCustomSecurityFilter/filter-name servlet-namefaces/servlet-name /filter-mapping filter-mapping filter-nameshale/filter-name url-pattern/*/url-pattern /filter-mapping servlet servlet-namefaces/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameresources/servlet-name servlet-classoracle.adf.view.faces.webapp.ResourceServlet /servlet-class /servlet servlet-mapping servlet-namefaces/servlet-name url-pattern/faces/*/url-pattern /servlet-mapping servlet-mapping servlet-nameresources/servlet-name url-pattern/adf/*/url-pattern /servlet-mapping session-config session-timeout35/session-timeout /session-config mime-mapping extensionhtml/extension mime-typetext/html/mime-type /mime-mapping mime-mapping extensiontxt/extension mime-typetext/plain/mime-type /mime-mapping listener listener-class org.apache.commons.chain.web.ChainListener /listener-class /listener welcome-file-list welcome-file/index.jsp/welcome-file /welcome-file-list error-page exception-typejava.lang.Exception/exception-type location/Error.jsp/location /error-page resource-ref descriptionOracle Datasource example/description res-ref-namejdbc/myoracle/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Am I missing something ? thanks in advance
Re: ADF faces with shale tiger
From: amjad Shahrour [EMAIL PROTECTED] Hi there, I am trying to utilize only shale-tiger with ADF faces. I am interested only in using only the view controller services (callbacks). i created a simple (adf) jsf page and used the @View @Preprocess @Init @Prerender @Destroy on the page's backing bean. but nothing seems to take effect (no callbacks are being called). It sounds like you are missing the binding between a JSF view and a managed bean. This is handled by a naming convention. The JSF viewId is normalized into a value that must have a corresponding managed. So if your target page was /something.jsf, the ViewController should be registered as a managed bean by the name of something. The default mapper, removes the suffix of the viewId and replaces the / with $. You can override the default mapper if you want to create your own rules. Since your are using the tiger annotations (you also need shale-tiger besides shale-view and shale-core), you could register your ViewControllers as managed beans with the following annotation: @Bean(name = something, scope = Scope.REQUEST) following is the web.xml file content thanks in advance Gary
Re: ADF faces with shale tiger
You are right Gary, that was the cause. Thanks. I am interested to learn more about the mapper configuration. can you point me to a document about it. regards, amjad On 1/26/07, Gary VanMatre [EMAIL PROTECTED] wrote: From: amjad Shahrour [EMAIL PROTECTED] Hi there, I am trying to utilize only shale-tiger with ADF faces. I am interested only in using only the view controller services (callbacks). i created a simple (adf) jsf page and used the @View @Preprocess @Init @Prerender @Destroy on the page's backing bean. but nothing seems to take effect (no callbacks are being called). It sounds like you are missing the binding between a JSF view and a managed bean. This is handled by a naming convention. The JSF viewId is normalized into a value that must have a corresponding managed. So if your target page was /something.jsf, the ViewController should be registered as a managed bean by the name of something. The default mapper, removes the suffix of the viewId and replaces the / with $. You can override the default mapper if you want to create your own rules. Since your are using the tiger annotations (you also need shale-tiger besides shale-view and shale-core), you could register your ViewControllers as managed beans with the following annotation: @Bean(name = something, scope = Scope.REQUEST) following is the web.xml file content thanks in advance Gary
Re: Shale + Facelets + Tomahawk [OT?]
On 1/26/07, Reynolds, James [EMAIL PROTECTED] wrote: In the taglib file, don't be tempted to list the actual path to the component in the tomahawk jar. Follow the component-type listed in the Facelets wiki I had a feeling it had to do with the tomahawk taglib file. Just so you know we are using that same configuration with our app: MyFaces 1.1.5-SNAPSHOT, Tomahawk 1.1.5-SNAPSHOT, Facelets 1.1.10 and Shale 1.0.4. Greg
Re: ADF faces with shale tiger
From: amjad Shahrour [EMAIL PROTECTED] You are right Gary, that was the cause. Thanks. I am interested to learn more about the mapper configuration. can you point me to a document about it. We have some site documentation [1]. This is Craig's craft-work so the javadoc is also very helpful [2]. [1]http://shale.apache.org/shale-view/index.html [2]http://shale.apache.org/shale-view/apidocs/org/apache/shale/view/impl/DefaultViewControllerMapper.html regards, amjad Gary On 1/26/07, Gary VanMatre wrote: From: amjad Shahrour Hi there, I am trying to utilize only shale-tiger with ADF faces. I am interested only in using only the view controller services (callbacks). i created a simple (adf) jsf page and used the @View @Preprocess @Init @Prerender @Destroy on the page's backing bean. but nothing seems to take effect (no callbacks are being called). It sounds like you are missing the binding between a JSF view and a managed bean. This is handled by a naming convention. The JSF viewId is normalized into a value that must have a corresponding managed. So if your target page was /something.jsf, the ViewController should be registered as a managed bean by the name of something. The default mapper, removes the suffix of the viewId and replaces the / with $. You can override the default mapper if you want to create your own rules. Since your are using the tiger annotations (you also need shale-tiger besides shale-view and shale-core), you could register your ViewControllers as managed beans with the following annotation: @Bean(name = something, scope = Scope.REQUEST) following is the web.xml file content thanks in advance Gary
Exceptions at startup
Hi, I am using shale-tiger along with ADF faces on tomcat 5.5.8. and i am having several exceptions thrown at the startup of the server (but this seems not affecting the working of shale, i.e. callbacks are being called) Class = org.apache.commons.digester.Digester Parse Error at line 83 column 19: The content of element type attribute must match (description*,display-name*,icon*,attribute-name,at tribute-class,default-value?,suggested-value?,attribute-extension*). org.xml.sax.SAXParseException: The content of element type attribute must match (description*,display-name*,icon*,attribut e-name,attribute-class,default-value?,suggested-value?,attribute-extension*). at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at org.apache.shale.tiger.config.FacesConfigParser.parse( FacesConfigParser.java:157) at org.apache.shale.tiger.view.faces.LifecycleListener2.parseResource( LifecycleListener2.java:1282) at org.apache.shale.tiger.view.faces.LifecycleListener2.contextInitialized( LifecycleListener2.java:290) at org.apache.shale.view.faces.LifecycleListener.contextInitialized( LifecycleListener.java:138) at org.apache.catalina.core.StandardContext.listenerStart( StandardContext.java:3659) at org.apache.catalina.core.StandardContext.start( StandardContext.java:4097) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java :1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java :718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java :1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java :442) at org.apache.catalina.core.StandardService.start( StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java :683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) regards, Amjad Shahrour
Exception handling on init, prerender and preprocess
Hi, As the AbstractViewController does not throw Exceptions on its init(), prerender() and preprocess(), I'm catching the exceptions in these methods in my own classes extending the AbstractViewController and build my own dispatching or logging. Why can these methods not utilize shale's exception handling? Regards, Joost