[jboss-user] [JBoss Seam] - JSF and updating hidden field

whafrog do-not-reply at jboss.com
Thu Nov 22 15:47:28 EST 2007


Hi, this is probably more of a JSF question, but maybe Seam has a workaround:

I have a simple table where each row is a component.  If the user has this component in the database, the hidden field has a value and the box is checked.  If they do not, they can always check the box and that component will be added to the database.  The problem is that the value of "lenderBenefitId" is handled on the server side.  If they check the box and click Save, the row is persisted to the database and the lenderBenefitId is populated.  If they uncheck the box that has a lenderBenefitId that is not null, that record will be deleted from the database and lenderBenefitId set to null.  But these changes are not propagated back to the view.  How can I get this propagation to happen?

<h:panelGrid columns="2">
  |   <h:selectBooleanCheckbox value="#{benefitMap.getBenefit('ORIGINATION_FEE').selected}"/>
  |   <h:panelGroup>
  |     <h:inputHidden value="#{benefitMap.getBenefit('ORIGINATION_FEE').lenderBenefitId}"/>
  |     <h:outputLabel for="originationFee">Origination Fee:</h:outputLabel>  
  |     <h:inputText value="#{benefitMap.getBenefit('ORIGINATION_FEE').percentReduction}" size="5"/>%
  |   </h:panelGroup>
  |   <h:selectBooleanCheckbox value="#{benefitMap.getBenefit('FEDERAL_DEFAULT_FEE').selected}"/>
  |   <h:panelGroup>
  |     <h:inputHidden value="#{benefitMap.getBenefit('FEDERAL_DEFAULT_FEE').lenderBenefitId}"/>
  |     <h:outputLabel for="federalDefaultFee">Federal Default Fee:</h:outputLabel>  
  |     <h:inputText value="#{benefitMap.getBenefit('FEDERAL_DEFAULT_FEE').percentReduction}" size="5"/>%
  |   </h:panelGroup>
  | </h:panelGrid>
  | 
  | <div class="actionButtons">
  | <h:commandButton type="submit" value="Save" action="#{lenderbenefits.processLenderBenefits}"/>
  | </div>

Many thanks in advance!

Jon

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107192#4107192

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107192



More information about the jboss-user mailing list