RE: Is there a MyFaces Tomahawk guide?
How about asking students to help as part of the practical parts of their curricular work? And how about asking companies to fund this effort? A while ago I supervised 10 students writing tutorials for 4 different Open Source projects. Turned out to be a great success. Problem is that students (at least around here) are used to get money for doing those projects even if those projects are part of their curricular work (Mandatory project work is often conducted in companies who provide some form of remuneration since students are embedded in real-life project teams doing real-life jobs) But if a few companies would provide a little bit of funding, the MyFaces team could start a little documentation award program or tutorial competition fund or something like that: Student groups are encouraged to provide documentation and tutorials (they have to first get to know the components, write sample applications in many different contexts and then document all of it) and the best win a price. Or so. What do you think? Matt Am Fr, 2.06.2006, 17:16, schrieb James Richards: I could help on explaining tracing MyFaces using AspectJ if that's of any interest. Let me know where's best to start. Thanks, James -Original Message- From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Fri 6/2/2006 11:15 AM To: MyFaces Discussion Subject: Re: Is there a MyFaces Tomahawk guide? We think that we seriously lack documentation. Indeed we do. Any help is welcome. regards, Martin On 6/2/06, Andrew Robinson [EMAIL PROTECTED] wrote: There are WIKIs, perhaps the best way to get started is for a new WIKI topic and have people start contributing. What do the MyFaces contributors think? -Andrew On 6/2/06, Todd Patrick [EMAIL PROTECTED] wrote: To continue, I've selected MyFaces and Tomahawk for a mission critical engineering project. I can say right now that I might need to look else where if documentation or a guide is lacking. I really can't spend a lot of time piecing together information when I know development needs to be done. I looked at Oracle ADF and they were too expensive. I might need to look at Facelets or Icefaces. MyFaces and Tomahawk really fits my needs, I'd really with there was better information. Thanks, --Todd -Original Message- From: James Richards [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 9:55 AM To: MyFaces Discussion Subject: RE: Is there a MyFaces Tomahawk guide? +1 on the documentation. Having spent some time grokking MyFaces, I can say that it's truly needed. I'll help in any way that I can on such an effort. -Original Message- From: Todd Patrick [mailto:[EMAIL PROTECTED] Sent: Fri 6/2/2006 10:43 AM To: MyFaces Discussion Subject: Is there a MyFaces Tomahawk guide? I'd like to know if there is a MyFaces Tomahawk guide? The samples are ok, the Wiki lacks a lot of detail and the Javadocs can only do so much in terms of learning how to properly use the components. This isn't negative, I'd just like to know if I'm missing something. MyFaces Tomahawk would be a lot more developer friendly if good documentation was available. Thanks, --Todd -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
[newbie] passing a parameter between two backing beans
Hi everyone I have a small JSF application with two pages: menu.jsp and details.jsp The menu.jsp contains something like this in a dataTable: h:form h:commandLink action=#{MenuBackingBean.userClick} h:outputText value=#{menuTabItem.itemName} / f:param name=itemID value=#{menuTabItem.itemID} / /h:commandLink /h:form Depending on the itemID, the method userClick() returns menu or details (if the return value is menu, there is a sub-menu to be displayed. if the return value is display, there is no more sub-menu but details of an actual item to be displayed) Those actions menu and details are obviously associated with navigation rules of the faces-config. But here is my question: If userClick() wants to return details, I want it to pass the itemID to the DetailsBackingBean first (before the statement return details;) How do I do that? The DetailsBackingBean is supposed to take this itemID and look up the details data associated with this itemID before it displays the details.jsp How can that be done? Is that even the right way to go?
Re: [newbie] passing a parameter between two backing beans
Thanks. I read that Wiki article. And in fact, when I wrote my question, I had the first approach implemented (the one with the FacesContext). I put this long statement FacesContext...get(id); into the constructor of my DetailsBackingBean - and was able to obtain the ID and perform the lookup. The same would happen with approach 2 outlined in your wiki article. However, this works only once: whenever the DetailsBackingBean is constructed. This scope of this bean is set to session because when i set it to request, the button back to the menu doesn't work anymore (no idea why). That button only calls a method in the DetailsBackingBean which return the action menu. Works if the scope is session, throws an exception when scope is request. I figured that the session scope would make sense because if I am not mistaken that means that those classes are instantiated once for each user session, right? So either I debug my application so the scope can be set to request or I need to implement the details lookup query in the MenuBackingBean which then updates the attributes of the DetailsBackingBean. Are those really my only options? Especially the latter one sounds ugly. Any idea? thanks Matt Am Mo, 22.05.2006, 17:15, schrieb Matthias Wessendorf: Hi Matthias :-) You should read [1]. I prefere the usage of updateActionListener -Matthias [1] http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters On 5/22/06, Matthias Klein [EMAIL PROTECTED] wrote: Hi everyone I have a small JSF application with two pages: menu.jsp and details.jsp The menu.jsp contains something like this in a dataTable: h:form h:commandLink action=#{MenuBackingBean.userClick} h:outputText value=#{menuTabItem.itemName} / f:param name=itemID value=#{menuTabItem.itemID} / /h:commandLink /h:form Depending on the itemID, the method userClick() returns menu or details (if the return value is menu, there is a sub-menu to be displayed. if the return value is display, there is no more sub-menu but details of an actual item to be displayed) Those actions menu and details are obviously associated with navigation rules of the faces-config. But here is my question: If userClick() wants to return details, I want it to pass the itemID to the DetailsBackingBean first (before the statement return details;) How do I do that? The DetailsBackingBean is supposed to take this itemID and look up the details data associated with this itemID before it displays the details.jsp How can that be done? Is that even the right way to go? -- Matthias Wessendorf Aechterhoek 18 48282 Emsdetten http://jroller.com/page/mwessendorf mwessendorf-at-gmail-dot-com
[newbie] embedding HTML links
I need to somehow embed a link such as a href=...ggg/a in a JSF page. I tried outputText with and without verbatim and I tried the tomahawk html tag component. Nothing works. How does one do such thing? Btw. the link itself is contructed in a backing bean as string so I can't hard-code the link in the page. thanks
Re: [newbie] embedding HTML links
I should have added some more info: The code that creates the string with the link looks like: this.link = a href=\; this.location += / + filename + \ target=\_blank\ + param + /a; It is embedded in the JSP page with h:outputText value=#{ContentBackingBean.link} / (I tried with verbatim, doesn't change a thing) When I then call that page I get lt;a href=quot;c:/JavaCode/files/10.htmlquot; target=quot;_blankquot;gt;10.htmllt;/agt; So the JSF renderer seems to insist to always translate the special characters of HTML (like into lt; and so on) How do I switch that off? Or is there a better way to embed links like that into JSF pages? Am Mo, 22.05.2006, 20:33, schrieb Matthias Klein: I need to somehow embed a link such as a href=...ggg/a in a JSF page. I tried outputText with and without verbatim and I tried the tomahawk html tag component. Nothing works. How does one do such thing? Btw. the link itself is contructed in a backing bean as string so I can't hard-code the link in the page. thanks
Re: [newbie] embedding HTML links
Thanks. That did it Am Mo, 22.05.2006, 21:08, schrieb Jeff Bischoff: h:outputLink ? Matthias Klein wrote: I need to somehow embed a link such as a href=...ggg/a in a JSF page. I tried outputText with and without verbatim and I tried the tomahawk html tag component. Nothing works. How does one do such thing? Btw. the link itself is contructed in a backing bean as string so I can't hard-code the link in the page. thanks
RE: [newbie]: click on commandButton does nothing. Why?
Thank you so much! Now it works. I _knew_ it was a stupid, little newbie mistake :-) Am Mi, 10.05.2006, 23:13, schrieb James Reynolds: Enclose your buttons in an h:form tag. -Original Message- From: Matthias Klein [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 3:11 PM To: users@myfaces.apache.org Subject: [newbie]: click on commandButton does nothing. Why? I am sure this is a super simple newbie problem, but would you mind helping me? Thanks so much! I wanted to start playing with MyFaces and JSF by building a tiny application: index.jsp simply forwards to menu.faces (which is the file menu.jsp) In menu.jsp there is one little button leading to details.jsp In details.jsp there are two buttons: one leading back to menu.jsp and one leading to content.jsp content.jsp has a button to menu.jsp. I can deploy everything in Tomcat 5.5 and call each page individually by using the .faces suffix instead of their real file name suffix .jsp. But here is the thing: when I click on any of those buttons, nothing happens. Absolutely nothing. I have added a System.out... statement in the method that is supposed to be called but that is not called either. Do you have any idea what I did wrong? Here some code: - Index.jsp - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body jsp:forward page=/menu.faces / /body /html - Menu.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.menu_frame} //title /head body menubr // h:commandButton value=Weiter rendered=true action=#{MenuBackingBean.userClick} / h:commandButton value=Weiter rendered=true action=showDetails / /body /html /f:view - Details.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.details_frame} //title /head body h:panelGrid columns=2 h:outputText value=#{bundle.details_title} / h:outputText value=#{DetailsBackingBean.title} / h:outputText value=#{bundle.details_author} / h:outputText value=#{DetailsBackingBean.author} / /h:panelGrid h:commandButton value=#{bundle.details_startbutton}. rendered=true action=#{DetailsBackingBean.showContent} / h:commandButton value=#{bundle.details_backbutton} rendered=true action=#{DetailsBackingBean.showMenu} / /body /html /f:view - Content.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.content_frame} //title /head body contentbr h:commandButton value=#{bundle.content_backbutton} rendered=true action=#{ContentBackingBean.showMenu} / /body /html /f:view - Faces-config.xml - ?xml version=1.0 encoding=UTF-8? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN http://java.sun.com/dtd/web-facesconfig_1_1.dtd; faces-config application locale-config default-localeen/default-locale supported-localeen/supported-locale supported-localede/supported-locale /locale-config message-bundleca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBun dle/message-bundle /application managed-bean managed-bean-nameDetailsBackingBean/managed-bean-name managed-bean-classca.gc.nrc.iit.eConservatoire.frontend.DetailsBacking Bean/managed-bean-class managed-bean-scopesession/managed-bean-scope managed-property descriptionTitle of the Learning Object/description property-nametitle/property-name property-classjava.lang.String/property-class value/value /managed-property managed-property descriptionAuthor of the Learning Object/description property-nameauthor/property-name property-classjava.lang.String/property-class value/value /managed-property /managed-bean managed-bean managed-bean-nameMenuBackingBean
[newbie]: click on commandButton does nothing. Why?
I am sure this is a super simple newbie problem, but would you mind helping me? Thanks so much! I wanted to start playing with MyFaces and JSF by building a tiny application: index.jsp simply forwards to menu.faces (which is the file menu.jsp) In menu.jsp there is one little button leading to details.jsp In details.jsp there are two buttons: one leading back to menu.jsp and one leading to content.jsp content.jsp has a button to menu.jsp. I can deploy everything in Tomcat 5.5 and call each page individually by using the .faces suffix instead of their real file name suffix .jsp. But here is the thing: when I click on any of those buttons, nothing happens. Absolutely nothing. I have added a System.out statement in the method that is supposed to be called but that is not called either. Do you have any idea what I did wrong? Here some code: - Index.jsp - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body jsp:forward page=/menu.faces / /body /html - Menu.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.menu_frame} //title /head body menubr // h:commandButton value=Weiter rendered=true action=#{MenuBackingBean.userClick} / h:commandButton value=Weiter rendered=true action=showDetails / /body /html /f:view - Details.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.details_frame} //title /head body h:panelGrid columns=2 h:outputText value=#{bundle.details_title} / h:outputText value=#{DetailsBackingBean.title} / h:outputText value=#{bundle.details_author} / h:outputText value=#{DetailsBackingBean.author} / /h:panelGrid h:commandButton value=#{bundle.details_startbutton}. rendered=true action=#{DetailsBackingBean.showContent} / h:commandButton value=#{bundle.details_backbutton} rendered=true action=#{DetailsBackingBean.showMenu} / /body /html /f:view - Content.jsp - %@ page language=java pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view f:loadBundle basename=ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle var=bundle / !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleh:outputText value=#{bundle.content_frame} //title /head body contentbr h:commandButton value=#{bundle.content_backbutton} rendered=true action=#{ContentBackingBean.showMenu} / /body /html /f:view - Faces-config.xml - ?xml version=1.0 encoding=UTF-8? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN http://java.sun.com/dtd/web-facesconfig_1_1.dtd; faces-config application locale-config default-localeen/default-locale supported-localeen/supported-locale supported-localede/supported-locale /locale-config message-bundleca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle/message-bundle /application managed-bean managed-bean-nameDetailsBackingBean/managed-bean-name managed-bean-classca.gc.nrc.iit.eConservatoire.frontend.DetailsBackingBean/managed-bean-class managed-bean-scopesession/managed-bean-scope managed-property
RE: Architecture question
Thanks for your super quick response. Well, that document says that the BackingBeans belong into the presentation tier. But as far as I understand Backing Beans, they are the Model of the JSF MVC. Am I wrong? If I am not too far off - what would be the responsibility of the Business Objects? In many cases applications just take data from a user or present data to a user. In that case, the business tier would be pretty empty as it just passes data from the frontend to the backend - and vice versa. Sorry. I am quite confused right now. Matt -Original Message- From: Julián García [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 8. Februar 2006 23:03 To: MyFaces Discussion Subject: Re: Architecture question Maybe you could find this useful: http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html Julian Matthias Klein wrote: If an application has 3 tiers: presentation, business, backend - in which of those would you put the JSF Model (the Backing Beans?) When I read through the www, I have to assume that it belongs in the business tier while the rest of the JSF stuff belongs into the presentation tier, right? But if you want a good architecture - shouldn't there be some sort of interface or facade centralizing the business tier access? (Like: all requests go through one gate?) Does anyone have a good JSF based architecture in UML (easier to talk about a diagram instead of trying to describe it with words) Thanks matt
RE: Null Pointer Exception with dataTable
I don't believe it. Now it works. Was my mistake that I forgot to create an instance of Vector (books)? Thanks Matt -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Samstag, 1. Oktober 2005 14:26 To: MyFaces Discussion Subject: Re: Null Pointer Exception with dataTable Vector? Hmm, ok. Change this: public Collection getBooks() { books = new Vector(); ... rest of method here... } Larry On 10/1/05, Matthias Klein [EMAIL PROTECTED] wrote: For the past 2 days I have tried to create a simple dataTable but all I get is a NullPointerException. I stripped the code down to the bare minimum and now have: LOMenu.jsp: --- %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN f:view f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.LOMenu var=MessageBundle/ html head link href=css/stylesheet.css rel=stylesheet type=text/css/ title h:outputText value=#{MessageBundle.dialogtitle} / /title /head body h:form id=LOMenuForm h:outputText value=#{MessageBundle.dialogtitle} / h:dataTable value=#{bookListBean.books} var=book border=1 h:column h:outputText value=#{book.classificationSystemName} / /h:column /h:dataTable /h:form /body /html /f:view The relevant pieces of faces-config are: - managed-bean managed-bean-namebookListBean/managed-bean-name managed-bean-classca.gc.nrc.iit.toml.frontend.LOMenuBackingBean/man aged-b ean-class managed-bean-scopesession/managed-bean-scope /managed-bean managed-bean managed-bean-namebook/managed-bean-name managed-bean-classca.gc.nrc.iit.toml.common.ClassificationSystemBean /mana ged-bean-class managed-bean-scoperequest/managed-bean-scope /managed-bean LOMenuBackingBean.java: package ca.gc.nrc.iit.toml.frontend; import java.util.*; import ca.gc.nrc.iit.toml.common.*; public class LOMenuBackingBean { private Vector books = null; public Collection getBooks() { ClassificationSystemBean a = new ClassificationSystemBean(1, title 1, bla, false); ClassificationSystemBean b = new ClassificationSystemBean(2, title 2, lala, true); ClassificationSystemBean c = new ClassificationSystemBean(3, title 3, smurf, false); this.books.add(a); this.books.add(b); this.books.add(c); return this.books; } public void setClassificationSystems(Vector classificationSystems) { this.books = classificationSystems; } } ClassificationSystemBean.java: --- package ca.gc.nrc.iit.toml.common; public class ClassificationSystemBean implements Serializable { private String classificationSystemName; public String getClassificationSystemName() { return classificationSystemName; } public void setClassificationSystemName(String classificationSystemName) { this.classificationSystemName = classificationSystemName; } } - I use MyFaces 1.0.9 and deploy the war in Tomcat 5.5.9 All I get is the following Stack Trace and I really, really don't know why. Everything works fine if I remove the dataTable tag (in that case, all I see is the message bundle output). But whenever I enter that dataTable, I get the exception. No matter what I tried, I always get the exception. I even did a copypaste from some dataTable tutorials I found - same result. What do I do wrong? I have tried to work with Vector, List, Collection and others in LOMenuBacking Bean but nothing seems to work. All I ever get is the exception. Thanks so much! Matt javax.faces.FacesException: Expression: '#{bookListBean.books}' at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch (Servl etExternalContextImpl.java:411) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspVi ewHand lerImpl.java:280) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110
General question about Action Listener
I just read http://www.laliluna.de/first-java-server-faces-tutorial.html and don't understand one thing: All action listener methods access the session. Why? Take a look at the deleteBook method, for instance. Instead of passing the book-ID direktly, its parameter is an event. Why? I mean, could the listBooks.jsp not simply pass the Book-ID as parameter to the method so that the parameter of deleteBook would be ID instead of event? Why is it necessary to access the session in every action listener and pass them events instead of IDs? Thanks Matt
RE: General question about Action Listener
Thanks for your quick reply. I still don't understand, though. Whydoes "general code" have to use the session? Do I have to do the same if I want to write a JSF application with commandLinks that call BackingBean methods? Thanks Matt From: ir. ing. Jan Dockx [mailto:[EMAIL PROTECTED] Sent: Freitag, 30. September 2005 11:28To: MyFaces DiscussionSubject: Re: General question about Action Listener Because this is general code, and the rest of the world doesn't know about your book-ID.But in essence, you're right. This is a major (performance and stability related) issue with JSF: too much stuff going on that is often not needed.And the problem is far more severe than you state now: just keep on studying :-).At this time, you have to choose: live with it, and enjoy the benefits of JSF that do exist; or go for more optimal, less complex code, and do it proprietary. Maybe Struts is an option for you: it has similar issues, but is a lot less intrusive than JSF.One last point: you could use outputLink instead of commandLink/Button to trigger an action on another URL than the page-of-origin, but this actually defies JSF.On 30 Sep 2005, at 11:16, Matthias Klein wrote:I just read http://www.laliluna.de/first-java-server-faces-tutorial.html and don't understand one thing:All action listener methods access the session. Why?Take a look at the "deleteBook" method, for instance. Instead of passing thebook-ID direktly, its parameter is an event. Why?I mean, could the listBooks.jsp not simply pass the Book-ID as parameter tothe method so that the parameter of deleteBook would be ID instead of event?Why is it necessary to access the session in every action listener and passthem events instead of IDs?ThanksMattMet vriendelijke groeten,Jan DockxPeopleWare NV - Head OfficeCdt.Weynsstraat 85 B-2660 Hoboken Tel: +32 3 448.33.38 Fax: +32 3 448.32.66 PeopleWare NV - Branch Office GeelKleinhoefstraat 5B-2440 GeelTel: +32 14 57.00.90Fax: +32 14 58.13.25http://www.peopleware.be/http://www.mobileware.be/
Conditional handling of list items
Is it possible to handle items in a list conditionally? What I mean is this: In my Backing Bean I have a Collection of ItemBeans. Each of those ItemBeans contains a boolean property such as isSomething. I would now like to display this Collection through a dataTable or dataList of commandLinks. (The result is essentially a simple list of links) Thus far it's easy. BUT now I want to treat the items differently depending on the isSomething flag: All Items with the flag set true are supposed to be outputText instead of commandLink (so a User can't click on that item) and may be rendered with a different color. Is that possible? (If it is easier to tag the special items in a different way, I can do that. I am not set on the boolean isSomething property) Thanks Matt
RE: Form data passing problem
Thanks. It works now. Matt -Original Message- From: Volker Weber [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 14. September 2005 14:47 To: MyFaces Discussion Subject: Re: Form data passing problem Hi, you must remove the immediate=true form your submit button! this skips the updatemodel phase. Matthias Klein wrote: I have written a simple JSF-page which contains only one single inputText: %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN f:view f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.RateCourse var=MessageBundle/ html head link href=css/stylesheet.css rel=stylesheet type=text/css/ title h:outputText value=#{MessageBundle.dialogtitle} / /title /head body h:form id=RateCourseForm h:panelGrid id=grid columns=4 h:outputText value=#{MessageBundle.dialogtitle} / h:inputText id=test value=#{RateCourseBackingBean.evaluation} required=true / h:commandButton id=submit action=#{RateCourseBackingBean.submit} value=#{MessageBundle.submitbuttonlabel} immediate=true / h:commandButton id=cancel action=#{RateCourseBackingBean.cancel} value=#{MessageBundle.cancelbuttonlabel} immediate=true / /h:panelGrid /h:form /body /html /f:view The Backing Bean looks like package ca.gc.nrc.iit.toml.frontend; //import javax.faces.model.*; public class RateCourseBackingBean { private String evaluation = test; public String submit() { System.out.println(this.evaluation); return submit; } public String cancel() { return cancel; } public String getEvaluation() { return evaluation; } public void setEvaluation(String evaluation) { this.evaluation = evaluation; } } It works so far but the System.out.println() in submit() only ever prints test on the console. And I don't know why. Did I make a mistake in the nesting of the tags of the JSF-page? (What is the official nesting of elements? The JSF-Spec does not seem to state what an empty JSF-page should look like and how the elements are to be nested.) Do you have any idea where that mistake is? Thanks Matt -- - Volker WeberDietrichsweg 38a 26127 Oldenburg Germany MAILTO:[EMAIL PROTECTED] HTTP://www.weber-oldenburg.de
Form data passing problem
I have written a simple JSF-page which contains only one single inputText: %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN f:view f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.RateCourse var=MessageBundle/ html head link href=css/stylesheet.css rel=stylesheet type=text/css/ title h:outputText value=#{MessageBundle.dialogtitle} / /title /head body h:form id=RateCourseForm h:panelGrid id=grid columns=4 h:outputText value=#{MessageBundle.dialogtitle} / h:inputText id=test value=#{RateCourseBackingBean.evaluation} required=true / h:commandButton id=submit action=#{RateCourseBackingBean.submit} value=#{MessageBundle.submitbuttonlabel} immediate=true / h:commandButton id=cancel action=#{RateCourseBackingBean.cancel} value=#{MessageBundle.cancelbuttonlabel} immediate=true / /h:panelGrid /h:form /body /html /f:view The Backing Bean looks like package ca.gc.nrc.iit.toml.frontend; //import javax.faces.model.*; public class RateCourseBackingBean { private String evaluation = test; public String submit() { System.out.println(this.evaluation); return submit; } public String cancel() { return cancel; } public String getEvaluation() { return evaluation; } public void setEvaluation(String evaluation) { this.evaluation = evaluation; } } It works so far but the System.out.println() in submit() only ever prints test on the console. And I don't know why. Did I make a mistake in the nesting of the tags of the JSF-page? (What is the official nesting of elements? The JSF-Spec does not seem to state what an empty JSF-page should look like and how the elements are to be nested.) Do you have any idea where that mistake is? Thanks Matt
RE: Form data passing problem
Thanks for your quick response. I deleted that but it still doesn't work. Any suggestions? DidI make a mistake with the nesting of the tags and elements? Thanks Matt From: Atree Blu [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 14. September 2005 15:05To: users@myfaces.apache.org; [EMAIL PROTECTED]Subject: Re: Form data passing problem Hi, the problem is immediate="true" on the submit commandButton. If you add this option the "properties sets step" and "validations step"are skiped and the action is executes immediatly. I hope this help you Nicola On 9/14/05, Matthias Klein [EMAIL PROTECTED] wrote: I have written a simple JSF-page which contains only one single inputText:%@ taglib uri=" http://java.sun.com/jsf/html" prefix="h" %%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" % !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"f:view f:loadBundlebasename="ca.gc.nrc.iit.toml.frontend.bundles.RateCourse"var="MessageBundle"/ html head link href="" rel="stylesheet"type="text/css"/ title h:outputTextvalue="#{MessageBundle.dialogtitle}" / /title /head body h:form id="RateCourseForm" h:panelGrid id="grid" columns="4" h:outputTextvalue="#{MessageBundle.dialogtitle}" / h:inputText id="test" value="#{RateCourseBackingBean.evaluation}" required="true" / h:commandButton id="submit"action=""value="#{MessageBundle.submitbuttonlabel}" immediate="true" / h:commandButton id="cancel"action=""value="#{MessageBundle.cancelbuttonlabel}" immediate="true" / /h:panelGrid /h:form /body /html/f:viewThe Backing Bean looks likepackage ca.gc.nrc.iit.toml.frontend;//import javax.faces.model.*;public class RateCourseBackingBean { private String evaluation = "test"; public String submit() { System.out.println(this.evaluation); return "submit"; } public String cancel() { return "cancel"; } public String getEvaluation() { return evaluation; } public void setEvaluation(String evaluation) { this.evaluation = evaluation; } }It works so far but the System.out.println() in submit() only ever prints"test" on the console.And I don't know why.Did I make a mistake in the nesting of the tags of the JSF-page? (What is the official nesting of elements? The JSF-Spec does not seem tostate what an empty JSF-page should look like and how the elements are to benested.)Do you have any idea where that mistake is?ThanksMatt
[newbie] Navigation does not work
I have started to create a simple MyFaces-App and encountered a problem with the navigation: Pressing a button does not do anything. Some code sniplets: - Page1: %@ page language=java % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.LODetails var=MessageBundle/ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body f:view h:form id=LODetailsForm table tbody [..] td h:commandButton id=viewuserratings action=#{LODetailsBackingBean.viewUserRatings} value=#{MessageBundle.viewratingsbuttonlabel} / /td [..] /h:form /f:view /body /html --- Excerpt from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule - Part of LODetailsBackingBean.java: public String viewUserRatings() { return viewuserratings; } I deployed that on Tomcat 5.5.9 with J2SDK 1.5.0_04 through MyEclipse IDE 4. I see the page1 but when I press the button, nothing happens. Why? Thanks a lot Matt
RE: [newbie] Navigation does not work
Actually, I did both but it did not change anything. Here the more complete excerpts from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case from-outcomeviewuserratings/from-outcome to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule managed-bean descriptionBacking-Bean for LODetails./description managed-bean-nameLODetailsBackingBean/managed-bean-name managed-bean-classca.gc.nrc.iit.toml.frontend.LODetailsBackingBean/manage d-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean Something like that I did. But still - pressing the button does not do anything at all So I am wondering if I did something wrong or if that is a JSF/MyFaces-issue. Thanks Matt -Original Message- From: hicham abassi [mailto:[EMAIL PROTECTED] Sent: Dienstag, 13. September 2005 12:59 To: MyFaces Discussion Subject: Re: [newbie] Navigation does not work 1/ it seems that yo don't declared your bean LODetailsBackingBean into faces-config.xml 2/ you don't declared a string outcome viewuserratings for view-id LODetails.jsf 2005/9/13, Matthias Klein [EMAIL PROTECTED]: I have started to create a simple MyFaces-App and encountered a problem with the navigation: Pressing a button does not do anything. Some code sniplets: - Page1: %@ page language=java % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.LODetails var=MessageBundle/ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body f:view h:form id=LODetailsForm table tbody [..] td h:commandButton id=viewuserratings action=#{LODetailsBackingBean.viewUserRatings} value=#{MessageBundle.viewratingsbuttonlabel} / /td [..] /h:form /f:view /body /html --- Excerpt from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule - Part of LODetailsBackingBean.java: public String viewUserRatings() { return viewuserratings; } I deployed that on Tomcat 5.5.9 with J2SDK 1.5.0_04 through MyEclipse IDE 4. I see the page1 but when I press the button, nothing happens. Why? Thanks a lot Matt -- hicham ABASSI [EMAIL PROTECTED]
RE: [newbie] Navigation does not work
That was only a try. I have used *.jsp before and it did not change a thing. I can easily run the example (e.g. the simple myfaces blank example) which works fine Then I took over the config they used and incorporated that in mine but it does not work. I really have NO idea what I did wrong. Matt -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Dienstag, 13. September 2005 13:55 To: MyFaces Discussion Subject: RE: [newbie] Navigation does not work Why do you have the *.jsf in your navigation-case? Shouldn't you be using *.jsp or are you not mapping to *.jsf as is common? Regards, David -Original Message- From: Matthias Klein [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 7:11 AM To: 'MyFaces Discussion'; [EMAIL PROTECTED] Subject: RE: [newbie] Navigation does not work Actually, I did both but it did not change anything. Here the more complete excerpts from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case from-outcomeviewuserratings/from-outcome to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule managed-bean descriptionBacking-Bean for LODetails./description managed-bean-nameLODetailsBackingBean/managed-bean-name managed-bean-classca.gc.nrc.iit.toml.frontend.LODetailsBackingBean/manage d-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean Something like that I did. But still - pressing the button does not do anything at all So I am wondering if I did something wrong or if that is a JSF/MyFaces-issue. Thanks Matt -Original Message- From: hicham abassi [mailto:[EMAIL PROTECTED] Sent: Dienstag, 13. September 2005 12:59 To: MyFaces Discussion Subject: Re: [newbie] Navigation does not work 1/ it seems that yo don't declared your bean LODetailsBackingBean into faces-config.xml 2/ you don't declared a string outcome viewuserratings for view-id LODetails.jsf 2005/9/13, Matthias Klein [EMAIL PROTECTED]: I have started to create a simple MyFaces-App and encountered a problem with the navigation: Pressing a button does not do anything. Some code sniplets: - Page1: %@ page language=java % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.LODetails var=MessageBundle/ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body f:view h:form id=LODetailsForm table tbody [..] td h:commandButton id=viewuserratings action=#{LODetailsBackingBean.viewUserRatings} value=#{MessageBundle.viewratingsbuttonlabel} / /td [..] /h:form /f:view /body /html --- Excerpt from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule - Part of LODetailsBackingBean.java: public String viewUserRatings() { return viewuserratings; } I deployed that on Tomcat 5.5.9 with J2SDK 1.5.0_04 through MyEclipse IDE 4. I see the page1 but when I press the button, nothing happens. Why? Thanks a lot Matt -- hicham ABASSI [EMAIL PROTECTED]
RE: [newbie] Navigation does not work
What does "LODetails.jsp is not using a resource file" mean? I changed jsf to jsp, too, but it still does not work. I assume there must be some tiny, little "stupid" mistake but I can't seem to find it. Matt From: Dexter Wong [mailto:[EMAIL PROTECTED] Sent: Dienstag, 13. September 2005 14:07To: MyFaces DiscussionCc: [EMAIL PROTECTED]Subject: Re: [newbie] Navigation does not work Hi,your sample worked for me. I am using jboss 4.0.2java 1.5.004windows xpI make some changes0. changed files from *.jsf to *.jsp1. my config files looks like navigation-rule from-view-id/LODetails.jsp/from-view-id navigation-case from-outcomeviewuserratings/from-outcome to-view-id/LORatings.jsp/to-view-id /navigation-case /navigation-rule 2. The LODetails.jsp is not using a resource file On 9/13/05, Matthias Klein [EMAIL PROTECTED] wrote: Actually, I did both but it did not change anything.Here the more complete excerpts from faces-config:navigation-rulefrom-view-id/LODetails.jsf/from-view-idnavigation-case from-outcomeviewuserratings/from-outcometo-view-id/LORatings.jsf/to-view-id/navigation-case/navigation-rulemanaged-bean descriptionBacking-Bean for LODetails./descriptionmanaged-bean-nameLODetailsBackingBean/managed-bean-namemanaged-bean-classca.gc.nrc.iit.toml.frontend.LODetailsBackingBean /managed-bean-classmanaged-bean-scopesession/managed-bean-scope/managed-beanSomething like that I did.But still - pressing the button does not do anything at all So I am wondering if I did something wrong or if that is aJSF/MyFaces-issue.ThanksMatt-Original Message-From: hicham abassi [mailto:[EMAIL PROTECTED] ]Sent: Dienstag, 13. September 2005 12:59To: MyFaces DiscussionSubject: Re: [newbie] Navigation does not work1/ it seems that yo don't declared your bean LODetailsBackingBean intofaces-config.xml 2/ you don't declared a string outcome viewuserratings forview-id LODetails.jsf2005/9/13, Matthias Klein [EMAIL PROTECTED]: I have started to create a simple MyFaces-App and encountered a problem with the navigation: Pressing a button does not do anything. Some code sniplets: - Page1: %@ page language="java" % %@ taglib uri="http://java.sun.com/jsf/html" prefix="h" % %@ taglib uri="http://java.sun.com/jsf/core " prefix="f" % f:loadBundle basename="ca.gc.nrc.iit.toml.frontend.bundles.LODetails" var="MessageBundle"/ !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" html body f:view h:form id="LODetailsForm" table tbody [..] td h:commandButton id="viewuserratings" action="" value="#{MessageBundle.viewratingsbuttonlabel}" / /td [..] /h:form /f:view /body /html --- Excerpt from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule - Part of LODetailsBackingBean.java: public String viewUserRatings() { return "viewuserratings"; } I deployed that on Tomcat 5.5.9 with J2SDK 1.5.0_04 through MyEclipse IDE4. I see the page1 but when I press the button, nothing happens. Why? Thanks a lot Matt--hicham ABASSI[EMAIL PROTECTED]
RE: [newbie] Navigation does not work
1. remove from-view-id/LODetails.jsp/from-view-id (is not needed for this test) I did that 2. set action=viewuserratings directly, instead of the bean method I did that 3. check if the container really update your modified web-application (how do you deploy?) I deploy out of MyEclipse IDE 4. The console says that it does deploy the .war Unfortunately, none of the changes helped. Pressing the button does not help at all. Matt Udo Dexter Wong wrote: Hi, your sample worked for me. I am using jboss 4.0.2 java 1.5.004 windows xp I make some changes 0. changed files from *.jsf to *.jsp 1. my config files looks like navigation-rule from-view-id/LODetails.jsp/from-view-id navigation-case from-outcomeviewuserratings/from-outcome to-view-id/LORatings.jsp/to-view-id /navigation-case /navigation-rule 2. The LODetails.jsp is not using a resource file On 9/13/05, *Matthias Klein* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Actually, I did both but it did not change anything. Here the more complete excerpts from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case from-outcomeviewuserratings/from-outcome to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule managed-bean descriptionBacking-Bean for LODetails./description managed-bean-nameLODetailsBackingBean/managed-bean-name managed-bean-classca.gc.nrc.iit.toml.frontend.LODetailsBackingBean /manage d-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean Something like that I did. But still - pressing the button does not do anything at all So I am wondering if I did something wrong or if that is a JSF/MyFaces-issue. Thanks Matt -Original Message- From: hicham abassi [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]] Sent: Dienstag, 13. September 2005 12:59 To: MyFaces Discussion Subject: Re: [newbie] Navigation does not work 1/ it seems that yo don't declared your bean LODetailsBackingBean into faces-config.xml 2/ you don't declared a string outcome viewuserratings for view-id LODetails.jsf 2005/9/13, Matthias Klein [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: I have started to create a simple MyFaces-App and encountered a problem with the navigation: Pressing a button does not do anything. Some code sniplets: - Page1: %@ page language=java % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jsf/core http://java.sun.com/jsf/core prefix=f % f:loadBundle basename=ca.gc.nrc.iit.toml.frontend.bundles.LODetails var=MessageBundle/ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html body f:view h:form id=LODetailsForm table tbody [..] td h:commandButton id=viewuserratings action=#{LODetailsBackingBean.viewUserRatings} value=#{MessageBundle.viewratingsbuttonlabel} / /td [..] /h:form /f:view /body /html --- Excerpt from faces-config: navigation-rule from-view-id/LODetails.jsf/from-view-id navigation-case to-view-id/LORatings.jsf/to-view-id /navigation-case /navigation-rule - Part of LODetailsBackingBean.java: public String viewUserRatings() { return viewuserratings; } I deployed that on Tomcat 5.5.9 with J2SDK 1.5.0_04 through MyEclipse IDE 4. I see the page1 but when I press the button, nothing happens. Why? Thanks a lot Matt -- hicham ABASSI [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- Dipl.-Math. Udo Schnurpfeil - Executive Officer - Atanion GmbH Software Development - Bismarckstraße 13 - 26122 Oldenburg - Germany phone +49 441 4082310 - mobile +49 174 9784746 - fax +49 441 4082333 mailto:[EMAIL PROTECTED] - http
RE: [newbie] Navigation does not work
Thank you so much for your help today. Indeed, that was the problem. Now everything is working fine. Thanks! Matt -Original Message- From: Udo Schnurpfeil [mailto:[EMAIL PROTECTED] Sent: Dienstag, 13. September 2005 16:37 To: MyFaces Discussion Subject: Re: [newbie] Navigation does not work I assume it is one of those tiny yet stupid newbie problems but I can't wrap my brain around it... Okay, I've found it ;-) Your have used the f:view tag 2 times on one page. That is not allowed and will evidently confusing the framework.