Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4072404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:52:49+00:00 2026-05-20T16:52:49+00:00

Hi: In my jsp page,I have a form to add/update a nested object using

  • 0

Hi:
In my jsp page,I have a form to add/update a nested object using struts tags,

First,here is an example which show what I am trying to do:
http://jsfiddle.net/mbwwg/

this is the code:

<table>
    <tr>
        <th>Step Name</th>
        <th>Step Operators</th>
        <th>Step Status</th>
        <th>Set the order</th>
    </tr>
    <tr>
        <td><s:textfield name="task.steps[0].name"/></td>
        <td>
            <s:select list="allOpInDb" listKey="id" listValue="name" multiple="true" name="task.steps[0].id" />
        </td>
        <td>
            <!-- Here,I do not know hwo to list the Status with the radio button -->
            <s:radio list="xx" name="task.steps[0].status" />
        </td>
        <td> up <br> down</td>
    </tr>
    <!-- step02 -->
    <tr>
        <td><s:textfield name="task.steps[1].name"/></td>
        <td>
            <s:select list="allOpInDb" listKey="id" listValue="name" multiple="true" name="task.steps[1].id" />
        </td>
        <td>
            <s:radio list="xx" name="task.steps[1].status" />
        </td>
    </tr>
    <td> up <br> down</td>
</table>

In the table,there are two rows (step01,and step02),they will be changed to the elements of an ArrayList by struts2 in the server side.

The realted classed:

class Task{
    private int id;
    private String name;
    private List<TaskStep> steps;  //the required steps to complete this task

}


class TaskStep{
    private int id;
    private String name;
    private List<Operator> operators;  //the operator who will directly do this job

}
class TaskAction extends ActionSupport{
    private int taskid;
    private Task task;
///
}

Now I want the user can change the order of the steps in the page(for example,move up or down a step),and when the two row exchanged,the realated attribute should be change accordingly,take the first row for example:

    <tr>
        <td><s:textfield name="task.steps[0].name"/></td>
        <td>
            <s:select list="allOpInDb" listKey="id" listValue="name" multiple="true" name="task.steps[0].id" />
        </td>
        <td>

            <s:radio list="xx" name="task.steps[0].status" />
        </td>
        <td> up <br> down</td>
    </tr>

When this row is moved down,so all “name” attribute of its input type shoulde be changed from “task.steps[0].xxx” to “task.steps[1].xxx”,and vice versa. Since the steps of the step are ordered.

So I thougth using javascirpt,and jquery is my first choice ,is there plugin can make this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:52:50+00:00Added an answer on May 20, 2026 at 4:52 pm

    This question has an answer that explains how to wire up your table with jQuery to make your up and down links work. You can also take a look at the jQuery sortable plugin.

    These will help you get your rows moving around but you also want to update your name attribute. You could do that using $('XXX').attr('name') to exchange the attributes of the two rows – the one that was moved and the one that was displaced.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jsp page with two radio tags. The page contains a struts2
On a JSTL/JSP page, I have a java.util.Date object from my application. I need
I have this simple Jsp page: <%@ page language=java import=java.awt.Color%> <% Color background =
Right now I have a JSP page that allows to sort some items, when
I have a list of bean objects passed into my JSP page, and one
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,
In a JSP page, I created a <h:form enctype=multipart/form-data> with some elements: <t:inputText> ,
I've got a JSP page with a piece of Javascript validation code which limits
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
In a JSP page(index.jsp): ${requestContext.requestURL} is the URL just shows the expression itself. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.