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

Similar Messages

  • 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

  • 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

  • Customized Bulk Action Form

    I saw that there are multiple unanswered questions about this, so I am assuming the answer is no but wanted to give it a shot. Is there any way to customize the Bulk Action form besides building an entirely different workflow? For example, I want to remove certain fields and add a checkbox which would save a variable into the workflow. I see bulkop.jsp, which instantiates BulkOpForm, so I gather it's not a form that can be modified. Is there maybe a point where I could merge into the standard bulk process after giving my own frontend? I'd rather not resort to reimplementing the file parsing and all that.

    If bulk action is launched by user who has 'Customer - Tabbed User Form' as User Form, this form will be applied
    You can specify at your form what workflow to launch. Just add field
    <Field name='viewOptions.Process'>
    <Expansion>
    <s>Customer - Update Workflow</s>
    </Expansion>
    </Field>

  • How to bind the data from my data source table to my jsp action form

    I am doing one small application in that i need to bind my data to the database table, that means if i enter any data in my action form fields then it should get appended at database. I have done the binding but it is not appending to the database table. May be i didnt bind the data properly, can anyone help me out in solving this problem. Its very urgent because i have to submit this application today itself. Please help me out from this problem. please tell me from the basics and give me some example.
    Thanking you in advance

    hi,
    try this:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/dataproviders.html
    regards,
    rpk

  • 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.

  • How to map GUI Bean with struts action form?

    Hi,
    I am new to struts and I have to integrate a GUI Based Bean to struts actionform. I am desperately looking for some tips. I would be much gratefull.
    See ya :)

    Hello.
    public vlass MyForm extends ActionForm {
    private MyBean myBean;
    public MyBean getMyBean() {
    return myBean;
    public void setMyBean(MyBean myBean) {
    this.myBean = myBean;
    }

  • Actions and form beans

    1. i have a jsp page that maps to a form bean
    2. the form bean extends action form
    3. i have 4 drop downs in my form
    4. on form load two drop downs are populated (no issues so far)
    5. on changing the selection in one of the forms i have to go back to the database fetch the values for the next drop down
    6. i have written a separate action class for this.
    7. This action class makes my input (what ever done on the form so far) as null and does not even retain the value of the drop down.
    8. An alternate method i tried out was to just call the form submit so that the same action class is called multiple times.
    9. however this fires the validator written in the form bean.
    10. i need to be able to fire the validator only after my form has been filled.
    11. Any ideas

    you can specify the submit 'property' for example you can have different submit values in different names
    than you can use validwher or requiredif validation case depending on the submit button checked.

  • netui:form how do i create Action URL in JavaScript

    hi,
    i want to submit the <netui:form> along with action form data to JPF from the
    java script,
    i can call the action method from the java script but actionForm is not passing
    to JPF....
    pls guide me....
    vijay

    The javascript that you suggested is similar to what we're using. When the onChange
    message is fired, both bits of javascript produce the following url;
    http://localhost:7001/mpsportal/getVersion.do?product_id=1
    This works fine in the weblogic browser but not in portal. If you use an anchor
    to fire the action, portal creates the following url;
    http://localhost:7001/mpsportal/mpsportal.portal?_nfpb=true&portlet_1_1_actionOverride=/portlets/task/getVersion
    So I've tried to put the 'extra bits', namely 'mpsportal.portal?_nfpb=true&portlet_1_1_actionOverride=/portlets/task/'
    into the javascript as below;
    javascript:window.location='mpsportal.portal?_nfpb=true&portlet_1_1_actionOverride=/portlets/task/getVersion.do?product_id='+document.forms[0][getNetuiTagName('product_id')].value;
    When this is run in portal it produces exactly the same url that portal produces
    except it has the parameter tagged onto the end;
    http://localhost:7001/mpsportal/mpsportal.portal?_nfpb=true&portlet_1_1_actionOverride=/portlets/task/getVersion.do?product_id=1
    Unfortunately portal doesn't like the parameter on the end and gives an error
    message 'Unable to find action getVersion.do?product_id=1'. The problem is that
    the value on the form, the product id in this case is not stored when the javascript
    jumps back to the server so it has to be sent in the url.
    If we can find a way of sending these values through in the url without portal
    complaining OR forcing the form to submit its values then its problem solved.
    Thomas Cook <[email protected]> wrote:
    Does this work?
    onChange="javascript:window.location='getVersion.do?product_id='+document.getElementById(getNetuiTagName('product_id',
    this)).value;"
    When you say the problem is in the onChange() method in the NetUI tag,
    can you elaborate on what you think might be happening?
    Thomas
    Steve Hicks wrote:
    Thomas
    We want to get java script to work with a netui:select tag so that whenthe user
    selects it, we populate a different netui:select tag (this requiresa call back
    to weblogic). Nothing to do with forms in Vijay's post!
    Here is a portion of our JSP:
    <td>
    <netui:select dataSource="{actionForm.product_id}"
    optionsDataSource="{pageFlow.taskProduct.taskProductSL}" nullable="false"multiple="false"
    onChange="javascript:window.location='getVersion.do?product_id='+document.forms[0][getNetuiTagName('product_id')].value;"
    tagId="product_id"></netui:select>
    </td>
    This works in the workshop debugger but NOT when we use it via portal(where nothing
    happens). The problem is in the javascript 'onChange' method in thenetui tag...
    Regards
    Steve H
    Thomas Cook <[email protected]> wrote:
    Getting back to Vijay's original post - something like the following
    should work (I can't confirm this code works since I'm in the middle
    of
    a build), but I have done this before. Does this not work? It should
    submit the form from javascript, as Vijay requests, passing the field
    value to the JPF via the action form.
    <netui:form tagId="myForm" action="doSomething">
    <netui:textBox dataSource="{actionForm.doSomethingValue}"/>
    <netui:button value="Submit" onClick="return doSubmit()"/>
    <script language="javascript">
    function doSubmit()
    var form = document.getElementById( getNetuiTagName( "myForm",
    this ) );
    form.method = "post";
    form.submit();
    return true;
    </script>
    </netui:form>
    Steve Hicks wrote:
    We have this problem and it seems quite sad that you can not perform
    this (typical)
    function using portal. Anyone from BEA watching? Could they do something
    about
    this in sp3?
    "Anant Kadiyala" <[email protected]> wrote:
    Beware that it is not entirely good idea to have action url in the
    Javascript.
    I had some problems with it. It works fine when you test it at the
    pageflow
    level.
    But when you pull the pageflow into a portlet, it starts acting strange.
    The urls
    that the portal generates behind the scenes dynamically, get messed
    up
    and you
    will notice that the new acion opens in a new browser window and
    will
    not have
    the context of the portal.
    Although the docs say we could use action urls in Javascript, youmight
    want to
    make sure it works in the portal context.
    Anant
    "julie" <[email protected]> wrote:
    do you still need help making an action url in javascript?
    "vijay patel" <[email protected]> wrote:
    hi,
    i want to submit the <netui:form> along with action form data to
    JPF
    from the
    java script,
    i can call the action method from the java script but actionForm
    is
    not
    passing
    to JPF....
    pls guide me....
    vijay
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
    <title></title>
    </head>
    <body>
    Getting back to Vijay's original post - something like the following
    should work (I can't confirm this code works since I'm in the middle
    of
    a build), but I have done this before. Does this not work?
    It should
    submit the form from javascript, as Vijay requests, passing the field
    value to the JPF via the action form.<br>
    <br>
    <tt><nobr><netui:form tagId="myForm" action="doSomething"></nobr><br>
    <nobr> <netui:textBox
    dataSource="{actionForm.doSomethingValue}"/></nobr></tt><br>
    <tt><nobr> <</nobr><nobr>netui:button value="Submit"
    onClick="return doSubmit()"/></nobr><br>
    <nobr> <script language="javascript"></nobr><br>
    <nobr> function </nobr></tt><tt><nobr>doSubmit</nobr></tt><nobr></nobr><tt><nobr>()</nobr><br>
    <nobr> {</nobr><br>
    <nobr> var form = document.getElementById(
    getNetuiTagName(
    "myForm", this ) );<br>
    form.method = "post";<br>
    form.submit();</nobr><nobr></nobr></tt><tt><nobr></nobr><br>
    <nobr> return true;</nobr><br>
    <nobr> }</nobr><br>
    <nobr> </script></nobr><br>
    <nobr></netui:form></nobr></tt><br>
    <br>
    Steve Hicks wrote:<br>
    <blockquote cite="[email protected]" type="cite">
    <pre wrap="">We have this problem and it seems quite sad that youcan
    not perform this (typical)
    function using portal. Anyone from BEA watching? Could they do something
    about
    this in sp3?
    "Anant Kadiyala" <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a>
    wrote:
    </pre>
    <blockquote type="cite">
    <pre wrap="">Beware that it is not entirely good idea to have action
    url in the Javascript.
    I had some problems with it. It works fine when you test it at thepageflow
    level.
    But when you pull the pageflow into a portlet, it starts acting strange.
    The urls
    that the portal generates behind the scenes dynamically, get messedup
    and you
    will notice that the new acion opens in a new browser window and will
    not have
    the context of the portal.
    Although the docs say we could use action urls in Javascript, you might
    want to
    make sure it works in the portal context.
    Anant
    "julie" <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a>
    wrote:
    </pre>
    <blockquote type="cite">
    <pre wrap="">do you still need help making an action url in javascript?
    "vijay patel" <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a>
    wrote:
    </pre>
    <blockquote type="cite">
    <pre wrap="">hi,
    i want to submit the <netui:form> along with action form data to
    JPF
    </pre>
    </blockquote>
    <pre wrap="">>from the
    </pre>
    <blockquote type="cite">
    <pre wrap="">java script,
    i can call the action method from the java script but actionForm is
    </pre>
    </blockquote>
    <pre wrap="">not
    </pre>
    <blockquote type="cite">
    <pre wrap="">passing
    to JPF....
    pls guide me....
    vijay
    </pre>
    </blockquote>
    </blockquote>
    </blockquote>
    <pre wrap=""><!---->
    </pre>
    </blockquote>
    </body>
    </html>

  • Adobe form on Link to Action

    Hi Experts,
    I an working on WDA application in which i have to call an adobe form on table column which is a link to action.
    form is already created thorugh SFP of standard form type.
    In some cases This form will be interactive and for some its not......which is through parameters in the form.
    With ABAP driver program it is working fine but i donno how to use this in WDA.
    Please suggest what to do...
    Regards
    Nik

    Hi Nikhil,
    The solution which I had suggested was for displaying the Adobe form in a new window on click of the LinkToAction field. Say suppose I have a view by name AIF & it is embedded within a window W_AIF. Then upon clicking on the LinktoAction within the MAIN view I can put the below code within the LinkToAction's onAction event to display the form in a new window:
    DATA lo_window_manager TYPE REF TO if_wd_window_manager.
    DATA lo_api_component  TYPE REF TO if_wd_component.
    DATA lo_window         TYPE REF TO if_wd_window.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    lo_window         = lo_window_manager->create_window(
                       window_name            = 'W_AIF'
    *                  title                  =
    *                  close_in_any_case      = abap_true
                       message_display_mode   = if_wd_window=>co_msg_display_mode_selected
    *                  close_button           = abap_true
                       button_kind            = if_wd_window=>co_buttons_ok
                       message_type           = if_wd_window=>co_msg_type_none
                       default_button         = if_wd_window=>co_button_ok
    lo_window->open( ).
    You can generate the above coding through the code wizard by selecting the option as, "Generate Popup" & select the window name as the 2nd window that you have created.
    Anyways now that you have specified that you want the form to be displayed within the same view as the LinkToAcion you can go ahead as how specified by Saketh. Define a context attribute say VISIBILITY of type WDUI_VISIBILITY. Give it a default value of 01 which would make it as invisible by default. Bind the "visible" property of the InteractiveForm UI element to this attribute. Now within the LinkToAction's onAction method you can just set the context attributes value to "02" which would mean making the form visible within the same view.
    METHOD onactioncall_aif .
      wd_context->set_attribute( EXPORTING name  =  'VISIBILITY'
                                           value = '02' ).
    endmethod.
    Regards,
    Uday

  • Could not getting field values from form

    hi,
    hellow, can you help me for solving the bellow problem
    i have form its enctype attribute of form tag is setted as multipart/form-data. when i am submiting this form, i call a request.getParameter(); in the submitting jsp file. But for any controls such as text,checkbox,select box etc could not get its corresponding value.

    Its obvious why its not picking up the change in the second action.
    Lets see...
    Here is your case I
    You get the populated form which is also put in the request with updated value from the JSP....
    (1)
    protected Forward updateGoalObjective(GoalsForm form)
    form.setGoalId(44); //int field set to 44
    return new Forward("success");
    You set one of the fields some other value....in one but how will the second action know about it???
    You try to execute the second action and the action grabs the form from the request again. This is the original form submitted by the JSP so you still see that value...
    You will have to pass in the customized or processed form for the form to be able to get it...
    protected Forward showGoal(GoalsForm form)
    System.out.println(form.getGoalId()); //prints 68
    return new Forward("success");
    In your second case you create a new form...why would you want to do that if you have a form value being set in JSP??
    The answer is you should be doing something Like this:
    * @jpf:action form="goalsForm"
    * @jpf:forward name="success" path="showGoal.do"
    protected Forward updateGoalObjective(GoalsForm form)
    //other code
    form.setGoalId(44); //int field set to 44
    return new Forward("success", form);
    * @jpf:action form="goalsForm"
    * @jpf:forward name="success" path="Goal.jsp"
    protected Forward showGoal(GoalsForm form)
    System.out.println(form.getGoalId()); //prints 68
    return new Forward("success");
    }

  • I want to create a form in IWeb can you help?

    I need to create a form page in Iweb on my website for visitors to complete and submit back to me.
    A Club membership application form.
    Anyone able to help??

    There are online form sites that you can use like JotForm, Wufoo, etc.  Jotform creates some very nice looking forms which you can embed into an iWeb page.  The free package gives you 100 submissions per month and 10 SSL secure submissions per month.  Over those numbers you will need to pay a monthly fee. 
    Here are examples of Jotform and Wufoo forms: Embedding Forms
    Or you can create your own Form Action form which uses the visitor's own email client to send the information. This is not best integrated method to obtain the information.   An example of this type of form is also on the page linked to above.
    OT

  • Using ADF View object create method in Data Action

    I need to know how to create a new row in an application module method and get the attributes from the ADF input form.
    If i Drag drop the create method in the data action form it is working fine. But how to do this programmatically, I have a need where i need to execute a query on another view object and set the create method.
    Thanks.

    Steven:
    (My application does not need to show all records and provide Edit/ Remove buttons at row level, navgational buttons and Create button for inserting new record. Instead, I would just open a blank record for entry, and commit)
    As per your post, I followed the following steps (action class) to insert blank record:
    DCBindingContainer bindings = actionContext.getBindingContainer();
    DCControlBinding binding = bindings.findCtrlBinding("Id");
    Row row = binding.getRowIterator().createRow();
    row.setNewRowState(row.STATUS_INITIALIZED);
    RowSetIterator rs =(RowSetIterator)
    binding.getRowIterator();
    rs.insertRow(row);
    End Results: It works fine and a new blank record is created. The only problem is <html:errors/> in JSP throws error for the first time. I do not want to elliminate error object from JSP.
    Please help!
    Thanks in advance

  • Assigning java script array to a variable in struts form class

    Hi,
    I am trying to send a javascript array of string from jsp to struts action form.
    I have constructed a javascript array and assigned it to the form variable. But iam not able to access the variable in Action form. :( please let me know as to how i can send a string array in javascript to action form?.
    JavaScript
    var scriptarray = new Array();
    // code for populating the array
    document.MyForm.javaArray = scriptArray;
    document.MyForm.action="MyAction.do?dispatch=handlerMethod";
    document.MyForm.submit();

    var input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", "bla..bla");
    input.setAttribute("value", "bla..bla");And in addition to that.. Google is still alive

  • Is it possible to make a form in iWeb for people to fill in

    Is it possible to make a form in iWeb for people to fill in for people to subsribe

    There  are two possible form types that you can add to your website.  One is using a 3rd party form provider that, when filed in and sent, goes directly to you.  Expamples of them, JotForm and Wufoo can be seen here: Add Form
    Further down that page is the second type,  Form action forms, that use the visitors email application to send the response.  That may put off responders.  Take a look at both types.
    OT

Maybe you are looking for