Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Retrieve HiddenItem attribute from servlet

    I need to pass a string array to my servlet through hiddenitem. This is what I've done so far:
    String[] userListArray = ...;
    display.getDataForm().getField("Records").setAttribute("Records",userListArray);

    On server side, I tried to retrieve the data but it cannot retrieve the array:

    String[] attributes = (String[]) request.getAttribute("Records");

    I also tried to use multiple HiddenItem with the same name but different values. On the sever side, I used request.getParameterValues("Record"). Still get nothing.

    HiddenItem item1 = new HiddenItem("Record");
    HiddenItem item2 = new HiddenItem("Record");
    item1.setValue("value1");
    item2.setValue("value2");

    Thanks!
    Last edited by my600080; 12 May 2010, 11:42.

    #2
    is for such things help available?

    e.g. in show case?

    Comment


      #3
      Hi,

      my try looks like that:

      Client:
      Code:
      	
      HiddenItem hi = new HiddenItem("myId");
      hi.setValue("57");
      
      df.setFields(hi);                    // DynamicForm
      df.submitForm();

      Servlet:
      Code:
      	private void processFiles(HttpServletRequest request,
      			HttpServletResponse response) {
      		HashMap<String, String> args = new HashMap<String, String>();
      		try {
      			String reqid = (String) request.getAttribute("myId");
      			String reqtype = (String) request.getAttribute("myId");
      			String[] items = request.getParameterValues("myId");
      			String helome= request.getParameter("myId");
      But all my strings remain null - what is the problem -

      thx in advance

      Comment


        #4
        try request.getFieldValue();

        Comment

        Working...
        X