0 Replies Latest reply: May 22, 2012 9:51 PM by 920854 RSS

    Retrieving indexed fields using by action [Struts]

    920854
      Hello All !


      I need to retrieve indexed fields using struts and im using DynaValidatorForm. Below, this is my code .

      <code>
      <logic:iterate id="paramEmpresa" name="listaParametros">
      <div style="width: 600px;">
      <div style="float: left; width: 250px;">
      <label><bean:write name="paramEmpresa" property="dsParametro" ignore="true" /> </label>
      </div>

      <div style="float: right; width: 350px;">
      <html:hidden name="paramEmpresa" property="cdParametro" indexed="true" />
      <html:hidden name="paramEmpresa" property="tpParametro" indexed="true" />

      <html:text name="paramEmpresa" property="vlParametro" size="25" value="" styleClass="required" indexed="true"/>
      </div>
      </div>
      </logic:iterate>
      And now, the HTML render by struts after submit the form :

      <input type="hidden" name="paramEmpresa[0].cdParametro" value="1">
      <input type="hidden" name="paramEmpresa[0].tpParametro" value="3">

      <input type="text" name="paramLogo[0].vlParametro" size="25" value="100" class="required">

      <input type="hidden" name="paramEmpresa[1].cdParametro" value="1">
      <input type="hidden" name="paramEmpresa[1].tpParametro" value="3">

      <input type="text" name="paramEmpresa[1].vlParametro" size="25" value="100" class="required">

      </code>

      And now, how i´m trying to do it... but its fail..

      DynaValidatorForm logoForm = (DynaValidatorForm) form;
      String[] paramEmpresa= (String[])logoForm.get("paramEmpresa");


      Somebody help me please? Is it possible to do it? I dont know how can i retrieve this values by my action..

      Thanks for help !!