How to bind value in a dynamic way?
I have a definition list of properties in object. In input component, I can use #{object[propertyName]} in the value attribute for value binding. Which protperyName is get from definition list in a forEach loop conidition. It works fine with property in object self,but when there is a composition in base object, Say object a have a filed object b, which object b contains many other fields. It faild in #{object[propertyName]} , as it should be #{object[propertyB][propertyName]}, How to put value binding dynamiclly? -- Anthony Hong
Tree2 question: How to retrieve entire path of current selected node?
Currently, when I click leaf node, a navigation is made to a new page. I want to know the whole path by this leaf node. I saw there is no method provided for retrieve parent by current tree node or tree state. Please help. Thanks -- Anthony Hong
Tree2 Navigation with iframe
I have a template, which left side is a tree component and right side is displaying zone. I want to render what tree node selected page in right div body zone. How can I achieve this? I to write following code in my node action method HttpServletResponse response = (HttpServletResponse) super.getExternalContext().getResponse(); response.setContentType(text/html); response.getWriter().write(scriptdocument.getElementById('innerFrameId').src='newPage.jsf';/script); super.getFacesContext().responseComplete(); But it didn't work, javascript error shown 'innerFrameId' can not be found.I already defined in page. Am I right? If I don't use iframe to display div body, each time working place have actions, tree data have to be reloaded. Any other alternative can I use? I found each time tree load nodes, backend getTreeNode function will be invoked more than once, Can I prevent it form repeatly loading? I think I cann't define a property in my backing bean, otherwise my tree node data is not refreshed. How to solve this problem -- Anthony Hong
Re: Tree2 Navigation with iframe
Thanks Andrew Robinson. But I have problem with both options. For 1. Tree panel is not refreshed, as page displaying in frame. For 2. Page displayed in div body zone also have to be used in ajax way, otherwise, The whole page refreshed, tree will be reloaded. Any advice. On 11/28/06, Andrew Robinson [EMAIL PROTECTED] wrote: My suggestions: 1) create outputLinks instead of commandLinks with a target specified in the tree instead of using actions -or- 2) use an AJAX framework like Ajax4Jsf and make the right side refreshed when the tree is clicked and don't use IFRAMEs -Andrew On 11/28/06, Anthony Hong [EMAIL PROTECTED] wrote: I have a template, which left side is a tree component and right side is displaying zone. I want to render what tree node selected page in right div body zone. How can I achieve this? I to write following code in my node action method HttpServletResponse response = (HttpServletResponse) super.getExternalContext().getResponse(); response.setContentType(text/html); response.getWriter().write(scriptdocument.getElementById('innerFrameId').src='newPage.jsf';/script); super.getFacesContext().responseComplete(); But it didn't work, javascript error shown 'innerFrameId' can not be found.I already defined in page. Am I right? If I don't use iframe to display div body, each time working place have actions, tree data have to be reloaded. Any other alternative can I use? I found each time tree load nodes, backend getTreeNode function will be invoked more than once, Can I prevent it form repeatly loading? I think I cann't define a property in my backing bean, otherwise my tree node data is not refreshed. How to solve this problem -- Anthony Hong -- Anthony Hong
Re: Does myfaces has grid component?
Where can I get it? Can you provide a url? On 9/26/06, Werner Punz [EMAIL PROTECTED] wrote: Volker Weber schrieb: The sheet component of tobago has dynamic coulumn resizing, but unfortunately you can't use tobago in combination with other jsf component libs. The live demo of tobagos sheet: http://tobago.atanion.net/tobago-example-demo/faces/overview/sheetControl.jsp Not really grid, but I recently committed a dynamic dhtml split pane into the sandbox... It is not fully finished yet but you can use it. (The state saving has to be moved from cookie state saving to jsf statesaving due to visual issues) -- Anthony Hong
Does myfaces has grid component?
Currently I use tomahawk t:dataTable component. I'd like something like activewidget grid component. Is there an existing components I can use? If not, how to add column sizing function to table column -- Anthony Hong
Re: Does myfaces has grid component?
I mean dynamic column sizing. On 9/25/06, Andrew Robinson [EMAIL PROTECTED] wrote: t:column style=width: 150px/t:column ? On 9/24/06, Anthony Hong [EMAIL PROTECTED] wrote: Currently I use tomahawk t:dataTable component. I'd like something like activewidget grid component. Is there an existing components I can use? If not, how to add column sizing function to table column -- Anthony Hong -- Anthony Hong
How to have dojo dialog functions in popup JSF component?
Currently I use jenia4faces popup component, which works fine for me. But customer want to block backend pages to force user input something in popup page. I saw javascript dialog in dojo. Is there any available components exist in JSF? That popup like dojo dialog on operate in jenia4faces components, which means interact JSF backing seperately in popup window without affact main window. -- Anthony Hong
Re: How to display exception trace in detail in JSF application
Yes, I did follow the first solution, But it didn't work. On 7/17/06, Mario Ivankovits [EMAIL PROTECTED] wrote: Anthony Hong schrieb: The detail of stack trace is not complete, I can only know the root cause by application server's log file. Any idea of my problem? Please have a look at: http://wiki.apache.org/myfaces/Handling_Server_Errors Ciao, Mario -- Anthony Hong
How to display exception trace in detail in JSF application
In JSF system, there is commonly to use a page bean + view page. We implements controller logic and fetch model from backend to support view. If there is anything wrong during interact with backend, exception will be thrown, The detail of stack trace is not complete, I can only know the root cause by application server's log file. Currently I use weblogic9 + my faces 1.3 + facelet. Here is a example. I have a add button in page, after clicking it, it save page model to backend. Suppose there is exception thrown in backend (Unexpected) The exception stack trace shown in console is all about JSF component, which is not written by myself. Only to have to open weblogic server.log to see more deep exception error trace that shows which source code method throws Any idea of my problem? -- Anthony Hong
immediate attribute of t:commandSortHeader doesn't work with value = false
As javadoc describe that commandSortHeader default immediate=true, If I want to set it to false. I still can not get updated value from page. Anyone who has successful on this component? As for default behavior, I have two column a, b. Each time click column, it will request my backingbean function sort, to sort list for displaying. I click a, it header shows asc, it sorts for previous column name due to immediate attribute=true, I can not get the updated value -- Anthony Hong
Re: immediate attribute of t:commandSortHeader doesn't work with value = false
When I click sortHead, DataTable set sort column as previous not current clicking column head, Is this correct? What I suppose is click on which column, sorting on that one On 7/6/06, Anthony Hong [EMAIL PROTECTED] wrote: As javadoc describe that commandSortHeader default immediate=true, If I want to set it to false. I still can not get updated value from page. Anyone who has successful on this component? As for default behavior, I have two column a, b. Each time click column, it will request my backingbean function sort, to sort list for displaying. I click a, it header shows asc, it sorts for previous column name due to immediate attribute=true, I can not get the updated value -- Anthony Hong -- Anthony Hong
required attribute of h:inputText consider space as valid value
h:inputText can set required attribute to true, that means this field is a mandatory fields. But it does not trim string before validation. So an empty space also a valid value for input text with required attribute. How to solve this problem, that I do not have to add trim string function in javascript one by one. Any idea? Thanks -- Anthony Hong
Re: required attribute of h:inputText consider space as valid value
Is it possible to modify current required validation that I do not have to change anything. On 7/4/06, Dennis Byrne [EMAIL PROTECTED] wrote: Anthony, Try writing a custom validator ... something like IsEmptyValidator. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 4, 2006 12:09 AM To: 'MyFaces Discussion' Subject: required attribute of h:inputText consider space as valid value h:inputText can set required attribute to true, that means this field is a mandatory fields. But it does not trim string before validation. So an empty space also a valid value for input text with required attribute. How to solve this problem, that I do not have to add trim string function in javascript one by one. Any idea? Thanks -- Anthony Hong -- Anthony Hong
Re: javax.faces.STATE_SAVING_METHOD doesn't work for form submting
Really? Rogerio, Currently I use facelte 1.15. Do you know which version works? On 6/17/06, pokkie [EMAIL PROTECTED] wrote: Actually I am not using facelets, but in my case I believe the problem is that my component is embedded within a tabbedPanel -- View this message in context: http://www.nabble.com/javax.faces.STATE_SAVING_METHOD-doesn%27t-work-for-form-submting-t1679622.html#a4913792 Sent from the MyFaces - Users forum at Nabble.com. -- Anthony Hong
How to make reset command button clear all form fields
Hi all, Jsf has a command button with type=reset that can reset current form components to the latest state. How can I make this reset button to clear all fields with empty value under this form. Is it the only way I have to write a action method and clear fields in page bean one by one? And Can I re-new a page bean when I required? If can, how to achieve this -- Anthony Hong
Is it possible to know which action is fired from facesContext?
If I have a h:commandButton or link with action, which there is MethodBinding with it. When submit form, How could I know which action is being trigged? -- Anthony Hong
Re: How to redirect to an error page when JSF page failed
Thanks, That's a useful resource On 5/29/06, Mert Çalışkan [EMAIL PROTECTED] wrote: This could be a solution for you. http://www.jroller.com/page/mert?entry=handling_errors_with_an_errror Regards, Mert On 5/26/06, Anthony Hong [EMAIL PROTECTED] wrote: In jsp with servlet, I define error page configuration in web.xml to redirect to an error page when error occured. error-page exception-typejava.lang.Exception/exception-type location/errorpages/error500.jsp/location /error-page But in JSF page, it doesn't work. How should I configurate? -- Anthony Hong -- Anthony Hong
Re: Is it possible to know which action is fired from facesContext?
I know the phase. But I don't know what is being sent when submit form for an action. Which paramter should I request from requestMap On 5/30/06, Ricardo Ramírez [EMAIL PROTECTED] wrote: like, know in what phase? You could know because that action method is being invoked... On Mon, 2006-05-29 at 14:20 +0800, Anthony Hong wrote: If I have a h:commandButton or link with action, which there is MethodBinding with it. When submit form, How could I know which action is being trigged? -- Anthony Hong
JSF authorization problem
I saw many myfaces component with role check. I have a question. If a page need to distinct read and write permission. They are the same page. For read operation, I can set action button (Add, submit) to rendered=false; Is it possible, that some one send a quest via some tool as write permission(a user with read permission send update command ). As there are the same view id, how can I distrinct what action it is request. Can I know the action for a view when submmiting? -- Anthony Hong
Re: How to redirect to an error page when JSF page failed
Hi Julian, Can you give me the link of dicussion this problem? That will be nice If any example I can read. Thanks. On 5/26/06, Julian Ray [EMAIL PROTECTED] wrote: This is in our web.xml error-page error-code500/error-code location/ErrorDisplay.jsf/location /error-page But there is a bug in the JSF framework which requires the error page to use a f:subview rather than a f;view tag. There is a good discussion on this in the MyFaces book. -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 9:38 PM To: MyFaces Discussion Subject: How to redirect to an error page when JSF page failed In jsp with servlet, I define error page configuration in web.xml to redirect to an error page when error occured. error-page exception-typejava.lang.Exception/exception-type location/errorpages/error500.jsp/location /error-page But in JSF page, it doesn't work. How should I configurate? -- Anthony Hong -- Anthony Hong
Re: How to redirect to an error page when JSF page failed
I use facelet, that means error page should be written in JSF instead of another web page? On 5/26/06, Julian Ray [EMAIL PROTECTED] wrote: This is in our web.xml error-page error-code500/error-code location/ErrorDisplay.jsf/location /error-page But there is a bug in the JSF framework which requires the error page to use a f:subview rather than a f;view tag. There is a good discussion on this in the MyFaces book. -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 9:38 PM To: MyFaces Discussion Subject: How to redirect to an error page when JSF page failed In jsp with servlet, I define error page configuration in web.xml to redirect to an error page when error occured. error-page exception-typejava.lang.Exception/exception-type location/errorpages/error500.jsp/location /error-page But in JSF page, it doesn't work. How should I configurate? -- Anthony Hong -- Anthony Hong
javax.faces.STATE_SAVING_METHOD doesn't work for form submting
I use myfaces with facelet. I have a problem with javax.faces.STATE_SAVING_METHOD If a use STATE_SAVING_METHOD=client everything works fine. If a change STATE_SAVING_METHOD=server. page can be displayed. But for form submit that invokes backend action function. It doesn't work. But there is no error shown on page even I use h:messages/ or in backend console. What's the problem with my web application? Following is my web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameRazorsight/display-name !-- Use Documents Saved as *.xhtml -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param context-param param-namefacelets.LIBRARIES/param-name param-value/WEB-INF/facelets/tomahawk.taglib.xmlparam-value /context-param !-- Special Debug Output for Development -- context-param param-namefacelets.DEVELOPMENT/param-name param-valuetrue/param-value /context-param context-param param-namefacelets.REFRESH_PERIOD/param-name param-value2/param-value /context-param context-param param-namejavax.faces.CONFIG_FILES/param-name param-value/WEB-INF/faces-config-global.xml,/WEB-INF/faces-config-beans.xml,/WEB-INF/faces-config-navigation.xml,/param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param context-param description This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output. If javascript is allowed, command_link anchors will have javascript code that submits the corresponding form. If javascript is not allowed, the state saving info and nested parameters will be added as url parameters. Default: true /description param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.DETECT_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param description If true, rendered HTML code will be formatted, so that it is human readable. i.e. additional line separators and whitespace will be written, that do not influence the HTML code. Default: true /description param-nameorg.apache.myfaces.PRETTY_HTML/param-name param-valuetrue/param-value /context-param context-param description If true, a javascript function will be rendered that is able to restore the former vertical scroll on every request. Convenient feature if you have pages with long lists and you do not want the browser page to always jump to the top if you trigger a link or button action that stays on the same page. Default: false /description param-nameorg.apache.myfaces.AUTO_SCROLL/param-name param-valuetrue/param-value /context-param filter filter-nameextensionsFilter/filter-name filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class init-param descriptionSet the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadMaxFileSize/param-name param-value2m/param-value /init-param init-param descriptionSet the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadThresholdSize/param-name param-value64k/param-value /init-param /filter filter-mapping filter-nameextensionsFilter/filter-name url-pattern*.jsf/url-pattern /filter-mapping filter-mapping filter-nameextensionsFilter/filter-name url-pattern/faces/*/url-pattern /filter-mapping !-- Faces Servlet -- servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet !-- extension mapping -- servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.jsf/url-pattern /servlet-mapping welcome-file-list welcome-filelogin.jsf/welcome-file /welcome-file-list /web-app -- Anthony Hong
How to redirect to an error page when JSF page failed
In jsp with servlet, I define error page configuration in web.xml to redirect to an error page when error occured. error-page exception-typejava.lang.Exception/exception-type location/errorpages/error500.jsp/location /error-page But in JSF page, it doesn't work. How should I configurate? -- Anthony Hong
Can one JSF page with three forms which work separately?
I have a web page with three form in each div, say: div 1: base information div 2: address information div 3: phone information. Each of them is a list table with add, edit, delete function. Can I operator each div in one page like I processing each jsf page in a div? I think this should with ajax supports, right? If it can be achieved, which ajax framework supports well with myfaces to achieves my goad. Thanks -- Anthony Hong
Re: Can one JSF page with three forms which work separately?
I also need page navigation in each div. Example: In div address information, Click Add button will display add form page. But others two divs are not changed Can sandbox supports this? I doesn't see Myfaces demo. It describes in multiplue form saving partial. I guess my requirement can not be fullfilled On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: Sandbox has two components which may help you, s:commandButtonAjax and s:subForm. regards.. On 5/22/06, Anthony Hong [EMAIL PROTECTED] wrote: I have a web page with three form in each div, say: div 1: base information div 2: address information div 3: phone information. Each of them is a list table with add, edit, delete function. Can I operator each div in one page like I processing each jsf page in a div? I think this should with ajax supports, right? If it can be achieved, which ajax framework supports well with myfaces to achieves my goad. Thanks -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong
Re: Can one JSF page with three forms which work separately?
:- ( I have the same problem. I tired it yesterday, It doesn't work for me. On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: if they don't fillfull your request you can try ajaxanywhere [1]. (but i couldn't make it work with latest myfaces and tomahawk). [1] http://ajaxanywhere.sourceforge.net/ regards... On 5/23/06, Anthony Hong [EMAIL PROTECTED] wrote: I also need page navigation in each div. Example: In div address information, Click Add button will display add form page. But others two divs are not changed Can sandbox supports this? I doesn't see Myfaces demo. It describes in multiplue form saving partial. I guess my requirement can not be fullfilled On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: Sandbox has two components which may help you, s:commandButtonAjax and s:subForm. regards.. On 5/22/06, Anthony Hong [EMAIL PROTECTED] wrote: I have a web page with three form in each div, say: div 1: base information div 2: address information div 3: phone information. Each of them is a list table with add, edit, delete function. Can I operator each div in one page like I processing each jsf page in a div? I think this should with ajax supports, right? If it can be achieved, which ajax framework supports well with myfaces to achieves my goad. Thanks -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong
When Can I can the latest tomahawk example source code
I want to know how to write jsCookMenu in backend. Thanks t:jscookMenu id=menu2 layout=hbr theme=ThemeOffice styleLocation=css/jscookmenu t:navigationMenuItems id=navitems value=#{navigationMenu.panelNavigationItems} / /t:jscookMenu -- Anthony Hong
Re: When Can I can the latest tomahawk example source code
I have found how to use this example integrate with facelt. Menu looks well. But I don't know what should I put into action argument, what I put into there doesn't decode correct in html page NavigationMenuItem vendorManagement = new NavigationMenuItem(Vendor Management, null); NavigationMenuItem vendor = new NavigationMenuItem(Vendors, page_vendor); vendor.setTarget(_self); vendorManagement.add(vendor); vendorManagement.add(new NavigationMenuItem(Split,null,null,true)); vendorManagement.add(new NavigationMenuItem(OCN,null)); NavigationMenuItem missingInvoice = new NavigationMenuItem(Missing invoice, null); menuList.add(vendorManagement); menuList.add(missingInvoice); What page shows is: var menuComp_menu = [ [null, 'Vendor Management', null, 'linkDummyForm', null, [null, 'Vendors', 'menuComp_menu:A]page_vendor', 'linkDummyForm', null], _cmSplit, [null, 'Split', null, 'linkDummyForm', null], [null, 'OCN', null, 'linkDummyForm', null]], [null, 'Missing invoice', null, 'linkDummyForm', null]]; It doesn't correct. what's wrong with my code On 5/23/06, Anthony Hong [EMAIL PROTECTED] wrote: I want to know how to write jsCookMenu in backend. Thanks t:jscookMenu id=menu2 layout=hbr theme=ThemeOffice styleLocation=css/jscookmenu t:navigationMenuItems id=navitems value=#{navigationMenu.panelNavigationItems} / /t:jscookMenu -- Anthony Hong -- Anthony Hong
JSCookMenu doesn't work with latest tomahawk and myfaces
I use myfaces 1.1.3 and tomahawk 1.1.2 and facelt 1.1.4 I use jsCookMenu in dynamic way. My code NavigationMenuItem(lable, action). I put method binding express in action. Menu can be build successfully. But action doesn't work. click it will open a new window and do nothing. And I couldn't provide a link directly. Doesn't new version of tomahawk will solve this problem? If I have to use it know, what should I do? -- Anthony Hong
Re: Can one JSF page with three forms which work separately?
Any example you can show for me, Andrew? Ajaxanywhere is lack of documents On 5/23/06, Andrew Robinson [EMAIL PROTECTED] wrote: I have it working fine and with server side zones, but I don't directly use AAUtils. I created ajaxCommandLink and ajaxCommandButton controls for my use, that take an ajaxZone attribute on the components. On the decode of these items, I queue a custom event, that simply adds the zones to the response. This way the view still dictates the zones, but the code runs on the server, and there is no messy javascript to worry about. I also use 1.1.0.6 because I couldn't get 1.2 to work. -Andrew On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: I talked with someone who successfully uses ajaxanaywhere with latest myfaces, only difference between me and him is he defines the zones to be refreshed on the server side, i define them on the client side. I don't want to put ajaxanywhere related ( AAutils.()) java code to my backing beans. May be you can try server side code, it may work, then you can inform as it worked or not. regards... On 5/23/06, Anthony Hong [EMAIL PROTECTED] wrote: :- ( I have the same problem. I tired it yesterday, It doesn't work for me. On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: if they don't fillfull your request you can try ajaxanywhere [1]. (but i couldn't make it work with latest myfaces and tomahawk). [1] http://ajaxanywhere.sourceforge.net/ regards... On 5/23/06, Anthony Hong [EMAIL PROTECTED] wrote: I also need page navigation in each div. Example: In div address information, Click Add button will display add form page. But others two divs are not changed Can sandbox supports this? I doesn't see Myfaces demo. It describes in multiplue form saving partial. I guess my requirement can not be fullfilled On 5/23/06, Murat Hazer [EMAIL PROTECTED] wrote: Sandbox has two components which may help you, s:commandButtonAjax and s:subForm. regards.. On 5/22/06, Anthony Hong [EMAIL PROTECTED] wrote: I have a web page with three form in each div, say: div 1: base information div 2: address information div 3: phone information. Each of them is a list table with add, edit, delete function. Can I operator each div in one page like I processing each jsf page in a div? I think this should with ajax supports, right? If it can be achieved, which ajax framework supports well with myfaces to achieves my goad. Thanks -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong -- Murat HAZER Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer Tel - Phone: +90 222 335 05 80 - 1395 Cep Tel - Mobile Phone: +90 532 472 00 63 Blog URL: http://www.projedunyasi.org Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/ -- Anthony Hong
Re: Issues with refresh page in JSF
Is that means all JSF request are post method, and if user click refresh button or F5 a get method is sent? On 4/29/06, Travis Reeder [EMAIL PROTECTED] wrote: I usually try to use h:outputLink's wherever possible instead of commandLink's so it will use GETs and you won't have to worry as much about this refresh problem. I know the JSF purists might say to use commands everywhere, but in reality, you're app will be much more usable if you use outputLink. Rule of thumb: commandLink or commandButton when you want an action to happen (aka, posting a form), and outputLink when it's just a navigation link. Travis On 4/28/06, Andrew Robinson [EMAIL PROTECTED] wrote: Could you create a phase listener to check if the request is a POST or GET, and if a GET, create a new view root? With server-side state saving, views seem to be reused if the URL doesn't change. I haven't looked at the code, but I see the same behavior (the same view tree is used). Another alternative is to use client side state, that way the browser will not post the component state back on refresh. On 4/28/06, Anthony Hong [EMAIL PROTECTED] wrote: You mean as javascript you wrote can prevent form submit? I don't want to prevent refresh, but I just want refresh in request a new page same as jsf page first requested, its lifecycle create a new jsf view component tree and render response. On 4/28/06, aliko [EMAIL PROTECTED] wrote: You can trap F5 key and call form.submit with a little javascript. But that does not help when user clicks the refresh button. script function ui_onkeydown_handler() { switch ( event.keyCode){ case 116 : // F5 event.keyCode = 0; event.returnValue = false; document.forms ['form1'].submit(); } } document.attachEvent(onkeydown, ui_onkeydown_handler); /script -- View this message in context: http://www.nabble.com/Issues-with-refresh-page-in-JSF-t1523452.html#a4140628 Sent from the MyFaces - Users forum at Nabble.com. -- Anthony Hong -- Anthony Hong
Issues with refresh page in JSF
There is a big problem with me for using JSF when refresh current page. That seams JSF always post latest action when clicking F5 in IE. What I want is a new request instead of posting latest action to Backing bean. Can I achieve my goal? If can, how to deal with this problem. Thanks -- Anthony Hong
Re: Issues with refresh page in JSF
You mean as javascript you wrote can prevent form submit? I don't want to prevent refresh, but I just want refresh in request a new page same as jsf page first requested, its lifecycle create a new jsf view component tree and render response. On 4/28/06, aliko [EMAIL PROTECTED] wrote: You can trap F5 key and call form.submit with a little javascript. But that does not help when user clicks the refresh button. script function ui_onkeydown_handler() { switch (event.keyCode){ case 116 : // F5 event.keyCode = 0; event.returnValue = false; document.forms['form1'].submit(); } } document.attachEvent(onkeydown, ui_onkeydown_handler); /script -- View this message in context: http://www.nabble.com/Issues-with-refresh-page-in-JSF-t1523452.html#a4140628 Sent from the MyFaces - Users forum at Nabble.com. -- Anthony Hong
Re: MyFaces JSF Facelets
servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.jsf/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces /url-pattern /servlet-mapping Put in web.xml. map url pattern to your face servlet On 4/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I just want to realize impacts: can Facelets works with MyFace JSF. For example: I have mapping to *.faces all JSF pages (MyFaces, Tomahawk) Want to add mapping to Facelets page like *.jsf Are all my *.faces and *.jsf pages will work? I mean in my faces-config.xml file I have faces-config application view-handler com.sun.facelets.FaceletViewHandler /view-handler /application Is this view handler will touch my *.faces pages? Thanks, Yura. -- Anthony Hong
Re: Advice please, updated model via valueChange event not render the way I thought
Can you give me Facelet tag.xml for this component? On 4/6/06, Mike Kienenberger [EMAIL PROTECTED] wrote: On 4/5/06, Mikael Andersson [EMAIL PROTECTED] wrote: you don't happen to know how to get the valueChangeNotifier to work with facelets do you? I downloaded the sandbox.taglib.xml from the facelet website but it didn't contain an entry for that tag, and I am not quite sure of how to add it myself since it isn't an ordinary component. Yes, this component isn't alternate-viewhandler friendly. There's component logic in the JSP tag file. I solved this problem by using the optional validation framework. You'd probably be better off giving the sandbox subforms a shot instead. Basically you want your pulldown to be in a logical form by itself so it passes validation and registers its model value despite whatever else is on the page. -- Anthony Hong
t:saveState can not fetch FacesContent.getViewRoot()
in my backing bean, I want to get view local in my constructor. But if I use t:saveState, when click some action to invoke backing bean. It throws null pointer exception. FacesContent.getViewRoot() is null. If I don't use saveState, it works fine. Is this correct? -- Anthony Hong
Re: t:saveState can not fetch FacesContent.getViewRoot()
save a request scope backing bean field. My backing bean construct want to get current view locale to read resource bundle On 3/27/06, Dennis Byrne [EMAIL PROTECTED] wrote: I'm not sure what you mean. What is @value of t:saveState ? Can you post the stack trace? Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Sunday, March 26, 2006 10:46 PM To: 'MyFaces Discussion' Subject: t:saveState can not fetch FacesContent.getViewRoot() in my backing bean, I want to get view local in my constructor. But if I use t:saveState, when click some action to invoke backing bean. It throws null pointer exception. FacesContent.getViewRoot() is null. If I don't use saveState, it works fine. Is this correct? -- Anthony Hong -- Anthony Hong
Re: selectionOneMany problem
Agree with you. But how can I solve this problem? I tried to use t:saveState with my backingbean country, but it shows null point exception. On 3/24/06, Cagatay Civici [EMAIL PROTECTED] wrote: Hi Anthony, What is binded to the value of the city component? If you bind a new City to the component at somewhere, it will likely to give a validation error because the component looks for the selectitem collection and when it cannot find the value that you bind in this case new city(), it will throw a validation error. This should be a cause. Regards, Cagatay, On 3/24/06, Anthony Hong [EMAIL PROTECTED] wrote: I have two selectionOneMany in page, one for county and the other for city. A valueChangeListener stick with country, after change city will be fetch new value corspand with county. Everything is fine for displaying and change county. But if I update this form after change a county, there is a error with city selection box. Value is not a valid option. what is the possible cause? -- Anthony Hong -- Anthony Hong
selectionOneMany problem
I have two selectionOneMany in page, one for county and the other for city. A valueChangeListener stick with country, after change city will be fetch new value corspand with county. Everything is fine for displaying and change county. But if I update this form after change a county, there is a error with city selection box. Value is not a valid option. what is the possible cause? -- Anthony Hong
How to solve paginationed Data table restore that used in request scope?
I have a backing bean in request scope with a datamodel. Table has pagination function. Pagination logic is embered in backing bean, when click next and previous, data display correct. But if I click a commandLink in dataTable, the rowIndex always correct. But the data object fetched always the row index in first page not I expected. How to solve this problem? -- Anthony Hong
jsf page refresh problem
There is a problem in jsf page when refreshing browser. Say there is a page to create a new car information(A form with serveral input text boxes). After clicking save button. I click refresh button in IE tool bar or F5. Then it the form re-submitted and create again. But I want it refresh current page with an empty form. Just like re-enter this page. It looks like JSF always do the latest request action if you click refresh. How to solve this problem? I saw some one said with a navigatorHandler decorater to solve this problem. I tried wrote one and saw what is action and outcome passed in. The result is there are no difference between click button and click refresh in tool bar. I don't want to write redirect in configuration as I have to put processing result message to user and my managed bean are all requrest scope. Any other simple solution to solve this? Thanks -- Anthony Hong
Phase Listener entered twice
I use Facelets with MyFaces implementation. There is a phase listener listens RESTORE_VIEW phase in system. I added a logger message each time phase listener after phase is entered. But each time I make a request of page, it always output enter message twice means listener is entered twice. I put try { throw new Exception(); } catch (Exception e) { logger.error(RESTORE_VIEW Called From, e); } in afterPhase method. The following is output 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Enter Ajax ListenerRESTORE_VIEW(1) 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Request view id:/ajaxRequest.xhtml 2006-3-17 13:20:40 ajax.AjaxListener afterPhase ERROR: RESTORE_VIEW Called From java.lang.Exception at ajax.AjaxListener.afterPhase(AjaxListener.java:26) at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter( LifecycleImpl.java:536) at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl. java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :66) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run (StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri tyHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav a:272) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Exte nsionsFilter.java:122) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:3020) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS ervletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC ontext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j ava:1288) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:179) 2006-3-17 13:20:40 ajax.AjaxListener handleAjaxRequest INFO: Msg requrest mapping:Hello 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Enter Ajax ListenerRESTORE_VIEW(1) 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Request view id:/ajaxRequest.xhtml 2006-3-17 13:20:40 ajax.AjaxListener afterPhase ERROR: RESTORE_VIEW Called From java.lang.Exception at ajax.AjaxListener.afterPhase(AjaxListener.java:26) at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter( LifecycleImpl.java:536) at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl. java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :66) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run (StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri tyHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav a:272) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Exte nsionsFilter.java:122) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:3020) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS ervletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC ontext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j ava:1288) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:179) ps: I have the same problem with navigator handler decorator -- Anthony Hong
Re: Phase Listener entered twice
Yes, I saw a message INFO: MyFaces already initialized But it should not a problem, the my faces source code shows it will not load twice in container. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: There is a context parameter in JSF that is used for loading the conf file(s). If you use /WEB-INF/faces-config.xml as a parameter value, the file is loaded twice ( the spec says to automatically load this file). BTW, if you are using a recent build of myfaces, you will see a warning for this in your log files . Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 12:41 AM To: 'MyFaces Discussion' Subject: Phase Listener entered twice I use Facelets with MyFaces implementation. There is a phase listener listens RESTORE_VIEW phase in system. I added a logger message each time phase listener after phase is entered. But each time I make a request of page, it always output enter message twice means listener is entered twice. I put try { throw new Exception(); } catch (Exception e) { logger.error(RESTORE_VIEW Called From, e); } in afterPhase method. The following is output 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Enter Ajax ListenerRESTORE_VIEW(1) 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Request view id:/ajaxRequest.xhtml 2006-3-17 13:20:40 ajax.AjaxListener afterPhase ERROR: RESTORE_VIEW Called From java.lang.Exception at ajax.AjaxListener.afterPhase(AjaxListener.java:26) at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter( LifecycleImpl.java:536) at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl. java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :66) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run (StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri tyHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav a:272) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Exte nsionsFilter.java:122) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:3020) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS ervletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC ontext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j ava:1288) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:179) 2006-3-17 13:20:40 ajax.AjaxListener handleAjaxRequest INFO: Msg requrest mapping:Hello 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Enter Ajax ListenerRESTORE_VIEW(1) 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Request view id:/ajaxRequest.xhtml 2006-3-17 13:20:40 ajax.AjaxListener afterPhase ERROR: RESTORE_VIEW Called From java.lang.Exception at ajax.AjaxListener.afterPhase(AjaxListener.java:26) at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter( LifecycleImpl.java:536) at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl. java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :66) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run (StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri tyHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav a:272) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Exte nsionsFilter.java:122) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:3020
Re: Phase Listener entered twice
redirect/ /navigation-case /navigation-rule /faces-config -- Anthony Hong
Re: Phase Listener entered twice
By the way, If I don't create a fake ConfigurationLisenter it will failed on startup. java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3775) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) I create com.sun.faces.config.ConfigureListener with empty implementation. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: Do you have a context parameter w/ the key javax.faces.CONFIG_FILES ? Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 12:56 AM To: 'MyFaces Discussion' Subject: Re: Phase Listener entered twice Yes, I saw a message INFO: MyFaces already initialized But it should not a problem, the my faces source code shows it will not load twice in container. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: There is a context parameter in JSF that is used for loading the conf file(s). If you use /WEB-INF/faces-config.xml as a parameter value, the file is loaded twice ( the spec says to automatically load this file). BTW, if you are using a recent build of myfaces, you will see a warning for this in your log files . Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 12:41 AM To: 'MyFaces Discussion' Subject: Phase Listener entered twice I use Facelets with MyFaces implementation. There is a phase listener listens RESTORE_VIEW phase in system. I added a logger message each time phase listener after phase is entered. But each time I make a request of page, it always output enter message twice means listener is entered twice. I put try { throw new Exception(); } catch (Exception e) { logger.error(RESTORE_VIEW Called From, e); } in afterPhase method. The following is output 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Enter Ajax ListenerRESTORE_VIEW(1) 2006-3-17 13:20:40 ajax.AjaxListener afterPhase INFO: Request view id:/ajaxRequest.xhtml 2006-3-17 13:20:40 ajax.AjaxListener afterPhase ERROR: RESTORE_VIEW Called From java.lang.Exception at ajax.AjaxListener.afterPhase(AjaxListener.java:26) at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter( LifecycleImpl.java:536) at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl. java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java :66) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run (StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
Re: Phase Listener entered twice
oops, It works. But why this is the cause? MyFaces examples also put these context-param in web.xml. It works fine If I have to load multiple configuration files, how to deal with them?' On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: Remove context-param param-namejavax.faces.CONFIG_FILES/param-name param-value/WEB-INF/faces-config.xml/param-value /context-param and the problem will go away. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:03 AM To: 'MyFaces Discussion' Subject: Re: Phase Listener entered twice My web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameJSF Facelets Trail/display-name !-- Use Documents Saved as *.xhtml -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param context-param param-namefacelets.LIBRARIES/param-name param-value /WEB-INF/facelets/tomahawk.taglib.xml;/WEB-INF/facelets/sandbox.taglib.xml;/WEB-INF/facelets/fsds.taglib.xml; /param-value /context-param !-- Special Debug Output for Development -- context-param param-namefacelets.DEVELOPMENT/param-name param-valuetrue/param-value /context-param context-param param-namefacelets.REFRESH_PERIOD/param-name param-value2/param-value /context-param context-param param-namejavax.faces.CONFIG_FILES/param-name param-value/WEB-INF/faces-config.xml/param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueclient/param-value /context-param context-param description This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output. If javascript is allowed, command_link anchors will have javascript code that submits the corresponding form. If javascript is not allowed, the state saving info and nested parameters will be added as url parameters. Default: true /description param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.DETECT_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param description If true, rendered HTML code will be formatted, so that it is human readable. i.e. additional line separators and whitespace will be written, that do not influence the HTML code. Default: true /description param-nameorg.apache.myfaces.PRETTY_HTML/param-name param-valuetrue/param-value /context-param context-param description If true, a javascript function will be rendered that is able to restore the former vertical scroll on every request. Convenient feature if you have pages with long lists and you do not want the browser page to always jump to the top if you trigger a link or button action that stays on the same page. Default: false /description param-nameorg.apache.myfaces.AUTO_SCROLL/param-name param-valuetrue/param-value /context-param filter filter-nameextensionsFilter/filter-name filter-classorg.apache.myfaces.component.html.util.ExtensionsFilter/filter-class init-param descriptionSet the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadMaxFileSize/param-name param-value2m/param-value /init-param init-param descriptionSet the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB /description param-nameuploadThresholdSize/param-name param-value64k/param-value /init-param !--init-param param-nameuploadRepositoryPath/param-name param-value/temp/param-value descriptionSet the path where the intermediary files will be stored. /description /init-param-- /filter filter
Re: Phase Listener entered twice
AHa, I think I found the problem. Look at JSF FaceServlet API, CONFIG_FILES_ATTR field description: Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to /WEB-INF/faces-config.xml which is loaded automatically if it exists) containing JavaServer Faces configuration information. See words in parenthesis, in addition to /WEB-INF/faces-config.xml which is loaded automatically if it exists. I think this is the point. Configurations with /WEB-INF/faces-config.xml is automatic loaded at first then load files you put in context-params. I tried to re-name my configuration file name and put it in context again. It works as my expect. Is this sounds correct? On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: But why this is the cause? MyFaces examples also put these context-param in web.xml. Please put this in the issue tracker. They should be removed. If I have to load multiple configuration files, how to deal with them?' The value of the context parameter is a comma seperated list of all faces cofig files to be loaded at startup. Dennis Byrne -- Anthony Hong
Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice
I think another frequent question is JSF page url and refresh problem. JSF send lastest action when you click refresh button in browser. As I want to reload page instead of re-do actions. It can not seperate sender is refresh button or an actual command button. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: I have started a new wiki page where we can put the top ten questions of the community. http://wiki.apache.org/myfaces/Top_10_Questions There are 8 left. Nominations? Dennis Byrne -Original Message- From: Dennis Byrne [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:15 AM To: 'MyFaces Discussion' Subject: Re: Phase Listener entered twice But why this is the cause? MyFaces examples also put these context-param in web.xml. Please put this in the issue tracker. They should be removed. If I have to load multiple configuration files, how to deal with them?' The value of the context parameter is a comma seperated list of all faces cofig files to be loaded at startup. Dennis Byrne -- Anthony Hong
Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice
Done On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: If you feel this problem troubles the community as a whole then do a little research and go for it. Did you put the orginal problem in the issue tracker ? I probably won't remember to do it otherwise. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:37 AM To: 'MyFaces Discussion' Subject: Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice I think another frequent question is JSF page url and refresh problem. JSF send lastest action when you click refresh button in browser. As I want to reload page instead of re-do actions. It can not seperate sender is refresh button or an actual command button. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: I have started a new wiki page where we can put the top ten questions of the community. http://wiki.apache.org/myfaces/Top_10_Questions There are 8 left. Nominations? Dennis Byrne -Original Message- From: Dennis Byrne [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:15 AM To: 'MyFaces Discussion' Subject: Re: Phase Listener entered twice But why this is the cause? MyFaces examples also put these context-param in web.xml. Please put this in the issue tracker. They should be removed. If I have to load multiple configuration files, how to deal with them?' The value of the context parameter is a comma seperated list of all faces cofig files to be loaded at startup. Dennis Byrne -- Anthony Hong -- Anthony Hong
Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice
How about you put comment directly? It will be more accurately . On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: Anthony, the behavior you describe in the issue is part of the spec. It can't be changed. Please put a comment in the issue regarding the myFaces examples, or a patch ;) . The examples should not use the context param this way. Thanks. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 02:07 AM To: 'MyFaces Discussion' Subject: Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice Done On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: If you feel this problem troubles the community as a whole then do a little research and go for it. Did you put the orginal problem in the issue tracker ? I probably won't remember to do it otherwise. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:37 AM To: 'MyFaces Discussion' Subject: Re: [TOP 10 QUESTIONS] was Re: Phase Listener entered twice I think another frequent question is JSF page url and refresh problem. JSF send lastest action when you click refresh button in browser. As I want to reload page instead of re-do actions. It can not seperate sender is refresh button or an actual command button. On 3/17/06, Dennis Byrne [EMAIL PROTECTED] wrote: I have started a new wiki page where we can put the top ten questions of the community. http://wiki.apache.org/myfaces/Top_10_Questions There are 8 left. Nominations? Dennis Byrne -Original Message- From: Dennis Byrne [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 01:15 AM To: 'MyFaces Discussion' Subject: Re: Phase Listener entered twice But why this is the cause? MyFaces examples also put these context-param in web.xml. Please put this in the issue tracker. They should be removed. If I have to load multiple configuration files, how to deal with them?' The value of the context parameter is a comma seperated list of all faces cofig files to be loaded at startup. Dennis Byrne -- Anthony Hong -- Anthony Hong -- Anthony Hong
Re: JSF value Change Listener Problem
Does that mean all listener happens BEFORE the update model phase? Include action listener On 3/15/06, Mario Ivankovits [EMAIL PROTECTED] wrote: Hi Anthony! I encounter a problem with JSF value change listener The valueChangeListener stuff happens BEFORE the update model phase. So you cant read the updated value from the model, nor you can change it (or any other model value) simply by setting it. Now you have two options: *) set the value through a binding of your component *) or - even bettery - use the valueChangeNotifier you can find in tomahawk-sandbox. The valueChangeNotifier will delay the delivery of the valueChange event to the after-model-update phase and so you can work with your model as you might expect it :-) Ciao, Mario -- Anthony Hong
How to set parameter in resource bundle in page
IN JSF page, usual do i18n like f:loadBundle basename=#{facesContext.application.messageBundle} var=tagVar/ then h:outputText value=#{tagVar.TEMPLATE_LOGIN_USER}/: I have a question how to use a composite message. like tagKey=We met for {0} days -- Anthony Hong
JSF value Change Listener Problem
I encounter a problem with JSF value change listener I have a selection box h:selectOneMenu id=selDebtorType converter=javax.faces.Integer validator=#{DebtorController.validateDebtorType} valueChangeListener=#{DebtorController.changeDebtorType} onchange=this.form.submit(); value=#{DebtorController.currentDebtor.debtorType} f:selectItems value=#{DebtorController.debtorTypes}/ /h:selectOneMenu Aslo I have a input box h:inputText id=txtDebtorID size=20 required=true value=#{DebtorController.currentDebtor.debtorPK.debtorID}/ Managed bean: DebtorController is in request scope In select one box there is value change listener. I want to set debtor ID in there. But I tried in that method: public void changeDebtorType(ValueChangeEvent event) { log.info(Debtor Type has been changed); log.info(New value is: + event.getNewValue()); log.info(Debtor ID is: + currentDebtor.getDebtorPK().getDebtorID()); currentDebtor.getDebtorPK().setDebtorID(abc); } log output for debtor ID is null and after I setting debtor ID, it doesn't display abc in input box when page rendered. But I have put something in debtor ID input text box, after changing selection box, its value is same as I input. Neither I can get this by get method nor set it by set method. Is listener has different life cycle? Say it doesn't have update model phase -- Anthony Hong
DataModel.getRowData() works incorrect with managed bean in request scope
I saw in JSF these is a dataTable that is used to display tabular data. like reports. I defined a dataTable in page and in backing bean I have a property of dataModel. There is a link in one column. By clicking it can enter an edit page. My table with pagination function, it works fine when I click previous and next page. I click next page, then click one link to edit page, it display the same position data in first page not my current page. As my backing bean is request level. Examples in website always use scope session. How does JSF processing events? With request level, dataTable can not be retrived back, right? -- Anthony Hong
Re: DataModel.getRowData() works incorrect with managed bean in request scope
I think when click row data, it send back current row index. But in a paginationed report with request scope managed bean. It's lack of page num. So it failed to work. On 3/15/06, Anthony Hong [EMAIL PROTECTED] wrote: I saw in JSF these is a dataTable that is used to display tabular data. like reports. I defined a dataTable in page and in backing bean I have a property of dataModel. There is a link in one column. By clicking it can enter an edit page. My table with pagination function, it works fine when I click previous and next page. I click next page, then click one link to edit page, it display the same position data in first page not my current page. As my backing bean is request level. Examples in website always use scope session. How does JSF processing events? With request level, dataTable can not be retrived back, right? -- Anthony Hong -- Anthony Hong
How to pass argument in a JSF action
I want to have following function In page a have command button h:commandButton id=btCreate value=#{tagVar.CREATE} action=#{DebtorController.createDebtor}/ Can I pass some argument to this backing bean functon? Say the orignial is public string createDebtor() I want it to be public string createDebtor(String argu) Can it be? -- Anthony Hong
Re: How to pass argument in a JSF action
I saw tomahawk example sort table t:commandSortHeader columnName=color arrow=true h:outputText value=#{example_messages['sort_carcolor']} / /t:commandSortHeader It has a backend method, sort(String columnname), is this a action method or delegate method? On 3/9/06, Dennis Byrne [EMAIL PROTECTED] wrote: Actions cannot take arguments. Try creating a property called argu on the backing bean. Inside your commandLink, you can then do this t:updateActionListener property=#{DebtorController.argu} value=foo / This says assign 'foo' to the argu property just before the action is called. In the action, you will have access to the argu String internally. Dennis Byrne -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 8, 2006 10:04 PM To: 'MyFaces Discussion' Subject: How to pass argument in a JSF action I want to have following function In page a have command button h:commandButton id=btCreate value=#{tagVar.CREATE} action=#{DebtorController.createDebtor}/ Can I pass some argument to this backing bean functon? Say the orignial is public string createDebtor() I want it to be public string createDebtor(String argu) Can it be? -- Anthony Hong -- Anthony Hong
Faceletes with myfaces, tab panel problem
When use t:panelTabbedPane bgcolor=black with facelet, It looks work fine, but click different button, it will show javascript error. I saw that its javascript required by panelTabbedPane was not written back. I had to add these resource by manual. Does it mean it can only be used with JSP page? And this panelTab fetch all page and show different div when clicking tab, isn't it? Is that anyway to fetch data from remote when clicking tab? -- Anthony Hong
Re: Faceletes with myfaces, tab panel problem
I have add filter, after that it also dosen't work. I saw javascript and css has been added back in returned html. link rel=stylesheet href=/webapp/faces/myFacesExtensionResource/tabbedpane.HtmlTabbedPaneRenderer/11302665/defaultStyles.css type=text/css / script src=/webapp/faces/myFacesExtensionResource/tabbedpane.HtmlTabbedPaneRenderer/11302665/dynamicTabs.js type=text/javascript!-- //--/script style rel=stylesheet type=text/css!-- #_id1 .myFaces_panelTabbedPane_activeHeaderCell input, #_id1 .myFaces_panelTabbedPane_pane, #_id1 .myFaces_panelTabbedPane_subHeaderCell{ background-color:black; } --/style The myfaces website said I don't have to do any other configuration after configure this filter, it will fetch js, css resource from myfaces.jar automaticly. Should I have to put a directory /faces/myFacesExtensionResource/* explicitly? On 3/8/06, Mike Kienenberger [EMAIL PROTECTED] wrote: Make sure you have properly configured the extensions filter. Note that the extensions filter web page was out of date until recently, so double-check your settings http://myfaces.apache.org/tomahawk/extensionsFilter.html It sounds like you might be missing the /faces/myFacesExtensionResource/* mapping. On 3/7/06, Anthony Hong [EMAIL PROTECTED] wrote: When use t:panelTabbedPane bgcolor=black with facelet, It looks work fine, but click different button, it will show javascript error. I saw that its javascript required by panelTabbedPane was not written back. I had to add these resource by manual. Does it mean it can only be used with JSP page? And this panelTab fetch all page and show different div when clicking tab, isn't it? Is that anyway to fetch data from remote when clicking tab? -- Anthony Hong -- Anthony Hong
Can I customize Validation Error Message
If I write this in this way, h:inputText id=txtDebtorLimit size=20 value=#DebtorController.currentDebtor.limit}/ h:message for=txtDebtorLimit errorClass=error_message/ when error occured, it shows: txtCustomerID Value is required. But I want to change txtCustomerID to support mulit language, it should fetch value from resource bundle at first. Can I do that? Is that means I have to rewrite all validator in My Faces implementation? -- Anthony Hong
Re: Can I customize Validation Error Message
Yes, I can redfine it in my properties. What I mean is I want to use current my faces message in detail mode but I don't want it output for id eg: javax.faces.component.UIInput.REQUIRED_detail = {0}: Value is required. I want it to be javax.faces.component.UIInput.REQUIRED_detail = Value is required. All detail message without label as an argument. Can it be? On 3/6/06, Enrique Medina [EMAIL PROTECTED] wrote: Hi Anthony, I think you want to have the exact keys for the messages used by Myfaces by default. If you're using myfaces-all.jar, open it with Winrar or Winzip or whatever zipping tool, and go to javax/faces. You will find several properties files. If you open the Messages.properties, you will find keys for all default messages used by JSF: # standard messages (Spec. 2.5.1.4) javax.faces.component.UIInput.CONVERSION= Conversion Error javax.faces.component.UIInput.CONVERSION_detail = {0}: Conversion error occurred. javax.faces.component.UIInput.REQUIRED= Validation Error javax.faces.component.UIInput.REQUIRED_detail = {0}: Value is required. javax.faces.component.UISelectOne.INVALID= Validation Error javax.faces.component.UISelectOne.INVALID_detail = {0}: Value is not a valid option. javax.faces.component.UISelectMany.INVALID = Validation Error javax.faces.component.UISelectMany.INVALID_detail = {0}: Value is not a valid option. javax.faces.validator.NOT_IN_RANGE= Validation Error javax.faces.validator.NOT_IN_RANGE_detail = {2}: Specified attribute is not between the expected values of {0} and {1}. etc.. So you can just redefine them in your resource bundle ;-) Regards, Enrique. On 3/6/06, Anthony Hong [EMAIL PROTECTED] wrote: If I write this in this way, h:inputText id=txtDebtorLimit size=20 value=#DebtorController.currentDebtor.limit}/ h:message for=txtDebtorLimit errorClass=error_message/ when error occured, it shows: txtCustomerID Value is required. But I want to change txtCustomerID to support mulit language, it should fetch value from resource bundle at first. Can I do that? Is that means I have to rewrite all validator in My Faces implementation? -- Anthony Hong -- Anthony Hong
Can I load another jsf page by t:popup?
I want to load another dynamic jsf page with some actions in page in a popup div. Can I? -- Anthony Hong
Re: Can I load another jsf page by t:popup?
So tomahawk is not provide such function. With tomahawk popup only static data can be loaded. I can not add any jsf interaction in popup page. right? -- Anthony Hong
JSF Bean Life Cycle Question
I have a page for creating an object. I found update page have same fields except an internal ID and its button is updaing not creating. So I add a boolean field in control bean to represent current action is update or create. My control bean scope is request in faces-config.xml I enter create page, click save button, In that function, I change status to true which means edit mode. Then the update botton is displayed, but click that button has no effect, control bean method was not invoked. but boolean flag is OKAY, its true in that time What's wrong with it? -- Anthony Hong
JSF navigation url problem
In JSF navigation rule, show as following navigation-rule from-view-id/pages/inputname.jsp/from-view-id navigation-case from-outcomesayHello/from-outcome to-view-id/pages/greeting.jsp/to-view-id /navigation-case navigation-case from-outcomesayGoodbye/from-outcome to-view-id/pages/goodbye.jsp/to-view-id /navigation-case /navigation-rule In this example, click button in inputname.jsp can change page to greeting.jsp, but the url in IE has no change, means it is as same inputname.jsp, click link in greeting.jsp to goodbye.jsp, url in IE is greeting.jsp Seams it is always one step after current page. it works fine by click link. but if I refresh current page, it displayed previous page not current page. This can be solved by add redirect/ in each navigation-case. But why default action has such problem? What is the purpose? -- Anthony Hong
Re: JSF Bean Life Cycle Question
I agree with you. We can do that in two seperated jsps. But I interested in how to deal with them in one page with some condition determination. On 3/2/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: Sorry, I haven't had my morning coffee (GMT-6.00), so left in some extraneous words in the last e-mail that made it difficult to read. It was *supposed* to read: I know that this doesn't answer your immediate question, but wouldn't it be easier and more explicit to put the common elements inside a JSP, and then to include that JSP inside each of two other JSPs, each with its own button that has its own action (update vs. create)? Then you wouldn't have this flag-setting and control issue happening underneath. - Brendan -Original Message- From: CONNER, BRENDAN (SBCSI) Sent: Thursday, March 02, 2006 9:44 AM To: MyFaces Discussion Subject: RE: JSF Bean Life Cycle Question I know that this doesn't answer your immediate question, but wouldn't it be easier and explicit to do put the common elements inside a JSP, and then to include that JSP inside each of two other JSPs, each with its own button that has its own action (update vs. create)? Then you wouldn't have this flag-setting and control issue happening underneath. - Brendan -Original Message- From: Anthony Hong [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 7:39 AM To: MyFaces Discussion Subject: JSF Bean Life Cycle Question I have a page for creating an object. I found update page have same fields except an internal ID and its button is updaing not creating. So I add a boolean field in control bean to represent current action is update or create. My control bean scope is request in faces-config.xml I enter create page, click save button, In that function, I change status to true which means edit mode. Then the update botton is displayed, but click that button has no effect, control bean method was not invoked. but boolean flag is OKAY, its true in that time What's wrong with it? -- Anthony Hong -- Anthony Hong
Re: getResource giving filenotfound
String filePath = ((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext()).getRealPath(/WEB-INF/test.properties); You can get correct file path. On 3/3/06, David Schlotfeldt [EMAIL PROTECTED] wrote: I have a property file in WEB-INF. I thought this is how you get to it: URL configUrl = FacesContext.getCurrentInstance().getExternalContext().getResource(/WEB-INF/test.properties); ... configProperties.load(new FileInputStream(file)); But I get this exception Caused by: java.io.FileNotFoundException: jndi:\localhost\test.biz\WEB-INF\test.properties (The filename, directory name, or volume label syntax is incorrect) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at biz.test.site.TestFacade.init(TestFacade.java:129) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.java:274) at org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.java:265) at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:50) at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311) at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134) at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44) at com.sun.el.parser.AstValue.getValue(AstValue.java:85) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233) ... 39 more == Why is it looking in jndi? What am I doing wrong? Thanks, David -- Anthony Hong
Re: Can I use JSF1.2 now
Hi, I found it is my configuration problem in web.xml. Now I can get that page at first, but after I clicking guess. It shous exception javax.faces.el.PropertyNotFoundException: /C:/bea91/user_projects/domains/jsfTrail/autodeploy/webapp/guess.xhtml @21,114 value=#{NumberBean.guess}: Target Unreachable, identifier 'NumberBean' resolved to null at com.sun.facelets.el.LegacyValueBinding.getType(LegacyValueBinding.java:96) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:111) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:759) at javax.faces.component.UIInput.validate(UIInput.java:684) at javax.faces.component.UIInput.executeValidate(UIInput.java:897) at javax.faces.component.UIInput.processValidators(UIInput.java:438) at javax.faces.component.UIForm.processValidators(UIForm.java:190) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:977) at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:640) at org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:179) Backing back is not initlized. javax.faces.el.PropertyNotFoundException: /C:/bea91/user_projects/domains/jsfTra il/autodeploy/webapp/guess.xhtml @21,114 value=#{NumberBean.guess}: Target Unr eachable, identifier 'NumberBean' resolved to null at com.sun.facelets.el.LegacyValueBinding.getType(LegacyValueBinding.jav a:96) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConverte dValue(HtmlBasicInputRenderer.java:111) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:759) at javax.faces.component.UIInput.validate(UIInput.java:684) at javax.faces.component.UIInput.executeValidate(UIInput.java:897) Truncated. see log file for complete stacktrace But it works fine in tomcat 5.5 I use myface + facelet in your recommanded version. -- Anthony Hong
Can not run Facelet on weblogic 9
Hi all, I downloaded the latest Facelet 1.0.11 and use it to learn facelet as a view of JSF. I put all libaries under %facelet_bundle%/lib into my web-inf/lib and jsf-facelet into web-inf/lib. I go through as facelet document section 1 example number guess But at weblogic startup time I saw a caution: Incorrect JSP version found, method getJspApplicationContext does not exist. And when I trying to request that page, following error occured: java.lang.AbstractMethodError: javax.faces.render.ResponseStateManager.isPostback(Ljavax/faces/context/FacesContext;)Z at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.java:188) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:143) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:112) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:175) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) at weblogic.work.ExecuteThread.run(ExecuteThread.java:179) How pity I am! anybody can help me out. Thanks in advance -- Anthony Hong
Re: Can I use JSF1.2 now
Dear Andrew Robinson, Now I am studying Facelet with weblogic 9. I cannot run the example that shown in section 1 of facelet. When I invoked it, is shown 2006-2-24 下午04时52分31秒 CST Error HTTP BEA-101017 [weblogic.servlet. [EMAIL PROTECTED] - name: 'webapp', context-path: '/webapp'] Root cause of ServletException. java.lang.AbstractMethodError: javax.faces.render.ResponseStateManager.isPostbac k(Ljavax/faces/context/FacesContext;)Z at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase. java:200) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.jav a:156) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) Truncated. see log file for complete stacktrace How to config that web-inf/lib. I copy all lib under facelet/lib and facelet.jar to my web-inf/lib Anthony
Re: Can not run Facelet on weblogic 9
Hi Adam, Now I follow the My faces installation guides to setup facelet, But the problem is the same. Exception show as following: 2006-2-25 下午01时27分40秒 CST Error HTTP BEA-101017 [weblogic.servlet. [EMAIL PROTECTED] - name: 'webapp', context-path: '/webapp'] Root cause of ServletException. java.lang.AbstractMethodError: javax.faces.render.ResponseStateManager.isPostbac k(Ljavax/faces/context/FacesContext;)Z at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase. java:200) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.jav a:156) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) Truncated. see log file for complete stacktrace I aslo tried same on on Tomcat5.5. It shows 404 error, Page can not be found. This is my web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; !-- Use Documents Saved as *.xhtml -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param !-- Special Debug Output for Development -- context-param param-namefacelets.DEVELOPMENT/param-name param-valuetrue/param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueclient/param-value /context-param !-- Optional JSF-RI Parameters to Help Debug -- context-param param-namecom.sun.faces.validateXml/param-name param-valuetrue/param-value /context-param context-param param-namecom.sun.faces.verifyObjects/param-name param-valuetrue/param-value /context-param !-- Faces Servlet -- servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet !-- Faces Servlet Mapping -- servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.jsf/url-pattern /servlet-mapping /web-app My faces-config.xml ?xml version=1.0 encoding=UTF-8? !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 application view-handlercom.sun.facelets.FaceletViewHandler/view-handler /application managed-bean managed-bean-nameNumberBean/managed-bean-name managed-bean-classfacelet.tutorial.NumberBean/managed-bean-class managed-bean-scopesession/managed-bean-scope managed-property property-namemin/property-name value1/value /managed-property managed-property property-namemax/property-name value10/value /managed-property /managed-bean !-- going from guess.xhtml to response.xhtml -- navigation-rule from-view-id/guess.xhtml/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/response.xhtml/to-view-id /navigation-case /navigation-rule !-- going from response.xhtml to guess.xhtml -- navigation-rule from-view-id/response.xhtml/from-view-id navigation-case from-outcomesuccess/from-outcome to-view-id/guess.xhtml/to-view-id /navigation-case /navigation-rule /faces-config I follow the example in facelte site. Any problem with my configurations?
Re: Can I use JSF1.2 now
Andrew, I still can not work on weblogic. Can you package a sample and mail it to me? It would be very kind of you if mail this package to me. Thanks. Anthony Hong
Re: Can I use JSF1.2 now
Thank you very much, Andrew Robinson. You understanding is correct. This explaination is a good start point for me. On 2/23/06, Andrew Robinson [EMAIL PROTECTED] wrote: Not 100% sure what you mean by a web layer, but I presume that you are refering to a new web project. I researched Struts, Plain JSF, JSF+Tiles, JSF+Facelets and finally settled on JSF+Facelets+Seam for my project. My home project is in development and is working fine. The only problems I have are when I I am working off of CVS/SVN latest to get the newest functionality. MyFaces 1.1.1 + Facelets 1.0.10 seems to be quite stable and my company is using that combination as well. The biggest issue/hurdle for me to deal with in development on both JSF as well as struts is that URLs may not be able to be bookmarked by users, as page validation occurs by posting back to the current URL before navigating to the new page (which is often done by a servlet forward and not a browser redirect). The learning curve on JBoss Seam is pretty steep for installation/setup, but JSF and facelets are pretty easy to understand if you are willing to do a bit of reading first (any of the online tutorials work, including Sun's). I was really hating JSF before I tried facelets. I don't recommend it. Tiles just doesn't work from an architectural perspective. Trying to work with view, subview and verbatim tags is ugly to be nice. Since pages contain no code like ASP, Perl, PHP, JSP, the pages are much more maintainable. The business code is nicely tucked away in Java beans (POJOs). I prefer JSF+Facelets over ASP.NET as well. ASP.NET has some powerful controls, but the binding is lackluster. ASP.NET also requires you to have backing code on every page, which maked it difficult to seperate out page developers from Java/code developers. The one thing I haven't heard too much about on these lists is performance for very large sites (I haven't heard either way - good or bad). Hope I answered your question instead of just babbling... On 2/22/06, Anthony Hong [EMAIL PROTECTED] wrote: Hi Andrew Robinson, In your words, JSF with Facelet is good to use if start a new project in web layer, Isn't it? Becuase I am going to have a new project and we want to use something new in web Layer. I want to know more about JSF in real project whether we can start use it or not. Thanks. On 2/22/06, Andrew Robinson [EMAIL PROTECTED] wrote: If you want JSF 1.2 and JSTL support I strongly recommend facelets. You can have your own tag handler for JSTL tags that are not yet supported, and there are several already supported. They tag handlers are processed before the JSF components, but other than that item, it is possible to feed EL statements into JSTL tags. For example: c:choose c:when test=#{mybean.myprop}/ c:otherwise/ /c:choose -Andrew FYI - I can't image using JSF without facelets. IMO, JSF is useless without facelets. Sun should make it part of the spec (IMO of course). On 2/22/06, Werner Punz [EMAIL PROTECTED] wrote: Anthony Hong schrieb: I knew that JSF have something like tableset to render table like view easily. But sometime I have to write html table by self to offer flexibility. I saw Facelet to use with JSF as a view, Is it useful? ah one thing, I do not no if there are facelet descriptors for the jsf:html lib in existence so combining both might become problematic. -- Anthony Hong -- Anthony Hong
Where to get facelet xsd defintions
I saw namespace like this in facelet example, but I can not get its element definition, xmlns:ui=http://java.sun.com/jsf/facelets; Where can I get this dtd or xsd -- Anthony Hong
Can I use JSF1.2 now
I interested in JSF these day. I used to try JSF1.1 but some problem issued by many place, such as write html code in jsf container display not properly. It can not use with jstl c:foreach. Now I see JSF 1.2 final spec. has publised. Can I use it now? As it is going with JSP2.1. Is there any web container support that? Another question is if I can not use JSF1.2 now. How can I use JSF backing bean in JSTL? Say I want to get bean parameter in JSTL that initialized by JSF -- Anthony Hong
Re: Can I use JSF1.2 now
I knew that JSF have something like tableset to render table like view easily. But sometime I have to write html table by self to offer flexibility. I saw Facelet to use with JSF as a view, Is it useful? -- Anthony Hong
Re: Can I use JSF1.2 now
Hi Andrew Robinson, In your words, JSF with Facelet is good to use if start a new project in web layer, Isn't it? Becuase I am going to have a new project and we want to use something new in web Layer. I want to know more about JSF in real project whether we can start use it or not. Thanks. On 2/22/06, Andrew Robinson [EMAIL PROTECTED] wrote: If you want JSF 1.2 and JSTL support I strongly recommend facelets. You can have your own tag handler for JSTL tags that are not yet supported, and there are several already supported. They tag handlers are processed before the JSF components, but other than that item, it is possible to feed EL statements into JSTL tags. For example: c:choose c:when test=#{mybean.myprop}/ c:otherwise/ /c:choose -Andrew FYI - I can't image using JSF without facelets. IMO, JSF is useless without facelets. Sun should make it part of the spec (IMO of course). On 2/22/06, Werner Punz [EMAIL PROTECTED] wrote: Anthony Hong schrieb: I knew that JSF have something like tableset to render table like view easily. But sometime I have to write html table by self to offer flexibility. I saw Facelet to use with JSF as a view, Is it useful? ah one thing, I do not no if there are facelet descriptors for the jsf:html lib in existence so combining both might become problematic. -- Anthony Hong
How to add url parameter in JSF?
As in html, a requrest url can be something like abc.jsp?a=1b=2 In JSF, links are managed by backend and it is event driven by jsf component. How can I do in original way? As my parameters are generated dynamicly. -- Anthony Hong
Re: How to add url parameter in JSF?
You are right. But I also curious of that. Thanks On 2/20/06, Jana Parvanova [EMAIL PROTECTED] wrote: What about something lik this: h:commandLink styleClass=table-header actionListener=#{inboxBean.sort} f:param name=column value=name/ /h:commandLink Usually you won't need using parameters though. - Original Message - From: Anthony Hong [EMAIL PROTECTED] To: users@myfaces.apache.org Sent: Monday, February 20, 2006 4:20 PM Subject: How to add url parameter in JSF? As in html, a requrest url can be something like abc.jsp?a=1b=2 In JSF, links are managed by backend and it is event driven by jsf component. How can I do in original way? As my parameters are generated dynamicly. -- Anthony Hong -- Anthony Hong