将p:orderList与p:inplace结合使用

时间:2012-05-03 13:21:07

标签: primefaces

我想有一个条目列表,我可以转移/订购,同时可以编辑。 所以我应该以这种方式将p:orderListp:inplace结合起来:

<p:scrollPanel style="width:300px;height:100px" scrollMode="native">
    <p:orderList var="title" value="#{detailModel.afterObject.metadata.getTitlesAsList()}" type="definition">
        <f:facet name="description">
            <p:inplace id="basic" editor="true">
                <p:inputText value="#{title.value}" required="true"/>
            </p:inplace>
        </f:facet>
    </p:orderList>
</p:scrollPanel>

但是我收到以下错误:

java.lang.NullPointerException
    at org.primefaces.component.orderlist.OrderListRenderer.encodeOptions(OrderListRenderer.java:152)
    at org.primefaces.component.orderlist.OrderListRenderer.encodeList(OrderListRenderer.java:108)
    at org.primefaces.component.orderlist.OrderListRenderer.encodeMarkup(OrderListRenderer.java:79)
    at org.primefaces.component.orderlist.OrderListRenderer.encodeEnd(OrderListRenderer.java:49)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:61)
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:45)
    at org.primefaces.component.scrollpanel.ScrollPanelRenderer.encodeMarkup(ScrollPanelRenderer.java:51)
    at org.primefaces.component.scrollpanel.ScrollPanelRenderer.encodeEnd(ScrollPanelRenderer.java:30)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312)
    at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:619)

我是否会遗漏某些内容或者不可能这样做?

如果我使用:dataList而不是我没有得到错误,但它有一个strang行为;当我点击一个条目时,所有条目都可以编辑,但是它们仍然处于编辑模式,没有其他可能...

scrolling, confirm and cancel have no effects

有什么建议吗?

修改

这是豆子:

public class DoiDetailModel extends DetailModel
{
    private List< String >      selectedTitles;
    private List< String >      selectedCreators;

    private String              title;
    private String              creator;

    public DoiDetailModel()
    {
        super();
    }

    public List< String > getSelectedTitles()
    {
        return selectedTitles;
    }

    public void setSelectedTitles( List< String > selectedTitles )
    {
        this.selectedTitles = selectedTitles;
    }
}

0 个答案:

没有答案