Java(jsp) problem....of combobox event

hai here jai.....
i m doing a project in jsp with backend postgresql.......
my problem is.....i hv a combobox where i display department code from database....i hv done this.....now when i select a dept code in the combobox,then there is a textbox on the same page where corresponding ddo code of that dept code will be displayed from the database.....and the dept code and ddo code are 4m the same table of the database.....i can't do this......please help....give me the code in jsp......

Try with the code below...I just implemented teh logic.You have to modify the code accoring to your need...............lemme know if it works or not...........
<html>
<head><script>
function subit(){
document.combo_chk.action='firstpage.jsp?combo='+document.combo_chk.combo.value;
//alert(document.combo_chk.action);
document.combo_chk.submit();
function selit(){
//alert(document.getElementById('<%=request.getParameter("combo")%>').value);
document.getElementById('<%=request.getParameter("combo")%>').selected='true'
</script>
</head><%if(request.getParameter("combo")!=null){%>
<body onload="selit()">
<%}else{%>
<body>
<%}%>
<form name="combo_chk" method="post" action="secondpage">
<%
String value="";
if(request.getParameter("combo")!=null){
//your code will go here..
//dummy value for test
value="edu1,edu2...................";
//End dummy value for test
}%>
<select name="combo" onchange="subit()">
<option value="home" id="home">HOME</option>
<option value="education" id="education">EDUCATION</option>
</select>
empid<input type="text" name="empid" value="<%=value%>">
</form>
</body>
<html>

Similar Messages

  • HTMLLoader problem with comboBox

    hi guys
    I'm trying to loader pdf file using XML to retrieve the URL  and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox
    the problem is the pdf file load only first time and dosent  change if I select another one from the list, I dont know what the the probelm I tried manything like removeChild and I tried to use container but no change, only first time the file loaded
    this is the code
    cb_list.addEventListener(
    SliderEvent.CHANGE,changehandler);
    function changehandler(e:Event):void {
        var sort1:String=cb_list.value;
        var id:String = myXML.tip.(title == sort1)[email protected]();
         //trace(id)
        var slectedtip = myXML.tip.(title == sort1).fulltip.text();
        tit_label.text=myXML.tip.(@ID == id).title .text();
        date_label.text=myXML.tip.(@ID == id).date.text();
        full_tip.text=myXML.tip.(@ID == id).fulltip.text();
         var flashfileURL = myXML.tip.(@ID == id).picURL.text();
        swfURL.text=flashfileURL;
        var url:String = new String();
        url= myXML.tip.(@ID == id).picURL.text().toXMLString();
        var requestpdf:URLRequest=new URLRequest(url);
         var container:Sprite = new Sprite();
        var pdf = new HTMLLoader();
        pdf.height=stage.stageHeight-150;
        pdf.width=stage.stageWidth-270;
        pdf.y=100;
        pdf.x=260;
        pdf.load(requestpdf);
           pdf.addEventListener(Event.COMPLETE, completeHandler);
        function completeHandler(event:Event):void {
            addChild(pdf);

    [problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]

  • In java/jsp got Error,ORA-01000: maximum open cursors exceeded,

    Dear ALL,
    We are facing a problem of in java/jsp. ORA-01000: maximum open cursors exceeded,We are using referance Cursor for returing the Record in java file.
    The Code is given below.
    import java.sql.*;
    import javax.sql.*;
    import com.india.trade.dbConnection.*;
    import oracle.jdbc.driver.*;
    import java.util.Vector ;
    public class IntRmsActivity
         private static JDBCConnection instance = null;
    private static Connection con = null;
         private static CallableStatement stmt_admin_getadmins = null;
         private static String str_admin_getadmins = "{ call Admin_conf.RMS_ADMIN_GETALLADMINS(?,?) }";
         static
              try
                   instance = new JDBCConnection();
                   con = instance.getConnection();
                   stmt_admin_getadmins = con.prepareCall(str_admin_getadmins);
    }catch(Exception se){se.printStackTrace();}
         public static Vector admin_getAdmins() throws Exception
              checkconnection();
              String message = null;
              Vector v_admins = new Vector();
              ResultSet rs_admins = null;
              stmt_admin_getadmins.registerOutParameter(1 , OracleTypes.CURSOR);
              stmt_admin_getadmins.registerOutParameter(2 , Types.VARCHAR);
              stmt_admin_getadmins.execute();
              message = stmt_admin_getadmins.getString(2);
              System.out.println("message " + message);
              rs_admins = ((OracleCallableStatement)stmt_admin_getadmins).getCursor(1);
              while (rs_admins.next())
                        v_admins.addElement(rs_admins.getString("adminid"));
              rs_admins.close();
              return v_admins;
    CREATE OR REPLACE PACKAGE Admin_conf IS
    TYPE REF_CRSR IS REF CURSOR; /* OUTPUT CURSOR VARIABLE TYPE */
    PROCEDURE RMS_ADMIN_GETALLADMINS(RESULTS OUT REF_CRSR,
                                            OUT_MESSAGE OUT VARCHAR2);
    END Admin_conf;
    CREATE OR REPLACE PACKAGE BODY Admin_conf
    IS
    PROCEDURE RMS_ADMIN_GETALLADMINS(RESULTS OUT REF_CRSR,
                                            OUT_MESSAGE OUT VARCHAR2)
    IS
    l_ref_out_crsr REF_CRSR;
    BEGIN
         OPEN l_ref_out_crsr FOR
         SELECT EXECUTIVE_ID adminid
         FROM MASTER_EXECUTIVE_ID
         ORDER BY EXECUTIVE_ID;
         OUT_MESSAGE := 'ADMIN IDS FETCHED SUCCESSFULLY';
         RESULTS := l_ref_out_crsr;     
    EXCEPTION WHEN OTHERS THEN
              OUT_MESSAGE := 'ERROR ' || SUBSTR(SQLERRM, 1, 60);
    END RMS_ADMIN_GETALLADMINS;
    END Admin_conf;
    Regards
    Ajay Singh Rathod

    Are you actually closing the connections, resultsets in all cases?
    From what you've posted you call
    rs_admins.close();but in that method, you propagate any exceptions that occur out to the caller method, which in turn just prints a stack trace.
    So if an exception occurs before you call the rs_admin.close() the result set will never be closed as the statement won't be reached.
    I'd add a speific exception handling routine to the admin_getAdmins() method and include a finally clause to close the result set in all cases. You can still onthrow the exception if you want.
    cheers
    -steve-

  • Problem with combobox gets dispalyed infront of popup window

    when ever popup window is open and kept on combobox ,combobox appears in front or overlaps the popup window,where exactly i have to check the code.which place of code i have to look into... plz help if there is any problem with css then plz specify which property i have to look into..

    [problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]

  • Java Bean Problem

    Hi,
              I have encountered a Java bean/JSP problem. I have developed a simple test
              case as follows:
              Paramtest.jsp:
              <html>
              <head>
              <title>Param Test</title>
              <body>
              <p>
              <form name="form1" method=post action="formtest.jsp">
              <input name="check1" type="checkbox">Check1
              <br>
              <input type="submit" value="OK" type="submit">
              </form>
              </body>
              </html>
              Formtest.jsp:
              <jsp:useBean id="cbtest" class="com.ebiffa.cbtest"
              scope="request" />
              <jsp:setProperty name="cbtest" property="*" />
              <html>
              <body>
              check1= <%= cbtest.getCheck1() %>
              </body>
              </html>
              cbtest.java:
              package com.ebiffa;
              public class cbtest {
              boolean check1;
              public void setcheck1 (boolean check1) {
              this.check1=check1;
              public boolean getCheck1() {
              return check1;
              When I run the program check1 always shows 'false' regardless of whether the
              checkbox is checked.
              I am running Weblogic 5.1.0 SP8
              The program works OK on Tomcat
              Any ideas ???
              Thanks in anticipation
              

    I had already pick that typo up I posted the wrong source code for the bean.
              "Nils Winkler" <[email protected]> wrote in message
              news:[email protected]...
              > The problem is in your bean class: The set-method's name should be
              > "setCheck1", not "setcheck1". Capitalization matters in this case (no
              > pun intended).
              >
              > Hope this helps,
              >
              > Nils
              >
              > Ian McDermid wrote:
              > >
              > > Hi,
              > >
              > > I have encountered a Java bean/JSP problem. I have developed a simple
              test
              > > case as follows:
              > >
              > > Paramtest.jsp:
              > >
              > > <html>
              > > <head>
              > > <title>Param Test</title>
              > > <body>
              > > <p>
              > > <form name="form1" method=post action="formtest.jsp">
              > > <input name="check1" type="checkbox">Check1
              > > <br>
              > > <input type="submit" value="OK" type="submit">
              > > </form>
              > > </body>
              > > </html>
              > >
              > > Formtest.jsp:
              > >
              > > <jsp:useBean id="cbtest" class="com.ebiffa.cbtest"
              > > scope="request" />
              > > <jsp:setProperty name="cbtest" property="*" />
              > > <html>
              > > <body>
              > > check1= <%= cbtest.getCheck1() %>
              > > </body>
              > > </html>
              > >
              > > cbtest.java:
              > >
              > > package com.ebiffa;
              > > public class cbtest {
              > >
              > > boolean check1;
              > >
              > > public void setcheck1 (boolean check1) {
              > > this.check1=check1;
              > > }
              > > public boolean getCheck1() {
              > > return check1;
              > > }
              > >
              > > }
              > >
              > > When I run the program check1 always shows 'false' regardless of whether
              the
              > > checkbox is checked.
              > >
              > > I am running Weblogic 5.1.0 SP8
              > >
              > > The program works OK on Tomcat
              > >
              > > Any ideas ???
              > >
              > > Thanks in anticipation
              >
              > --
              > ============================
              > [email protected]
              

  • SUM(score) in JAVA/JSP

    hi,
    i want to add the total amount of a string called "score". In SQL this is done by "SUM(SCORE)... though how would i do this in JAVA/JSP?
    Regards

    fahafiz wrote:
    right... good luck... but basically the results i want to add up is total score. this CAN NOT be done in SQL as it is a long process and too many filters involved.
              rsKSB = StmtKsbLit.executeQuery("SELECT SUM(bksb_Diag_Assessments.[Total Score]) FROM bksb_Diag_Assessments LEFT JOIN CommentScores ON CommentScores.Score=bksb_Diag_Assessments.[Total Score] AND CommentScores.Curric=bksb_Diag_Assessments.Curric  WHERE (bksb_Diag_Assessments.[Stu Ref No] = '"+sr_studentid+"') AND (bksb_Diag_Assessments.[Curric]='"+lit1_curric_ref+"') AND ([Date] =(SELECT MAX(Date) FROM bksb_Diag_Assessments WHERE [Stu Ref No] = '"+sr_studentid+"' AND Curric = '"+lit1_curric_ref+"'))");or
                    int total = 0;
              while(rsKSB.next())
              lit1_out_of                              = rsKSB.getInt(2);
              lit1_total_score                    = rsKSB.getInt(1);
                    total += lit1_total_score;
              commentid                              = spformat.format(rsKSB.getString("CommentID"));
              }I dunno, maybe I'm misinterpreting your problem, but it seems to me like either of these ways would work.

  • New To java/JSP

    I am new to JAVA/JSP. I downloaded and installed tomcat. When I try to start it I am getting an error. (java.exe has encountered a problem and needs to close.) It will not start. I am running on Windows-xp. Anyone has any ideas as to what the problem could be ? Do I need to do anything special for Windows-xp ?
    Thanks for your help.
    - Madan

    Your description is not very detailed but I'm using Tomcat quite well to run my JSP/Beans stuff which I'm progressing in learning.
    Tomcat is actually "jakarta-tomcat-4.1.18", and to start the server I use d:\jakarta-tomcat-4.1.18\bin\startup.bat
    You need to set up various classpath and directory info in setclasspath.bat
    Assuming you then get the thing started, to test it out, go to
    http://localhost:8080/index.jsp (unless you changed 'localhost')
    Please post more questions if you want - I'm sure someone can help.
    Gary

  • Problem Posting an Event to the EventQueue

    Hi all,
    while i develop a java application i get problem posting ana event to the EventQueue using postEvent method.Here is the problem.i have a menu which have 3 menu items (Load, store, hide).i want when the user click "hide" the code in "store" option excuted plus extra code in option "hide".i tried to implement this using the postEvent of EventQueue. i simlate this by tring to post ActionEvent to simulate user cliks option "store" but this didn't work. can anyone tell me what's the problem.thanks

    try JMenuItem's doClick(). that simulates the user clicking on your menu item.
    thomas

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • ICal error "There was a problem receiving this event invitation"

    Whenever I try accepting an event invitation I get a dialog prompt that says
    *There was a problem receiving this event invitation*
    Someone invited you to an event using an email address that isnt on your "me" card in Address Book. Find your email address in the following list and add it to your card in Address Book
    Problem is I've done that, my vCard is up to date. It was working fine, I cant recieve any invites anymore, wether they come from OSX or Windows. Can anyone help?

    I ran into this same issue. To resolve this, go into the Address Book application. Select the vCard that is "your" card. Now in the menu bar, go to "Card". On the drop down menu, select "Make this my card". You should now be able to accept iCal invitations without any issues. When I upgraded to 10.5.1 the issue came back and this method seemed to resolve it.

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • How do I identify a problem in an event?

    Friends,
    I've updated to FCP X 10.1.  An event that I created after updating and for which I created a project suddenly displayed a yellow hazard symbol next to the name of the event.  This suggests that there is some sort of problem with the event or project.  How can I identify more specifically what the problem is?  Everything looks good when I look at the event and enclosed project.
    Thanks!
    Steve

    It means at least one peice of media is offline, and needs to be relinked.
    Select the Event, go to File > Relink Files, then swith from All to Missing Files.  You can then relink anything that is offline.

  • Java-JSP working with packages and classes

    Hi everybody,
    I'm bearly new on Java-JSP developping and I wanted to know how Tomcat (for example) manage the imported packages and classes.
    The fact is I'm working on a project ('/bob') which use some packages that I don't see in the '/bob' directory. So, is that possible that '/bob' is downloading packages and classes from Internet to '/bob/download' virtual repertory and use it? If it is true, is it possible to override this download by making '/bob' project using local packages or classes (example : com.boblibrary.classes.util in '/bob/WEB-INF/classes/com/boblibrary/classes/util') instead of downloading it?
    Therefore, the '/bob' project is using bugged classes (that I think it downloads from Internet) which I can't correct.
    Thanks for your help.
    - Renaud

    Thank you for your answer, but I can't imagine where is physicaly the class that my project use and show me as http://localhost:8080/atlassian-jira-3.13.2/download/ressources/br.com.ecore.jira.plugin.projectViewPlugin:ProjectViewTabPanel/js/projectviewtabpanel.js. Where is that Javascript file suppose to be on my hard drive? Or where is that class 'br.com.ecore.jira.plugin.projectViewPlugin' suppose to be on my hard drive? If it is not dowloaded from the Internet.
    I have no trace of that class on 'atlassian-jira-3.13.2/', neither on 'jdk1.6.0_18/', 'jre6/' or 'apache-tomcat-5.5.28/common/classes/'.
    Thanks.

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

Maybe you are looking for

  • When connected to my external screen the desktop numbers are not in sequence

    Hi Relatively new to Apple but use an Apple external screen.  When viewing muptiple screen on the MacBook they are shown in order left to right 1  2   3   4  etc however when connected to the extrenal screen they show 1  3  2  4  It is confusing.  Al

  • Avoid timeout in Thread.run

    I have a Thread running task by task from a taskpool. while(running) { task = tasks.elementAt(0); process(task); Sometime, processing might take too long (timeout) so I need to force the thread to skip to the next task. 1) How can I accomplish this w

  • How to delete existing templates -- because they override DW files

    I can't figure out how to crreate a new BC site and delete all the existing template files. Some I can. Others override the Dreamweaver files that I try to upload.

  • How to add cursors on polar plot

    I want to add cursors on polar plot just like the XY graph has. I am new to LabVIEW and want to be able to move those cursors by mouse movements and get the respective Angle and Magnetude values. Since the polar plot is a picture I am unable to do th

  • How do I move or archive large numbers of old Sent mail messages?

    I've created folders for past years Sent mail and tried moving my messages out of my Sent folder (for several accounts). They seem to move, but then I get a very basic error (with no details..): "34 messages could not be moved to the mailbox "2009 Se