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

  • Home
  • SEARCH
  • 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 3751322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:03:29+00:00 2026-05-19T09:03:29+00:00

I have the following code to do a doubleselect using Struts2 and the jquery

  • 0

I have the following code to do a doubleselect using Struts2 and the jquery plugin:

jsp:

<s:url id="ajaxActionUrl" value="/getStateCodesJson"/>
<sj:select name="stateCodeId"
           id="stateCodeId"
           label="State"
           href="%{ajaxActionUrl}"
           onChangeTopics="reloadSecondSelect"
           list="stateCodeList"
           listKey="id"
           listValue="label"
           emptyOption="true"
           headerKey="-1"
           headerValue="Please Select A State"/>

<sj:select name="subCodeId"
           id="subCodeId"
           label="Sub Feature"
           href="%{ajaxActionUrl}"
           formIds="mapGeneratorForm"
           reloadTopics="reloadSecondSelect"
           list="subCodeList"
           listKey="id"
           listValue="subCodeDescription"
           emptyOption="true"
           headerKey="-1"
           headerValue="Please Select A Code"/>

Action:

@Action(value = "getStateCodesJson", results = {
        @Result(name = "success", type = "json")
})
public String getStateCodesJson() throws Exception {
    stateCodeList = stateCodeService.getAll();
    Collections.sort(stateCodeList);

    if (stateCodeId != null) {
        StateCode stateCode = stateCodeService.getById(stateCodeId);
        subCodeList = subCodeService.getByStateCode(stateCode);
    }

    return SUCCESS;
}

When the jsp first loads, the getStateCodesJson() method is called 3 times. However, after making the change, the action is not called again, so the second never gets populated.

Can anyone assist?

Jason

  • 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-19T09:03:30+00:00Added an answer on May 19, 2026 at 9:03 am

    Handle the null value of the second list at the action itself, rather than transferring it to the DAO.

    Else you can use a struts2 double select tag.

    Here is a good example.

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

Sidebar

Related Questions

I have the following code: ListBox.DataSource = DataSet.Tables(table_name).Select(some_criteria = match) ListBox.DisplayMember = name The
I have the following code: SELECT <column>, count(*) FROM <table> GROUP BY <column> HAVING
I have the following code making a GET request on a URL: $('#searchButton').click(function() {
I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but
i have following code for allocation two dimensional array #include <iostream> using namespace std;
i have following code #include <iostream> #include <string> using namespace std; string generate(){ for
i have following code #include <iostream> #include <set> #include <string> using namespace std; template<class
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following Code Block Which I tried to optimize in the Optimized section
I'm trying to use opengl in C#. I have following code which fails with

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.