Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 将文本输入到列表中';行不通_Jsf_Jsf 2 - Fatal编程技术网

Jsf 将文本输入到列表中';行不通

Jsf 将文本输入到列表中';行不通,jsf,jsf-2,Jsf,Jsf 2,我得到了以下信息 HTML代码: <h:form id="form"> <h:dataTable id="table1" value="#{fournisseurbean.BC.selecteditems}" rendered="#{not empty fournisseurbean.BC.selecteditems}" style="width : 900px; " var="car" border="3" cellpadding="1

我得到了以下信息 HTML代码:

<h:form id="form">
      <h:dataTable id="table1" value="#{fournisseurbean.BC.selecteditems}" rendered="#{not empty fournisseurbean.BC.selecteditems}" style="width : 900px;  " var="car"
             border="3" cellpadding="10" cellspacing="3">

    <h:column>
        <f:facet name="header">
            <h:outputText value="Désignation" />
        </f:facet>
        <h:outputText value="#{car.itemmateriel.designation}" />
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Unité" />
        </f:facet>
        <h:outputText value="#{car.itemmateriel.unite}" />
    </h:column>

     <h:column>
        <f:facet name="header">
            <h:outputText value="Input" />
        </f:facet>
        <h:inputText value="#{car.value}" />
    </h:column>


</h:dataTable>
 <p:commandButton value=" Sauvegarder "  render="form"  action="#{fournisseurbean.sauvegarderBC()}" />
</h:form>


函数
sauvegarderBC()
是一个修改BC的函数,这里的问题是
,用户输入的值不能修改,它们总是=0。我可以确保函数
sauvegarderBC()
一切正常,所以问题来自HTML部分,我想这是因为我在同一个表中进行了输出和输入,感谢您解释错误。

添加Fourniseurbean的代码。问题可能是访问字段fourniseurbean.BC.selecteditems的方式。试试fournisseurbean.bC。由于getter原因,请选择bC中带有小写字母b的编辑项。@johny:yesss!!我真的很感激!!我在JSF中输入值时总是遇到问题,现在我意识到这是因为我总是用大写字母写我的新对象!!我向你保证,我永远不会忘记!!