I have a table that displays all rows as readonly.  If the user clicks on the
edit button on the side, then that column is no longer readonly and they can
update the value.  However when the instance gets back to the backing bean
the data for columns that were originaly readonly has not been updated.  Any
idea?  In the example below, only one column is read only at first.  When
they click on edit, I update the column but the new data never gets back to
the backing bean.  If I remove the readonly clause it works, however all the
rows are now editable.  We can only permit one row to be edited at a time
because of special validations that need to be done.

                        
        <fieldset>              
                <legend>#{msgs.ddListOfDisabilitiesLbl}&#160;
                                <h:commandButton onclick="if
(!#{disabilityDetail.authorizationMap['12']})
{alert('#{msgs.authNotAuthorized}'); return false;}" 
                                                                
action="#{disabilityDetail.addRowAction()}" 
                                                                
value="#{msgs.ddAddNewDisabilityTypeBtn}" 
                                                                
disabled="#{disabilityDetail.isSaveBtnDisabled}" /></legend>
                
                <h:dataTable value="#{disabilityList}" var="disability"
                        styleClass="view" headerClass="viewHeader"
                        rowClasses="viewRows" 
                
columnClasses="viewColDisabilityCrud,viewColDisabilityCrud,viewColDisabilityType,viewColDisabilityOccCnt">
                        
                        <h:column 
rendered="#{!disabilityDetail.isSaveBtnDisabled}">                              
              
                                <s:link id="removeDisabilityId"
action="#{disabilityDetail.removeRowAction()}" 
                                        
rendered="#{!disabilityDetail.isCreatableRow and
!disabilityDetail.isEditableRow }">
                                        <h:graphicImage id="removeImageId" 
alt="Remove"
url="../images/delete.gif"
                                                                        
onclick="if (!#{disabilityDetail.authorizationMap['12']})
{alert('#{msgs.authNotAuthorized}'); return false;}" />                         
                
                                        <f:param name="instanceParamId" 
value="#{disability.id}"/>                                                      
                        
                                        <s:conversationPropagation type="join"/>
                                </s:link>                               
                        </h:column>     
                        <h:column>
                                <h:outputText value="" 
rendered="#{disabilityDetail.isCreatableRow or
disabilityDetail.isEditableRow}"/>                                              
        
                                <s:link id="editDisabilityId" 
action="#{disabilityDetail.editRowAction}" 
rendered="#{!disabilityDetail.isCreatableRow and
!disabilityDetail.isEditableRow}">
                                        <h:graphicImage id="editImageId" 
alt="Edit"
url="../images/editable.gif"
                                                                        
onclick="if (!#{disabilityDetail.authorizationMap['12']})
{alert('#{msgs.authNotAuthorized}'); return false;}" /> 
                                        <f:param name="instanceParamId" 
value="#{disability.id}"/>                                      
                                        <s:conversationPropagation type="join"/>
                                </s:link>                       
                        </h:column>     
                        
                        <h:column>                              
                                <f:facet 
name="header">#{msgs.ddTypeOfDisabilityTtlLbl}</f:facet>
                                        <h:selectOneMenu 
value="#{disability.disabilityTypeCode}"
converter="#{disabilityDetail.disabilityTypeCodePickList.converter}" >
                                                <f:selectItems
value="#{disabilityDetail.disabilityTypeCodePickList.pickListMap}"
/></h:selectOneMenu>
                        </h:column>
                        <h:column>
                                <f:facet
name="header">#{msgs.ddNoOfOccupantsWithDisabilityTtlLbl}</f:facet>
                        <h:inputText id="Occupants_Count"
value="#{disability.occupantsCount}" class="rightalign" size="5"
maxlength="5" readonly="#{!(disability.id == null or
(disabilityDetail.isEditableRow and disability.id ==
disabilityDetail.instanceParamId))}">
                        </h:inputText><br/>
                                        <h:message for="Occupants_Count" 
styleClass="ahMessages"/>              
                        </h:column>                                             
         
                </h:dataTable>  

        </fieldset> 
-- 
View this message in context: 
http://www.nabble.com/Problem-updating-a-column-using-datatable-tf4024533.html#a11431233
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to