-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hello
i m working on a ZK project using hibernate and Spring .
i got a wierd Null pointer exception when i Reload my list onTimer , and i dont know what i m doing wrong , when i load my list in Init() it works fine and when i Reload after a while using a timer it gives me Null pointer exception on first Index .
here is my timer
<timer delay="@load(ac.refreshDuration)" onTimer="@command('refreshActivite')" repeats="true"></timer>
refreshActivite Command
@Command("refreshActivite")
@NotifyChange({"listActivites"})
public void refresh()
{
fillActivites();
Messagebox.show("Hello time");
}
fillActivites function
@SuppressWarnings("unchecked")
@NotifyChange({"listActivites","visible"})
public void fillActivites()
{
listActivites = new ArrayList<Journal>();
parameters.put("date", getDate(new Date()));
parameters.put("idProcess", user.getIdProcess());
listActivites=CRUDService.findWithNamedQuery("Journal.findForUserBar", parameters);
if(listActivites.size()==0 || listActivites==null )
{
visible = false;
}
else
{
visible = true;
}
}
anyone had a similar problem and can help me pls ?
probably the problem is on this line
if(listActivites.size()==0 || listActivites==null )
revert the conditions to
if(listActivites == null || listActivities.isEmpty())
but without a stacktrace I can't be sure
Asked: 2014-08-05 20:32:08 +0800
Seen: 7 times
Last updated: Aug 08 '14
a stacktrace could aways be usefull. and point out where the line numbers are
chillworld ( 2014-08-05 21:53:50 +0800 )edit