开发者

can't edit my h:datatable

开发者 https://www.devze.com 2022-12-25 17:41 出处:网络
i have this code: <h:form> <rich:dataTablevalue=\"#{my.lreqs}\"var=\"req\" id=\"reqs\" width=\"630px\">

i have this code:

<h:form>
        <rich:dataTable  value="#{my.lreqs}"  var="req"
            id="reqs" width="630px"  >
                <rich:column label="Valu开发者_StackOverflow中文版e" styleClass="schColL" width="90px"
                style="text-align:center">
                <f:facet name="header">
                    <h:outputText value="#{my.colValue}" />
                </f:facet>
                <h:inputText value="#{req.value}" >
                </h:inputText>
            </rich:column>
        </rich:dataTable>
        <h:commandButton value="Save"
            action="#{my.saveChanges}" ></h:commandButton>
    </h:form>

and this is my bean:

private List<Detail> lreqs;


public void setLreqs(List<Detail> lreqs) {
        this.lreqs = lreqs;
}

public void saveChanges() {

        firstNewValue = lreqs.get(0).getValue();
        }

/**
     * @return the lreqs
     */
    public List<Detail> getLreqs() {
        if (currentJob != null && lreqs==null) {
            lreqs = (List<Detail>) jobsBDataDAO.findByJobBooking(currentJob);
        }
        return lreqs;
    }

but when i click save - a new value in req.value field is not being saved! why is it?


I add a mistake.

the a4j:keepAlive tag of richfaces was before f:view.. and wasn't read properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号