gpt4 book ai didi

jsf - java.lang.IllegalArgumentException : Setter not found for property class

转载 作者:行者123 更新时间:2023-12-03 18:36:27 27 4
gpt4 key购买 nike

我想实现一个带有行编辑的表。

我找到了 this exemple在展示中,但我每次都会收到此错误:

  • javax.servlet.ServletException:找不到属性类的 Setter
  • java.lang.IllegalArgumentException:找不到属性的 Setter
    类(class)

  • 我的 xhtml
               <a4j:status onstart="#{rich:component('statPane')}.show()"
    onstop="#{rich:component('statPane')}.hide()" />

    <h:form id="form">
    <rich:dataScroller for="dataTableId" maxPages="8" />
    <rich:extendedDataTable id="dataTableId" rows="200"
    value="#{declarationReglementaireModel.detailCurrentDecReg.decReg.listLigneTa3SDTO}"
    var="ligneTA3" frozenColumns="2"
    style="height:300px; width:800px;" selectionMode="none">

    <rich:column width="35px">
    <h:panelGrid columns="1" cellpadding="2">

    <a4j:commandLink class="lien_detail" render="editGrid"
    execute="@this"
    oncomplete="#{rich:component('editPane')}.show()">
    <span class="icone icone-edit icone-align-center" />
    <a4j:param value="1"
    assignTo="#{modifDecRegTa3Model.currentLigneTa3Index}" />
    <f:setPropertyActionListener target="#{modifDecRegTa3Model.editedRow}"
    value="#{ligne}" />
    </a4j:commandLink>

    </h:panelGrid>
    </rich:column>
    <rich:column width="150px" sortBy="#{ligneTA3.idTitre}"
    sortOrder="ascending">
    <f:facet name="header">Référence Titre</f:facet>
    <h:outputText value="#{ligneTA3.idTitre}">
    </h:outputText>
    </rich:column>
    <rich:column>
    <f:facet name="header">
    <h:outputText value="a" />
    </f:facet>
    <h:outputText value="#{ligneTA3.vlColA}">
    </h:outputText>
    </rich:column>
    <rich:column>
    <f:facet name="header">
    <h:outputText value="b" />
    </f:facet>
    <h:outputText value="#{ligneTA3.vlColB}">
    </h:outputText>
    </rich:column>
    <rich:column>
    <f:facet name="header">
    <h:outputText value="c" />
    </f:facet>
    <h:outputText value="#{ligneTA3.vlColC}">
    </h:outputText>
    </rich:column>

    <rich:dataScroller for="dataTableId" maxPages="8" />


    <rich:popupPanel id="statPane" autosized="true">
    Please wait...
    </rich:popupPanel>

    <rich:popupPanel header="Modifier ligne" id="editPane" domElementAttachment="parent" width="400" height="170">
    <h:panelGrid columns="3" id="editGrid">
    <h:outputText value="vlColA" />
    <h:outputText value="#{modifDecRegTa3Model.editedRow.vlColA}" />
    <h:panelGroup />
    <h:outputText value="vlColB" />
    <h:outputText value="#{modifDecRegTa3Model.editedRow.vlColB}" />
    <h:panelGroup />
    <h:outputText value="vlColC" />
    <h:inputText value="#{cmodifDecRegTa3Model.editedRow.vlColC}" required="true" requiredMessage="Price is required" id="price"/>
    </h:panelGrid>
    <a4j:commandButton value="Store" action="#{rechercheDecRgltCtrl.validerModifications}" render="table" execute="editPane"
    oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('editPane')}.hide();}" />
    <a4j:commandButton value="Cancel" onclick="#{rich:component('editPane')}.hide(); return false;" />
    </rich:popupPanel>


    </h:form>
    </h:panelGrid>
    </h:form>

    我的模特
    @ManagedBean(name="modifDecRegTa3Model")
    @SessionScoped
    public class ModifDecRegTa3Model {
    private static final long serialVersionUID = 1L;
    private LigneTa3DTO currentElement;
    private Integer selectedPage;
    private int currentLigneTa3Index;
    private LigneTa3DTO editedRow;
    public ModifDecRegTa3Model() {
    super();
    }

    public LigneTa3DTO getCurrentElement() {
    return currentElement;
    }
    public void setCurrentElement(LigneTa3DTO currentElement) {
    this.currentElement = currentElement;
    }
    public Integer getSelectedPage() {
    return selectedPage;
    }
    public void setSelectedPage(Integer selectedPage) {
    this.selectedPage = selectedPage;
    }
    public int getCurrentLigneTa3Index() {
    return currentLigneTa3Index;
    }
    public void setCurrentLigneTa3Index(int currentLigneTa3Index) {
    this.currentLigneTa3Index = currentLigneTa3Index;
    }
    public LigneTa3DTO getEditedRow() {
    return editedRow;
    }
    public void setEditedRow(LigneTa3DTO editedRow) {
    this.editedRow = editedRow;
    }

    }

    最佳答案

    这可能与您的不良属性有关:

    <a4j:commandLink class="lien_detail" />

    没有属性 class用于组件 a4j:commandLink你应该使用 styleClass反而。

    关于jsf - java.lang.IllegalArgumentException : Setter not found for property class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16935343/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com