t:columns openDataTable.jsp: openDataList -- request scope
Hello, When I change the backing bean openDataListto request scope, I got the exception when I click any header to sort. javax.servlet.ServletException: Cannot get value for _expression_ '#{openDataList.data}' If I set preserveDataModel=true or t:saveState value="#{openDataList.data}"/ or both, I still got the exception. What is wrong? When the backing bean is instantiated, its data model is created in the default constructor. Does the backing bean have to be session scope? Thanks for help. Dave Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
rendering a custom component
If I have inside of my encodeBegin method a UISelectOne object... how can I render it??
Re: t:columns data conversion
h:column or t:columns do not make any data conversion. The UIInput component does it. Can you post your jsp code? 2005/9/16, Dave [EMAIL PROTECTED]: Previously I used h:column with dataTable, data conversion was done by JSF between String/Integer, String/BigDecimal. When I changed it to use t:columns for variable number of columns, I got error. Cannot set value for expression '#{backingBean.columnValue}' to a new value of type java.lang.String In the backing bean: public Object getColumnValue(); public void setColumnValue(Object value); The value passed into setColumnValue() is always String. t:dataTable does not keep track of data type for each column and then convert data automatically. So I need to make data conversion in setColumnValue(Object value) for all columns. Am I correct? Thanks! Dave __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Mathias
Re: t:columns resource bundle
AFAIK the resource bundle is only loaded once. But this depends on the implementation for the resource boundle I think. 2005/9/15, Dave [EMAIL PROTECTED]: When I use t:columns for variable number of columns in dataTable, I need to call getResourceBundle() from ViewRoot, and then call resoucebundle.getString(Label). In JSP, I just use #{bundle.Label}. Is there any performance overhead? Is there a better way to display localized string from a backing bean such as for t:columns? I am trying to understand how JSP manage resource bundle? does JSF need to access disk everytime I call getResourceBundle() or everytime a page loads that declares a resouce bundle? or any cache going on? Thanks. Dave __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Mathias
Re: rendering a custom component
This code snippet from my last project should give you a good hint: HtmlOutputText iconDesc = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE); iconDesc.setValue(xxx); try { RendererUtils.renderChild(ctx, iconDesc ); } catch (IOException e){e.printStackTrace();} I hope this answered your question? 2005/9/16, Goyo Escobar Escalero [EMAIL PROTECTED]: If I have inside of my encodeBegin method a UISelectOne object... how can I render it?? -- Mit freundlichen Grüßen / Greetings, Hendrik Neumann
Re: PreserveDataModel behaviour (2)
Any comments? I think this is a serious issue...2005/9/15, Enrique Medina [EMAIL PROTECTED]: Hi again, I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner. Currently, I use a session scoped bean to work with my objects (e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess). >From my views (JSP), I simply use: t:dataTable .. value=#{sessionScopedWhateverBean.listOfObjectsAsListDataModel} So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here. The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase... When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object). When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object that was used to create the _SerializedDataModel object when saving the state. But with a definitive difference: the rowIndex from the event was set on the _SerializedDataModel object, not the one we have here now, i.e. our ListOfObjectsAsListDataModel object. And due to the fact that our ListOfObjectsAsListDataModel was used to create the _SerializedDataModel object, now it has its internal rowIndex attribute set to the last row plus one (obviously, as the saveState method iterates through the ListOfObjectsAsListDataModel list of objects to populate the _SerializedDataModel list of objects). At the end, the result is a call to setRowIndex(last row + 1), which obviously does not exist, so a IllegalArgumentException: row is unavailable is thrown. On the other hand, if I don't use preserveDataModel, everything works perfectly, as the ListOfObjectsAsListDataModel object is the one used to save the state (not the _SerializedDataModel). IMHO, the solution will be as simple as updating my ListOfObjectsAsListDataModel object with the _SerializedDataModel object when restoring the state. But I would like to hear the MyFaces' team experts about this possibility before going deeper into the code. Is it feasible? Is it possible to work with the preserveDataModel together with a DataModel inside my bean and the getRowData() method? Is the use od preserveDataModel incompatible with using the getRowData() method inside my bean? Looking forward to hearing your comments :-)
Re: PreserveDataModel behaviour (2)
Hi Martin, What does 'ev' stands for? One of the possible solutions I suggested was, the same way a new _SerializedDataModel is generated from the current data model (my own ListOfObjectsAsListDataModel), to assign the serialized data model to the original data model in the restoring data phase. Please also note that I also posted a solution to the problem of lazy loading in Hibernate through the use of a LazyListDataModel object via callback mechanisms (so this will also not work with preserveDataModel...).2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Well,the preserveDataModel feature was not programmed especially for thisuse, I would say. I understand your interest for such a usecase,though.Were I've got my problems is that with normal valueBindings for the dataTable, the model of the backing bean will not be used until therender response phase, instead the serialized data model will be used- for me this means that you will need to use the serialized datamodel in your backing bean as well. Why do you need to use your original model?can't you say ((UIData) ev.getParent().getParent()).getDataModel()?regards,MartinOn 9/15/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi again,I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner.Currently, I use a session scoped bean to work with my objects (e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess).From my views (JSP), I simply use:t:dataTable .. value=#{sessionScopedWhateverBean.listOfObjectsAsListDataModel} So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here.The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase...When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object).When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object that was used to create the _SerializedDataModel object when saving the state. But with a definitive difference: the rowIndex from the event was set on the _SerializedDataModel object, not the one we have here now, i.e. our ListOfObjectsAsListDataModel object. And due to the fact that our ListOfObjectsAsListDataModel was used to create the _SerializedDataModel object, now it has its internal rowIndex attribute set to the last row plus one (obviously, as the saveState method iterates through the ListOfObjectsAsListDataModel list of objects to populate the _SerializedDataModel list of objects).At the end, the result is a call to setRowIndex(last row + 1), which obviously does not exist, so a IllegalArgumentException: row is unavailable is thrown. On the other hand, if I don't use preserveDataModel, everything works perfectly, as the ListOfObjectsAsListDataModel object is the one used to save the state (not the _SerializedDataModel).IMHO, the solution will be as simple as updating my ListOfObjectsAsListDataModel object with the _SerializedDataModel object when restoring the state. But I would like to hear the MyFaces' team experts about this possibility before going deeper into the code. Is it feasible? Is it possible to work with the preserveDataModel together with a DataModel inside my bean and the getRowData() method? Is the use od preserveDataModel incompatible with using the getRowData() method inside my bean?Looking
Re: PreserveDataModel behaviour (2)
Hmm, but you can't restore the value if there is no DataModel you are binding to, but just a simple list, right? regards, Martin On 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi Martin, What does 'ev' stands for? One of the possible solutions I suggested was, the same way a new _SerializedDataModel is generated from the current data model (my own ListOfObjectsAsListDataModel), to assign the serialized data model to the original data model in the restoring data phase. Please also note that I also posted a solution to the problem of lazy loading in Hibernate through the use of a LazyListDataModel object via callback mechanisms (so this will also not work with preserveDataModel...). 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Well, the preserveDataModel feature was not programmed especially for this use, I would say. I understand your interest for such a usecase, though. Were I've got my problems is that with normal valueBindings for the dataTable, the model of the backing bean will not be used until the render response phase, instead the serialized data model will be used - for me this means that you will need to use the serialized data model in your backing bean as well. Why do you need to use your original model? can't you say ((UIData) ev.getParent().getParent()).getDataModel()? regards, Martin On 9/15/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi again, I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner. Currently, I use a session scoped bean to work with my objects (e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess). From my views (JSP), I simply use: t:dataTable .. value=#{sessionScopedWhateverBean.listOfObjectsAsListDataModel} So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here. The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase... When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object). When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object that was used to create the _SerializedDataModel object when saving the state. But with a definitive difference: the rowIndex from the event was set on the _SerializedDataModel object, not the one we have here now, i.e. our ListOfObjectsAsListDataModel object. And due to the fact that our ListOfObjectsAsListDataModel was used to create the _SerializedDataModel object, now it has its internal rowIndex attribute set to the last row plus one (obviously, as the saveState method iterates through the ListOfObjectsAsListDataModel list of objects to populate the _SerializedDataModel list of objects). At the end, the result is a call to setRowIndex(last row + 1), which obviously does not exist, so a IllegalArgumentException: row is unavailable is thrown. On the other hand, if I don't use preserveDataModel, everything works perfectly, as the ListOfObjectsAsListDataModel object is the one used to save the state (not the _SerializedDataModel).
Re: PreserveDataModel behaviour (2)
Well, my ListOfObjectsAsListDataModel is indeed a DataModel, binded through the value attribute of the tree component. But IMHO, if I used an HtmlDataTable object binded to the tree component, I would get the same result, as the _SerializedDataModel would be also created and used in the restore phase, instead of my original data model object, wouldn't it?2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Hmm,but you can't restore the value if there is no DataModel you arebinding to, but just a simple list, right?regards,MartinOn 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi Martin,What does 'ev' stands for?One of the possible solutions I suggested was, the same way a new _SerializedDataModel is generated from the current data model (my own ListOfObjectsAsListDataModel), to assign the serialized data model to the original data model in the restoring data phase.Please also note that I also posted a solution to the problem of lazy loading in Hibernate through the use of a LazyListDataModel object via callback mechanisms (so this will also not work with preserveDataModel...). 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Well, the preserveDataModel feature was not programmed especially for this use, I would say. I understand your interest for such a usecase, though. Were I've got my problems is that with normal valueBindings for the dataTable, the model of the backing bean will not be used until the render response phase, instead the serialized data model will be used - for me this means that you will need to use the serialized data model in your backing bean as well. Why do you need to use your original model? can't you say ((UIData) ev.getParent().getParent()).getDataModel()? regards, MartinOn 9/15/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi again,I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner.Currently, I use a session scoped bean to work with my objects ( e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess).From my views (JSP), I simply use:t:dataTable .. value=#{ sessionScopedWhateverBean.listOfObjectsAsListDataModel} So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here. The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase... When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object). When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object that was used to create the _SerializedDataModel object when saving the state. But with a definitive difference: the rowIndex from the event was set on the _SerializedDataModel object, not the one we have here now, i.e. our ListOfObjectsAsListDataModel object. And due to the fact that our ListOfObjectsAsListDataModel was used to create the _SerializedDataModel object, now it has its internal rowIndex attribute set to the last row plus one (obviously, as the saveState method iterates through the ListOfObjectsAsListDataModel list of objects to populate the _SerializedDataModel list of objects).At the end, the result is a call to setRowIndex(last row + 1), which obviously does not exist, so a
Re: PreserveDataModel behaviour (2)
So you are using a dataTable embedded in a tree? On 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Well, my ListOfObjectsAsListDataModel is indeed a DataModel, binded through the value attribute of the tree component. But IMHO, if I used an HtmlDataTable object binded to the tree component, I would get the same result, as the _SerializedDataModel would be also created and used in the restore phase, instead of my original data model object, wouldn't it? 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Hmm, but you can't restore the value if there is no DataModel you are binding to, but just a simple list, right? regards, Martin On 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi Martin, What does 'ev' stands for? One of the possible solutions I suggested was, the same way a new _SerializedDataModel is generated from the current data model (my own ListOfObjectsAsListDataModel), to assign the serialized data model to the original data model in the restoring data phase. Please also note that I also posted a solution to the problem of lazy loading in Hibernate through the use of a LazyListDataModel object via callback mechanisms (so this will also not work with preserveDataModel...). 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Well, the preserveDataModel feature was not programmed especially for this use, I would say. I understand your interest for such a usecase, though. Were I've got my problems is that with normal valueBindings for the dataTable, the model of the backing bean will not be used until the render response phase, instead the serialized data model will be used - for me this means that you will need to use the serialized data model in your backing bean as well. Why do you need to use your original model? can't you say ((UIData) ev.getParent().getParent()).getDataModel()? regards, Martin On 9/15/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi again, I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner. Currently, I use a session scoped bean to work with my objects ( e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess). From my views (JSP), I simply use: t:dataTable .. value=#{ sessionScopedWhateverBean.listOfObjectsAsListDataModel} So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here. The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase... When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object). When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object that was used to create the _SerializedDataModel object when saving the state. But with a definitive difference: the rowIndex from the event was set on the _SerializedDataModel object, not the one we have here now, i.e.
Re: PreserveDataModel behaviour (2)
Yes, I have a session scoped bean called UsuariosBean, which has defined a variable of type ListDataModel called usuariosDataModel. Then, in the JSP page, I have: t:tree2 id= value=#{usuariosBean.usuariosDataTable} ... So whenever the component needs the data model, it invokes my getUsuariosDataModel() method from my UsuariosBean, as obvious.2005/9/16, Martin Marinschek [EMAIL PROTECTED]:So you are using a dataTable embedded in a tree? On 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Well, my ListOfObjectsAsListDataModel is indeed a DataModel, binded through the value attribute of the tree component. But IMHO, if I used an HtmlDataTable object binded to the tree component, I would get the same result, as the _SerializedDataModel would be also created and used in the restore phase, instead of my original data model object, wouldn't it? 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: Hmm, but you can't restore the value if there is no DataModel you are binding to, but just a simple list, right? regards, Martin On 9/16/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi Martin,What does 'ev' stands for?One of the possible solutions I suggested was, the same way a new _SerializedDataModel is generated from the current data model (my own ListOfObjectsAsListDataModel), to assign the serialized data model to the original data model in the restoring data phase. Please also note that I also posted a solution to the problem of lazy loading in Hibernate through the use of a LazyListDataModel object via callback mechanisms (so this will also not work with preserveDataModel...). 2005/9/16, Martin Marinschek [EMAIL PROTECTED]:Well, the preserveDataModel feature was not programmed especially for thisuse, I would say. I understand your interest for such a usecase,though. Were I've got my problems is that with normal valueBindings for thedataTable, the model of the backing bean will not be used until therender response phase, instead the serialized data model will be used - for me this means that you will need to use the serialized datamodel in your backing bean as well. Why do you need to use your original model? can't you say ((UIData) ev.getParent().getParent()).getDataModel()? regards, Martin On 9/15/05, Enrique Medina [EMAIL PROTECTED] wrote: Hi again, I have investigated another interesting behaviour about using PreserveDataModel, which makes my application crash (due to the way I'm working with data tables). Let me explain it to you in a straight-forward manner.Currently, I use a session scoped bean to work with my objects ( e.g. one bean to work with customer objects, one bean to work with the users, etc), due to the fact that I don't want to loose state between requests (yes, I know it could have been done using t:saveState...). So within all my session beans, I have defined a ListDataModel variable that holds the data model that is presented to the view every time the view is rendered (nothing strange here, I guess). From my views (JSP), I simply use:t:dataTable .. value=#{ sessionScopedWhateverBean.listOfObjectsAsListDataModel } So whenever the view is rendered, the method public DataModel getListOfObjectsAsListDataModel() in my session scoped bean is invoked. Obviously, the first time it will be created, and the subsequent calls simply will return the existing object. Everything's fine here.The problem comes when using PreserveDataModel because, as explained in the wiki I posted about working with PreserveDataModel, every object in my listOfObjectsAsListDataModel is added to a new ArrayList belonging to a new _SerializedDataModel object, which is the object being really serialized when saving the state by the JspStateManagerImpl. And why is it the problem? Think about the future restoring phase... When a link is clicked inside the data table to work with a particular object, the event created as a consequence of the clicked link has the information about the exact row which has been clicked (specifically in its rowIndex attribute). Following, the state is restored, and the previously serialized data model (as a _SerializedDataModel object) is used to set the information about the clicked row. What does this mean? It's as simple as this: the clicked row information is set on the restored object, so it is really set on the _SerializedDataModel object (nothing to be with our original ListOfObjectsAsListDataModel object).When afterwards the broadcast calls our action method (the one associated with the link in the data table through usually an HtmlCommandLink tag), our session scoped bean has the original ListOfObjectsAsListDataModel object
Looking for a RBAC example with JSF
Hello, I'm looking for a RBAC example with JSF. JAAS, Custom RBAC are welcome. Thanks -- hicham ABASSI [EMAIL PROTECTED]
Re: [newbie] Forward to launch page
Thanks. But I've tried redirect already. Still the same problem. I also prefer to use path mapping as opposed to prefix mapping. I'm still baffled why this simple test won't work. I'll keep banging at it. The problem has to be something simple. /robert Thomas Spiegl wrote: You could use a redirect instead. If you are using extension mapping *.jsf the following redirect should work. % response.sendRedirect(response.encodeRedirectURL(/pages/launch.jsf)); % Thomas On 9/16/05, *Robert Taylor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config I keep getting a 404 error. The HTTP request is for /test/app/launch, but the 404 error indicates it cannot find /test/launch. The log files reflect the following: 2005-09-15 17:39:05,140 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering restoreView in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,187 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request 2005-09-15 17:39:05,234 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /launch 2005-09-15 17:39:05,312 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - Newly created view UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting restoreView in org.apache.myfaces.lifecycle.LifecycleImpl (-- render response) 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.webapp.webxml.WebXmlParser - adding mapping for servlet + Faces Servlet urlpattern = /app/* 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Dispatching to /launch 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - View after rendering UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl Any ideas, suggestions, RTFM, etc... would be helpful. I have read through the JSF spec. regarding the navigation and I still can't figure out what I have misconfigured. I even tried removing the from-view-id/launch/from-view-id altogether to make sure the navigaction-case/ would execute but still get the same error. /robert
Re: [newbie] Forward to launch page
Hi, your redirect path shoud be relative i.e. without the leading '/'. % response.sendRedirect(response.encodeRedirectURL(pages/launch.jsf)); % regards Robert Taylor wrote: Thanks. But I've tried redirect already. Still the same problem. I also prefer to use path mapping as opposed to prefix mapping. I'm still baffled why this simple test won't work. I'll keep banging at it. The problem has to be something simple. /robert Thomas Spiegl wrote: You could use a redirect instead. If you are using extension mapping *.jsf the following redirect should work. % response.sendRedirect(response.encodeRedirectURL(/pages/launch.jsf)); % Thomas On 9/16/05, *Robert Taylor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config I keep getting a 404 error. The HTTP request is for /test/app/launch, but the 404 error indicates it cannot find /test/launch. The log files reflect the following: 2005-09-15 17:39:05,140 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering restoreView in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,187 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request 2005-09-15 17:39:05,234 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /launch 2005-09-15 17:39:05,312 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - Newly created view UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting restoreView in org.apache.myfaces.lifecycle.LifecycleImpl (-- render response) 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.webapp.webxml.WebXmlParser - adding mapping for servlet + Faces Servlet urlpattern = /app/* 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Dispatching to /launch 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - View after rendering UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl Any ideas, suggestions, RTFM, etc... would be helpful. I have read through the JSF spec. regarding the navigation and I still can't figure out what I have misconfigured. I even tried removing the from-view-id/launch/from-view-id altogether to make sure the navigaction-case/ would execute but still get the same error. /robert -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by
[newbie] How to display dynamic content from a database
I would like to write a JSF-application that displays a data-list from a database.The amount of entries in that list, however, differs.My question is:I assume I have to place that data into the backing bean BEFORE the page is rendered. How do I do that? I actually have two use cases:Case 1: Upon its first call, a page has to display such a data list (so somehow I need to be able to place the data from the database into the backing bean BEFORE the page is displayed)Case 2: A page is called by another page which passes a key to the new page. The new page has to then use that key to query the database (Key can be a search criteria or such. It is usually an integer)How can that be done?ThanksEstherVerschicken Sie romantische, coole und witzige Bilder per SMS!Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
[newbie] How to pass a parameter from one page to another
If I have a commandLink or commandButton on one page to which I attach a value (e.g. an integer or even a bean) how can I pass that on to the next page so that the bean of the next page knows this value?ThanksVerschicken Sie romantische, coole und witzige Bilder per SMS!Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
[newbie] How to display dynamic content from a database
I would like to write a JSF-application that displays a data-list from a database. The amount of entries in that list, however, differs. My question is: I assume I have to place that data into the backing bean BEFORE the page is rendered. How do I do that? I actually have two use cases: Case 1: Upon its first call, a page has to display such a data list (so somehow I need to be able to place the data from the database into the backing bean BEFORE the page is displayed) Case 2: A page is called by another page which passes a key to the new page. The new page has to then use that key to query the database (Key can be a search criteria or such. It is usually an integer) How can that be done? Thanks scrut
Sorry for the double-post
Sorry I posted the last help request twice.To avoid spam, I usually use my hotmail account but the mailing list returned my mails as "undeliverable" so I posted them again with my "regular" web.de account.For some reason, one message from my hotmail account went through anyways.Sorry about thatYour help would be greatly appreciatedE.Verschicken Sie romantische, coole und witzige Bilder per SMS!Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
Antwort: URGENT! HELP ME! Tree2 state problem
You could set preserveToggle=false, but this is the general problem that the tree does not like dynamic changing tree structures, because the TreeState is not notified of the changes. I will propose a patch that will make the tree more tolerant to incompatible states, see MYFACES-568. [EMAIL PROTECTED] schrieb am 15.09.2005 14:56:15: Hi, I have a tree2 with showRootNode=true preserveToggle=true clientSideToggle=true. I describe my problem: 1) I open a JSP popup page with a tree2 (there are many nodes under the root); 2) I expand some node; 3) I close popup; 4) I reopen the popup with another tree2 that, in this case, has only the root because the datamodel is empty. When I open the page the following error occurs: Encountered a node 0 with an illogical state. Node is expanded but it is also considered a leaf (a leaf cannot be considered expanded.) When I populate the TreeNode the new TreeNodeBase is create as Leaf, and then, if it has at least a child, I set Leaf=false. I tried to set Leaf=false but the problem is not resolved. I tried to use collapsePath(0) in the backbean but it doesn't work. I think the tree attempts to restore the previous tree node state. Please everyone help me!!! Thank you
Re: [newbie] How to pass a parameter from one page to another
with a commandLink, you could use the f:param tag. A cool MyFaces specific feature is the t:updateActionListener tag - you can set a value onto a backing bean if a command has been executed. Another possibility is to write an actionListener instead of an action method and use the supplied ActionEvent to get to the component and e.g. to the dataModel of a wrapping dataTable. regards, MartinOn 9/16/05, Esther Leimbeck [EMAIL PROTECTED] wrote: If I have a commandLink or commandButton on one page to which I attach a value (e.g. an integer or even a bean) – how can I pass that on to the next page so that the bean of the next page knows this value? Thanks Verschicken Sie romantische, coole und witzige Bilder per SMS!Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 -- http://www.irian.atYour JSF powerhouse - JSF Trainings in English and German
Re: commandLink with action inside Table
Christian Froelich wrote the following on 9/16/2005 5:31 AM: h:column id=columnBrowsTab1 rendered=#{foo.secondBoolean} x:saveState id=listenerObid value=#{listener.obid}/ x:saveState id=fooObid value=#{foo.obid}/ h:commandLink id=TMIL action=#{listener.sort} value=#{foo.obid == 'obid'} rendered=#{foo.obid == 'obid'} / I'm stabbing in the dark here since this is all new to me also. It doesn't look ilke you need to saveState of listener since your rendered is only concerned with foo.obid == 'obid'. Try leaving off the first saveState and just put: x:saveState id=foo value=#{foo}/ Maybe you can have more than one saveState on a page and only the first one is getting called? Also make sure the bean backed by foo is serializable (at least I think it needs to be for saveState to work). -- Rick
WML RenderKit
Hi, are there any plans to take back WML RenderKit as a MyFaces subproject e.g. Waphawk? The RenderKit went away when the MyFaces project was reorganized... Thanks, Jiri
Re: URGENT! HELP ME! Tree2 state problem
Hi, Thank you very much for your answer. I hope the patch will includes in the nightly builds quickly. On 9/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You could set preserveToggle=false, but this is the general problem that the tree does not like dynamic changing tree structures, because the TreeState is not notified of the changes. I will propose a patch that will make the tree more tolerant to incompatible states, see MYFACES-568. [EMAIL PROTECTED] schrieb am 15.09.2005 14:56:15: Hi, I have a tree2 with showRootNode=true preserveToggle=true clientSideToggle=true. I describe my problem: 1) I open a JSP popup page with a tree2 (there are many nodes under the root); 2) I expand some node; 3) I close popup; 4) I reopen the popup with another tree2 that, in this case, has only the root because the datamodel is empty. When I open the page the following error occurs:Encountered a node 0 with an illogical state. Node is expanded but it is also considered a leaf (a leaf cannot be considered expanded.) When I populate the TreeNode the new TreeNodeBase is create as Leaf, and then, if it has at least a child, I set Leaf=false. I tried to set Leaf=false but the problem is not resolved. I tried to use collapsePath(0) in the backbean but it doesn't work. I think the tree attempts to restore the previous tree node state.Please everyone help me!!! Thank you
ELException with little explanation
I'm receiving an ELException that doesn't really explain what happened. It seems that managed-propertys aren't being set, and then this error occurs when getting a property. Stacktrace, faces-config.xml and ContainerLocatorObjectFactory.java follow. Sep 16, 2005 9:04:43 AM edu.cornerstone.portal.portlet.util.ContainerLocatorObjectFactory init FINE: constructed Sep 16, 2005 9:04:43 AM com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View javax.el.ELException: /file:/C:/Program Files/Apache Software Foundation/Tomcat 5.5/temp/11-PrintShopWorkOrder/WEB-INF/lib/Electronic Forms.jar!/view/index.xhtml: Bean: edu.cornerstone.portal.portlet.util.ContainerLocatorObjectFactory, property: object at com.sun.facelets.compiler.UIText.encodeBegin(UIText.java:51) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:441) at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427) at org.apache.myfaces.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:62) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:450) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:203) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:521) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:518) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:518) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:447) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300) at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:305) at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:280) at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:362) at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:248) at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:250) at javax.portlet.GenericPortlet.render(GenericPortlet.java:178) at edu.cornerstone.portal.portlet.util.MyFacesModalPortlet.render(MyFacesModalPortlet.java:38) at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:205) at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.pluto.core.PortletServlet.service(PortletServlet.java:140) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499) at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:120) at org.apache.pluto.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:73) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:105) at org.jasig.portal.channels.portlet.CPortletAdapter.getMarkup(CPortletAdapter.java:574) at org.jasig.portal.channels.portlet.CPortletAdapter.renderCharacters(CPortletAdapter.java:497) at org.jasig.portal.MultithreadedCharacterChannelAdapter.renderCharacters(MultithreadedCharacterChannelAdapter.java:41) at org.jasig.portal.channels.error.CError.renderCharacters(CError.java:564) at org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:477) at org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:27) at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:418) at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:165) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:660) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:685) at java.lang.Thread.run(Thread.java:595) relevant part of faces-config.xml: managed-bean
Re: WML RenderKit
Jiri, yes something like that needs to be done. can you help out on that? Since you created the wml render kit ;) -Matthias On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Hi, are there any plans to take back WML RenderKit as a MyFaces subproject e.g. Waphawk? The RenderKit went away when the MyFaces project was reorganized... Thanks, Jiri -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln
Re: [newbie] How to pass a parameter from one page to another
Martin Marinschek wrote the following on 9/16/2005 8:25 AM: A cool MyFaces specific feature is the t:updateActionListener tag - you can set a value onto a backing bean if a command has been executed. I'm very interested in seeing this tag used or some docs on it. I looked under the UpdateActionListenerTag docs http://myfaces.apache.org/javadoc/tomahawk/ and http://myfaces.apache.org/tlddoc/tomahawk/ but didn't find anything. Does one of the MyFaces examples show how it's used? -- Rick
RE: WML RenderKit
Yes, of course, I'm prepared to help with it;-) -Original Message- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Friday, September 16, 2005 3:30 PM To: MyFaces Discussion Subject: Re: WML RenderKit Jiri, yes something like that needs to be done. can you help out on that? Since you created the wml render kit ;) -Matthias On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Hi, are there any plans to take back WML RenderKit as a MyFaces subproject e.g. Waphawk? The RenderKit went away when the MyFaces project was reorganized... Thanks, Jiri -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln
Re: WML RenderKit
fine, open a jira ticket for all of your stuff I'll look at it! On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Yes, of course, I'm prepared to help with it;-) -Original Message- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Friday, September 16, 2005 3:30 PM To: MyFaces Discussion Subject: Re: WML RenderKit Jiri, yes something like that needs to be done. can you help out on that? Since you created the wml render kit ;) -Matthias On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Hi, are there any plans to take back WML RenderKit as a MyFaces subproject e.g. Waphawk? The RenderKit went away when the MyFaces project was reorganized... Thanks, Jiri -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln
Re: [newbie] Forward to launch page
Robert Taylor wrote the following on 9/15/2005 6:12 PM: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config How's it going Robert. Good to see you here:) I'm not totally sure of the interaction/effects of using .faces (assuming you have in you web.xml: servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping ) but what should work is jsp:forward page=/app/launch.faces/ navigation-rule navigation-case from-outcomeapp/launch/from-outcome to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule Someone please correct if what I'm doing above is the wrong approach (as I'm using it in the online example I wrote and I want to be doing the correct thing http://www.reumann.net/reumann/jsf/jsf_employees/ )
Re: WML RenderKit
We should adapt all this to the project structure. Where to put 'waphawk'? Bruno 2005/9/16, Matthias Wessendorf [EMAIL PROTECTED]: fine, open a jira ticket for all of your stuff I'll look at it! On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Yes, of course, I'm prepared to help with it;-) -Original Message- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Friday, September 16, 2005 3:30 PM To: MyFaces Discussion Subject: Re: WML RenderKit Jiri, yes something like that needs to be done. can you help out on that? Since you created the wml render kit ;) -Matthias On 9/16/05, Jiri Zaloudek [EMAIL PROTECTED] wrote: Hi, are there any plans to take back WML RenderKit as a MyFaces subproject e.g. Waphawk? The RenderKit went away when the MyFaces project was reorganized... Thanks, Jiri -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln
Re: ELException with little explanation
Dave Brondsema wrote: I'm receiving an ELException that doesn't really explain what happened. It seems that managed-propertys aren't being set, and then this error occurs when getting a property. Stacktrace, faces-config.xml and ContainerLocatorObjectFactory.java follow. Nevermind. My getter was protected instead of public. -- Dave Brondsema Software Developer Cornerstone University signature.asc Description: OpenPGP digital signature
Re: [newbie] How to pass a parameter from one page to another
If your bean is Serializable use t:saveState value=#{yourBean} / to make yourBean available on next page. regards, Thomas On 9/16/05, Rick Reumann [EMAIL PROTECTED] wrote: Martin Marinschek wrote the following on 9/16/2005 8:25 AM: A cool MyFaces specific feature is the t:updateActionListener tag - you can set a value onto a backing bean if a command has been executed. I'm very interested in seeing this tag used or some docs on it. I lookedunder the UpdateActionListenerTag docshttp://myfaces.apache.org/javadoc/tomahawk/ andhttp://myfaces.apache.org/tlddoc/tomahawk/but didn't find anything.Does one of the MyFaces examples show how it's used?--Rick
Re: [newbie] How to pass a parameter from one page to another
Thomas Spiegl wrote the following on 9/16/2005 10:14 AM: If your bean is Serializable use t:saveState value=#{yourBean} / That's not what I'm asking though. I'm asking about how to use the t:updateActionListener tag. I'm thinking the tag would be used inside of a commandLink or commandButton tag and when the action is fired that the link or button represents, it will automatically set and bean properties of the backing bean backing that action? If so, this would be a SUPERBLY nice feature. Currently, for example if you pass in parameters with a commandLink you need to do the following in the resulting action (assuming foo is the f:param): FacesContext context = FacesContext.getCurrentInstance(); Map map = context.getExternalContext().getRequestParameterMap(); String foo = (String) map.get(foo); I'm assuming that possibly t:updateActionListener would avoid this construct and that if you had a property in the Action called foo it would be automagically populated using the tag. This would be very nice - so nice, that I think it should be part of standard JSF. to make yourBean available on next page. regards, Thomas On 9/16/05, *Rick Reumann* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Martin Marinschek wrote the following on 9/16/2005 8:25 AM: A cool MyFaces specific feature is the t:updateActionListener tag - you can set a value onto a backing bean if a command has been executed. I'm very interested in seeing this tag used or some docs on it. I looked under the UpdateActionListenerTag docs http://myfaces.apache.org/javadoc/tomahawk/ and http://myfaces.apache.org/tlddoc/tomahawk/ but didn't find anything. Does one of the MyFaces examples show how it's used? -- Rick -- Rick
Shale Examples?
Are there any good examples of using Shale with MyFaces? In particular, I would like to see some examples of Clay so that I can better understand how this works. I am launching a new project in which JSF will be used and would like to put in place a good templating solution. Thanks, Brad
Re: [newbie] How to pass a parameter from one page to another
Rick, My answer was related to Esther Leimbeck's question. When using the updateActionListener nested inside a commandLink, the backing bean will automatically be updated. Have a look at the Master-Detail example: http://irian.at/myfaces/masterDetail.jsf http://irian.at/myfaces/masterDetail.jsp.source regards,Thomas http://www.irian.at Your JSF powerhouse - JSF Trainings in English and German On 9/16/05, Rick Reumann [EMAIL PROTECTED] wrote: Thomas Spiegl wrote the following on 9/16/2005 10:14 AM: If your bean is Serializable use t:saveState value=#{yourBean} /That's not what I'm asking though. I'm asking about how to use the t:updateActionListener tag. I'm thinking the tag would be used inside ofa commandLink or commandButton tag and when the action is fired that thelink or button represents, it will automatically set and bean properties of the backing bean backing that action? If so, this would be a SUPERBLYnice feature.Currently, for example if you pass in parameters with a commandLink youneed to do the following in the resulting action (assuming foo is the f:param):FacesContext context = FacesContext.getCurrentInstance();Map map = context.getExternalContext().getRequestParameterMap();String foo = (String) map.get(foo);I'm assuming that possibly t:updateActionListener would avoid this construct and that if you had a property in the Action called foo itwould be automagically populated using the tag. This would be very nice- so nice, that I think it should be part of standard JSF. to make yourBean available on next page. regards, Thomas On 9/16/05, *Rick Reumann* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: Martin Marinschek wrote the following on 9/16/2005 8:25 AM: A cool MyFaces specific feature is the t:updateActionListener tag - you can set a value onto a backing bean if a command has been executed. I'm very interested in seeing this tag used or some docs on it. I looked under the UpdateActionListenerTag docs http://myfaces.apache.org/javadoc/tomahawk/ and http://myfaces.apache.org/tlddoc/tomahawk/ but didn't find anything. Does one of the MyFaces examples show how it's used? -- Rick--Rick
Re: Shale Examples?
An alternative to Shale/Clay is facelets. You can find the documentation here: https://facelets.dev.java.net/nonav/docs/dev/docbook.html On 9/16/05, Bradley G Smith [EMAIL PROTECTED] wrote: Are there any good examples of using Shale with MyFaces? In particular, I would like to see some examples of Clay so that I can better understand how this works. I am launching a new project in which JSF will be used and would like to put in place a good templating solution. Thanks, Brad
validator question
I have a issue here, I define a validate method in backing bean dealerPricing, we need validate force user must input at least 2 non space letters, otherwise we may have legal issue, like somebody enter spaces instead enter nothing. So we can't use default request validator. I made a validator in bean. But we found my validator will never be called if we put required=ture; if I remove required=true, it will never be called when user enter nothing. I don't want create a customized validator for this simple issue. h:inputText id=whoShopped value=#{dealerPricing.dealerVehicle.whoShopped} validator = #{dealerPricing.validateWhoShopped} required=true rendered=#{!dealerPricing.isAA}/ Thanks.-- Zhong LiWebJabber.Net
Re: validator question
Does your submit button have immediate=true. If immediate is set to true the validation phase is skipped. Is that your problem? Bruno 2005/9/16, Zhong Li [EMAIL PROTECTED]: I have a issue here, I define a validate method in backing bean dealerPricing, we need validate force user must input at least 2 non space letters, otherwise we may have legal issue, like somebody enter spaces instead enter nothing. So we can't use default request validator. I made a validator in bean. But we found my validator will never be called if we put required=ture; if I remove required=true, it will never be called when user enter nothing. I don't want create a customized validator for this simple issue. h:inputText id=whoShopped value=#{dealerPricing.dealerVehicle.whoShopped} validator = #{dealerPricing.validateWhoShopped} required=true rendered=#{!dealerPricing.isAA}/ Thanks. -- Zhong Li WebJabber.Net
Re: validator question
If required=true and no data is provided, then validation isn't checked (there's nothing to validate). Instead, the component will throw a validation exception. If required=true and data is provided, then your validator will be run. -Mike On 9/16/05, Zhong Li [EMAIL PROTECTED] wrote: I have a issue here, I define a validate method in backing bean dealerPricing, we need validate force user must input at least 2 non space letters, otherwise we may have legal issue, like somebody enter spaces instead enter nothing. So we can't use default request validator. I made a validator in bean. But we found my validator will never be called if we put required=ture; if I remove required=true, it will never be called when user enter nothing. I don't want create a customized validator for this simple issue. h:inputText id=whoShopped value=#{dealerPricing.dealerVehicle.whoShopped} validator = #{dealerPricing.validateWhoShopped} required=true rendered=#{!dealerPricing.isAA}/ Thanks. -- Zhong Li WebJabber.Net
Re: Shale Examples?
From: Bradley G Smith [EMAIL PROTECTED] Are there any good examples of using Shale with MyFaces? In particular, I would like to see some examples of Clay so that I can better understand how this works. I am launching a new project in which JSF will be used and would like to put in place a good templating solution. There is an example webapp included in the nightly builds for Shale: http://svn.apache.org/builds/struts/nightly/struts-shale/ Take a look at the Clay View Use Cases - Rolodex example. -- Wendy Smoak
Re: [newbie] How to pass a parameter from one page to another
Thomas Spiegl wrote the following on 9/16/2005 11:08 AM: Rick, My answer was related to Esther Leimbeck's question. When using the updateActionListener nested inside a commandLink, the backing bean will automatically be updated. Have a look at the Master-Detail example: http://irian.at/myfaces/masterDetail.jsf http://irian.at/myfaces/masterDetail.jsp.source Awesome! Thanks Thomas! That tag is so cool. This really is the answer I think to all the questions on this list that come up when people are concerned about using request params in command links and then having to pull them out of the faces Context. Instead, this tag should be used imo. Saves lot of time is much cleaner. -- Rick
Re: [newbie] How to display dynamic content from a database
the MasterDetail covers your problem http://irian.at/myfaces/masterDetail.jsf http://irian.at/myfaces/masterDetail.jsp.source Just read the data from database, pack it into a java.util.List and pass it to your dataTable t:dataTable value=#{countryList.countries} ... where countryList.countries returns a List regards,Thomas http://www.irian.at Your JSF powerhouse - JSF Trainings in English and GermanOn 9/16/05, Esther Leimbeck [EMAIL PROTECTED] wrote: I would like to write a JSF-application that displays a data-list from a database. The amount of entries in that list, however, differs. My question is: I assume I have to place that data into the backing bean BEFORE the page is rendered. How do I do that? I actually have two use cases: Case 1: Upon its first call, a page has to display such a data list (so somehow I need to be able to place the data from the database into the backing bean BEFORE the page is displayed) Case 2: A page is called by another page which passes a "key" to the new page. The new page has to then use that "key" to query the database (Key can be a search criteria or such. It is usually an integer) How can that be done? Thanks Esther Verschicken Sie romantische, coole und witzige Bilder per SMS!Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
Re: [newbie] How to display dynamic content from a database
On 9/16/05, Esther Leimbeck [EMAIL PROTECTED] wrote: I would like to write a JSF-application that displays a data-list from a database. The amount of entries in that list, however, differs. My question is: I assume I have to place that data into the backing bean BEFORE the page is rendered. How do I do that? I actually have two use cases: Case 1: Upon its first call, a page has to display such a data list (so somehow I need to be able to place the data from the database into the backing bean BEFORE the page is displayed) Have a backing bean hold on to a Collection (or maybe a bean holding a Collection). You call a method in that backing bean that populates the collection when you click on a link or button. The resulting page you go to then just uses this Collection for the dislay. Case 2: A page is called by another page which passes a "key" to the new page. The new page has to then use that "key" to query the database (Key can be a search criteria or such. It is usually an integer) How can that be done? A couple ways. The cleanest solution seems to be using the updateActionListener tag that Thomas just introduced me to. So for example I have a link in a table that looks like... t:dataTable var=emp t:commandLink action=""> h:outputText value=#{msgs.edit} / t:updateActionListener property=#{employeeAction.employee.id} value=#{emp.id} / /t:commandLink In the backing bean employeeAction there is an employee reference. Clicking on the link above will set the Id of employee in my EmployeeAction's 'prepareForEdit' method. It's very nice.
Character scaping inside f:verbatim
Guys, even if scape is false, some international characters keep being scaped inside f:verbatim. For example, ç gets scaped to #231; This is correct inside normal html, and the browser displays the correct character. But it gets messed when JSF outputs _javascript_ that is inside a f:verbatim tag body. All my alert messages that are displayed comes with the escaped characters. Is this normal behaviour or am I doing something wrong? Thanks in advance, Ps.: MyFaces rocks :) Eduardo Bastos Leite Analista de Sistemas QuickMind Tecnologia em Conhecimento http://www.quickmind.com.br Tel.: +55 21 2524-2956 Ext. 215 Cel.: +55 21 9953-2223
Re: Shale Examples?
Thanks Wendy. I have looked this example over before. I was wondering if there were others that readers of this mailing list were aware of. Thank you, Brad Wendy Smoak [EMAIL PROTECTED] g To MyFaces Discussion 09/16/2005 09:23 users@myfaces.apache.org cc Please respond to Subject MyFaces Re: Shale Examples? Discussion [EMAIL PROTECTED] ache.org From: Bradley G Smith [EMAIL PROTECTED] Are there any good examples of using Shale with MyFaces? In particular, I would like to see some examples of Clay so that I can better understand how this works. I am launching a new project in which JSF will be used and would like to put in place a good templating solution. There is an example webapp included in the nightly builds for Shale: http://svn.apache.org/builds/struts/nightly/struts-shale/ Take a look at the Clay View Use Cases - Rolodex example. -- Wendy Smoak
Re: Shale Examples?
Since both Shale/Clay and Facelets are relatively new, are there any comparisons available? Brad Mike Kienenberger [EMAIL PROTECTED] omTo MyFaces Discussion 09/16/2005 08:14 users@myfaces.apache.org cc Please respond to Subject [EMAIL PROTECTED] Re: Shale Examples? m An alternative to Shale/Clay is facelets. You can find the documentation here: https://facelets.dev.java.net/nonav/docs/dev/docbook.html On 9/16/05, Bradley G Smith [EMAIL PROTECTED] wrote: Are there any good examples of using Shale with MyFaces? In particular, I would like to see some examples of Clay so that I can better understand how this works. I am launching a new project in which JSF will be used and would like to put in place a good templating solution. Thanks, Brad
t:columns How to render different UI for each column
Some column is boolean type, need a h:selectBooleanCheckbox some column is choice, need a h:selectOneMenu The openDataTable.jsp example uses a flag to render h:inputText or h:outputText. but what is the way to render different UIcomponent for each column? Thanks. t:columns id="columns" value="#{openDataList.columnHeaders}" var="columnHeader" style="width:#{openDataList.columnWidth}px" f:facet name="header" t:commandSortHeader columnName="#{columnHeader.label}" arrow="false" immediate="false" f:facet name="ascending" t:graphicImage value="images/ascending-arrow.gif" rendered="true" border="0"/ /f:facet f:facet name="descending" t:graphicImage value="images/descending-arrow.gif" rendered="true" border="0"/ /f:facet h:outputText value="#{columnHeader.label}" / /t:commandSortHeader /f:facet !-- row is also available -- h:inputText rendered="#{openDataList.valueModifiable}" value="#{openDataList.columnValue}" / h:outputText rendered="#{!openDataList.valueModifiable}" value="#{openDataList.columnValue}" / /t:columns Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
Re: [newbie] How to pass a parameter from one page to another
If you like it, you might want to document it ;) regards, Martin On 9/16/05, Rick Reumann [EMAIL PROTECTED] wrote: Thomas Spiegl wrote the following on 9/16/2005 11:08 AM: Rick, My answer was related to Esther Leimbeck's question. When using the updateActionListener nested inside a commandLink, the backing bean will automatically be updated. Have a look at the Master-Detail example: http://irian.at/myfaces/masterDetail.jsf http://irian.at/myfaces/masterDetail.jsp.source Awesome! Thanks Thomas! That tag is so cool. This really is the answer I think to all the questions on this list that come up when people are concerned about using request params in command links and then having to pull them out of the faces Context. Instead, this tag should be used imo. Saves lot of time is much cleaner. -- Rick -- http://www.irian.at Your JSF powerhouse - JSF Trainings in English and German
Re: [newbie] How to pass a parameter from one page to another
Man, what a awesome example this master detail. Best Regards Rafael Mauricio Nami 2005/9/16, Martin Marinschek [EMAIL PROTECTED]: If you like it, you might want to document it ;) regards, Martin On 9/16/05, Rick Reumann [EMAIL PROTECTED] wrote: Thomas Spiegl wrote the following on 9/16/2005 11:08 AM: Rick, My answer was related to Esther Leimbeck's question. When using the updateActionListener nested inside a commandLink, the backing bean will automatically be updated. Have a look at the Master-Detail example: http://irian.at/myfaces/masterDetail.jsf http://irian.at/myfaces/masterDetail.jsp.source Awesome! Thanks Thomas! That tag is so cool. This really is the answer I think to all the questions on this list that come up when people are concerned about using request params in command links and then having to pull them out of the faces Context. Instead, this tag should be used imo. Saves lot of time is much cleaner. -- Rick -- http://www.irian.at Your JSF powerhouse - JSF Trainings in English and German -- Java - Assim no Server como no Palm iJava - thus in the Server as it is in Palm
Re: [newbie] Forward to launch page
Hey Rick! It's nice to see a familiar name. Nice JSF example on your site. I'm using it to see where the heck I'm screwing up. Here's my directory set up: /index.jsp /css /images /javascript /pages/launch.jsp /WEB-INF Here's a snippet from my web.xml - snip servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping /snip Here's a snippet from my faces-context.xml file. This is really the only thing I have in it besides the doctype. -- faces-config navigation-rule navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config Here's my index.jsp file: -- jsp:forward page=/launch.faces/ This set up produces a 404 error: --- HTTP Status 404 - /launch.jsp type Status report message /launch.jsp description The requested resource (/launch.jsp) is not available. Notices there is no mention of /pages directory in the error message. Now, if I copy or move the /pages/lauch.jsp to /launch.jsp AND make no other changes, redeploy. The page is found and is rendered. As long as launch.jsp resides directly under the webapp root context, I can even change to-view-id/pages/launch.jsp/to-view-id to to-view-id/launch.jsp/to-view-id and it is found. It's as if the /pages part of the view-id is being stripped out. I'm going to have a look at the source in org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl to see if I can tell what's happening. Any ideas? Have you seen any examples where the pages reside in a subdirectory instead of directly under the web app root context? I running Tomcat 5.5.9, JDK 1.4.2, on Win2K, with MyFaces 1.0.9. /robert Rick Reumann wrote: Robert Taylor wrote the following on 9/15/2005 6:12 PM: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config How's it going Robert. Good to see you here:) I'm not totally sure of the interaction/effects of using .faces (assuming you have in you web.xml: servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping ) but what should work is jsp:forward page=/app/launch.faces/ navigation-rule navigation-case from-outcomeapp/launch/from-outcome to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule Someone please correct if what I'm doing above is the wrong approach (as I'm using it in the online example I wrote and I want to be doing the correct thing http://www.reumann.net/reumann/jsf/jsf_employees/ )
Re: [newbie] Forward to launch page
Well I believe your index page of: jsp:forward page=/launch.faces/ Is going to try to find /launch.jsp in the root but you don't have launch there so make it: jsp:forward page=/pages/launch.faces/ and you should be all set. Also this rule: navigation-rule navigation-caseto-view-id/pages/launch.jsp/to-view-id /navigation-case/navigation-rule I don't think will do anything since you don't have a from-outcome defined, so I'm not sure what the above will ever do. I think you are expecting the to-view-id to fire based on the forward set up in your index, but that's not the case since that forward is going to try to resolve to a jsp (which doesn't exist in your root).
Re: [newbie] Forward to launch page
From: Robert Taylor [EMAIL PROTECTED] /pages/launch.jsp jsp:forward page=/launch.faces/ What happens if you use: jsp:forward page=/pages/launch.faces / ? I don't think the navigation rules are coming into play at all, this is just strip off the .faces extension and look for a .jsp with the same name. The requested resource (/launch.jsp) is not available. Notices there is no mention of /pages directory in the error message. ... and that makes sense to me, because you told it to forward to /launch.faces, so it's looking for /launch.jsp. -- Wendy Smoak
Re: [newbie] How to pass a parameter from one page to another
On 9/16/05, Martin Marinschek [EMAIL PROTECTED] wrote: If you like it,you might want to document it ;) Created a wiki entry here on it, plus some other techniques. I'm sure I made some mistakes so any corrections welcome. http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters -- Rick