Nested objects - populating action form - Struts

I'll use an analogy to explain my question:
I have a Company bean that contains a list of Employee beans. On the JSP i want to iterate through all the employees and print out their name and salary, which is fine. I just do it like this...
<nested:root name="company">
<nested:iterate property="employees" id="employee" type="myPackage.Employee">
<tr>
<td>
<nested:write name="employee" property="name"/>
</td>
</nested:iterate>               
</nested:root>
Which is OK when im just writing out the names. but say i want to generate a text box for each employee, providing the functionality to edit any of the names, is it possible?
I tried switching the nested:write to a nested:text but when I submit the form any edited values do not update.
Any ideas,
Thanks.

I'll use an analogy to explain my question:
I have a Company bean that contains a list of Employee beans. On the JSP i want to iterate through all the employees and print out their name and salary, which is fine. I just do it like this...
<nested:root name="company">
<nested:iterate property="employees" id="employee" type="myPackage.Employee">
<tr>
<td>
<nested:write name="employee" property="name"/>
</td>
</nested:iterate>               
</nested:root>
Which is OK when im just writing out the names. but say i want to generate a text box for each employee, providing the functionality to edit any of the names, is it possible?
I tried switching the nested:write to a nested:text but when I submit the form any edited values do not update.
Any ideas,
Thanks.

Similar Messages

  • Passing values to action form in struts using html:link tag in struts

    hi
    As we can post values to action form bean in struts using a <html:text> tag in side a form.
    Can the same be achieved by using a html:link attribute.
    If not then how can this be achieved (i.e. posting a form on click of a link and populating action form bean property for the same).
    thanx in advance.

    Crosspost:
    http://forum.java.sun.com/thread.jspa?threadID=5244035&tstart=0

  • How to populate form bean (Action form) from Action  (Struts)

    Hello to all..
    I have a problem populating a from bean in struts from Action class...
    What I would like is ..
    1. how can I populate a formbean from Action so when a page (JSP) with tags will be displayed some tags will be set and some no (depends on data from database)..
    example...
    look at the picture...
    http://freeweb.siol.net/peterv6i/ax1.jsp
    I have a AO2.jsp page linked to action2 and also i have a formbean with set/get methods...
    nex step.. when I call action2 I' retrive datas from my database and in Action class I would like to populate formbean which is from page AO3 (which will be displayed)..
    Is this possible? here is my code but work only for 1 user.. if there are 2 or more users on page I get internal server error (Exception)..
    this is my Action class
    public class Action2 extends Action
    public[b] ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    System.out.println("Action2");
    session = request.getSession();
    if (session.isNew()) {
    response.sendRedirect("AO2.jsp");
    AO3formbean frm = new AO3formbean(); <-- this is formbean from page AO3.jsp which I like to populate
    frm.setName("xxxxxx");
    frm.setSurname("ekekelek");
    session.setAttribute("AO3formbean", frm); <-- here I put a formbean in session
    return mapping.findForward("success");
    then the AO3.jsp page will be called which use a AO3formbean... and here problems come... If only one user use the application all is ok.. but when two or more users use the same form with different session the page will not work well.. sometimes i get exception, sometimes white page.. sometimes nonsense datas are displayed..
    Anybody know if is possibile to populate a formbean and store it in session or I must change whole code?
    for example...
    In my form i must enter a car assicurance policy number... (page AO2.jsp)..
    then in the action form I must connect to my database and retrive information from table and populate bean which is also a formbean on the page AO3 which will be desplayed.. (if I'am doing something wrong please let me know the right way)
    best regards

    http://freeweb.siol.net/peterv6i/ax1.jpg

  • Action multiple OM objects in one Form

    Hi Experts,
    The OM Processes & Forms include a number of standard forms in system such as:
    - Create Position
    - Change Position Attributes
    - Create Org Unit
    - change Org Unit
    These forms work on one base object and they process the form.
    We have 2 requirements:
    1) Manager should be able to Process the request for multiple objects in one form. For example, if I want to delete 10 Positions though one form. The standard form selects only one position and processes the form.
    I would like to know that can we develop a custom form which can select multiple objects (positions) and action them through one form only.
    2) The OM Forms include the maintainence infotypes like Account Assignments IT 1008, Employee Grp/subgrp IT 1013, Work schedule IT 1011.
    I would like to know if we need to add the field of new OM infotype for example Authorities and Resources IT 1010, Department and staff IT 1003, Planned Compensation 1005 in a form then
    - is it possible, if yes then what is the process
    - what will be the man days effort to add fields from one OM infotype.
    thanks
    Manu

    Hi Heather,
    in methode set_table_for_first_display you can use the parameter is_variant of type DISVARIANT. Use the field HANDLE in this structure to distinguish the two ALV Objects. Fill also field REPORT of the same structure with sy-repid.
    Regards Florian

  • How to use nested tables object in oracle form

    Hello forum
    How all r u ..
    i need ur help guys, pls help me out...
    i m using an object oriented approach to design my database by using nested tables and
    varrays. it is quite done successfully.
    but the problem is when i m trying to use that object of nested table into the datablock of the form it is not been added to item list of that block.
    so what is the proper way to use these type of objects to the form.
    all ideas are welcomed and vry much required.
    pls give example if possible so easy to understand or have any demo form related to above case then pls post me to my id i.e [email protected]
    thank u all and expecting some expert solutions

    Hello Francois Degrelle...
    How r u doing ... i have searched the forum abt the above mentioned topic then i found that u have some demo form which will help out to explain the functionality of the nested table in forms ..
    will u pls me that form to my i.e [email protected] pls mail all the detail u have regarding using nested tables to forms and reports
    lots of thanks to u n advance.

  • Nested object property in a form?

    Hi,
    I have a problem with nested object property in a form; the nested property could be business.address.zipcode, however, the Flex data binding doesn't support the "." operator. Any advice/hint/code sample will be greatly appreciated.

    It does support the dot operator, there are several examples below:
    http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_4.html
    Have you tried? What problems did you have?

  • How to pass arraylist of object from action class to jsp and display in jsp

    I need to do the following using struts
    I have input jsp, action class and action form associated to that. In the action class I will generate the sql based on the input from jsp page/action form, create a result set. The result set is stored as java objects in a ArrayList object.
    Now I need to pass the arraylist object to another jsp to display. Can I put the ArrayList object in the request object and pass to the success page defined for the action? If this approach is not apprpriate, please let me know correct approach.
    if this method is okay, how can I access the objects from arraylist in jsp and display their property in jsp. This java object is a java bean ( getter and setter methods on it).
    ( need jsp code)
    Can I do like this:
    <% ArrayList objList = (ArrayList)request.getattribute("lookupdata"): %> in jsp
    (***I have done request.setattribute("lookupdata", arraylistobj); in action class. ***)
    Assuming the java object has two properties, can I do the following
    <% for (iint i=0. i<objList.size;I++){ %>
    <td> what should i do here to get the first property of the object </td>
    <td> what should i do here to get the first property of the object </td>
    <% }
    %>
    if this approach is not proper, how can I pass the list of objects and parse in jsp?
    I am not sure what will be the name of the object. I can find out how many are there but i am not sure I can find out the name
    thanks a lot

    Double post:
    http://forum.java.sun.com/thread.jspa?threadID=5233144&tstart=0

  • How to use nested tables in adobe form

    Hi All,
    I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
    EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
    item--materialdescription-ordered qty--delivered qty--delivery date-price  
    xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
    10----
    xxxxxxxxxx
    10----
    xxxxxxxxxx
    yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy 
    xxxxxx is table 1 and will have multiple lines
    yyyyyy is table 2 and will have only 1 entry for item xxx
    and this group will be repeate as per no of items. table 1 can have any no of lines per item.
    I am currently able to display 1 line for table 1 and 1 line for table 2.
    But how to show multiple lines for table 1 and 1 line for table 2.

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • In Web Logic Server Due to HTML file tag the action of struts is not called

    Hi All
    I have a problem as under:-
    There is a HTML page which contains several fields including a file input tag of HTML and i write enctype = "multipart/form-data" in the form tag
    I am calling a struts Action from this form, then it is not reaching to that action of struts.
    If I remove this file tag and enctype = "multipart/form-data" then it reaches to the struts action.
    I am facing this problem in Weblogic server 8.1 but i can easily deploy this same code on Tomcat 5.0
    Please help me out from this problem..
    Thanks...
    Nitin Saxena

    My installation has a DefaultWebApp directory under mydomain/applications,
              try moving everything down there. (I'm on 6.1 but I think 6.0 is the same)
              Eliot Stock
              eliot [ at ] carbonfive [ dot ] com
              http://carbonfive.com
              "Ram" <[email protected]> wrote in message
              news:3bc71641$[email protected]..
              >
              > Hi,
              >
              > I am trying to deploy a simple servlet in WebLogic Server.
              > I have done the following steps.
              >
              > 1) Compiled the MyWorld.Java Servlet Successfully in c:test\ Directory..
              >
              > 2) Created WEB-INF/Classes Directory in the home Directory of
              WebApplication Directory..
              > C:\bea\wlserver6.0\config\mydomain\applications\
              > 3) Copied the Class file into the WebApplication Directory i.e
              >
              > C:\bea\wlserver6.0\config\mydomain\applications\WEB-INF/Classes
              >
              > 4) Executed in the Browser using following URL:
              > http://127.0.0.1:7001/MyWorld
              >
              > But, I am getting this error:
              >
              > Error 404--Not Found
              >
              > Please let me know if the above procedure is wrong, then what are the
              exact steps
              > involved in Deploying a servlet in WebLogic Server.
              >
              > Thanks,
              > Ram.
              >
              

  • How to call another action from Struts dispatch action?

    Hi all,
    there is a method in dispatch action that needs data from another chained action. How should other action determine which method in dispatch action will receive response and how should these data be returned from called action? Called action does not have associated form bean
    thanks,

    Not sure, why are there then "chained actions" is struts practice? Struts allows action without form bean to be configured and the action is a class?

  • Action forms

    Hi, I've a query reg Struts action form.
    I want to display a list of registered Users. Here's my UserVO
    UserVO {
      String strFirstName;
      List Vehicles; // Ferrari, Lambhorgini
    }Now, I'll get a List of UserVO from db. How do I create a action form for this, so that I can show details on the jsp. Thanks

    hi mate,
    i am using these properties with 16 different names in my jsp.
    how come these values are stored in the foem bean?
    can you please guide me with some sample code?
    regards and thanks in advance

  • NULL nested object

    Hi,
    OTT generates code as
    streamOCCI_.setObject(obj);
    when one define a nested object (not REF) e.g
    CREATE TYPE inside_t (f1 NUMBER)
    CREATE TYPE outside_t (id NUMBER, insider inside_t)
    The problem I am seeing is that when I instantiate a persistent object of outside_t in a c++ app and assign the result to a Ref<>
    Ref<outside_t> o = new(conn, "OUTSIDERS_V") outside_t;
    where OUTSIDERS_V is an object view over a traditional relational table of the form
    CREATE TABLE outsiders (id NUMBER, f1 NUMBER) and
    CREATE VIEW outsiders_v OF outside_t ... AS SELECT id,inside_t(f1) FROM outsiders
    it core-dumps on the setObject as the writeSQL is called upon the new but i don't have any value for inside_t yet and could want it to remain NULL for the lifetime of the object. Is it possible to achieve this without using REFs ?

    Unfortunately, AMF serialization is something of a black art. I'd run into multiple issues in the past (working with Granite DS, rather than Blaze--but it's essentially the same thing). I'm not sure about Blaze, but Granite has very verbose logging available if you configure log4j to DEBUG level for org.granite. The other alternative is to attach to your Java process with a debugger (Eclipse makes this fairly automagical), download the Blaze source and configure Blaze as a project in Eclipse, add it to source lookup for your project, and step through the actual serialization to see what's going on. This is moderately complicated to set up, but priceless when it comes to debugging.

  • Using Nested Object Properties as DataGrid dataField

    I am populating a DataGrid with an ArrayCollection of
    Objects. Each of those Objects has a property that is itself an
    Object. I want to use a property of the second (or "nested") Object
    as a dataField for one of my columns.
    Any idea how to make this work? Would a custom item render be
    the only way?

    Using the labelFunction property of the DataGridColumn would
    be enough:
    <mx:DataGrid width="100%" height="100%"
    dataProvider="{myAC}">
    <mx:columns>
    <mx:DataGridColumn dataField="myProperty1" />
    <mx:DataGridColumn dataField="myProperty2" />
    <mx:DataGridColumn
    labelFunction="myOwnLabel" />
    </mx:columns>
    </mx:DataGrid>
    function myOwnLabel(item:Object,
    column:DataGridColumn):String
    return item.myProperty;
    The function must have that signature in order to work, where
    item is an instance of the objects in your dataProvider and column
    is the DataGridColumn calling the function.

  • Can we show the nested objects in Powershell?

    I am adding a .NET type to Powershell session using Add-Type and then creating object of that type using New-Object. This is done as follows:
    Add-Type -AssemblyName OuterObj
    $a = New-Object OuterObj
    Object of type OuterObj is successfully created. Now .NET type $a has a field named innerObj which is object of another .NET type innerObject. So I add "innerObject" .NET type and create an instance using New-Object.
    Add-Type -AssemblyName innerObject
    $b = New-Object innerObject
    Object of type innerObject is also successfully created. Now I do as follows:
    $a.innerObj = $b
    Now when I print $a, it shows something like this:
    innerObj : innerObject
    Thus it does not display the contents of innerObject by default. When I go and explore, innerObj has the fields. I know Powershell does not show the nested objects by default but instead just shows their types, but is there a way I can specify that what
    level of nesting of objects powershell should show by default? Is there something to specify to show 1 or 2 levels of nested objects?
    Any help would be highly appreciated.

    The simplest approach, if you're writing these C# classes yourself, is probably to override the class's ToString method.  That way it will just display that way by default in PowerShell, without any extra effort on the scripter's part.
    If that's not an option, then you can write PowerShell code to accomplish something similar.  Here are examples of both:
    # C# ToString version:
    Add-Type -TypeDefinition @'
    public class innerObject
    public string Property1;
    public string Property2;
    public override string ToString()
    return string.Format("Property1: {0}, Property2: {1}", Property1, Property2);
    public class OuterObj
    public innerObject innerObj;
    $a = New-Object OuterObj
    $b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
    $a.innerObj = $b
    $a | Format-List
    # PowerShell version using constructed property values with
    # Format-List.
    Add-Type -TypeDefinition @'
    public class innerObject
    public string Property1;
    public string Property2;
    public class OuterObj
    public innerObject innerObj;
    $a = New-Object OuterObj
    $b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
    $a.innerObj = $b
    $a | Format-List -Property @{ Label = 'innerObj'; Expression = { "Property1: $($_.innerObj.Property1), Property2: $($_.innerObj.Property2)" } }

  • View Acrobat 9.0 PDF object in VB6 Form

    I'm programming in Visual Basic 6 and I was able to load the Acrobat 5 pdf object into the VB form.
    Now I try to find VB6 components to open Acrobat 9.0 PDF object in VB6 Form and could not find it.
    What should I do?
    Could somebody help me?
    I’ll really appreciate it,
    Ben

    I forgot to tell that I have Windows XP SP3.
    I added the Adobe Acrobat Browser Control type Library 1.0 (AcroPDF.dll) from Components.
    But when I try to Load the PDF into the VB6 Form I received Message from Adobe:
    “There is a problem with Adobe Acrobat/Reader. Please Exit Adobe Acrobat/Reader and try again.”
    When I click OK the PDF object is not showing up in the VB6 Form and trying again not help.
    If I just click the object manually outside of VB it is open without notice.
    Thanks,
    Ben.

Maybe you are looking for

  • Credit not appearing in account

    I haved topped up my credit with 9,98 but that amount is not appearing in my account information. Can you help me to sort this out?  Thanks

  • Facing problem in ABAP program "HINCALC0"

    hi all,            i m facing problem in the  ABAP program "HINCALC0". when i m run this hr program we face problem in processing problem is " No entry in table T512W for key 40 /4OD for time 30.04.2009". plz suggest me hw can i rectify this problem.

  • Ipod Won't Work Please Help

    My ipod wouldn't work at all so i sent it in and they sent me a new one. I thought yeah now itll work but boy was i wrong. It wont get formatted for Windows. The updater does not work and i uninstalled it and then reinstalled it but nothing. It autom

  • Can't open an NEF file in PE 5

    I took some raw (nef) photos with my Nikon D-80 and saved the files to my hard drive. They have a .nef extension. When I go to PE 5.0 windows xp version, and go to File, Open, and try to open the Nef file in the Editor I get a message indicating it i

  • Why isnt my ipod connecting to my wifi

    hey im having trouble connecting my ipod touch 1 generation to my wifi.. it shows my wifi in the box thingy butit sayes i have a passcode on it and i dont.. all my  other divices are connected to this wifi except this.. its really making me mad so pl