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 6019075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:22:05+00:00 2026-05-23T03:22:05+00:00

I have a drop down in a jsp page having the following code <s:select

  • 0

I have a drop down in a jsp page having the following code

<s:select name="newQuestion.CertificationId"
    list="certificationList"
    listKey="certificationId"
    listValue="certificationName"
    headerKey=""
    headerValue="Select Certification"
    label="Certification Name"
    onchange="getQuestionsList(this.value)" />

Now the on change event of the drop down is calling a JS function getQuestionsList() which intends to fetch the question list of the certification Id choosen.

In the JS function I am submitting it to a action class where I am doing a DB call to fetch question list based on values of certification Id

function getQuestionDetails(value){
    var submiturl = "Action1.action?certId="+value;

$.ajax({
    url:submiturl,
    type: 'get',
    beforeSend: function(){
        $("#loading").show();
        alert("parsed");
    },  
    success: function(result){
        if(result!=''){

        } else {
            alert(result);
        }
    },
  });
}

Now in the action class I am setting the value of questionList with values I fetch from database .questionList is a instance variable in action class with getter and setter methods.Now in struts.xml I am passing to the same jsp where I had the drop down

<action name="questionAction" class="questionInfo.QuestionManager"
            method="displaySelectedQuestions">
    <result name="loaded">/questionAdmin.jsp</result>
</action>

The problem I encounter is when I go back to the jsp I am not able to retrieve the question List which I display in an iterator

<table class="registrationDetailsTable">
    <tr class="tabledataheader">
        <td>Question Id</td>
        <td>Question Description</td>
    </tr>
    <s:iterator value="questionList">
        <tr class="tabledatarow">
            <td><s:property value="questionId" /></td>
            <td><s:property value="questionDesc" /></td>        
        </tr>
    </s:iterator>
</table>

Please let me know where I am getting wrong so that I have the question List populated in my jsp

  • 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-23T03:22:06+00:00Added an answer on May 23, 2026 at 3:22 am

    When you call your action with $.ajax(...), the action creates the response by forwarding to the view (questionAdmin.jsp), right? And this response should be available to you in that Ajax call’s return value handler.

    So when you have this:

    success: function(result){
            if(result!=''){
                // nothing here currently!
            } else {
                alert(result);
            }
        }
    

    You should do something with the resulting HTML. You could begin by doing just alert(result) to see what you are getting and then display the new list contents using Javascript. I would do it so that you have a div containing your table like this:

    <div id="myTableWrapper"> <!-- I added this div -->
        <!-- This part should come from the action when called by Ajax -->
        <table class="registrationDetailsTable">
            <tr class="tabledataheader">
                <td>Question Id</td>
                <td>Question Description</td>
            </tr>
           <tr class="tabledatarow">
                <td>1</td>
                <td>My question #1</td>        
            </tr>
            <tr class="tabledatarow">
                <td>2</td>
                <td>My question #2</td>        
            </tr>
        </table>
        <!-- //This part should come from the action when called by Ajax -->
    </div>
    

    So now you can do this:

    success: function(result){
            if(result!=''){
                $('.myTableWrapper').html(result);
            } else {
                alert(result);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a drop-down list like: <select id='list'> <option value='1'>Option A</option> <option value='2'>Option
On my page I have a drop-down select box, with a default value of
In my JSP, I have the following exception while populating drop down value. ........
I have a drop down list that is populated in the page load event
I have two drop down list on a page. The first one list projects
I have a drop down list on my page. The onchange event of this
In my aspx page I have drop down list that initialy in page load
I have a drop down list (select) populated from SQL. This is dynamic so
I have 3 drop down boxes, created using the HTML select tag. On page
I have a drop down like this on my page: <p> <%= f.label :episode_id

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.