exception - Why do I get JSF (primefaces) Unable to create new Collection instance for type java.util.Arrays$ArrayList -


maybe can me this: i've got datatable , it's populated arraylist<> , when try update datatable after causing changes in i've got exception

severe [http-apr-8080-exec-1] com.sun.faces.renderkit.html_basic.menurenderer.createcollection unable create new collection instance type java.util.arrays$arraylist java.lang.instantiationexception: java.util.arrays$arraylist

caused by: java.lang.nosuchmethodexception: java.util.arrays$arraylist.()

i saw similar questions on sof but, unfortunatly, it's no use me. (my arraylist doesn't instantiated arrays.aslist). app works fine, need remove exception.

this part of .xhtml datatable define:

<p:datatable id="columnsdef"    widgetvar="columnslist"    value="#{setup.columnwrapperlist}"    var="columnvar"    rowkey="#{columnvar.wrappedcolumnid}"    selectionmode="single"    selection="#{setup.selectedcolumn}"    lazy="false"    rows="10"    paginator="false"    style="width: 100%"    emptymessage="#{msg['common.emptymsg']}"    resizablecolumns="true"    filterevent="enter"    tablestyle="width: auto"> 

here part of .xhtml whre setup.columnwrapperlist updated

<div class="left">             <p:commandbutton icon="ui-icon-triangle-1-n"                              actionlistener="#{setup.decorder}"                              update="@([id$=columnsdef])"                              />             <p:commandbutton icon="ui-icon-triangle-1-s"                              actionlistener="#{setup.incorder}"                              update="@([id$=columnsdef])"                              />         </div> 

and finaly part of "setup" bean cause changes in arraylist:

    public void decorder() {     int = selectedcolumn.getorder();     if (i > 0) {         columnwrapperlist.get(i).setorder(i - 1);         columnwrapperlist.get(i - 1).setorder(i);         columnwrapperlist.sort(new comparator<columnwrapper>() {             @override             public int compare(columnwrapper o1, columnwrapper o2) {                 return o1.getorder() < o2.getorder() ? -1 : 1;             }         });     } } 

can 1 me please?

it works without sort? if so, try sort collections.sort:

collections.sort(columnwrapperlist, new comparator<columnwrapper>() {     @override public int compare(columnwrapper o1, columnwrapper o2) {         return integer.compare(o1.getorder(), o2.getorder());     } }); 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -