3 Replies Latest reply on Aug 13, 2007 10:49 PM by Matt Drees

    Seam + Ajax4JSF

    Phil Haigh Novice


      I'm using seam with a4j for dynamic validation etc etc. However, all of my a4j enabled parts of the form are actually written to the database on every change.


       <h:form id="webpageForm">
       <f:facet name="afterInvalidField">
       <f:facet name="aroundInvalidField">
       <s:span styleClass="error"/>
       <h:panelGrid columns="2" columnClasses="object, value">
       <h:outputText value="Banner #1"/>
       <h:panelGroup id="smallimage1">
       <h:selectOneMenu value="#{webpage.banner_image_1}" required="true">
       <a4j:support event="onchange" reRender="smallimage1" ajaxSingle="true"/>
       <s:selectItems value="#{bannerImages.resultList}"
       var="image" noSelectionLabel="Please select"
       label="#{image.filename}: #{image.altText}"/>
       <h:graphicImage value="../images/#{webpage.banner_image_1.filename}" alt="#{webpage.banner_image_1.altText}"></h:graphicImage>

      Changing the drop down will result in the database entry being updated instantly. Can someone tell me why this is the case, and what I need to do (or have missed doing) to prevent it? I want the model to be updated, naturally, but the database should only be written to when I tell it to..