Error in JSF, error in the p: commandButton

0
                <h:form id="form">
                    <p:dataTable id="tblUB" var="infoUT" value="#{sdiacMB.listaUbicacionTecnica}" 
                                 resizableColumns="true" paginator="true" paginatorPosition="bottom" >
                        <p:column headerText="ID">
                            <h:outputText value="#{infoUT.idUbicacionTecnica}" />
                        </p:column>                            
                        <p:column headerText="Lugar">
                            <h:outputText value="#{infoUT.tipoLugar}" />
                        </p:column>
                        <p:column headerText="Ubicación">
                            <h:outputText value="#{infoUT.ubicacion}" />
                        </p:column>
                        <p:column headerText="Denominacion">
                            <h:outputText value="#{infoUT.denominacion}" />
                        </p:column>
                        <p:column style="width:32px;text-align: center">
                            <p:commandButton update=":form:utDetail" oncomplete="PF('utDialog').show()" icon="ui-icon-search" title="View">
                                <f:setPropertyActionListener value="#{infoUT}" target="#{sdiacMB.selectedUbicacionTecnica}" />
                            </p:commandButton>
                        </p:column>

                        <f:facet name="footer">
                            <p:commandButton value="Modificar" />
                            <p:commandButton value="Eliminar" />
                        </f:facet>
                    </p:dataTable>

                    <p:dialog header="Ubicacion Tecnica" widgetVar="utDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
                        <p:outputPanel id="utDetail" style="text-align:center;">
                            <p:panelGrid  columns="2" rendered="#{not empty sdiacMB.selectedUbicacionTecnica}"  columnClasses="label,value">
                                <f:facet name="header">
                                    <h:outputText value="Datos Ubicacion Tecnica" />
                                </f:facet>
                                <h:outputText value="Lugar:" />
                                <h:outputText value="#{sdiacMB.selectedUbicacionTecnica.tipoLugar}" />
                                <h:outputText value="Ubicacion" />
                                <h:outputText value="#{sdiacMB.selectedUbicacionTecnica.ubicacion}" />
                                <h:outputText value="Denominacion" />
                                <h:outputText value="#{sdiacMB.selectedUbicacionTecnica.denominacion}" />
                                <h:outputText value="ID" />
                                <h:outputText value="#{sdiacMB.selectedUbicacionTecnica.idUbicacionTecnica}" />
                            </p:panelGrid>
                        </p:outputPanel>
                    </p:dialog>

                </h:form>

@ManagedBean (name="sdiacMB") @ViewScoped public class SistemaDeInventarioACManagedBean {

private UbicacionTecnicaDTO ubicacionTecnicaDTO;
private List<UbicacionTecnicaDTO> listaUbicacionTecnica;

@EJB
private IUbicacionTecnicaService ubicacionTecnicaService;

private UbicacionTecnicaDTO selectedUbicacionTecnica ;

public SistemaDeInventarioACManagedBean() {
    ubicacionTecnicaDTO = new UbicacionTecnicaDTO();
}

@PostConstruct
public void init() {
    ListarUbicacionTecnica();        
}

public void ListarCentroDeCosto() {
    FacesContext context = FacesContext.getCurrentInstance();
    try {
        listaCentroDeCosto = centroDeCostoService.listarCentroDeCosto();
        context.addMessage(null, new FacesMessage("Consulta con exito"));
    } catch (Exception e) {
        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error!", "Error al Consultar Lista"));
    }
}

public UbicacionTecnicaDTO getUbicacionTecnicaDTO() {
    return ubicacionTecnicaDTO;
}

public void setUbicacionTecnicaDTO(UbicacionTecnicaDTO ubicacionTecnicaDTO) {
    this.ubicacionTecnicaDTO = ubicacionTecnicaDTO;
}

public List<UbicacionTecnicaDTO> getListaUbicacionTecnica() {
    return listaUbicacionTecnica;
}

public void setListaUbicacionTecnica(List<UbicacionTecnicaDTO> listaUbicacionTecnica) {
    this.listaUbicacionTecnica = listaUbicacionTecnica;
}

public IUbicacionTecnicaService getUbicacionTecnicaService() {
    return ubicacionTecnicaService;
}

public void setUbicacionTecnicaService(IUbicacionTecnicaService ubicacionTecnicaService) {
    this.ubicacionTecnicaService = ubicacionTecnicaService;
}

public UbicacionTecnicaDTO getSelectedUbicacionTecnica() {
    return selectedUbicacionTecnica;
}

public void setSelectedUbicacionTecnica(UbicacionTecnicaDTO selectedUbicacionTecnica) {
    this.selectedUbicacionTecnica = selectedUbicacionTecnica;
}

}

Warning: Defining non-serializable attribute value in ViewMap: (key: sdiacMB, value class: controller.ACManagedBeanInventorySystem) Serious: javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: /dirUbicTec.xhtml @ 62,100 value="": Illegal Syntax for Set Operation     at javax.faces.component.UIInput.updateModel (UIInput.java:866)     at javax.faces.component.UIInput.processUpdates (UIInput.java:749)     at javax.faces.component.UIComponentBase.processUpdates (UIComponentBase.java:1291)     at javax.faces.component.UIComponentBase.processUpdates (UIComponentBase.java:1291)     at javax.faces.component.UIComponentBase.processUpdates (UIComponentBase.java:1291)     at javax.faces.component.UIComponentBase.processUpdates (UIComponentBase.java:1291)

    
asked by David Latorre 29.04.2017 в 20:28
source

1 answer

0

If you look at the stack of your exception you can see:

javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: 

which comes from

javax.faces.component.UIInput.updateModel(UIInput.java:866)

The phase updateModel must set in the backing bean the value after it has been sub-validated and validated and in order to do so there must be a setter defined for the bean attribute (otherwise it has no way of writing if the member is private)

Since you do not publish the whole of your xhtml, it is not possible to know what line 62 corresponds to (if you look at the stack, you see that it is there where PropertyNotWritableException occurs); but seeing your model and the xhtml, it is likely that some of the attributes of the class UbicacionTecnicaDTO have not defined the setter

Verify that you have set getters and setters for:

-typeLugar

-location

-designation

-Technical Location

    
answered by 06.06.2017 в 03:12