Events in jsp

hi all,
I'm new to JSP. Please help me to solve the below problem
i have one combo box and 2 textfields in my project..if i select some value in the first combo box ,that value pass into the JSP database coding and then related value of first combo box is populate in to the 2 textfields from SQL server (data base) in JSP......
should i use itemstatechanged event like java
if yes how
Plz help me ............soon.........
thanks in advance

You can use AJAX for doing this. Or you can submit the page onchange event of the combo and get the required values from the DB and set the values in the text field.
Please check the onchange attribute of the select tag.

Similar Messages

  • Handling mouse events in JSP

    Hi ,
    I have to handle mouse events in JSP,means i have to handle the event
    of the user i.e, if he press the lest click we have to handle that
    event where he pressed it with JSP. Iam finding examples in Applets ,
    nut i have to do it in JSP.Can any body help me please? it's very
    urgent.
    Thanks in advance
    BhargavKumar.B

    JSP cannot catch mouse events. You need a clientside language for that, such as Javascript. So catch the mouse click event in Javascript, get the desired information from it and send it as request parameters to the server, so that the serverside logic can intercept on it. You can use AJAX for that, if you want to do it asynchronously.

  • Monitor Swing events in JSP

    How can I monitor a Swing object's events in a jsp page. Namely, my jsp has an <object> tag which defines a cache_archive param for a jar file. This jar file has a class that creates Swing jbuttons, jpanel and jprogressbar. How can my jsp keep track of these jbuttons and their events?
    Thank you,
    Igor
    Message was edited by:
    eazyigz

    1) When the JSP runs, it simply generates HTML, at which point the JSP page's job is done.
    2) The HTML gets read by the browser and displayed.
    3) The browser sees the object/embed tag and loads the jar file and then runs the applet.
    At this point, the applet can certainly connect back to the server. Depending on what you need to do, it may differ. Generally, you will fall into 1 of 2 categories:
    1) You just need to move to a new page: In this case, you just call applet.getAppletContext().showDocument() with a URL. That can target a frame or a window, or just replace the contents of the current page (closing the applet). The URL you use can have parameters attached in the standard HTTP GET URL format.
    2) You need the applet to load some data: In this case, you use URLConnection to send a request to the server. This can be GET or POST. There's plenty of examples around the forums for either. This will not close the applet, the browser won't see the response, you have to handle everything within the applet itself.
    Message was edited by:
    bsampieri

  • Post a custom event with jsp portlet

    I have a portal page which contains a jsp portlet and a couple of other portlets.
    The jsp has several links and when the links are clicked and the page is redrawn on the portal, I want the jsp portlet to fire events to which the other portlets in the page can react to.
    To achieve this, I have attached a backing file to a jsp portlet and have a custom event being fired (from the handlePostBack method) when certain conditions are met. The problem is that the handlePostBack method is not called in the jsp portlet lifecycle (only init(), preRender() and destroy() are called). I realize it may be because the urls dont have the _nfpb parameter set. I did try adding that to the link url - but no luck.
    Will someone point me as to what is wrong with the setup described above.
    ram.

    Kevin,
    How would I use postbackURL tag on a url which already has the "?" appended - for example if my url is "/somedomain/something.portal?cmd=4", the postbackUrl tag converts it as "/somedomain/something.portal?cmd=4?_nfpb=true&_page_Label=..."
    Shouldnt it have the intelligence to sense that the url already contains "?" and hence it should use '&' to append further parameters.
    Also if I strip out my "?cmd=4" from the url and just provide the bare url so that it is now free to add the "?_nfpb=true" to the url, how do I instruct the tag to later append my cmd=4 parameter to the query string? I see an attribute called "parameters" but how do I provide a name value pair? Or should I simply provide the string "cmd=4" as attribute value?
    As of now I am contructing the url object and the jsp looks a bit unwieldy though it works :)
    Thanks,
    Ram.

  • Keyboard events in jsp  that working in Mozila fire fox Browser

    hai cutes
    have a peace day.
    i did some keyboard event project using JSP
    that can be nicely working in Internet Explorer
    But i want to working in Mozila fire fox Browser and other browser also...
    thank u

    You didn't do it using JSP, keyboard events are client side and will need to be done with javascript. AFAIK the only thing about events that is not cross-browser is the way the event object is handled. This can easily be fixed with a minor workaround.
    <script>
    function handleEvent(e)
    // this is the trick
    if(e == null){
      e = window.event;
    if(e.keyCode == 13) { // enter
    </script>
    <input type="button" onKeyDown="handleEvent(event)">That should make it work in multiple browsers. Well it least it works for me :)

  • Posting event from JSP/Servlet to Agent?

    Hi everyone!
    I would like to know if it is possible that a jsp file or servlet (runs behind the JWS) can post an event and be captured in the Agent (runs behind the IFS Server).
    Any insight regarding this matter will be greatly appreciated.
    Vince

    I don't think that's possible and even if it is there's an easier way. Normally you just create an instance of the session bean in a servlet and pass it the information. The session bean then calls the entity bean which updates the database. You don't have to forward the request - just pass the data to the bean.

  • Using onLoad event in jsp?

    Hi,
    i have created a link in my controller class dynamically and i want this link to load into my iView without clicking on Link control.
    That is , when the user clicks on the page having my iView he should see the contents of the link. For eg . an HTML report.
    How shall i accomplish this?
    i used onLoad event in the <body> but it  is not working.
    Thanks
    Saurabh

    Hi Saurabh,
    Try this:
    <head>
    <script language="javascript">
    function openwin(){
       var newWin = window.open("the real url", ....); // params and stuff
    window.onLoad = openwin();
    </script>
    </head>
    <body onLoad="openwin()">
    </body>
    </html>
    Regards,
    Pooja.
    Message was edited by: Pooja S

  • Code Event in JSP

    Hola, estoy preocupado porque no veo ningun mensaje en espa�ol, en todo caso si alguien puede leer esto y ayudarme le agradecere mucho.
    Estoy utilizando JDeveloper10g y he creado una Web Application, tengo una pagina JSP a la cual le he agregado un boton submit con un evento on click, de esta forma:
    <input type="SUBMIT" value="Adjuntar" onclick="AdjuntarDocumento"/>
    pero no encuentro donde introducir el codigo del evento AdjuntarDocumento.
    De antemano gracias por su valiosa ayuda

    Espero que pueda ayudarte
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>adjuntar documento</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function AdjuntarDocumento()
         alert('adjutar documento');
    //-->
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM METHOD="POST" ACTION="">
    <INPUT TYPE="SUBMIT" VALUE="Adjuntar" onclick="AdjuntarDocumento()"/>
    </FORM>
    </BODY>
    </HTML>(many thanks to Linda for the Spanish ;-) )
    -Jan

  • Jsp inputfield - Event Handling examples

    Hi,
    Can someone please tell me how to handle an event for jsp inputField
    The same way how we do it for button ... I want to know some   event based attributes for inputfield
    Thanks,
    Sandeep

    Hi,
      Can u please close these threads appropriately. I think my answer gave u the solution. Please mark the answer as 'Problem Solved'.
    JspDynPage - JspDynPage Communication ???
    Program Flow using response.write(" "); ???
    For this question, there are no standard events for input field like button or any other control. But u can try with onFocus or onBlur etc. I will try to get u some example.
    Regards,
    Harini S

  • Need help for Visual Web application onkeydown event

    hi,
    I have create a visual web application. I have include a text field and a button in my webpage. When user press a key in the text field, i would like to change the button to enable. I try to use the keydown event to call the function in java package. However, it display error once I put the function name in my onkeydown event in jsp page. The code is shown as below.
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page binding="#{RegisterProgress.page1}" id="page1">
    <webuijsf:html binding="#{RegisterProgress.html1}" id="html1">
    <webuijsf:head binding="#{RegisterProgress.head1}" id="head1">
    <webuijsf:link binding="#{RegisterProgress.link1}" id="link1" url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body binding="#{RegisterProgress.body1}" focus="form1:txtPassword1" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{RegisterProgress.form1}" id="form1">
    <webuijsf:button actionExpression="#{RegisterProgress.button1_action}" binding="#{RegisterProgress.button1}" id="button1"
    style="left: 71px; top: 96px; position: absolute; width: 72px" text="Next"/>
    <webuijsf:textField binding="#{RegisterProgress.txtPassword1}" id="txtPassword1" label="Password :" onKeyDown="="#{RegisterProgress.keydown}" style="left: 24px; top: 48px; position: absolute"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    Is there anybody may teach me the way to invoke the keydown event?

    Sorry,
    onKeyDown="="#{RegisterProgress.keydown}"
    should be onKeyDown=#{RegisterProgress.keydown}"
    But, that onkeyDown still can't work.
    Below is my java package:
    package usm_biologin;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.webui.jsf.component.Body;
    import com.sun.webui.jsf.component.Button;
    import com.sun.webui.jsf.component.Form;
    import com.sun.webui.jsf.component.Head;
    import com.sun.webui.jsf.component.Html;
    import com.sun.webui.jsf.component.Label;
    import com.sun.webui.jsf.component.Link;
    import com.sun.webui.jsf.component.Page;
    import com.sun.webui.jsf.component.StaticText;
    import com.sun.webui.jsf.component.TextArea;
    import com.sun.webui.jsf.component.TextField;
    import javax.faces.FacesException;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    public RegisterProgress() {
    public void init() {
    super.init();
    txtUsername1.setText(getRequestBean1().getUsername());
    txtPassword1.setText("");
    try {
    _init();
    } catch (Exception e) {
    log("RegisterProgress Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    public void preprocess() {
    public void prerender() {
    public void destroy() {
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1)getBean("RequestBean1");
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1)getBean("SessionBean1");
    public String button1_action() {
    return null;
    public void keydown() {
    Any help will be appreciated.

  • JSP compilation errors in weblogic 6.1

              I'm getting these JSP compilation errors in weblogic 6.1 on Solaris. Please help.
              Full compiler error(s):
              error: Invalid class file format:
              ^
              /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              eb/_jsp/_event/__eventForm.java:34: Class
              com.ford.redherring.model.PropertiesAttributesModel not found in import.
              import com.ford.redherring.model.PropertiesAttributesModel; <file://[>
              /web/jsp/event/eventForm.jsp; Line: 64]
              ^
              /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              eb/_jsp/_event/__eventForm.java:38: Class com.ford.redherring.util.DialogHeader
              not found in import.
              import com.ford.redherring.util.DialogHeader; <file://[> /web/jsp/event/eventForm.jsp;
              Line: 68]
              ^
              /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              eb/_jsp/_event/__eventForm.java:39: Class com.ford.redherring.util.DialogFooter
              not found in import.
              import com.ford.redherring.util.DialogFooter; <file://[> /web/jsp/event/eventForm.jsp;
              Line: 69]
              ^
              /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              eb/_jsp/_event/__eventForm.java:40: Class com.ford.redherring.model.DDContainer
              not found in import.
              import com.ford.redherring.model.DDContainer; <file://[> /web/jsp/event/eventForm.jsp;
              Line: 70]
              ^
              /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              eb/_jsp/_event/__eventForm.java:41: Class
              com.ford.redherring.model.DDValidationModel not found in import.
              import com.ford.redherring.model.DDValidationModel; <file://[>
              /web/jsp/event/eventForm.jsp; Line: 71]
              

    This appears to be a CLASSPATH problem (you are missing references to
              'com.ford.redherring.model.*' and 'com.ford.redherring.util.*'). The
              CLASSPATH may be set in the server startup script. Hope this helps.
              Wade.
              "Katri Alur" <[email protected]> wrote in message news:<[email protected]>...
              > I'm getting these JSP compilation errors in weblogic 6.1 on Solaris. Please help.
              >
              > ----------------------------------------------------------------------------
              > ----
              > Full compiler error(s):
              > error: Invalid class file format:
              >
              >
              > ^
              > /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              > tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              > eb/_jsp/_event/__eventForm.java:34: Class
              > com.ford.redherring.model.PropertiesAttributesModel not found in import.
              > import com.ford.redherring.model.PropertiesAttributesModel; <file://[>
              > /web/jsp/event/eventForm.jsp; Line: 64]
              > ^
              > /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              > tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              > eb/_jsp/_event/__eventForm.java:38: Class com.ford.redherring.util.DialogHeader
              > not found in import.
              > import com.ford.redherring.util.DialogHeader; <file://[> /web/jsp/event/eventForm.jsp;
              > Line: 68]
              > ^
              > /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              > tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              > eb/_jsp/_event/__eventForm.java:39: Class com.ford.redherring.util.DialogFooter
              > not found in import.
              > import com.ford.redherring.util.DialogFooter; <file://[> /web/jsp/event/eventForm.jsp;
              > Line: 69]
              > ^
              > /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              > tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              > eb/_jsp/_event/__eventForm.java:40: Class com.ford.redherring.model.DDContainer
              > not found in import.
              > import com.ford.redherring.model.DDContainer; <file://[> /web/jsp/event/eventForm.jsp;
              > Line: 70]
              > ^
              > /opt/projects/redherring/beahome/wlserver6.1/config/mydomain/applica
              > tions/.wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_redherring/jsp_servlet/_w
              > eb/_jsp/_event/__eventForm.java:41: Class
              > com.ford.redherring.model.DDValidationModel not found in import.
              > import com.ford.redherring.model.DDValidationModel; <file://[>
              > /web/jsp/event/eventForm.jsp; Line: 71]
              

  • Portlet event link to pass parameter between portlets

    Ok list, I followed the documentation Adding Parameters and Events to Portlets
    PDK Release 2 (9.0.2 and later) and tried to make a portlet that pass parameter to another portlet using event link. I created the supposed parameter in the page and made the correct association to the receiving parameter portlet. The case is: The parameter is not caught in the receiving parameter page.
    This is my event link jsp code:
    <%
    String sImgPath = PropertiesReader.getProperty(PropertiesReader.KEY_IMAGES_PATH);
    PortletRenderRequest portletRequest = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    // The portlet definition in provider.xml includes the following:
    // - Event "submit" with event parameters "funcionalidade"
    String eventSubmit = EventUtils.eventName("submit");
    String eventParamFuncionalidade = EventUtils.eventParameter("funcionalidade");
    // Build up the list of parameters for the "submit" event
    NameValuePair[] eventSubmitParams = new NameValuePair[2];
    // Give the 'funcionalidade' event parameter the constant value 'chat'
    eventSubmitParams[0] = new NameValuePair(eventParamFuncionalidade, "chat");
    // The event name must be passed as a parameter on the URL
    eventSubmitParams[1] = new NameValuePair(eventSubmit, "");
    %>
    <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
    <TR><TD><a href="<%=PortletRendererUtil.constructLink(portletRequest,   portletRequest.getRenderContext().getEventURL(), eventSubmitParams, true, true)%>"><IMG SRC="<%= sImgPath + "menuButChat.gif" %>" BORDER="0"></a></TD><TR>
    </TRABLE>
    And this is my receiving parameter jsp code:
    <%
    String sFuncionalidade = "";
    PortletRenderRequest portletRequest = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    // Get the portlet definition - needed to get the public portlet parameters
    PortletDefinition portlet = portletRequest.getPortletDefinition();
    // Get the public portlet parameters
    ParameterDefinition[] parameters = portlet.getInputParameters();
    // Display all values for each of the public portlet parameters
    for (int currParameter = 0; currParameter < parameters.length; currParameter++)
    String name = parameters[currParameter].getName();
    out.println(" <p>name = " + name + "</p> ");
    // Get the parameter values
    String[] values = portletRequest.getParameterValues(name);
    // Display the parameter's values.
    if ( values == null )
    // Null array indicates no values for this parameter.
    out.println(" <p>values i null</p> ");
    else
    out.println(" values nco i null ");
    // Loop through each of the values and display non-null values on a separate line.
    for ( int j = 0; (values != null) && (j < values.length); j++ )
    sFuncionalidade = values[j];
    out.println(" <p>" + sFuncionalidade + "</p> ");
    %>
    And this is my portlet definition in provider.xml:
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
    <id>3</id>
    <name>MenuColaboracao</name>
    <title>Menu de Colaboragco</title>
    <shortTitle>Menu de Colaboragco</shortTitle>
    <description>Portlet de menu para funcionalidade de Comuicagco e Colaboragco.</description>
    <timeout>10000</timeout>
    <timeoutMessage>Portlet timed out</timeoutMessage>
    <showEdit>false</showEdit>
    <showEditDefault>false</showEditDefault>
    <showPreview>false</showPreview>
    <showDetails>false</showDetails>
    <hasHelp>false</hasHelp>
    <hasAbout>false</hasAbout>
    <acceptContentType>text/html</acceptContentType>
    <renderer class="oracle.portal.provider.v2.render.RenderManager">
    <renderContainer>false</renderContainer>
    <contentType>text/html</contentType>
    <showPage>/menuColaboracao.jsp</showPage>
    <pageParameterName>next_page</pageParameterName>
    </renderer>
         <event class="oracle.portal.provider.v2.DefaultEventDefinition">
         <name>submit</name>
    <description>Use this event to submit the form data to a page</description>
    <parameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
    <name>funcionalidade</name>
    <displayName>funcionalidade</displayName>
    <description>Parbmetro que indica a funcionalidade a ser apresentada.</description>
    </parameter>
    </event>
    </portlet>
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
    <id>4</id>
    <name>HomeController</name>
    <title>Home Controller</title>
    <shortTitle>Home Controller</shortTitle>
    <description>Portlet que controla a exibigco do jsp correspondente a opgco de menu selecionada.</description>
    <timeout>10000</timeout>
    <timeoutMessage>Portlet timed out</timeoutMessage>
    <showEdit>false</showEdit>
    <showEditDefault>false</showEditDefault>
    <showPreview>false</showPreview>
    <showDetails>false</showDetails>
    <hasHelp>false</hasHelp>
    <hasAbout>false</hasAbout>
    <acceptContentType>text/html</acceptContentType>
    <renderer class="oracle.portal.provider.v2.render.RenderManager">
    <renderContainer>false</renderContainer>
    <contentType>text/html</contentType>
    <showPage>/homeController.jsp</showPage>
    <pageParameterName>next_page</pageParameterName>
    </renderer>
         <inputParameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
         <name>funcionalidade</name>
    <displayName>funcionalidade</displayName>
    <description>Parbmetro que indica a funcionalidade a ser apresentada.</description>
    </inputParameter>
    </portlet>
    Where do I miss ???
    Any help will be appreciated.
    Regards,
    Leandro.

    Leandro,
    Few things which you might want to cross check to see if we are
    on the right track :
    1. Page containing Parameter receiving portlet contains a
    paga parameter mapped on to its public parameter.
    As per your example, parameter receiving page should have a page
    parameter with name - "funcionalidade" - and portlet's corresponding
    parmeter should be mapped to this page parameter. This can be
    done through "Parameters" tab in the Page Properties screen.
    2. Page containing Parameter passing portlet contains proper event
    mapping.
    As per your example, we have an event called "submit". We should
    be able to see "submit" event under "MenuColaboracao" portlet.
    When this event is raised, select which page should receive the event
    data. As soon as a page is selected, this page's public parameters
    are displayed below. Beside that we must be able to see a choice box
    which displays four choices one of which would be "Event Output".
    Map this output to the event parameter.
    Hope it helps.
    -AMJAD.

  • Events on JSpage

    i want to execute some code on happening of an event on JSP page can any one help me
    for example when i lose focus from a text box i want to display the contents of text box to another text box
    Please Help

    actually that example i out was simple and can be handled with javascript
    the acual work is when i enter an id in text field i want to get all details of that id to be displayed in that displaying is not a porblem but writting a function java funcion in javascript makes no sence it gets excuted at loading time itseft help me out is there any other way to do that

  • Possible to run javaBean in onClick event?

    Hello everybody,
    Does anybody know if it is possible to run javaBean from onClick event in JSP,
    for example:
    .... onClick="<%bean.doSomething()%>" .......
    It does not work for me, perhaps it is a syntax error??
    Best regards,
    danny

    Hello everybody,
    Does anybody know if it is possible to run javaBean
    from onClick event in JSP,
    for example:
    .... onClick="<%bean.doSomething()%>" .......
    It does not work for me, perhaps it is a syntax
    error??
    Best regards,
    dannywell it wont work, coz onClick event is a client side event which will execute in the browser, to run an server event u have to load a page in a new window so that when the page load it would execute the doSomething() methodof the bean.

  • Inbox, Calander, Schedule and Events

    Can anyone give a breif outline on How to use Calendar, Schedule and Events in Solaris Environment with Oracle 9iAS and how to develop application for calendar, schedule and events using JSP?

    I think much more detail is required - what calendar are you trying to use?

Maybe you are looking for