myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "HowToImplementSomeBrowseButton" by ArnaudValere
Date Mon, 15 Dec 2008 10:26:28 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by ArnaudValere:
http://wiki.apache.org/myfaces/HowToImplementSomeBrowseButton

The comment on the change is:
Better solutions available now

------------------------------------------------------------------------------
- A fictive example: your brand new JSF-App gives the possibility to assign to each computer
(entity A) of your firm one network printer (entity B). You are dealing with some 100.000
computers and 20.000 network printers!
+ deleted
  
- When the user add or edit a computer, you can not confront him with a list of 20.000 printers.
A common solution is to use some kind of "Browse..." button leading to a search form. There
you can search for the right printer and when you pick it up, the app take you back to the
computer view where your choice is inserted in the corresponding input field.
- 
- My first shot was to use two JSF views and two backing beans: one for adding/editing computers,
one for searching printers. But because of the problem explained in ["How The Immediate Attribute
Works"], I was bound to following dilemma: whether I use immediate=true on the "browse" command
button and every user input get lost (remember: the backing bean will not be updated), or
I use immediate=false and the validation may prevent from proceeding to the printer search.
- 
- The solution I present here is tricky, but the concept is simple: use the same <h:form>
for both the computer view and the printer search.
- 
- Reduced comprehensive working example coming soon ;-)
- 

Mime
View raw message