Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3114

Form Bean Properties not being set when form is submitted

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.3.5
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      MS/UNIX on Tomcat/Weblogic

      Description

      I have a action form which has structure like
      FORM_A( attribute1<String>, attribute2<Date>,....., attributeN <LinkedHashMap<<String>,<BeanB>>) -> where BeanB has its own attributes(attributeA, attributeB....)
      I get all these data from data service and I am using logic-iterate/jstl tags in jsp to display Map attribute of FORM_A. Display part works fine.
      Now the problem is if the user updates ones of the attributes for BeanB in UI (say attributeB, which is a float), the values are not getting populated in BeanB. It never says no setter method found for property or anything and it doesn't call setter methods as well.

      I think the problem is the way it keeps the name is just name of the bean-attribute and it doesn't know which attribute goes in which bean on the Map. Right now I am using

      {indexed="true"}

      property and manually getting those values from request and setting those in bean. Can we have one more attribute other than indexed which can tell BeanUtils that use index number to determine the location of the bean in the collection <assuming or verifying that its a ordered collection> and automatically set value for the attributes in the Bean?
      This will reduce lot of work for all grid kind of developments when we have a ordered/editable list situation. Please let me know if there's already a way to do this in struts 1 or struts 2 ?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              apoorva Apoorva Rais
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: