我正在研究icefaces 3.x. 问题是当我第一次使用shift +点击选择任何行时,我得到错误。 ice:rowselector标签的value属性给出了错误,此标记放在第一列
中<ice:rowSelector
value="#{instantInvoiceDetails.highlighted}"
enhancedMultiple="true"
selectionListener="#{instantInvoice.selectListener}"
toggleOnInput="false"
preStyleOnSelection="true">
</ice:rowSelector>
当我第一次使用shift +点击选择任何行
时,错误如下javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: //D:/Error Correction/WorkSpace/InstantInvoicing/WebContent/InstantInvoicing.xhtml @169,279 value="#{instantInvoiceDetails.highlighted}": Target Unreachable, identifier 'instantInvoiceDetails' resolved to null
at javax.faces.component.ValueBindingValueExpressionAdapter.setValue(ValueBindingValueExpressionAdapter.java:150)
at com.icesoft.faces.component.ext.RowSelector.setValue(RowSelector.java:101)
at com.icesoft.faces.component.ext.RowSelector.processDecodes(RowSelector.java:431)
at com.icesoft.faces.component.ext.HtmlDataTable.processKids(HtmlDataTable.java:337)
at com.icesoft.faces.component.ext.HtmlDataTable.iterate(HtmlDataTable.java:278)
at org.icefaces.impl.component.UISeriesBase.processDecodes(UISeriesBase.java:520)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at org.icefaces.ace.component.panel.Panel.processDecodes(Panel.java:123)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIForm.processDecodes(UIForm.java:212)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: javax.el.PropertyNotFoundException: //D:/Error Correction/WorkSpace/InstantInvoicing/WebContent/InstantInvoicing.xhtml @169,279 value="#{instantInvoiceDetails.highlighted}": Target Unreachable, identifier 'instantInvoiceDetails' resolved to null
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:130)
at javax.faces.component.ValueBindingValueExpressionAdapter.setValue(ValueBindingValueExpressionAdapter.java:148)
... 34 more
以下是InstantInvoiceDetails.java的代码片段
private boolean highlighted=false;
public boolean isHighlighted() {
return highlighted;
}
public void setHighlighted(boolean highlighted) {
this.highlighted = highlighted;
}
InstantInvoice.java的代码片段
public void selectListener(RowSelectorEvent event) {
if (sumOfHighRows == null || sumOfHighRows.equals("")) {
setSumOfHighRows("0");
}
//System.out.println(" Enhanced multiple ?"+row.isEnhancedMultiple());
commentstatus=true;
System.out.println("size is "+getHighlightedInvoices().size());
setSumOfHighRows("0");
getHighlightedInvoices().clear();
int sumOfH = Integer.parseInt(getSumOfHighRows());
System.out.println("--1-sumOfH--"+sumOfH);
for (InstantInvoiceDetails nwIid : invoices) {
if (nwIid.isHighlighted()) {
commentstatus=false;
sumOfH += Integer.parseInt(nwIid.getNetChrgAmt());
System.out.println("--2-sumOfH--"+sumOfH);
getHighlightedInvoices().add(nwIid);
System.out.println(getHighlightedInvoices().size());
if(getHighlightedInvoices().size()==0)
{
commentstatus=true;
}
setSumOfHighRows(Integer.toString(sumOfH));
}
}
}
}