2) textBean is a request-scoped backing bean with textValue attribute and its setters and getters
3) managedBean is the RAD-generated, request-scoped bean with all the component getters, in which I have the showText action as foll
Question: Is there a better (simpler) way to code for the above requirement? I am still trying to get my head around the lifecycle..so forgive this question..isn't it possible to do a simple text2.value=text1.value somewhere?
True, but I meant the showText() method..getting the facesContext instance, getexternalcontext, etc..etc..till you set it back as an attribute. I was thinking my approach was long-winded and there was a shorter way
You didn't supply a value attribute on the text1 control. Therefore, the MVC controller has no Model to get/set with the contents of that form control. You need something more like this:
To achieve your purpose, the the showText action needs to do something like this:
You don't need a navigation rule in JSF2 if you're re-displaying the same View. If you place the showText method in the textBean instead of its own bean and are following the POJO JavaBean conventions, you can also code:
As a general rule, the only objects and classes from the javax.faces packages that most JSF code should be using are the SelectItem and DataTable model wrapper classes. When you start referencing the FacesContext and/or non-model JSF classes, there's a good chance you're not doing it right.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"