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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:27:58+00:00 2026-06-17T12:27:58+00:00

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).

  • 0

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am using jqGrid to display records in tabular format.

I want to get values for combobox in jqGrid from servlet, so far I have done following.

I am accessing the array passed by Servlet in JSP scriplet.

<%
    String[] stageIDs = (String[])request.getAttribute("combo");
%>

Following is my colModel:

jQuery("#list10_d").jqGrid({
            height: "100%",
            url:'ProtocolJGridServChild?q=2&action=protAction',
            datatype: "xml",
colNames:['Sr. No.','PID',  'SID'],
colModel:[{name:'srNo',index:'srNo', width:35,sortable:true},
{name:'PID',index:'PID', width:100,sortable:false,editable:true,hidden:true},
{name:'SID',index:'SID', width:100, sortable:false, editable:true, edittype:"select",editoptions:{value:<%for(int i=0;i<stageIDs.length;i++)%><%="ID:"+ stageIDs[i]+";"%>}}
],
            rowNum:2,
            rowList:[2,4,6],
            pager: '#pager10_d',
            sortname: 'PID',
            viewrecords: true,
            sortorder: "asc",
            multiselect: true,
            editurl: "MyServletName",
            caption:"CRM_PROT_ACTIONS",
}).navGrid('#pager10_d',{edit:true,add:true,del:true});

But I am getting an exception in for loop line where I am assigning the editoptions to the combobox. Please let me know is there any mistake in code.

My another question is that is there any better way of assigning values to combobox in jqGrid from servlet (without using scriplet)?

  • 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-06-17T12:27:59+00:00Added an answer on June 17, 2026 at 12:27 pm

    You should use dataUrl instead of value inside of editoptions to get values for combobox from the server. If the server return JSON data instead of HTML fragment you can use buildSelect to convert server response from dataUrl to the format which jqGrid need. The exact implementation could depend on the version of jqGrid which you use. You can use ajaxSelectOptions to change type or dataType of the corresponding Ajax request from default “html” to "json" (see here). See here an example of buildSelect implementation.

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

Sidebar

Related Questions

I developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10). I
I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am developing a web application using JSP & Servlet.(IDE: Eclipse, Container: Tomcat7.0) To
I am developing web application using JSP and Servlet (IDE: Eclipse, Container: Tomcat7.0, DB:
I am developing a web application. I am using Eclipse as IDE. I was
I am using eclipse Indigo IDE ..I am developing a jsp application ( myProject
I am developing a web application using JSP and Servlet. I am trying to
I am developing a web application using JSP and Servlets. In that application I
I am developing a dynamic JSP/Servlet web application. In order to handle the session,

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.