private void endHeartbeat() { heartbeat.end(); } }
private void endHeartbeat() { heartbeat.end(); index++; }
/** * Called at the end of the form render (or at the end of the form submission) to clean up the {@link Environment} * stack. */ void cleanupEnvironment() { heartbeat.end(); environment.pop(PropertyEditContext.class); }
public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer) { Heartbeat heartbeat = new HeartbeatImpl(); heartbeat.begin(); environment.push(Heartbeat.class, heartbeat); renderer.renderMarkup(writer, reply); environment.pop(Heartbeat.class); heartbeat.end(); } };
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer) { Heartbeat heartbeat = new HeartbeatImpl(); heartbeat.begin(); environment.push(Heartbeat.class, heartbeat); renderer.renderMarkup(writer); environment.pop(Heartbeat.class); heartbeat.end(); } };
void afterRender(MarkupWriter writer) { heartbeat.end(); if (insideForm) { environment.pop(FormSupport.class); if (actionSink.isEmpty()) { hiddenFieldPositioner.discard(); } else { hiddenFieldPositioner.getElement().attributes("type", "hidden", "name", Form.FORM_DATA, "value", actionSink.getClientData()); } } writer.end(); // div }
public void cleanupAfterPartialZoneRender() { if (formComponentId == null) return; heartbeat.end(); formSupport.executeDeferred(); environment.pop(ValidationTracker.class); environment.pop(FormSupport.class); // If the Zone didn't actually contain any form control elements, then // nothing will have been written to the action sink. In that case, // get rid of the hidden field, if one was even added. if (actionSink.isEmpty()) { hiddenFieldPositioner.discard(); return; } // We've collected some hidden data that needs to be placed inside the Zone. // This will raise an exception if the content of the zone didn't provide such a position. hiddenFieldPositioner.getElement().attributes("type", "hidden", "name", Form.FORM_DATA, "value", actionSink.getClientData()); }
void afterRender(MarkupWriter writer) { environment.peek(Heartbeat.class).end(); formSupport.executeDeferred(); String encodingType = formSupport.getEncodingType(); if (encodingType != null) { form.forceAttributes("enctype", encodingType); } writer.end(); // form div.element("input", "type", "hidden", "name", FORM_DATA, "value", actionSink.getClientData()); div.pop(); if (autofocus) { environment.pop(ValidationDecorator.class); } }
@Test public void single_heartbeat() { Runnable r1 = mockRunnable(); Runnable r2 = mockRunnable(); replay(); Heartbeat hb = new HeartbeatImpl(); hb.begin(); hb.defer(r1); hb.defer(r2); verify(); r1.run(); r2.run(); replay(); hb.end(); verify(); }
@Test public void trigger_immediate() { FormSupport support = mockFormSupport(); ComponentResources resources = mockComponentResources(); Heartbeat heartbeat = new HeartbeatImpl(); Request request = mockRequest(); String elementName = "myname"; train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null); train_getParameter(request, elementName, "login"); replay(); heartbeat.begin(); Submit submit = new Submit(request); TestBase.set(submit, "resources", resources, "formSupport", support, "heartbeat", heartbeat, "defer", false); submit.processSubmission("xyz", elementName); verify(); expect(resources.triggerEvent(EventConstants.SELECTED, null, null)).andReturn(false); replay(); heartbeat.end(); verify(); }
EasyMock.expectLastCall().times(3); hb.end(); EasyMock.expectLastCall().times(3);
heartbeat.end();