Re: Datatable and highlighting
Hi Patrick, I use the javascript I send you below, hope it helps. I know there is a MyFaces Extension that let you set the onmouseover event for rows, but I don't remember the exact name. dt-row-hover - is my CSS class for highlighting a row. comp - is the table row, or whatever component you like I am not a javascript expert, but I may say a dummy javascript user, so I won't be able to help you much more. Hope it helps as it is, it works for me. Tonio. //-- // Provide hover and click effect to entire table rows. // Usage: // table class=grid // tr href=somelink.jsp onmouseover=rowHover(this) // ... //- function rowHover(comp) { comp.oldClassName = comp.className; comp.className = 'dt-row-hover'; comp.onmouseout = function() { this.className = this.oldClassName; } } On Mon, 2006-07-24 at 21:43 +, rahmoune patrick wrote: Hi all, I'm facing a problem with t:dataTable and highlighting I have a t:dataTable with rowClasses=standardTable_Row1,standardTable_Row2 and would like to add highlighting when the mouse goes over every row. My first idea was to add some javascript on the onMouseOver/onMouseOut that changes the css class. The pb in that I'm unable to restaure the old css class. Another bad idea was to find a place to store the old css class name Something like rowOnMouseOver=this.title = this.className; this.className='highlighted'; rowOnMouseOut=this.className = this.title; It works but a tooltip is displayed with the css class name :-). Does someone have this problem? Do I have to store this in something like a hashmap index by the TR, or an array with index? How to generate the index? Thank you for any help. patrick
Re: ValueChangeEvent getSource()
Jeff, The solution was to change my source code making the listeners different for each component, and they will work with RI and myfaces no matter how they are implemented. Craig, The problem that originated this mail has NOT to do with the components values, but with the components itself, although they seem related. In MyFaces: the components that correspond to event-source are stored in the BackingBean during the UpdateModel Phase, so during the valueChangeListener process the getSource()/getComponent() method does not match any of the BackingBean components. My BackingBeans has Request Scope. In RI: the components that correspond to event-source are in the BackingBean when valueChangeListeners are called. Also their getValue() method returns the newValue and not the oldValue Hope not to mess things up Tonio On Thu, 2006-06-08 at 09:36 -0700, Craig McClanahan wrote: On 6/8/06, Jeff Bischoff [EMAIL PROTECTED] wrote: Tonio, Your description of the phases sounds about right, and it makes sense why you ran into that problem. Let me check the diagram in Core JSF, to double-check... yep, Backing bean shouldn't have been updated when your listener is called. Sounds like you may have found a bug in the RI, albeit one that was convenient to you at the time. :) You'd be better off looking at the JSF spec and the API javadocs, which are authoritative :-). And the RI is working correctly on this point ... values *inside* an editable value holder will have been updated by the time value change event listeners are called. What will not have happened yet is pushing the updated value back to your model, if you use a value binding expression on the value property. That doesn't happen until the following phase (Update Model Values), which won't start until all the value change events have been fired in Process Validations. @Martin ... check particularly the API javadocs for UIInput.validate() ... in there you will see that setValue() is supposed to be called immediately after the validations have succeeded for a particular component. Value change listeners aren't called until the end of Process Validations, after *all* the validations on the entire component tree have been processed. You said you already have a solution or workaround for this right? If you want to know what the old value was, call getOldValue() on the event ... that's what it is there for. You can also call getNewValue() on the event, so if that's all you need to know you don't even need to bother looking up the source. Regards, Jeff Bischoff Kenneth L Kurz Assoc, Inc. Craig
Re: ValueChangeEvent getSource()
Craig, See my comments between and thanks for your time Tonio. On Thu, 2006-06-08 at 14:47 -0700, Craig McClanahan wrote: On 6/8/06, Tonio Caputo [EMAIL PROTECTED] wrote: Jeff, The solution was to change my source code making the listeners different for each component, and they will work with RI and myfaces no matter how they are implemented. Craig, The problem that originated this mail has NOT to do with the components values, but with the components itself, although they seem related. In MyFaces: the components that correspond to event-source are stored in the BackingBean during the UpdateModel Phase, so during the valueChangeListener process the getSource()/getComponent() method does not match any of the BackingBean components. By stored in the backing bean, does that mean you are using the binding=#{ mybean.mycomponent} attribute on your components in the JSP page, to bind the component instances themselves into the backing bean? If so, then this sounds like a different bug in MyFaces -- those component instances should have been re-established during the Restore View phase of the request processing lifecycle. It should indeed be the same instance that is the source of the event later on. == Yes that's exactly what I mean, I'm using the binding attribute for all my components. == @Matthias (see, I got it right this time): the spec language on restoring components with a binding attribute is near the end of Section 2.2.1. The net effect is that, on a postback of a component tree with components using binding, the value of this component property in the backing bean will be set to the one that was deserialized ... and this happens in Restore View phase, so that if a component fires events in any later phase, the source of the event will be == to the component instance that was deserialized. Craig My BackingBeans has Request Scope. In RI: the components that correspond to event-source are in the BackingBean when valueChangeListeners are called. Presuming that in the BackingBean means you used the binding attribute, that is the way it is supposed to be (i.e. that is the behavior required by the JSF specification).. Also their getValue() method returns the newValue and not the oldValue That is also the way it is supposed to be. If MyFaces does not do either of these, then it needs to be reported as a bug against MyFaces. === Just to make it clear, as I understood from the earlier mails: (1) if you use value binding (JSP attribute value) this binding will not be updated until UpdateModel Phase (2) if you use component binding (JSP attribute binding) the binding must occur in the Restore View Phase (component and all it's attributes) === Hope not to mess things up Tonio Craig On Thu, 2006-06-08 at 09:36 -0700, Craig McClanahan wrote: On 6/8/06, Jeff Bischoff [EMAIL PROTECTED] wrote: Tonio, Your description of the phases sounds about right, and it makes sense why you ran into that problem. Let me check the diagram in Core JSF, to double-check... yep, Backing bean shouldn't have been updated when your listener is called. Sounds like you may have found a bug in the RI, albeit one that was convenient to you at the time. :) You'd be better off looking at the JSF spec and the API javadocs, which are authoritative :-). And the RI is working correctly on this point ... values *inside* an editable value holder will have been updated by the time value change event listeners are called. What will not have happened yet is pushing the updated value back to your model, if you use a value binding expression on the value property. That doesn't happen until the following phase (Update Model Values), which won't start until all the value change events have been fired
Re: ValueChangeEvent getSource()
Matthias, Well, I understood what was going on. The event source correctly return the UIComponent that generated the event, the problem is that the BakingBean Components are not updated during the execution of the ValueChangeListener.processValueChange() method. If I look the at the BakingBean after the UpdateModel phase, the getSource() is correctly containing a reference to the updated UIComponent. Thanks a lot, and I will use myFaces valueChangeNotifier for the rest of my life. On Mon, 2006-06-05 at 20:12 -0700, Matthias Wessendorf wrote: Have you tried getComponent() which is defined in FacesEvent? The getSource() comes from java.util.Event clazz. In MyFaces getComponent() is *only*: return (UIComponent) getSource(); So can you tell us, what you get form a getSource() call? -Matthias On 6/5/06, Tonio Caputo [EMAIL PROTECTED] wrote: Hi everybody, I'm moving my application from sun's implementation (it's working ok) to myfaces. I'm using: jsf 1.1-01 myfaces 1.1.1 I'm having a difference in behavior regarding valueChangeEvent source. My application: ~~~ JSP- Jsp with standard JSF components, all bound to components in a java Page Page - Java class with all components of the JSP page - It adds ValueChangeListeners to the components who need it. - Request Scope My code for ValueChangeListener looks something like this: ~~ public void processValueChange(ValueChangeEvent ev) { .. Object src=ev.getSource(); if ( src.equals(_cmbCountry) ) do... else if ( src.equals(_cmbAnyCode) ) do else if ( src.equals(_cmbState) ) do.. else do nothing ... } where _cmbXXX are HtmlSelectOneMenu components defined in the Page class. The problem: In my faces, the event source does not match any of the the components, in sun's implementation it does. If I change the equals function for ==, it doesn't work either (as expected, there is a new Page for each request) The question: ~ Is this OK, a myfaces problem, a bad implementation (as usual) of sun's reference, or just worked by chance ? The solution of this problem is easy, I'm just checking to see what goes on. Thanks in advance tonio
Re: ValueChangeEvent getSource()
Matthias, I'll try to. This is what I suppose is happening in my faces, regarding this problem. 1 - Restore View/Apply Request Value/Process Validations Phases - The Backing Bean is constructed - Old components are stored in the BackingBean with their old values or new components are created and the old values are stored in them (really don't know exactly). - The Component Tree is updated with the new values. 2 - ValueChangeListeners are called - The getValue() of the components returns the old value - UIComponents are not the same of those in the component tree 3 - UpdateModel Phase - The UIComponents from the component tree are stored in the BackingBean. - This implies the the BackingBean getValue() methods return the new values. So when you call event.getSource() (in point (2)) the UIComponent returned is the one in the component tree, but not the one in the BackingBean. (this will not happen in ActionEvents that are executed after the UpdateModel Phase) In RI in point (2) the values and the components stored in the BackingBean are those of the new request, that's why it is working. Hope it is clearer if not just ask and I'll try again Tonio On Wed, 2006-06-07 at 14:16 -0700, Matthias Wessendorf wrote: I guess I didn't get you. sorry so what is different between MyFaces and RI ? Can you explain more detailed, so that fools like me can follow? :) -Matthias On 6/7/06, Tonio Caputo [EMAIL PROTECTED] wrote: Matthias, Well, I understood what was going on. The event source correctly return the UIComponent that generated the event, the problem is that the BakingBean Components are not updated during the execution of the ValueChangeListener.processValueChange() method. If I look the at the BakingBean after the UpdateModel phase, the getSource() is correctly containing a reference to the updated UIComponent. Thanks a lot, and I will use myFaces valueChangeNotifier for the rest of my life. On Mon, 2006-06-05 at 20:12 -0700, Matthias Wessendorf wrote: Have you tried getComponent() which is defined in FacesEvent? The getSource() comes from java.util.Event clazz. In MyFaces getComponent() is *only*: return (UIComponent) getSource(); So can you tell us, what you get form a getSource() call? -Matthias On 6/5/06, Tonio Caputo [EMAIL PROTECTED] wrote: Hi everybody, I'm moving my application from sun's implementation (it's working ok) to myfaces. I'm using: jsf 1.1-01 myfaces 1.1.1 I'm having a difference in behavior regarding valueChangeEvent source. My application: ~~~ JSP- Jsp with standard JSF components, all bound to components in a java Page Page - Java class with all components of the JSP page - It adds ValueChangeListeners to the components who need it. - Request Scope My code for ValueChangeListener looks something like this: ~~ public void processValueChange(ValueChangeEvent ev) { .. Object src=ev.getSource(); if ( src.equals(_cmbCountry) ) do... else if ( src.equals(_cmbAnyCode) ) do else if ( src.equals(_cmbState) ) do.. else do nothing ... } where _cmbXXX are HtmlSelectOneMenu components defined in the Page class. The problem: In my faces, the event source does not match any of the the components, in sun's implementation it does. If I change the equals function for ==, it doesn't work either (as expected, there is a new Page for each request) The question: ~ Is this OK, a myfaces problem, a bad implementation (as usual) of sun's reference, or just worked by chance ? The solution of this problem is easy, I'm just checking to see what goes on. Thanks in advance tonio
Re: HtmlSelectOneMenu value is not set during ValueChangeListenerexecution
Mario, Not a all, but it will be of great help. I'm just beginning to use myfaces features, for now I'm just adapting my application to work as it is (using sun's implementation). Thank you very much tonio On Sat, 2006-06-03 at 08:56 +0200, Mario Ivankovits wrote: Hi Tonio, You are aware about our s:valueChangeNotifier which behaves like ValueChangeListener with the difference that it will fire AFTER the updateModel phase? Ciao, Mario ValueChangeListeners are called after Process Validators Phase, and the model (Components values) is only updated (in the Update Model Values Phase) after processing the ValueChange events.
ValueChangeEvent getSource()
Hi everybody, I'm moving my application from sun's implementation (it's working ok) to myfaces. I'm using: jsf 1.1-01 myfaces 1.1.1 I'm having a difference in behavior regarding valueChangeEvent source. My application: ~~~ JSP- Jsp with standard JSF components, all bound to components in a java Page Page - Java class with all components of the JSP page - It adds ValueChangeListeners to the components who need it. - Request Scope My code for ValueChangeListener looks something like this: ~~ public void processValueChange(ValueChangeEvent ev) { .. Object src=ev.getSource(); if ( src.equals(_cmbCountry) ) do... else if ( src.equals(_cmbAnyCode) ) do else if ( src.equals(_cmbState) ) do.. else do nothing ... } where _cmbXXX are HtmlSelectOneMenu components defined in the Page class. The problem: In my faces, the event source does not match any of the the components, in sun's implementation it does. If I change the equals function for ==, it doesn't work either (as expected, there is a new Page for each request) The question: ~ Is this OK, a myfaces problem, a bad implementation (as usual) of sun's reference, or just worked by chance ? The solution of this problem is easy, I'm just checking to see what goes on. Thanks in advance tonio
Re: Problem with selectOneMenuItem
Hi Faisal, I had the same problem, it was because my Backing Bean has request scope, and my list was not initialized in the constructor method. The problem was, that as the Backing Bean did not have the list initialized the value of the component was not set. An easy way to detect this problem is to be sure that your JSP page has somewhere the tag h:messages. h:messages showDetail=table layout=table/ Hope this helps tonio On Mon, 2006-06-05 at 11:48 -0700, Faisal Mahmoud wrote: Hi All, I am building a drop down list using the h:selectOneMenu tag and all the items in the List populate and show up correctly in the drop down list. But after the user selects an item in the list and submits the form, when I check the property that is specified in the tag's value attribute, I get a NullPointerException. My code is below: jsp page: h:selectOneMenu id=selectFromExistingTenants immediate=true value=#{SelectNewControlDeviceTypePage.chosenDevice} f:selectItems value=#{SelectNewControlDeviceTypePage.licensedDevices}/ /h:selectOneMenu Code that builds the java.util.List of javax.faces.model.SelectItem objects in the f:selectItems value attribute: List list = this.licensedControllerDAO.getAllLicensedControllers(); logger.debug(Retrieved List of LicensedController objects. List size = + list.size()); Iterator iter = list.iterator(); while (iter.hasNext()) { LicensedController licensedController = (LicensedController) iter.next(); String controllerLabel = licensedController.getLabel(); SelectItem selectItem = new SelectItem(controllerLabel, controllerLabel); licensedDevices.add(selectItem); logger.debug(Added a SelectItem to the List with controllerLabel = + controllerLabel); } Backing Bean code for the h:selectOneMenu tag's value attribute: //SelectNewControlDeviceTypePage.java private String chosenDevice; // PROPERTY: chosenDevice public String getChosenDevice() { return this.chosenDevice; } public void setChosenDevice(String chosenDevice) { this.chosenDevice = chosenDevice; } So what am I doing wrong in my code such that my backing bean property is not getting with the chosen item? Faisal Mahmoud www.quidprocode.com
RE: Problem with selectOneMenuItem
()); } managed-bean managed-bean-nameSelectNewControlDeviceTypePage/managed-bean-name managed-bean-classcom.dv.ocs.jsf.bean.view.page.SelectNewControlDeviceTypePage /managed-bean-class managed-bean-scopesession/managed-bean-scope managed-property property-namecontrolDeviceEditDelegate/property-name value#{controlDeviceEditDelegate}/value /managed-property /managed-bean -faisal -Original Message- From: Tonio Caputo [mailto:[EMAIL PROTECTED] Sent: Monday, June 05, 2006 12:18 PM To: MyFaces Discussion Subject: Re: Problem with selectOneMenuItem Hi Faisal, I had the same problem, it was because my Backing Bean has request scope, and my list was not initialized in the constructor method. The problem was, that as the Backing Bean did not have the list initialized the value of the component was not set. An easy way to detect this problem is to be sure that your JSP page has somewhere the tag h:messages. h:messages showDetail=table layout=table/ Hope this helps tonio On Mon, 2006-06-05 at 11:48 -0700, Faisal Mahmoud wrote: Hi All, I am building a drop down list using the h:selectOneMenu tag and all the items in the List populate and show up correctly in the drop down list. But after the user selects an item in the list and submits the form, when I check the property that is specified in the tag's value attribute, I get a NullPointerException. My code is below: jsp page: h:selectOneMenu id=selectFromExistingTenants immediate=true value=#{SelectNewControlDeviceTypePage.chosenDevice} f:selectItems value=#{SelectNewControlDeviceTypePage.licensedDevices}/ /h:selectOneMenu Code that builds the java.util.List of javax.faces.model.SelectItem objects in the f:selectItems value attribute: List list = this.licensedControllerDAO.getAllLicensedControllers(); logger.debug(Retrieved List of LicensedController objects. List size = + list.size()); Iterator iter = list.iterator(); while (iter.hasNext()) { LicensedController licensedController = (LicensedController) iter.next(); String controllerLabel = licensedController.getLabel(); SelectItem selectItem = new SelectItem(controllerLabel, controllerLabel); licensedDevices.add(selectItem); logger.debug(Added a SelectItem to the List with controllerLabel = + controllerLabel); } Backing Bean code for the h:selectOneMenu tag's value attribute: //SelectNewControlDeviceTypePage.java private String chosenDevice; // PROPERTY: chosenDevice public String getChosenDevice() { return this.chosenDevice; } public void setChosenDevice(String chosenDevice) { this.chosenDevice = chosenDevice; } So what am I doing wrong in my code such that my backing bean property is not getting with the chosen item? Faisal Mahmoud www.quidprocode.com
RE: Problem with selectOneMenuItem
Faisal, I'm out of this problem, up to this I can help you, sorry my myfaces knowledge is not enough for it. I also noticed the submitFormViaAJAX method, hope nothing to do with that. Sorry, hope you find out what is going on tonio. On Mon, 2006-06-05 at 14:07 -0700, Faisal Mahmoud wrote: Tonio, Sorry, here is the form that contains the JSF code: h:form id=chooseControlDeviceForm style=margin: 0px; padding: 0px; width: auto; background-color: #77; onsubmit=submitFormViaAJAX(event, this, 'step2FillResultArea'); STEP 1: Add a new Control Device by choosing a type from the drop-down list:br / h:selectOneMenu id=selectFromExistingTenants value=#{SelectNewControlDeviceTypePage.chosenDevice} f:selectItems value=#{SelectNewControlDeviceTypePage.licensedDevices}/ /h:selectOneMenunbsp;nbsp; h:commandButton id=fillButton immediate=true type=submit action=#{SelectNewControlDeviceTypePage.chooseDevice} value=Choose/ h:messages showDetail=table layout=table/ /h:form So the method is being called via the commandButton. -Faisal -Original Message- From: Tonio Caputo [mailto:[EMAIL PROTECTED] Sent: Monday, June 05, 2006 2:00 PM To: MyFaces Discussion Subject: RE: Problem with selectOneMenuItem Faisal, When are you calling chooseDevice() method ? I mean, during the processing of which JSF event are you calling chooseDevice(). Regards On Mon, 2006-06-05 at 13:40 -0700, Faisal Mahmoud wrote: Hi Tonio, My backing bean is in the session, and the way I populate the List is via in the getter method for the property. The full class code is below. Note I use the Spring framework, so alot of my dependencies are wired using Spring. For the life of me, I cannot figure out why the selection does not get bound to the property. Also, beneath the java code is my faces-config.xml entry for this class. public class SelectNewControlDeviceTypePage { /** * Default no-args constructor */ public SelectNewControlDeviceTypePage() {} // BUSINESS LOGIC public String chooseDevice() { logger.info(Received a request from the JSF View to forward to the view associated with the chosen licensed controller.); if (this.getChosenDevice() == null) { logger.debug(#chosenDevice is null); } if (this.getChosenDevice().equals(this.ILON100)) { logger.info(Forwarding to view associated with Licensed Controller: + this.ILON100); return this.CHOOSEILON100; } else if (this.getChosenDevice().equals(this.CARRIERDDE)) { logger.info(Forwarding to view associated with Licensed Controller: + this.CARRIERDDE); return this.CHOOSECARRIERDDE; } else if (this.getChosenDevice().equals(this.HONEYWELL)) { logger.info(Forwarding to view associated with Licensed Controller: + this.HONEYWELL); return this.CHOOSEHONEYWELL; } else { logger.info(Forwarding to error view, unknown Licensed Controller chosen: + this.getChosenDevice()); return this.ERROR; } } // PROPERTY: controlDeviceEditDelegate public ControlDeviceEditDelegate getControlDeviceEditDelegate() { return this.controlDeviceEditDelegate; } public void setControlDeviceEditDelegate(ControlDeviceEditDelegate controlDeviceDelegate) { this.controlDeviceEditDelegate = controlDeviceDelegate; } // PROPERTY: chosenDevice public String getChosenDevice() { return this.chosenDevice; } public void setChosenDevice(String chosenDevice) { this.chosenDevice = chosenDevice; } // PROPERTY: licensedDevices public List getLicensedDevices() { if (this.licensedDevices == null) { logger.debug(List of licensedDevices is NULL, retrieving via delegate.); try { this.licensedDevices = this.controlDeviceEditDelegate.getLicensedControllerList(); } catch (BaseViewException e) { logger.error(e); this.licensedDevices = new LinkedList(); } catch (Exception e) { logger.error(e); this.licensedDevices = new LinkedList(); } catch (Throwable e
HtmlSelectOneMenu value is not set during ValueChangeListener execution
Hi everybody, I'm changing my application to run with myfaces 1.1.1, it was developed using sun's reference implementation, and it is working ok. The problem I'm having is the value HtmlSelectOneMenu.getValue() returns during the execution of ValueChangeListener.processValueChange() method. In sun's reference implementation the returned value is the event.getNewValue() in myfaces the returned value is event.getOldValue() As I understand during the ApplyRequestValue Phase all the values from the request are stored in the corresponding component, so sun's implementation is correct. May be I'm misunderstanding some spec, maybe my code is mistaken, but I'm getting a lot of trouble because I'm assuming that the component's value is the new one. I will describe basically my application: FormData - All the values components/selectItems had in the last request - Session scope Page/JSP - Java Class with all the components transient - JSP page with all its components bound to the Page's ones. - Request scope STATE_SAVING_METHOD is client. The readObject method of my Page is overridden, and this is what it is doing: 1. calls in.defaultReadObject() 2. creates all Html/UISelectItems components 3. FormData values (components and selectItems) are stored in the recently created components Any help or comment will be welcomed Thanks in advance tonio PD: I was really surprised not to find any e-mails regarding this problem in the list.
RE: HtmlSelectOneMenu value is not set during ValueChangeListenerexecution
Thanks Julian, You made me reread faces docs, you are right. ValueChangeListeners are called after Process Validators Phase, and the model (Components values) is only updated (in the Update Model Values Phase) after processing the ValueChange events. Well I must correct my code, and simply trust myfaces implementation. This is my third conflict between sun's implementation and myfaces, and in all cases myfaces was correct. Thanks again tonio On Fri, 2006-06-02 at 18:20 -0400, Julian Ray wrote: Hmmm, I always thought that the model had not been updated when the ValueChangeListener event is sent in which case the value would be the old value and the new value is only available via event.getNewvalue(). If you call renderResponse() from the value change listener it bypasses all model updates -- or am I misinformed? -Original Message- From: Tonio Caputo [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 5:49 PM To: MyFaces-Users-List Subject: HtmlSelectOneMenu value is not set during ValueChangeListenerexecution Hi everybody, I'm changing my application to run with myfaces 1.1.1, it was developed using sun's reference implementation, and it is working ok. The problem I'm having is the value HtmlSelectOneMenu.getValue() returns during the execution of ValueChangeListener.processValueChange() method. In sun's reference implementation the returned value is the event.getNewValue() in myfaces the returned value is event.getOldValue() As I understand during the ApplyRequestValue Phase all the values from the request are stored in the corresponding component, so sun's implementation is correct. May be I'm misunderstanding some spec, maybe my code is mistaken, but I'm getting a lot of trouble because I'm assuming that the component's value is the new one. I will describe basically my application: FormData - All the values components/selectItems had in the last request - Session scope Page/JSP - Java Class with all the components transient - JSP page with all its components bound to the Page's ones. - Request scope STATE_SAVING_METHOD is client. The readObject method of my Page is overridden, and this is what it is doing: 1. calls in.defaultReadObject() 2. creates all Html/UISelectItems components 3. FormData values (components and selectItems) are stored in the recently created components Any help or comment will be welcomed Thanks in advance tonio PD: I was really surprised not to find any e-mails regarding this problem in the list.
RE: NavigationHandler fails to find navigation rule
Hi Conway, Thanks very much for your help, IT WORKED !! Two things: 1 - When I copied the example in the e-mail I thought: What if I put it at the end ? I told me: No its stupid it has nothing to do Good lesson: Try all solutions no matter how trivial they look like. 2 - Of course this is not how faces Navigation Algorithm should work, at least what Core JAVA SERVER FACES describes. It's ok for my application, but it will cause a lot of trouble to many others. Thanks again tonio. On Thu, 2006-02-09 at 09:29 +, Conway. Fintan (IT Solutions) wrote: Hi Tony, I am not an expert, but have you tried moving the default rule to the end of the list? Otherwise you could specify some from-view-id's in your navigation-case's? HTH, Fintan -Original Message- From: Tonio Caputo [mailto:[EMAIL PROTECTED] Sent: 08 February 2006 21:28 To: MyFaces-Users-List Subject: NavigationHandler fails to find navigation rule Hi, I implemented a custom NavigationHandler, that just do some stuff and them call the default Implementation. The application is running correctly with Sun Faces implementation. What is happening is that NavigationHandler is not matching any rule and always going to the default rule. I've checked the outcome parameter, it is correct. I've checked that my Navigation Handler is called, yes. I send you a portion if my navigation configuration to see if it helps: navigation-rule navigation-case !-- This is the default destination -- to-view-id/PageSessionExpired.jsp/to-view-id /navigation-case navigation-case from-outcomeindex/from-outcome to-view-id/index.jsp/to-view-id /navigation-case navigation-case from-outcomestateSignout/from-outcome to-view-id/PageSignout.jsp/to-view-id /navigation-case navigation-case from-outcomestateInqCriteria/from-outcome to-view-id/PageQuoteSearchCrit.jsp/to-view-id /navigation-case navigation-case from-outcomestateInqList/from-outcome to-view-id/PageInquirySearchLst.jsp/to-view-id /navigation-case navigation-case from-outcomestatePnowEntry/from-outcome to-view-id/PagePriceNow.jsp/to-view-id /navigation-case Any Ideas will be great Thanks tonio * ** *** ** * ** *** ** * ** *** ** * This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any views or opinions presented are solely those of the author, and do not necessarily represent those of ESB. If you have received this email in error please notify the sender. Although ESB scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. * ** *** ** * ** *** ** * ** *** ** *
HtmSelectOneRadio setting style per component
Hi, I'm trying to make my application implemented and tested with sun reference implementation run with myfaces- 1.1.1 After some basic problems all seems to work ok. There is only a difference: HtmlSelectOneRadio Style renderer I'm setting the style of the component with the HtmlSelectOneRadio.setStyle() method, what happens: * Sun implementations generates a span tag with style information surrounding all the input elements * My faces is setting the style attribute of every component to the style information. I'm using XY Layout, so imagine that instead of positioning all elements in a box, all Radio Buttons with the size of all elements. My question: Is this a correct difference between implementations, or shoul one of them change the way it is rendered. The solution I suppose is putting this components inside a HtmlPanelGrid. Thanks in advance tonio.
Re: HtmSelectOneRadio setting style per component
Martin, Finally I was able to find the specs (http://java.sun.com/j2ee/javaserverfaces/1.1/docs/renderkitdocs/index.html) here is what it says regarding my problem: Render a table element. If the styleClass is specified, render the value of the styleClass attribute as the value of the class attribute on the table element. If the style, border attributes are specified, pass them thru. ... Well it seems myfaces is ok, as I understand (its not very clear) styleClass (class attribute) corresponds to the element surrounding all elements style,border attributes I suppose they mean put them in the input elements (Not sure what they mean with pass them thru) Well really I would prefer the other way round (styleClass/style) but specs are specs. Regards tonio On Thu, 2006-02-09 at 21:30 +0100, Martin Marinschek wrote: Have you read up what the spec says about this? Is there a way to set an item style in the RI? It seems to me that that would be important in many cases... regards, Martin On 2/9/06, Tonio Caputo [EMAIL PROTECTED] wrote: Hi, I'm trying to make my application implemented and tested with sun reference implementation run with myfaces- 1.1.1 After some basic problems all seems to work ok. There is only a difference: HtmlSelectOneRadio Style renderer I'm setting the style of the component with the HtmlSelectOneRadio.setStyle() method, what happens: * Sun implementations generates a span tag with style information surrounding all the input elements * My faces is setting the style attribute of every component to the style information. I'm using XY Layout, so imagine that instead of positioning all elements in a box, all Radio Buttons with the size of all elements. My question: Is this a correct difference between implementations, or shoul one of them change the way it is rendered. The solution I suppose is putting this components inside a HtmlPanelGrid. Thanks in advance tonio. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Anonymous classes and restoreComponentState Exception (Solution)
Hi everybody, Thank you again, now I could take some time to explore the problem again, the solution was simple of course: All Inner Classes must implement Serializable, so Anonymous Inner Classes must extend/implement a class who implements Serializable. Well faces.ActionListener, faces.ValueChangeListener are not Serializable (I suppose all faces Listeners). So now I'm extending an ApplListener that extends Listener and java.io.Serializable, and all seems to work fine. Thank you very much for your help. tonio On Wed, 2005-12-21 at 20:16 -0300, Tonio Caputo wrote: Hi, I'm having a big problem trying to use MyFaces. I have an application running with Java reference implementation all works ok. When I try to use it with MyFaces I'm getting this problem: javax.servlet.ServletException: Could not restore StateHolder of type com.avivacanada.pampa.util.jsf.BasePageBean$1 (missing no-args constructor?) Of course BasePageBean$1 is an anonymous class, no constructor in it. I will describe you some characteristics of my application that could help (of course if you need the source no problem) Every jsp has a java class java-page associated with it. They all extend BasePageBean, all components in the jsp are bound to a corresponding one in the java class. BasePageBean has a CommandButton common to all pages and it adds a listener to this command-button, this is the anonymous class that gives the problem. Any help will be welcomed thank you in advance
NavigationHandler fails to find navigation rule
Hi, I implemented a custom NavigationHandler, that just do some stuff and them call the default Implementation. The application is running correctly with Sun Faces implementation. What is happening is that NavigationHandler is not matching any rule and always going to the default rule. I've checked the outcome parameter, it is correct. I've checked that my Navigation Handler is called, yes. I send you a portion if my navigation configuration to see if it helps: navigation-rule navigation-case !-- This is the default destination -- to-view-id/PageSessionExpired.jsp/to-view-id /navigation-case navigation-case from-outcomeindex/from-outcome to-view-id/index.jsp/to-view-id /navigation-case navigation-case from-outcomestateSignout/from-outcome to-view-id/PageSignout.jsp/to-view-id /navigation-case navigation-case from-outcomestateInqCriteria/from-outcome to-view-id/PageQuoteSearchCrit.jsp/to-view-id /navigation-case navigation-case from-outcomestateInqList/from-outcome to-view-id/PageInquirySearchLst.jsp/to-view-id /navigation-case navigation-case from-outcomestatePnowEntry/from-outcome to-view-id/PagePriceNow.jsp/to-view-id /navigation-case Any Ideas will be great Thanks tonio
Re: Anonymous classes and restoreComponentState Exception
HtmlForm formMain = new HtmlForm(); . HtmlSelectOneMenu fCmbReferReason = new HtmlSelectOneMenu(); PmpLabel fLblVerbose = new PmpLabel(); HtmlInputTextarea fTaVerbose = new HtmlInputTextarea(); .. UISelectItems itmReferReason = new UISelectItems(); public PageReferReason() { } // = // Getter and Setters // = // Combo/List items public UISelectItems getItmReferReason() { return itmReferReason; } public void setItmReferReason(UISelectItems pList) { itmReferReason = pList; } // Page components public HtmlForm getForm() { return formMain; } public void setForm(HtmlForm pComp) { formMain = pComp; } public HtmlSelectOneMenu getReferReason() { return fCmbReferReason; } public void setReferReason(HtmlSelectOneMenu pComp) { fCmbReferReason = pComp; } public PmpLabel getLblVerbose() { return fLblVerbose; } public void setLblVerbose(PmpLabel pComp) { fLblVerbose = pComp; } public HtmlInputTextarea getVerbose() { return fTaVerbose; } public void setVerbose(HtmlInputTextarea pComp) { fTaVerbose = pComp; } . } public abstract class BasePageBean implements ItfControlledComp { public BasePageBean() { ... toolsActions(); } ... /** help option == */ private HtmlCommandButton _fbtnMainHelpBtn = new HtmlCommandButton(); public HtmlCommandButton getMainHelpBtn() { return this._fbtnMainHelpBtn; } public void setMainHelpBtn(HtmlCommandButton pMainHelpBtn) { this._fbtnMainHelpBtn = pMainHelpBtn; } /** logout option == */ private HtmlCommandButton _fbtnMainLogoutBtn = new HtmlCommandButton(); public HtmlCommandButton getMainLogoutBtn() { return this._fbtnMainLogoutBtn; } public void setMainLogoutBtn(HtmlCommandButton pMainLogoutBtn) { this._fbtnMainLogoutBtn = pMainLogoutBtn; } ... public void toolsActions() { _fbtnMainLogoutBtn.addActionListener(new ActionListener() { public void processAction(ActionEvent e) { enqueueUG(new UserGesture(UserGesture.SIGN_OUT,this,null)); } }); _fbtnMainHelpBtn.addActionListener(new ActionListener() { public void processAction(ActionEvent e) { enqueueUG(new UserGesture(UserGesture.HELP,this,null)); } }); } } --- ### - JSP PAGE --- f:view html .. body h:form onkeypress=return blockEnter(event); binding=#{PageReferReason.form} id=form div class=avivaLogo . h:commandButtonbinding=#{PageReferReason.mainLogoutBtn}/ . h:commandButtonbinding=#{PageReferReason.mainHelpBtn}/ . /div div class=mainDiv !-- Combo: PageReferReason.referReason -- h:selectOneMenu binding=#{PageReferReason.referReason} id=referReason f:selectItems id=itmReferReason binding=#{PageReferReason.itmReferReason}/ /h:selectOneMenu h:outputText binding=#{PageReferReason.lblVerbose} id=lblVerbose/ h:inputTextarea binding=#{PageReferReason.verbose} id=verbose/ .. /div /h:form .. /body /html /f:view -- Tonio Caputo [EMAIL PROTECTED] 4864-4154
Re: Anonymous classes and restoreComponentState Exception
On Thu, 2005-12-22 at 14:36, Dennis Byrne wrote: Is it trying to instantiate a BasePageBean directyly? I noticed that class is abstract? I don't know if this question is for me, but as for the application BasePageBean is not a JSF managed Bean, only the base class for all Page Classes. The Exception Message says: BasePageBean$1 (missing no-args constructor?) So the problem is with the anonymous listener classes in toolsAction() method. If it was not for me, sorry. -- Tonio Caputo [EMAIL PROTECTED] 4864-4154
Anonymous classes and restoreComponentState Exception
Hi, I'm having a big problem trying to use MyFaces. I have an application running with Java reference implementation all works ok. When I try to use it with MyFaces I'm getting this problem: javax.servlet.ServletException: Could not restore StateHolder of type com.avivacanada.pampa.util.jsf.BasePageBean$1 (missing no-args constructor?) Of course BasePageBean$1 is an anonymous class, no constructor in it. I will describe you some characteristics of my application that could help (of course if you need the source no problem) Every jsp has a java class java-page associated with it. They all extend BasePageBean, all components in the jsp are bound to a corresponding one in the java class. BasePageBean has a CommandButton common to all pages and it adds a listener to this command-button, this is the anonymous class that gives the problem. Any help will be welcomed thank you in advance -- Tonio Caputo [EMAIL PROTECTED] 4864-4154