コード例 #1
0
  @Override
  public void populate(HttpServletRequest request) {
    super.populate(request);

    if (StringUtils.isNotBlank(
        request.getParameter(KRADConstants.TableRenderConstants.VIEWED_PAGE_NUMBER))) {
      setViewedPageNumber(
          Integer.parseInt(
              request.getParameter(KRADConstants.TableRenderConstants.VIEWED_PAGE_NUMBER)));
    } else {
      setViewedPageNumber(0); // first page is page 0
    }

    if (KRADConstants.TableRenderConstants.SWITCH_TO_PAGE_METHOD.equals(getMethodToCall())) {
      final String paramPrefix =
          KRADConstants.DISPATCH_REQUEST_PARAMETER
              + "."
              + KRADConstants.TableRenderConstants.SWITCH_TO_PAGE_METHOD
              + ".";
      setSwitchToPageNumber(
          PagingBannerUtils.getNumbericalValueAfterPrefix(
              paramPrefix, request.getParameterNames()));
      if (getSwitchToPageNumber() == -1) {
        throw new RuntimeException("Couldn't find page number");
      }
    }

    if (KRADConstants.TableRenderConstants.SORT_METHOD.equals(getMethodToCall())) {
      final String paramPrefix =
          KRADConstants.DISPATCH_REQUEST_PARAMETER
              + "."
              + KRADConstants.TableRenderConstants.SORT_METHOD
              + ".";
      setColumnToSortIndex(
          PagingBannerUtils.getNumbericalValueAfterPrefix(
              paramPrefix, request.getParameterNames()));
      if (getColumnToSortIndex() == -1) {
        throw new RuntimeException("Couldn't find column to sort");
      }
    }

    setPreviouslySelectedObjectIdSet(parsePreviouslySelectedObjectIds(request));
    setSelectedObjectIdSet(parseSelectedObjectIdSet(request));
    setDisplayedObjectIdSet(parseDisplayedObjectIdSet(request));

    setSearchUsingOnlyPrimaryKeyValues(parseSearchUsingOnlyPrimaryKeyValues(request));
    if (isSearchUsingOnlyPrimaryKeyValues()) {
      setPrimaryKeyFieldLabels(getLookupable().getPrimaryKeyFieldLabels());
    }
  }
コード例 #2
0
 /** @see LookupForm#addRequiredNonEditableProperties() */
 @Override
 public void addRequiredNonEditableProperties() {
   super.addRequiredNonEditableProperties();
   registerRequiredNonEditableProperty(KRADConstants.LOOKUP_RESULTS_SEQUENCE_NUMBER);
   registerRequiredNonEditableProperty(KRADConstants.LOOKED_UP_COLLECTION_NAME);
 }