Ejemplo n.º 1
0
  public void appendToResponse(WOResponse response, WOContext context) {
    // set the numberOfObjectsPerBatch
    Number newNumberOfObjectsPerBatch = (Number) ERXThreadStorage.valueForKey(_threadStorageKey);
    if (newNumberOfObjectsPerBatch != null
        && newNumberOfObjectsPerBatch.intValue() != displayGroup().numberOfObjectsPerBatch()) {
      if (displayGroup() != null) {
        NSArray selection = selection();

        if (log.isDebugEnabled())
          log.debug("Setting db # of objects per batch to " + newNumberOfObjectsPerBatch);
        displayGroup().setNumberOfObjectsPerBatch(newNumberOfObjectsPerBatch.intValue());

        if (log.isDebugEnabled()) log.debug("The batch index is being set to : " + 1);
        displayGroup().setCurrentBatchIndex(1);
        clearSelection(selection);
      }
      Object d2wcontext = valueForBinding("d2wContext");
      if (d2wcontext != null) {
        NSNotificationCenter.defaultCenter()
            .postNotification(
                "BatchSizeChanged",
                ERXConstant.integerForInt(newNumberOfObjectsPerBatch.intValue()),
                new NSDictionary(d2wcontext, "d2wContext"));
      }
      ERXThreadStorage.takeValueForKey(null, _threadStorageKey);
    }

    if (displayGroup() != null && !displayGroup().hasMultipleBatches()) {
      if (currentBatchIndex() != 0) setCurrentBatchIndex(ERXConstant.ZeroInteger);
    }
    super.appendToResponse(response, context);
  }
Ejemplo n.º 2
0
 @Override
 public void reset() {
   super.reset();
   _currentTab = null;
   _tabSectionsContents = null;
 }
 @Override
 public void reset() {
   super.reset();
   color = null;
 }
Ejemplo n.º 4
0
 public void reset() {
   super.reset();
   _displayGroup = null;
   _threadStorageKey = null;
 }
Ejemplo n.º 5
0
 public void awake() {
   super.awake();
   wasInForm = context().isInForm();
   _threadStorageKey = "ERXBatchNavigationBar_numberOfObjectsPerBatch_" + context().elementID();
 }