sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 29239 - http://anonsvn.icesoft.org/repo / icefaces2 / scratchpads / patches / ICE-7939 / icefaces / core / src / main / java / org / icefaces / impl / facelets / tag / icefaces / core / RefreshHandler.java
Unified Diff View - RefreshHandler.java
/icefaces2/scratchpads/patches/ICE-7939/icefaces/core/src/main/java/org/icefaces/impl/facelets/tag/icefaces/core/RefreshHandler.java @ revision 29238
/icefaces2/scratchpads/patches/ICE-7939/icefaces/core/src/main/java/org/icefaces/impl/facelets/tag/icefaces/core/RefreshHandler.java @ revision 29239
@@ -22,6 +22,7 @@     private long interval;     private long duration;     private boolean disabled; +    private boolean receivingPreRenderEvents;     public RefreshHandler(TagConfig config) {         super(config); @@ -30,15 +31,16 @@         TagAttribute durationAttribute = getAttribute("duration");         TagAttribute disabledAttribute = getAttribute("disabled"); -        interval = intervalAttribute == null ? 10000 : Long.valueOf(intervalAttribute.getValue()); -        duration = durationAttribute == null ? -1 : Long.valueOf(durationAttribute.getValue()); +        interval = intervalAttribute == null ? 10000 : (Long.valueOf(intervalAttribute.getValue()) * 1000);//seconds +        duration = durationAttribute == null ? -1 : (Long.valueOf(durationAttribute.getValue()) * 60 * 1000);//minutes         disabled = disabledAttribute == null ? false : Boolean.parseBoolean(disabledAttribute.getValue());         disabled = duration == 0 ? true : disabled;     }     public void apply(FaceletContext ctx, UIComponent parent) throws IOException { -        if (!disabled) { +        if (!disabled && !receivingPreRenderEvents) {             ctx.getFacesContext().getApplication().subscribeToEvent(PreRenderComponentEvent.class, new RefreshSetup()); +            receivingPreRenderEvents = true;         }     }


feed icon

sventon 2.5.1