How to name items that are coming from forEach loop

I have an arraylist of String[]'s that I need to display on the screen. I am sorting through the arrayList and pulling the values I need and displaying them without a problem. Two of the values from the String[] the user can modify. The problem is that when they modify it they aren't being mapped back to the original ArrayList when I submit the form. There seem to me to be two possible answers... A. It can't be done, or B I don't know what to name the values.
So here is the code I am using and then I'll explain how I've worked around the problem.
<table><tr>
          <th> </th>
          <th><fmt:message key="T895Form.deNumber" /></th>
          <th><fmt:message key="T895Form.deDescription" /></th>
          <th><fmt:message key="T895Form.deValue" /></th>
          <th><fmt:message key="T895Form.calcOptions" /></th></tr>
          <c:set var="counter" value="0" />
     <c:forEach var="list" items="${sessionScope.T895Form.dictionaryDE}" varStatus="status">
          <c:if test="${list[0]>100}">
               <c:set var="counter" value="${counter+1}" />
               <tr>
                    <td><c:out value="${counter}" /></td>
                    <td><INPUT type="text" size="5" MAXLENGTH="5" name="deNumber"
                                   readonly style="background-color: #D3D3D3;"
                                   value="<c:out value='${list[0]}' />"></td>
                    <td><INPUT type="text" size="50" MAXLENGTH="50" name="deDescription"
                                   readonly style="background-color: #D3D3D3;"
                                   value="<c:out value='${list[1]}' />"></td>
                    <td><INPUT type="text" size="20" MAXLENGTH="50" name="deValue"
                                   value="<c:out value='${list[2]}' />" onblur=""></td>          
                    <td><select name="calcOptions">
                         <c:choose>
                              <c:when test="${empty list[3]}">
                                   <option selected value=""></option>
                              </c:when>
                              <c:otherwise>
                                   <option value=""></option>
                              </c:otherwise>
                         </c:choose>
                         <c:choose>
                              <c:when
                                   test="${not empty list[3] and list[3] == 'O'}">
                                   <option selected value="O"><fmt:message
                                        key="T895Form.calcOptionsO" /></option>
                              </c:when>
                              <c:otherwise>
                                   <option value="O"><fmt:message key="T895Form.calcOptionsO" /></option>
                              </c:otherwise>
                         </c:choose>
                         <c:choose>
                              <c:when
                                   test="${not empty list[3] and list[3] == 'A'}">
                                   <option selected value="A"><fmt:message
                                        key="T895Form.calcOptionsA" /></option>
                              </c:when>
                              <c:otherwise>
                                   <option value="A"><fmt:message key="T895Form.calcOptionsA" /></option>
                              </c:otherwise>
                         </c:choose>
                         <c:choose>
                              <c:when
                                   test="${not empty list[3] and list[3] == 'S'}">
                                   <option selected value="S"><fmt:message
                                        key="T895Form.calcOptionsS" /></option>
                              </c:when>
                              <c:otherwise>
                                   <option value="S"><fmt:message key="T895Form.calcOptionsS" /></option>
                              </c:otherwise>
                         </c:choose>
                    </select></td>     
                    <td><INPUT type="hidden" size="20" MAXLENGTH="50" name="position"
                                   value="<c:out value='${list[8]}' />"></td>                                                       
               </tr>                                                  
          </c:if>     
     </c:forEach>
</table>Right now when I submit the page I get String[]'s returned for each of the columns... I thing use the position string[] that contains the position the row was pulled from the arraylist at and loop through the arrays and put them back in the arraylist... that way when I revisit the screen the arraylist still contains the users changes...
This all works.. but I was wondering if there was a better way to do this. .. ie name the deNumber input something else that will map directly back to the arrayList?
Thanks in advance... but again, it works the way I'm doing it... it just isn't very pretty.

There seem to me to be two possible answers...
A. It can't be done, or
B I don't know what to name the valuesIf you are talking standard JSP/JSTL the answer is A
however as part of Struts, they developed indexed properties.
You can use the jakarta commons BeanUtils package to automatically populate
Therefore the answer is B if you consider this approach.
Each individual textfield gets numbered. This is resolved by the BeanUtils package.
You don't NEED struts to do this. You can use the BeanUtils class on its own. I haven't done too much research into it though :-)
<INPUT type="text" size="5" MAXLENGTH="5" name="deNumber[${status.index}]" Linkies:
http://struts.apache.org/userGuide/building_view.html#indexed
http://jakarta.apache.org/commons/beanutils/api/index.html
Cheers,
evnafets

Similar Messages

  • On iphone 4 how do i block text messages that are coming from an email account?

    on iphone 4 how do i block text messages that are coming from an email account?

    There is no way to block text messages.  You may wish to report them to your carrier

  • HT5622 my stepdad used to use my phone and the imessage accounts have now joined together by mistake we don't know how it happened but is there a way we can separate the two accounts because we are able to read messages that are coming from two different

    hello can i please get some help, my stepdad used to use my phone a while ago, i deleted his old account from my phone, last night out IMessages merged without us knowing how it happened, he is able to read any messages that are coming into my phone through IMessage and also i am able to read his and this is happen from two different phone, i dont know how to fix  this or two separate the two accounts, is anyone able to help please

    Settings>Messages Send and Receive should only have the phone number and addresses checked that you want reaching that individual devices  If your step-dads number and email are checked just tap them it will remove the check.

  • How should I set up my VI so that I can use the linear fit coefficient data analysis program, when my values are coming from while loops within a sequence structure?

    I'm attempting to create a calibration program, using the printer port, and a Vernier Serial Box by modifying a calibration program designed for the serial box.
    There are six calibration points, and to collect them, I have it controlled by while loops so that the numbers are taken when a button is pushed, and this is inside a sequence structure so that I can get the six different points. I feed these numbers into two different arrays (for x and y values) and then try to use the linear coefficient analysis on these points, but the values for the slope and intercepts it returns are not correc
    t.
    If I cut out the array and coefficient analysis, and feed the same numbers in directly without the while loop and sequence structures, it produces the proper values... I don't know why the numbers it is producing are different, and I'd really like to know.
    Thanks,
    Karinne.

    I would use a data manager sub-vi that would be called by each from of the sequence structure that produced a data point. The data manager sub-vi could auto append new items or could place items in a specific entry of an array. Later on when you want to calculate the linear fit, call the sub-vi to return the array of values.
    Stu

  • HT201302 How to import photos that are imported from itunes back to iphoto?

    I had imported photos from Itunes( Iphoto ) to my iphone and i deleted all the photos in Iphoto. Now I wanted to control some of the photos but I can't! If I sync photos again, all the photos will be gone. So I wanted to import the photos in my Iphone back to Iphoto. Anyone knows how?

    The iTunes transfer process for photos from your computer is a one way transfer process only. Photos transferred from your computer are optimized for viewing on the iPhone - the original resolution is changed/lowered, which is why transferring these photos in the opposite direction is not supported.
    There are some 3rd party paid utilities that provide for transferring these photos in the opposite direction but the original resolution of these photos deleted from your computer will be lost and the 3rd party utilities are not supported by Apple.

  • User-exit on APO side for the deliveries that are coming from R/3

    Hi,
    When a delivery is created in ECC for a VMI customer, it creates an EI order in APO. We need to record some details of these orders on the APO side.   Can you please let me know the user exit/BADI that gets triggered when a delivery comes to APO through CIF which we can use for our requirement?
    Thanks in advance.

    Hi,
        You can use APOCF006(EXIT_/SAPAPO/SAPLCIF_PU_001) CIF User exit on APO side for CF_OBJECTTYPE = B(Delivery).
    I hope this will help you.
    Regards,
    Saurabh

  • My iMac holds my main iTunes account.  How do I find out a list of all the devices that are authorized from this computer?

    My iMac holds my main iTunes account and it shows 4 devices are authorized to play iTunes.  I can only name 3.  How do I find out a list of all the devices that are authorized from this computer?

    I don't believe this is possible, but you can deauthorize all your computers and start over if you are concerned.
    See here
    Best of luck

  • My iMessages are coming from my email, how do I get them to come from my phone

    My iMessages are coming from my email, how do I get them to come from my phone number again?

    This forum is intended for questions about old Apple hardware that precedes the PowerMacs, i.e. hardware from the 1990s and earlier, and doesn't get much traffic. Hence it's not the forum where you'll be most likely to get help with your problem. I've asked the Communities Hosts to move your post to the iPhone forum.  You'll be more likely to get assistance there.  Regards.

  • How to remove the buttons which are coming from a report?

    Hi All,
    I need to remove the buttons from an iview which is a sap transaction. when i execute the  report program which uses a ldb (PCH) shows a selection screen having all the buttons.
    We have created variants for this.Now i want to remove the buttons which are coming from the report program.how to do this ?
    Lakshmi.

    Hi,
    I think u r mentioning about the addition buttons that appear in the selection screen when using a logical database. for removing these buttons u can use a function module RS_SET_SELSCREEN_STATUS  for setting ur own pf-status
    do this in "at selection screen output" of the program..
    in the tables parameter, u have the option for giving the ok-codes that u want to remove. append all the ok-codes into this table.
    for getting the ok-codes u can use "tab" and go the button.. press F1. it will give the ok-code.
    Regards,
    Anoop

  • HT4859 how do you see the items that are backed up to iCloud -  I have 4.5 GB that I have used but I cant find where to see those items...help

    how do you see the items that are backed up to iCloud -  I have 4.5 GB that I have used but I cant find where to see those items...help

    That is everything in your iCloud account.  Videos and camera roll photos are only included in your backup, the size and content of which you can see on your phone in Settings>iCloud>Storage & Backup>Manage Storage>tap the name of your device under Backup.  This will show you the size of "Camera Roll", where these are contained.  (You can't see any detail beyond that.)  Photo stream photos can only been seen in your photo stream album on your phone, and they don't count against your storage so they aren't part of the 4.5 GB.  Everything esle is either in the backup, the items listed in Settings>iCloud>Storage & Backup>Manage Storage, or on icloud.com, where you can see your contacts, calendars, etc.

  • I have taken pictures of items that are linked to a database that I am building.  How can I bypass importing into iPhoto and simply downloading the images as "files" not "photos" so I can access them with my database?  thanx.

    I have taken pictures with both my Sony camera and my iPhone of items that are linked to a database that I am building, as well as my website.  How can I bypass importing the images into iPhoto and simply downloading the images as "files" not "photos" so I can access them with my database?  thanx.

    If your Sony has a removable memory card you can use a card reader to copy the image files from to a folder on your Desktop and then move them anywhere you'd like.
    Since the iPhone doesn't have a removable memory card you can try using Image Capture to see if you can manually upload the files to a folder on the Desktop. 
    If you have to import the photos, which are image files, into iPhoto you can then export them out of iPhoto to the Desktop and go from there to your database.  Just because they are in iPhoto doesn't prevent you from using them elsewhere.
    OT

  • How to figure out where non-deallocated objects are coming from?

    When running the instruments program and checking the "net" box on the left side, is see that as I run my program the counts for various object types keep increasing. As my program is a simple one where the user is going from page to page, I will assume that these increases are the mark of a memory leak. The system is not detecting these as leaks but certainly my block count should stay more or less constant. I see that I am leaking some CGImage blocks; how do I find out where in the code these blocks are coming from; how to I go the line of code that create a particular block?

    Instruments has plug-in tools. Which tool are you working with?

  • How do you select and move more than one bookmark at a time? Shift+Click does not select multiple items that are next to one another in a list because the item

    How do you select and move more than one bookmark at a time?
    Shift+Click does not select multiple items that are next to one another in a list because the items open in firefox before this happens.

    Use the bookmarks library. You may use Shift +Click, and Ctrl + Click to create groupings of selected bookmarks to drag and drop.
    * one method of opening the bookmarks library is keyboard shortcut <br /> Ctrl+Shift+B (Windows)
    *see also [[How to use bookmarks to save and organize your favorite websites]]
    *and [[Use bookmark folders to organize your bookmarks]]

  • How can I transfer photos from my comp to my ipad2.I have the connection kit and can transfer photos that are direct from camera BUT if I transfer photos from comp to card it will not recognize them ????

    how can I transfer photos from my comp to my ipad2.I have the connection kit and can transfer photos that are direct from camera BUT if I transfer photos from comp to card it will not recognize them ????

    To sync photos from a Mac or Windows PC to your device using photo applications
    Make sure you have the latest version of iTunes installed.
    In iTunes, select your device's icon in the Devices list on the left.
    Click the Photos tab.
    Choose "Sync photos from."
    On a Mac, choose iPhoto or Aperture from the pop-up menu.
    On a Windows PC, choose Photoshop Album or Photoshop Elements from the pop-up menu.
    Note: Some versions of Photoshop Album and Photoshop Elements don't support collections. You can still use them to sync all your photos.
    If you want to sync all your photos, enable the option for "All photos, albums, events, and faces." If you want to sync photos from only some albums, events, or faces, enable the option for "Selected albums, events, and faces" and then select the albums you want. If syncing on a Mac with iPhoto version 6.0.6 or later, you may enable the option to "Include videos" to sync videos directly from iPhoto to your device. (Requires iOS 3.0 or later).
    Click Apply.
    To sync photos from a folder on your hard disk to your device
    Drag the images you want into a folder on your computer. If you want images to appear in separate photo albums on your device, create folders inside the main folder and drag images into the new folders.
    In iTunes, select the device icon in the Devices list on the left.
    Choose "Sync photos from."
    Select Choose Folder from the pop-up menu and choose your main image folder.
    Click Apply.

  • The ipad'osby media pro' could not be synced because this computer is not authourised for purchased item that are on this ipad.how can i solve this proble,i've authourised it several times

    the ipad'osby media pro' could not be synced because this computer is not authourised for purchased item that are on this ipad.how can i solve this proble,i've authourised it several times

    Hello, osbybass. 
    Thank you for the question.  This alert can mean that iTunes is recognizing applications on the iPad purchased by another Apple ID.  If anyone in your household has an Apple ID, try authorizing the computer with their Apple ID and attempt to sync.  If you are still experiencing issues, go through the troubleshooting steps in the attached article. 
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Cheers,
    Jason H. 

Maybe you are looking for