Ejemplo n.º 1
0
  protected void addHiddenFieldsForInputAndFilterData(InputAndFilterData aInputAndFilterData) {
    if ((aInputAndFilterData != null)
        && (aInputAndFilterData.getInputHiddenFieldNameValueMap() != null)) {
      ObjectFactory tempObjectFactory = new ObjectFactory();

      for (Map.Entry<String, String> tempMapEntry :
          aInputAndFilterData.getInputHiddenFieldNameValueMap().entrySet()) {
        String tempName = tempMapEntry.getKey();
        Object tempValue = tempMapEntry.getValue();
        ParameterT parameter = tempObjectFactory.createStringT();
        parameter.setName(tempName);
        parameter.setUse(UseT.OPTIONAL);

        // compile list of parameters (TODO: is this needed?)
        getParameterMap().put(parameter.getName(), parameter);

        HiddenFieldT hiddenField = new HiddenFieldT();
        hiddenField.setInitValue(tempValue.toString());
        hiddenField.setParameterRef(tempName);

        Atdl4jWidget hiddenFieldWidget =
            getAtdl4jWidgetFactory().createHiddenFieldT(hiddenField, parameter);
        hiddenFieldWidget.setHiddenFieldForInputAndFilterData(true);

        addToAtdl4jWidgetMap(tempName, hiddenFieldWidget);
        addToAtdl4jWidgetWithParameterMap(tempName, hiddenFieldWidget);
      }
    }
  }
Ejemplo n.º 2
0
  protected void addHiddenFieldsForParameterWithoutControl(Map<String, ParameterT> aParameterMap) {
    if (aParameterMap != null) {
      ObjectFactory tempObjectFactory = new ObjectFactory();

      for (Map.Entry<String, ParameterT> tempMapEntry : aParameterMap.entrySet()) {
        String tempName = tempMapEntry.getKey();
        ParameterT tempParameter = tempMapEntry.getValue();

        // -- If Parameter does not have a Control --
        if (getAtdl4jWidgetForParameter(tempParameter) == null) {
          // -- Add a HiddenField control for this parameter (to add to ControlWithParameters map
          // used by StrategyEdit and FIX Message building) --
          HiddenFieldT tempHiddenField = new HiddenFieldT();
          tempHiddenField.setParameterRef(tempName);

          Atdl4jWidget hiddenFieldWidget =
              getAtdl4jWidgetFactory().createHiddenFieldT(tempHiddenField, tempParameter);
          addToAtdl4jWidgetMap(tempName, hiddenFieldWidget);
          addToAtdl4jWidgetWithParameterMap(tempName, hiddenFieldWidget);
        }
      }
    }
  }