I created PickList is my website and it works but is very slow. I have about 1000 items and every time I click submit it goes into Converter and does 1000 times it. Even if nothing selected.
Maybe I can skip converter or take only target items (not found example on internet) or give back only some text (for this can be only Code) or other solusion?
I am using primefaces 3.5
My Converter:
public Object getAsObject(FacesContext context, UIComponent component, String value) {
if(value != null){
int iii = Integer.parseInt(value);
Jbtit s = new Jbtit();
s = SR.findById(iii);
return s;
}
return null;
}
public String getAsString(FacesContext context, UIComponent component, Object value) {
if(value == null){
return "";
}
if (!(value instanceof Jbtit)) return null;
Integer i = ((Jbtit) value).getId();
if(i != null){
String s = Integer.toString(i);
return s;
}
return "";
}
XHTML:
<p:pickList id="jbtit" styleClass="jbtitPickList"
value="#{panelCountMB.jobTitles}" var="jb" effect="none"
itemValue="#{jb}" itemLabel="#{jb.code} - #{jb.description_en}"
converter="#{jbtitConverter}" showCheckbox="true" showSourceFilter="true"
showTargetFilter="true" filterMatchMode="contains" >
<f:facet name="sourceCaption">Available</f:facet>
<f:facet name="targetCaption">Selected</f:facet>
<p:column >
<h:outputLabel styleClass="testingas" style="width:100%" value="#{jb.code} - #{jb.description_en}" />
</p:column>
</p:pickList>