0

I want to pass a string parameter on my form Panel. Is it possible to add string parameter data on GWT form panel?

I have servlet code that will receive passed string parameter using post, I cannot include the parameters in the link because it has large amounts of data

this is my servlet code:

public void doPost(HttpServletRequest request, HttpServletResponse response) {
            String printMode = request.getParameter("printMode");
            String nodeNm = ConfigConstants.PRINTER.getValue();
            String outputLogPath=SrchSvcImpl.cnfg.readValCnfg(nodeNm, ConfigConstants.OUTPUT_ERROR_LOG.getValue());

            if(printMode.equalsIgnoreCase("single_print")) {
                String role = request.getParameter("role");
                String itemsToPrint = request.getParameter("itemsToPrint");
                //do something else..
            }
}
George
  • 263
  • 5
  • 17
  • I managed to get around that using form input boxes, put strings in them and disabled them. The doPost method would then iterate over the items and you check the 'id' of them before fetching the right value from it. – WLGfx May 25 '17 at 13:28
  • 2
    Use [Hidden](http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/Hidden.html) widget. It creates `` element. – Adam May 25 '17 at 22:22
  • @Adam you should put that as answer; that's the correct answer. – Thomas Broyer May 27 '17 at 13:40
  • @ThomasBroyer I did as you suggested. Hopefully it will be easier to find an answer. – Adam May 27 '17 at 14:15

1 Answers1

2

Use Hidden widget. It creates <input type='hidden'> element.

Adam
  • 5,403
  • 6
  • 31
  • 38