0 Replies Latest reply on May 23, 2012 2:51 AM by 920854

    Retrieving indexed fields using by action [Struts]

      Hello All !

      I need to retrieve indexed fields using struts and im using DynaValidatorForm. Below, this is my 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 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"/>
      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">


      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 !!