jsf - p:selectOneRadio converter causing stack heap memory issues -
really odd one...
i have converter works when use p:selectonemenu, when switch p:selectoneradio, major crash java heap space errors. stacktrace seems of no use, java.lang.outofmemeoryerror.
this works:
<p:selectonemenu id="regions" value="#{admsbean.selectedregion}"> <f:selectitem itemlabel="global" itemvalue="#{null}" /> <f:selectitems value="#{admsbean.adminregions}" var="adminregion" itemlabel="# {adminregion.regionname}" itemvalue="#{adminregion}" /> <f:converter id="adminregionconverter" converterid="regionconverter" /> <p:ajax listener="#{admsbean.regionselect}" update="unassignedtasks"></p:ajax> </p:selectonemenu>
this crashes , burns:
<p:selectoneradio id="regions" value="#{admsbean.selectedregion}"> <f:selectitem itemlabel="global" itemvalue="#{null}" /> <f:selectitems value="#{admsbean.adminregions}" var="adminregion" itemlabel="# {adminregion.regionname}" itemvalue="#{adminregion}" /> <f:converter id="adminregionconverter" converterid="regionconverter" /> <p:ajax listener="#{admsbean.regionselect}" update="unassignedtasks"></p:ajax> </p:selectoneradio>
i can assume converter ok, works selectonemenu.
@facesconverter("regionconverter") public class regionconverter implements converter { @override public object getasobject(facescontext context, uicomponent component, string value) { region region = null; if (value != null && value.length() > 0) { region = region.findregion(new long(value)); } return region; } @override public string getasstring(facescontext context, uicomponent component, object value) { string val = ""; if (value != null && value instanceof region) { val = ((region) value).getid().tostring(); } return val; } }
regards
i
in end recursive @rootostring method being called. had examine data model relationships , add annotation @rootostring avoid cycle in few entities
@rootostring(excludefields = { "adminregion" })
Comments
Post a Comment