Hello,

You use a raw method to resolve parameters from the request.

I suggest that the problem came from the form html definition. When you
submit do you analyzed the request send by your browser ? (F12 ->
Network on firefox)

Nicolas

On 28/04/2022 05:48, Avijit Bose wrote:
> My code is as follows:
>
> “finalizeLC.ftl”
>  --------------------
> <div class="screenlet-body">
>   <form method="post" action="<@ofbizUrl>finalizeLCUpdate</@ofbizUrl>"
>  name="finalizeLCUpdate" id="finalizeLCUpdate">
>
>            <input type="hidden" name="LcReceiveDate" value="">
>            <input type="hidden" name="countDownDays" value="">
>            <input type="hidden" name="remarks" value="">
>
>
>              <table width="100%" cellspacing="2">
>             <tbody>
>               <tr>
>                 <td align="right">
>                 </td>
>                 <td align="right">
>                            <label
> for="LcReceiveDate">${uiLabelMap.LcReceiveDate}&nbsp;</label>
>                 </td>
>                 <td colspan="4">
>            <input type="date" id="LcReceiveDate" name="LcReceiveDate"
> style="background-color:#D6F2FF" value="${LcReceiveDate!}" required>
>                                             </td>
>                 <td></td>
>               </tr>
>               <tr>
>                 <td align="right">
>                 </td>
>                 <td align="right">
>                            <label
> for="countDownDays">${uiLabelMap.countDownDays}&nbsp;</label>
>                 </td>
>                 <td colspan="4">
>                            <input type="number" id="countDownDays"
> name="countDownDays" style="background-color:#D6F2FF"
> value="${countDownDays!}" required>
>                                             </td>
>                 <td></td>
>               </tr>
>                                             <tr>
>                 <td align="right">
>                 </td>
>                 <td align="right">
>                            <label
> for="remarks">${uiLabelMap.remarks}&nbsp;</label>
>                 </td>
>                 <td colspan="4">
>                      <input type="text" id="remarks"
> value="${remarks!}" name="remarks" size="100"
> style="background-color:#D6F2FF" required>
>                                             </td>
>                 <td></td>
>               </tr>
>             </tbody>
>           </table>
>
>              <table width="100%" cellspacing="2">
>             <tbody>
>               <tr>
>                 <td align="right">
>                 </td>
>                 <td align="right">
>
>                 </td>
>                 <td>
>
>                      <button type="submit" form="finalizeLCUpdate"
> value="Submit">${uiLabelMap.finalizeLC}</button>
>            </td>
>                 <td></td>
>               </tr>
>             </tbody>
>           </table>
> </form>
> </div>
>
>
> “UpdateLCServices.java and method finalizeLCUpdate”
> ------------------------------------------------------------------------------------
>            public static String finalizeLCUpdate(HttpServletRequest
> request, HttpServletResponse response) {
>
>                       Delegator delegator = (Delegator)
> request.getAttribute("delegator");
>
>                       String LcReceiveDate =
> request.getParameter("LcReceiveDate").trim();
>                      String countDownDays =
> request.getParameter("countDownDays").trim();
>                       String remarks = request.getParameter("remarks").trim();
>
>                      Debug.logInfo("=======LcReceiveDate=========",
> LcReceiveDate);
>                      Debug.logInfo("=======countDownDays=========",
> countDownDays);
>                      Debug.logInfo("=======remarks=========", remarks);
>                }
>
>
> “Controller”
> ----------------
> <request-map uri="finalizeLCUpdate">
>         <security https="true" auth="true"/>
>         <event type="java" path="com.akm.exim.events.UpdateLCServices"
> invoke="finalizeLCUpdate"/>
>         <response name="success" type="view" value="exportHome"/>
>     </request-map>
>
>
> I am passing hidden values from the “finalizeLC.ftl” file and unable
> to retrieve data in the java class “UpdateLCServices.java and method
> finalizeLCUpdate”. Debug.loginfo showing null values.
>
> Pls help in how to pass form parameter values to ftl java class in Ofbiz.
>
> Regards
> Avijit Bose

Reply via email to