performance - PrimeFaces CRUD button take time to appear -
i facing performance issue have support please.
here configuration:
- netbeans ide 8.0.2 (build 201411181905)
- primefaces 5.2
- nbpfcrudgen-0.30.1-8.0.2_patch1-impl (crud generator used apps)
- glassfish 4.0 postgresql 9.2
i created crud apps netbeans crud generator (http://sourceforge.net/projects/nbpfcrudgen/)
below code showing list of action in table. @ bottom of page there button “view” activated when select row in table.
out of box working fine: when select row “view” button activated in 2sc.
<h:form id="actionlistform"> <p:panel header="#{bundle.listactiontitle}"> <p:datatable id="datalist" value="#{actioncontroller.items}" var="item" rowkey="#{item.idaction}" paginator="true" rows="10" rowsperpagetemplate="10,20,30,40,50" selectionmode="single" selection="#{actioncontroller.selected}"> <p:ajax event="rowselect" update=":actionlistform:viewbutton" listener="#{actioncontroller.resetparents}"/> <p:ajax event="rowunselect" update=":actionlistform:viewbutton" listener="#{actioncontroller.resetparents}"/> <p:ajax event="contextmenu" update=":actionlistform:viewbutton" listener="#{actioncontroller.resetparents}"/> <p:ajax event="rowdblselect" onsuccess="document.getelementbyid('actionlistform:viewbutton').click();"/> <p:column sortby="#{item.idaction}" filterby="#{item.idaction}"> <f:facet name="header"> <h:outputtext value="#{bundle.listactiontitle_idaction}"/> </f:facet> <h:outputtext value="#{item.idaction}"/> </p:column> <p:column sortby="#{item.actionlink}" filterby="#{item.actionlink}"> <f:facet name="header"> <h:outputtext value="#{bundle.listactiontitle_actionlink}"/> </f:facet> <h:outputtext value="#{item.actionlink}"/> </p:column> <p:column sortby="#{item.identity.name}" filterby="#{item.identity.name}"> <f:facet name="header"> <h:outputtext value="#{bundle.listactiontitle_identity}"/> </f:facet> <h:outputtext value="#{item.identity.name}"/> </p:column> </p:datatable> <p:commandbutton id="viewbutton" style="visibility: hidden;" icon="ui-icon-search" value="#{bundle.view}" update=":actionviewform" oncomplete="pf('actionviewdialog').show()" disabled="#{empty actioncontroller.selected}"/> </h:form> problems start when tried limit record showed in table, below modification
<h:form id="actionlistform"> <p:panel header="#{bundle.listactiontitle}"> <p:datatable id="datalist" value = "#budgetcontroller.getallactionbyentity('bob’}" after modification, when select row, “view” button take @ least 10sc activated. below getallactionbyentity method in class actioncontroller
public list<action> getallactionbyentity(string iduserparam) { entitymanagerfactory emf = persistence.createentitymanagerfactory("propensionpu"); entitymanager em = emf.createentitymanager(); try { entity identity = new entity (iduserparam); allactionbyentity = em.createnamedquery("action.findallbyentity").setparameter("identity", identity).getresultlist(); } catch (noresultexception e) {system.out.println (e);} return allactionbyentity; } and extract of action.java query referenced above:
@namedquery(name = "action.findallbyentity", query = "select action a.identity = :identity")}) would has idea of reason creating slowness? in case can please me correct mistake?
Comments
Post a Comment