我是JSF和ICE面孔的新手,
以下是我的问题的前言。
fxtext - 在xhtml中备份bean变量名
fxtext.textList - 填充在数据表
中基于
valueChangeListener ="#{fxtext.gettextDetailsBytype}
数据在数据表中动态填充。
以下数据表格xhtml
我的Xhtml文件
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:wm="http://www.test.com/wm">
<h:head>
</h:head>
<h:body>
<ui:composition template="/templates/nav.xhtml">
<ui:define name="bodycontent">
<ice:panelGroup timestamp="#{fxtext.timestampNew}">
<ice:outputStyle href="#{contextpath}/css/datepicker.css" rel="stylesheet" type="text/css" />
<ice:form id="managetextForm">
<div class="shadow_container">
<!--border-->
<div class="color_container_blue">
<ui:include src="../fxtextadmin/fxtextadmin_sub_nav.xhtml">
<ui:param name="selectedSubTab" value="fxsearch" />
</ui:include>
<!--content-->
<div class="content_container">
<div class="module" style="width: 100% !important">
<div class="module_head" style="width: 100% !important;">
<h2>Manage Fx text Details</h2>
</div>
<div class="module_body" rendered="#{not empty fxtext.textRow}">
<ice:outputText rendered="#{not empty fxtext.errorMessage}" styleClass="redFontError">
#{fxtext.errorMessage}
</ice:outputText>
<ice:messages errorClass="redFontError"></ice:messages>
<div class="spacer"></div>
<div class="fieldrow">
<span class="label width30per">Fx ID : #{fxtext.textRow.fxtextId}</span>
<span class="label width70per">Fx Name : #{fxtext.textRow.name}</span>
</div>
<div class="spacer"></div>
<div class="fieldrow">
<span class="label width200">#{resources['fxtextadmin.fxtext.type.label']}</span>
<div class="space5"></div>
<ice:selectOneMenu styleClass="width200" valueChangeListener="#{fxtext.gettextDetailsBytype}"
value="#{fxtext.type}" immediate="true" id="typeselect" partialSubmit="true">
<f:selectItems value="#{fxtext.typeList}"></f:selectItems>
</ice:selectOneMenu>
</div>
<ice:dataTable value="#{fxtext.textList}" id="textValue"
var="textRow" width="100%" varStatus="vs" styleClass="fxtexttab"
headerClasses="lightgreyheader,lightgreyheader" rendered="#{not empty fxtext.textList}">
<ice:column>
<div class="spacer"></div>
<div class="fieldrow">
<span class="label margin5px" style="width: 25%">#{resources['fxtextadmin.fxtext.starttime.label']}</span>
<span class="label margin5px" style="width: 25%">#{resources['fxtextadmin.fxtext.endtime.label']}</span>
<span class="label margin5px" style="width: 25%">#{resources['fxtextadmin.fxtext.text.label']}</span>
</div>
<div class="fieldrow">
<ice:inputText styleClass="width200 margin13px" value="#{textRow.startTime}" maxlength="4"/>
<ice:inputText styleClass="width200 margin13px" value="#{textRow.endTime}" maxlength="4"/>
<ice:inputText styleClass="width200 margin13px" value="#{textRow.textValue}" maxlength="4"/>
<ice:commandLink action="#{fxtext.deletetextInterval}"
immeditate="true" styleClass="orange_big" id="delete" title="Delete">
<f:setPropertyActionListener target="#{fxtext.removetext}" value="#{textRow}"/>
<span>#{resources['fxtextadmin.fxtext.action.delete.label']}</span>
</ice:commandLink>
<ice:commandLink action="#{fxtext.addOrUpdatetextInterval}"
immeditate="true" styleClass="orange_big" id="save" title="Save"
rendered="#{!vs.last}">
<f:setPropertyActionListener target="#{fxtext.addtext}" value="#{textRow}"/>
<span>#{resources['fxtextadmin.fxtext.action.add.label']}</span>
</ice:commandLink>
<ice:commandLink action="#{fxtext.addOrUpdatetextInterval}"
immeditate="true" styleClass="orange_big" id="save_last" title="Save"
rendered="#{vs.last}">
<f:setPropertyActionListener target="#{fxtext.addtext}" value="#{textRow}"/>
<f:setPropertyActionListener target="#{fxtext.addMoreEnabled}" value="true"/>
<span>#{resources['fxtextadmin.fxtext.action.add.label']}</span>
</ice:commandLink>
</div>
<div class="spacer"></div>
</ice:column>
</ice:dataTable>
<ice:outputText rendered="#{empty fxtext.textList}">
<table>
<tr>
<td>#{resources['fxtextadmin.fxtext.no.text.entry.message']}</td>
</tr>
</table>
</ice:outputText>
<div class="spacer"></div>
<ice:panelGroup styleClass="buttonwrapper_left" rendered="#{(wm:length(fxtext.textList) lt 25) and not empty fxtext.textRow}">
<ice:commandLink
styleClass="orange_big" action="#{fxtext.addMoretextInterval}" immeditate="true"
id="addmorebuttonenabled" rendered="#{fxtext.addMoreEnabled}">
<span>#{resources['fxtextadmin.fxtext.action.addmore.label']}</span>
</ice:commandLink>
<ice:commandLink id="addmorebuttondisabled"
styleClass="grey disabled" onclick="return false;" rendered="#{!fxtext.addMoreEnabled}">
<span>#{resources['fxtextadmin.fxtext.action.addmore.label']}</span>
</ice:commandLink>
</ice:panelGroup>
<div class="spacer"></div>
</div>
</div>
</div>
</div>
</div>
</ice:form>
</ice:panelGroup>
</ui:define>
</ui:composition>
</h:body>
</html>
在我的java支持bean文件中,
public void gettextDetailsBytype(ValueChangeEvent event) {
Loging.debug(" Method Start - selected " + event.getNewValue());
errorMessage = "";
if(event.getNewValue() != null) {
originaltextList = myService.getTextValues(fiId, (String)event.getNewValue());
textList.clear();
textList.addAll(originalThrottleList);
for(text t :textList){
CMessageLog.getInstance().debug("Type" + event.getNewValue() + " "+t.getStartTime()+ " "+t.getEndTime()+ " "+t.gettextValue());
}
addMoreEnabled = true;
}
Loging.debug(" Method End");
}
现在我的问题是
当 fxtext.textList 中的值发生更改时,它不会反映在我的数据表中。
我的意思是,如果fxtext.textList中最初有list(1,2,3,4,6)的值 当触发更改侦听器时,假设现在fxtext.textList具有值(5,8)。 但数据表显示(1,2)。但是在bean中记录数据具有正确的值(5,8)
请注意,它会保留列表的大小,但不会更改值
是否必须添加任何属性或标签才能在服务器中禁用缓存? 因为在浏览器网络控制台中我可以看到它从服务器返回错误的数据(缓存数据)。
任何帮助将不胜感激。
注意: 我使用list(1,2,3,4,5 ..)从字面上解释下面的字段。
value="#{textRow.startTime}"
value="#{textRow.endTime}"
value="#{textRow.textValue}"