Results 1 to 2 of 2

Thread: Can i use a list of command objects on my form.

  1. #1
    Join Date
    Apr 2005
    Location
    Galway, Ireland
    Posts
    24

    Default Can i use a list of command objects on my form.

    Hi Guys.

    For my web application i am offering an administrative page that allows a user configure their website.
    This type of configuration could be seen in property files but i am storing the information in a database.

    My DB Table has a table StoreConfig that contains, id,key,value
    Sample data:
    1,STORE_NAME,My Store
    2,STORE_EMAIL, email@email.com

    I have mapped this table via hibernate to a StoreConfig object that has, id,key,value.


    On my StoreConfiguration page, i want to display a form that contains many of these config items e.g 10 items.

    Originally i was going to create a custom model object that would have g(s)etters such as storeName,storeEmail etc and then in my service layer
    i would mapp this model to a many store config objects.

    But then i was wondering if i could just use a list of StoreConfig objects in my original web form.

    maybe use someting like
    Code:
    <form action="storeConfig.html"/>
    ------ 1st Item is Store Name --------
    <input type ="hidden" name="storeConfig[0].key" value ="STORE_NAME"/>
    <input type ="text" name="storeConfig[0].value" value =""/>
    
    ------ 2st Item is Store Email --------
    
    <input type ="hidden" name="storeConfig[1].key" value ="STORE_EMAIL"/>
    <input type ="text" name="storeConfig[1].value" value =""/>
    
    </form>
    When the user fills out the form and submit my controller would collect a list of storeConfig items loop thru them and save them.

    I putting this out there, to see if this is possible of if anyone could suggest abetter way of doing this.
    Cheers

  2. #2

    Default

    the problem as the same ,i want combine a list on jsp,how i use formbackcommandObject,or other method?

    hope and help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •