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 "SubmitPageOnValueChange" by MarioIvankovits
Date Thu, 24 Nov 2005 07:06:03 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 MarioIvankovits:
http://wiki.apache.org/myfaces/SubmitPageOnValueChange

------------------------------------------------------------------------------
  
  In the previous example, if you don't want your button to be seen, use the style style="visibility:hidden;",
so the button is hidden and the effect is better :-)
  
+ == How To Submit a page when an input control value changes (simplified) ==
+ 
+ If you do not need navigation rules to apply, you can do this:
+ 
+ === Example ===
+ 
+ {{{
+ <f:view>
+     <h:form>
+ 
+         <h:selectOneMenu
+             onchange="submit()"
+             value="#{page.physicalLocation}"
+             title="No location selected"
+             required="true"
+             valueChangeListener="#{page.menuChanged}">
+             <f:selectItems
+                 value="#{page.locationItems}"/>
+         </h:selectOneMenu>
+ 
+     </h:form>
+ </f:view>
+ }}}
+ 
+  1. less javascript
+  1. no need to use "id"s
+ 
+ If you need to update model values (e.g. to fill a second menu) in your valueChangeListener,
please see here: http://issues.apache.org/jira/browse/MYFACES-864
+ 
+ 
+ == How To Submit a page when hitting "enter" ==
+ 
  Here's another example provided by Bruno Aranda. It is doing a form submission with just
a text field for something like a quick search. It works as follows:
  
   1. Include this javascript in the {{{<head>}}}

Mime
View raw message