Hide Ajax enabled portlet with jsp form  loading

Hi All,
I seriously struck with this problem and any help is appreciated.
Functionality:-
I have 2 portlet in a page portletA(non ajax) and PortalB(ajax enabled and it will just handle the portletA events). For checkbox event on portletA i am submitting PortletB JSP Form through PortletA JavaScript.
PortletB jsp Form consists of only hidden variables, which will be set by PortletA JavaScript. All this is working fine.
Problem:-
My problem is I have to hide PortletB.For this i am using BackingFile preRender method. If I hide portletB then JSP Form is not loading and from PortletA iam unable to get the Form object of portletB to submit.
Even setVisible is not working.
Here is my PortletB jsp Form
<netui:form tagId="ajaxEnabledForm" action="deleteRSAandCMFProfile">
<netui:hidden dataSource="actionForm.userName" tagId="userName"></netui:hidden>
</netui:form>
How to make PortletB invisible with jsp form loading?
Thanks in advance.

hi, i don't have the exact solution to your problem, but can suggest you work around.
in portlet b jsp, add <div> tag at the top, and use its style properties to hidden/visible as per your need. from the backing file you can set a request attribute which determines the hiding and showing in the div tag.
you may not be able to control the visibility of title bar. for this, there are two options.
1. you can try to use portlet backing context tile bar and hide title bar from backing file.
2. if this does not work, then define id attribute to div tag in title bar skeleton jsp, and access that div by using id from the portlet jsp and then hide that div tag.
thanks
sampath

Similar Messages

  • Tech Preview for AJAX-enabled JSF with BEA Workshop 10.1

    BEA is announcing a tech preview, ending in September 2007, for BEA Workshop Studio 10.1 and BEA Workshop for WebLogic 10.1. This technology preview integrates ICEFaces's Ajax-enabled JSF technology into Workshop. ICEfaces is a library of Ajax-enabled JSF tags, distributed under a number of open source licenses, including but not limited to Apache 2.0 and the Mozilla Public License. For more information and further announcements, please visit Gary Horen's Blog.
    <B>Get it now </B>
    Existing BEA Workshop 10.1 users can access this technical preview via an Eclipse update, accessible at the following URI:
    dev2dev.bea.com/eclipse/icefaces-tooling/
    New Workshop 10.1 users should download the product first, and then apply the Eclipse update.
    BEA Workshop for Studio 10.1
    BEA Workshop for WebLogic 10.1
    <B>Tutorial</B>
    Visit BEA's online developer community for an excellent tutorial at http://dev2dev.bea.com/pub/a/2007/06/icefaces-workshop.html
    <B>Key Features</B><UL>
    <LI>WYSIWYG page construction for ICEfaces
    <LI>Full BEA AppXRay? support offers unique capabilities in code completion, code navigation, dependency visualization, consistency checking with generated classes, configuration files and annotations, pre-build error checking, and validation that understands ICEFaces JSF tags.
    <LI> Supports SUN RI and Apache MyFaces JSF implementations
    <LI> Workshop Smart Editor assistance with tag attributes, and smart navigation between markup, JSF configuration files, and Java types
    </UL>
    <B>Tech Preview feedback</B>
    Please post questions and feedback to the Workshop Tech Preview forum. We're anxious to hear from you!

    BEA is announcing a tech preview, ending in September 2007, for BEA Workshop Studio 10.1 and BEA Workshop for WebLogic 10.1. This technology preview integrates ICEFaces's Ajax-enabled JSF technology into Workshop. ICEfaces is a library of Ajax-enabled JSF tags, distributed under a number of open source licenses, including but not limited to Apache 2.0 and the Mozilla Public License. For more information and further announcements, please visit Gary Horen's Blog.
    <B>Get it now </B>
    Existing BEA Workshop 10.1 users can access this technical preview via an Eclipse update, accessible at the following URI:
    dev2dev.bea.com/eclipse/icefaces-tooling/
    New Workshop 10.1 users should download the product first, and then apply the Eclipse update.
    BEA Workshop for Studio 10.1
    BEA Workshop for WebLogic 10.1
    <B>Tutorial</B>
    Visit BEA's online developer community for an excellent tutorial at http://dev2dev.bea.com/pub/a/2007/06/icefaces-workshop.html
    <B>Key Features</B><UL>
    <LI>WYSIWYG page construction for ICEfaces
    <LI>Full BEA AppXRay? support offers unique capabilities in code completion, code navigation, dependency visualization, consistency checking with generated classes, configuration files and annotations, pre-build error checking, and validation that understands ICEFaces JSF tags.
    <LI> Supports SUN RI and Apache MyFaces JSF implementations
    <LI> Workshop Smart Editor assistance with tag attributes, and smart navigation between markup, JSF configuration files, and Java types
    </UL>
    <B>Tech Preview feedback</B>
    Please post questions and feedback to the Workshop Tech Preview forum. We're anxious to hear from you!

  • Invoke-WebRequest with JSP forms

    Hi everyone,
    I am a newbie with PowerShell struggling to write a script that posts information to a JSP Web application.
    My script should be divided in two parts : 
    ########### The first should authenticate to the admin page (the form bellow)
    <form name="loginoath" id="loginoath" action="../servlet/UserRequestServlet" method="post" autocomplete="off">
    <input type="hidden" name="action"
        value="auth">
    <input type="hidden" name="authtype" id="authtype"
        value="oath">
    <input type="hidden" name="authformat"
        value="pwd">
    <input type="hidden" name="opensess"
        value="true">
    <input type="hidden" name="version"
        value="3.0">
    <input type="hidden" name="forwardtype"
        value="relativeurl">
    <input type="hidden" name="successurl" value="/adminportal/index.jsp">
    <input type="hidden" name="errorurl" value="/adminportal/login_oath.jsp">
        <tr valign="middle" class="display_row" id='authoption'>
            <td class="form_label">
                <span class="help_spot" onMouseOver="loadHelp('Select\x20\x3Cb\x3EPassword\x3C\x2Fb\x3E\x20to\x20log\x20in\x20with\x20your\x20user\x20ID\x20and\x20password\x20only.\x3Cbr\x3E\x3Cbr\x3ESelect\x20\x3Cb\x3EOTP\x3C\x2Fb\x3E\x20to\x20log\x20in\x20with\x20your\x20user\x20ID,\x20password,\x20and\x20a\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20generated\x20from\x20your\x20device.')">
                    Authenticate by:
                </span>
            </td>
            <td class="form_field_cell">
                <input type="radio" name="authByOTP" id="authByOTP" value="yes" checked onclick="onChangeAuth()"> OTP&nbsp;
                <input type="radio" name="authByOTP" id="authByOTP" value="no"  onclick="onChangeAuth()" > Password&nbsp;
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Enter\x20the\x20user\x20ID\x20that\x20you\x20want\x20to\x20log\x20in\x20with.\x3Cbr\x3E\x3Cbr\x3EThe\x20user\x20ID\x20is\x20a\x20unique\x20alphanumeric\x20string\x20that\x20identifies\x20a\x20user.\x20It\x20is\x20assigned\x20when\x20the\x20user\x20record\x20is\x20created.')">
            User ID:</span>
            </td>
            <td>
                <input type="text" name="j_username" id="j_username" size="20" maxlength="50" tabindex="1" class="form_field">
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Enter\x20the\x20password\x20for\x20your\x20login\x20user\x20ID.\x3Cbr\x3E\x3Cbr\x3EThe\x20password\x20is\x20a\x20private\x20character\x20string\x20that\x20verifies\x20the\x20user\x20ID.\x20After\x20login,\x20this\x20password\x20can\x20be\x20changed.')">
            Password:</span>
            </td>
            <td>
                <input type="password" name="j_pin" id="j_pin" size="20" maxlength="50" tabindex="2" class="form_field">
            </td>
        </tr>
        <tr valign="middle" id="otp_section">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Generate\x20a\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20with\x20the\x20device\x20you\x20are\x20using\x20for\x20login,\x20and\x20enter\x20the\x20value\x20in\x20the\x20field.\x20Connected\x20devices\x20generate\x20and\x20enter\x20the\x20OTP\x20value\x20automatically\x20when\x20you\x20click\x20\x3Cb\x3EGet\x20OTP\x3C\x2Fb\x3E.\x3Cbr\x3E\x3Cbr\x3EConsult\x20your\x20device\x20documentation\x20for\x20instructions\x20on\x20how\x20to\x20generate\x20an\x20OTP.')">
            OTP:</span>
            </td>
            <td>
                <input type="text" name="j_password" id="j_password" size="20" maxlength="50" tabindex="3" class="form_field">
                <a href="javascript:gemalto.otpplugin.getOTPsAndPANForCustomButton();" class="form_button" onMouseOver="loadHelp('Click\x20this\x20button\x20to\x20generate\x20and\x20enter\x20the\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20value\x20automatically\x20with\x20your\x20connected\x20device.\x3Cbr\x3E\x3Cbr\x3EBe\x20sure\x20that\x20your\x20device\x20is\x20plugged\x20in\x20and\x20connected\x20to\x20your\x20computer\x20before\x20trying\x20to\x20generate\x20the\x20OTP.')"/>Get
    OTP</a>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="form_separator"><img src="../img/spacer.gif"
                width="1" height="1"></div>
            </td>
        </tr>
        <tr valign="middle">
            <td colspan="2" align="center">
            <input type="submit" tabindex="4" id="login_button" name="submit" value="LOGIN" class="form_button" onMouseOver="loadHelp('When\x20you\x20have\x20entered\x20information\x20in\x20all\x20fields,\x20click\x20this\x20button\x20to\x20authenticate\x20your\x20user\x20ID\x20and\x20log\x20in\x20to\x20the\x20Customer\x20Care\x20Portal.')"
    onClick="return checkFields();">
            </td>
        </tr>
      </form>
    ########### The second should fill the form with new information and validate them (the form bellow)
    <form name="userform" action="user_migrate.jsp" method="POST" autocomplete="off">
        <tr>
            <td colspan="2" class="form_text" align="left">
                Fields marked with an asterisk <font color='red'><big>*</big></font> are required.
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('User\x20ID\x20field.\x20The\x20User\x20ID\x20is\x20a\x20unique\x20alphanumeric\x20string\x20chosen\x20to\x20identify\x20a\x20user.')">
            User ID:</span>
            </td>
            <td>
                <input type="text" name="userid" value="" size="26" class="form_field">
            </td>
        </tr>
           <tr id="pwdguideline">
                <td class="form_label"> &nbsp;</td>
            <td class="form_text" align="left">
                A valid password is case-sensitive and must: <br>&nbsp;-&nbsp; consists of 6 characters or more<br>&nbsp;-&nbsp; include at least 1 alphabetic character<br>&nbsp;-&nbsp;
    include at least 1 numeric character<br>&nbsp;-&nbsp; not include white space<br>
            </td>
        </tr>
            <input type="hidden" name="password" value=""/>
        <tr>
            <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('First\x20security\x20answer\x20field.\x20The\x20security\x20answers\x20are\x20answers\x20to\x20personal\x20questions\x20used\x20to\x20validate\x20a\x20user\x5C\x27s\x20identity\x20in\x20case\x20the\x20user\x20loses\x20his\x20or\x20her\x20password.')">
            What is your mother's maiden name?:</span>
            </td>
             <td>
                <input type="text" name="answer1" value="" size="26" class="form_field">
            </td>        
        </tr>
        <tr>
        <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('Second\x20security\x20answer\x20field.\x20The\x20security\x20answers\x20are\x20answers\x20to\x20personal\x20questions\x20used\x20to\x20validate\x20a\x20user\x5C\x27s\x20identity\x20in\x20case\x20the\x20user\x20loses\x20his\x20or\x20her\x20password.')">
            What is your date of birth?:<br>(yyyy-mm-dd)</span>
            </td>
             <td>
                <input type="text" name="answer2" value="" size="26" class="form_field">
            </td>  
        </tr>   
        <tr>
        <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('Role\x20field.\x20Refers\x20to\x20the\x20role\x20associated\x20with\x20the\x20user.\x20A\x20role\x20is\x20identified\x20by\x20its\x20unique\x20role\x20name\x20and\x20defines\x20what\x20functions\x20are\x20available\x20to\x20its\x20associated\x20users.')">
            Role:</span>
            </td>
              <td class="form_text">
                <select name="rolename" class="form_select" single>
                   <option value="Admin" >Admin</option>
                   <option value="Agent" >Agent</option>
                   <option value="Default" selected>Default</option>
                   <option value="Support" >Support</option>
                 </select>
                </td>
             </tr>
        <tr>
            <td class="form_label">
            <span class="help_spot"
                  onMouseOver="loadHelp('Sends\x20the\x20user\x20an\x20email\x20with\x20a\x20link\x20to\x20download\x20the\x20selected\x20application.\x20Email\x20must\x20be\x20filled\x20and\x20a\x20separate\x20mail\x20will\x20be\x20sent\x20per\x20application\x20selected.')">
            Initiate Token registration:</span>
            </td>
            <td class="form_field_cell">
                &nbsp;&nbsp;
                <input type="checkbox" name="initMobileapptokenReg" value="true" class="form_field_cell" >
                IDProve 300 Mobile
                &nbsp;&nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="form_separator"><img src="../img/spacer.gif"
                width="1" height="1"></div>
            </td>
        </tr>
        <tr valign="middle">
            <td colspan="2" align="center">
            <input type="submit" name="submituserform" value="MIGRATE" class="form_button" onMouseOver="loadHelp('Create\x20a\x20new\x20record.')" onClick="return validateForm()"
    >
            <input type="Reset" name="resetuserform" value="START OVER" class="form_button" onMouseOver="loadHelp('Reset\x20the\x20form.')">   
            </td>
        </tr>
        <input type="hidden" name="posting" value="true">
    </form>
    ############ Here is my Powershell Script
    [System.Net.ServicePointManager]::CheckCertificateRevocationList = $false;
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true; };
    Add-Type @"
      using System.Net;
      using System.Security.Cryptography.X509Certificates;
      public class TrustAllCertsPolicy : ICertificatePolicy {
         public bool CheckValidationResult(
          ServicePoint srvPoint, X509Certificate certificate,
          WebRequest request, int certificateProblem) {
          return true;
    [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
    [System.Net.ServicePointManager]::CheckCertificateRevocationList = $false;
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true; };
    # Authentication
    $url1 = 'https://localhost/login.jsp'
    $param1 = @{ authByOTP='no'; j_username='test'; j_pin='test' }
    Invoke-WebRequest -Uri $url1 -SessionVariable CurrentSession -Method Post -Body $param1 -ContentType "text/xml"
    # Registration
    $AccountName ="test2"
    $Reponse1 ="replyOne"
    $Reponse2 = "replyTwo"
    $Role ="Default"
    $IDProve ="False"
    $Post = "MIGRATE"
    $url2 = 'https://localhost/registration.jsp'
    $parametre2 = @{ userid=$AccountName; answer1=$Reponse1; answer2=$Reponse2; rolename=$Role;               'initMobileapptokenReg'=$IDProve; submituserform=$Post; }
    Invoke-WebRequest -Uri $url2 -SessionVariable CurrentSession -Method Post -Body $parametre2 -ContentType "text/xml"
    When I run it, I get this status
    StatusCode        : 200
    StatusDescription : OK
    Content           :
    But nothing happens when I check the result.
    I will be grateful if someone can help. Thanks in advance.
    Regards,
    Louban.

    Hi Louban,
    To run the cmdlet "Invoke-WebRequest" with .jsp file, the script is for your reference:
    # variables for the script
    $YellowLevel = 14
    $RedLevel = 7
    $SleepHours = 1
    # change window title
    $Host.UI.RawUI.WindowTitle = "QAS DB Expiry Checker"
    # loop indefinitely
    while($true){
    #get web page
    $Page = (Invoke-WebRequest "http://qaswebserver.rcmtech.co.uk:8080/proweb/test.jsp").Content # look for text on web page using regular expression
    if($Page -match "[0-9]+ days"){
    # get matching text string from full web page text
    $FullText = (Select-String -InputObject $Page -Pattern "[0-9]+ days").Matches.Value
    Write-Host (get-date),"QAS remaining: $FullText - " -NoNewline
    # get just the number of days
    $DaysString = (Select-String -InputObject $FullText -Pattern "[0-9]+").Matches.Value
    # convert number of days to integer to allow numeric matching operations, e.g. "greater than"
    $DaysInteger = [convert]::ToInt16($DaysString)
    # interrogate the number of days and set status based on what its value is
    switch($DaysInteger){
    {$_ -gt $YellowLevel} {
    Write-Host "Green" -ForegroundColor Green
    {($_ -le $YellowLevel) -and ($_ -gt $RedLevel)} {
    Write-Host "Yellow" -ForegroundColor Yellow
    {$_ -le $RedLevel} {
    Write-Host "Red" -ForegroundColor Red
    } else {
    # page did not contain expected text
    Write-Host "Error with page" -ForegroundColor Yellow
    # wait for specified time
    Start-Sleep -Seconds ($SleepHours * 60 * 60)
    Refer to:
    PowerShell: QuickAddress Pro data expiry checker
    If there is anything else regarding this matter, please feel free to post back.
    Best Regards,
    Anna Wang

  • Prolem with jsp forms

    I cannot changed the size of the text area.How do i change the size of the text area when i have created a few forms using the jsp wizard in j developer i need a answer soon

    Hi Reuben Wee,
    You can do this if you change attribute size in input tag in your form (e.g. <input type="text" size="11" maxlength="255">). In addition, you can insert an style in input tag for settings several attributes (e.g <input type="text" size="11" maxlength="255" style="width:90px;height:18px;font-size:12px">).
    Hope this help.
    Veso
    null

  • Cannot get EL with JSP 2.0 and Tomcat 5 to work.

    I cannot seem to get the EL to work with Tomcat 5 to work. When I use <c:out value="${expr}"/>, I simply get printed out the content of the double quotes as though it is a string. I don't know if EL has to be enabled with JSP 2.0 and I cannot find any documentation on enabling EL with JSP 2.0. Please help.

    Check out [url http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0] this thread , reply #6.
    It covers the basics issues that people encounter installing JSTL.
    I cannot find any documentation on enabling EL with JSP 2.0I guess you haven't looked hard enough.Try the JSP2.0 specification section 3.3.2: Deactivating EL Evaluation

  • An error occurred while trying to connect to a Web service, when InfoPath web enabled form loads.

    Hi Everyone,
    I am getting an error message: An error occurred while trying to connect to a web service, when my InfoPath form tries to load.  The last few days, it only spits this error message in the morning and around 12pm-1pm it resolves itself and the form loads
    fine the rest of the day, oddly enough. 
    A few things about my form:
    1). It is web enabled
    2). The form submits to a form library on the SP server
    3). I use the UserProfileService data connection in the form to auto-populate a few fields
    4). I use a udcx file with correct language stored in the root of the site collection in the data connection library
    5). The form has been working fine until a few days ago
    I noticed while in Central Administration, that the User Profile Service Synchronization is Stopped.  Not sure if this is causing some or all of the problem. If I need to start it I will need to contact my farm administrator to do this, since I do not
    have the service account information.
    Also, I looked thru the log files on the SharePoint server and found the following by searching for the Correlation ID shown when the error comes up, I won't put in everything just the important messages.
    Schema file was already loaded: BuiltInActiveXControls.xsd
    FormServer Partial Trust - Proxy operation invoked in the SHIM process.
    FormServer Partial Trust - Invoking proxy operation for Web service adapter failed with exception Operation is not valid due to the current state of the object. for Url=https://<SP URL>/_vti_bin/UserProfileService.asmx
    Data adapter failed during OnLoad: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator.
    The following query failed: GetUserProfileByName (User: , Form Name: Expense Report, IP: , Connection Target: <SP URL>/Data Connections/GetUserProfileByName.udcx, Request: , Form ID: urn:schemas-microsoft-com:office:infopath:Expense-Report:-myXSD-2014-04-11T21-06-32
    Type: DataAdapterException, Exception Message: The custom code in the form cannot be run. This functionality may be deactivated on the server.

    Hi B.,
    You are on the right track. I recommend that you first get the User Profile Synchronization Service started because that itself could be the root cause of the issue.
    If that doesn't fix it then focus your attention on the GetUserprofileByName data connection. I always use my secure store ID for this connection. I add the ID by editing the udcx file and then publishing it again.
    Hope this helps.
    Daniel Christian (MCTS)

  • How to use VPD in Java/Struts JSP portlet with SSO

    DB = 10.1.0 (Standard Edition)
    Portal = 9.0.4.1
    10gAS = 9.4.0.1 (EE)
    I am in the beginning stages of developing some portlets that will be Java/Struts JSP based. We use SSO and have implemented some VPD security in our DB by creating some views that use SYS_CONTEXT('USERENV','CURRENT_USERID').
    These Java portlets connect to the DB using a defined JDBC connection for the OC4J container they are deployed in. The problem I'm having is that the call to SYS_CONTEXT is returning the user of the JDBC connection and not the SSO user. So far I have been unable to find any documentation that will point me in the right direction to get this configured properly.
    Deployment and configuration are as follows. Deploy war file to custom container on app server. In the configuration of the OC4J contain the app used the containers default JDBC connection using the oracle.jdbc.pool.OracleDataSource class. Max and Min open connections are blank.
    In the portal configuration under Navigator - Providers tab we defined a new Registered Provider. In the Connections tab for the provider we Specify the URL Http://hpsrv02.simsol.com:7777/discovery-portlets/providers. Under "Specify how the user's identity will be set by the Portal..." the "The user has the same identity in the Web providers application as in the Single Sign-On identity" is selected. Under "User/Session Information" User is selected and Login Frequency is set to "Once per user session". Then we created a new portal page and created a new portlet with the new provider.
    Just an FYI I do have Discoverer working with VPD and any report portlet, dynamic page portlet and any other type of portlet I created all work correctly with VPD it is just the java/struts one that is not working.
    So does any one have any insight into what configuration steps I have missed?
    Any help is much appreciated,
    Ed Klinger

    Ed,
    Your java code must get the SSO username (it's just a HTTP header variable) :
    ie: code sample...
    Enumeration e = request.getHeaderNames();
    while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    String value = request.getHeader(name);
    out.println("<br> "+name + " = " + value);
    if (name.toUpperCase().trim().equals("OSSO-USER-DN")){
    dn_user=value;
    out.println("<br>******** USER DN = "+dn_user);
    Then, the SSO username can be used in the VPD policy.
    Note that there is a difference between the sso username and the database username . SSO username is not known by database (CURRENT_USERID will return a database username)
    Discoverer worked OK in your case with the SYS_CONTEXT (.. CURRENT_USERID) because authentication is made by database user, probably.

  • Working with multiple buttons on a jsp form....!

    Hi guys...!
    I have a jsp form, which has 3 buttons (submit, update, cancel), and I also have a java Servlet that processes that form.
    In my java Servlet, i have a method called submitData(). I also want to have a method called updateData(), which will be called when the user clicks on the update button.
    These are the codes in my jsp form:
    <SCRIPT language="JavaScript" type="text/javascript">
                   function submitFunction (i) {
                        if (i==1) {
                             document.theForm.action="/MyWebApp/FormServlet";
                        if (i==2) {
                             document.theForm.action="/MyBugWebApp/FormServlet";
                        if (i==3) {
                             document.theForm.action="/MyWebApp/DisplayForm.jsp";
                        document.theForm.submit()
              </SCRIPT>
    <form name="theForm">
    <input type="button" value="Submit" onClick="submitFunction(1)"></input>
    <input type="reset" value="Reset"></input>
    <input type="button" value="Cancel" onClick="submitFunction(3)"></input>
    <input type="button" value="Update" onClick="sumbitFunction(2)"></input>
    </form>
    As u can see, both the submit and the update button use the same java servlet file. But inside that java servlet file, I want to have methods that will be called inside my doPost() method when the user clicks on update or submit.
    I've tried to pass a value through the httpRequest but it doesn't work... This is what I did.
    In my javaScript, I added this value in the action attribute:
    document.theForm.action="/MyWebApp/FormServlet?id=submit";
    document.theForm.action="/MyWebApp/FormServlet?id=update";
    I did that because I wanted to be able to retrieve the value of the "id" in my servlet and check which type of action was sent and then call the appropriate function in my servlet.
    But, it doesn't work. It returns "null" as the value for "id"
    Does anyone know how to do this task??...or what am I doing wrong in my code???
    Thanks...

    So there are really two solutions to this:
    1) Use <input type="submit" instead of buttons. Give all three buttons the same name but different values. Then the button used to submit will be added to the list of parameters.
    2) Add a hidden input to the form, and when the form determines which button was pushed, set a different value for the hidden input field. For example of both, take a look at this code:
    <html>
      <head>
        <script type="text/javascript">
          function formSubmit(i)
            var toSubmit = document.getElementById("myForm")
            if (i == 1) toSubmit.doThis.value="one"
            if (i == 2) toSubmit.doThis.value="two"
            if (i == 3) toSubmit.doThis.value="three"
            toSubmit.submit()
        </script>
      </head>
      <body>
        <form id="myForm" action="" method="get">
          <input type="hidden" name="doThis" /><br />
          <input type="submit" name="whatToDo" onclick="formSubmit(1)" value="Submit" />
          <input type="submit" name="whatToDo" onclick="formSubmit(2)" value="Cancel" />
          <input type="submit" name="whatToDo" onclick="formSubmit(3)" value="Update" />
        </form>
      </body>
    </html>For method one, if the servlet did:
    String whatToDo = request.getParameter("whatToDo");
    if ("Submit".equals(whatToDo)) {
      //doSubmit();
    } else if ("Update".equals(whatToDo)) {
      //doUpdate();
    } else if ("Cancel".equals(whatToDo)) {
      //doCancel();
    } else if ("Reset".equals(whatToDo)) {
      /doReset();
    } else {
      //error situation
    }Or you could instead look at the hidden value:
    String doThis = request.getParameter("doThis");
    if ("1".equals(doThis)) { ... }I personally like the submit button with the same names and different values, since the second method breaks if the user has javascript disabled.

  • JSP Form with Formatted Confirmation Page

    I have a basic form, and I would like to have a confirmation page pop-up when the user clicks that they are done. The confirmation page needs to have considerable formatting on it, and include the data the user inputted on the form. It also needs to have a "Continue", "Go Back" and "Print" buttons. Continue will tell the form to proceed with submitting the form to the servlet, Go Back will put the user back on the form, Print will bring up another JSP with the form data in printable format with print/email options. Upon exit from the print page they will be back on the Confirmation Page.
    The code below will allow for an OK, and Cancel button in the standard Message box, but this won't work.
    I am assuming I need to create another jsp for the confirmation page. But i am stuck on two issues. How can i ...
    1) Get the data onto the confirmation page from the form?
    2) How can I pass back to the initial form the value of what the user selected (Continue or Go Back) so i know whether to proceed with submitting the form, or staying put.
    Thanks for any help! I am very new to jsp programming.
    <FORM
    ACTION="http://www.mcfedries.com/scripts/formtest.asp"
    METHOD="POST"
    NAME="Monikers"
    onSubmit="return validate(Monikers)">
    Here's the JavaScript for this function:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function validate(frm) {
    // Build the form data
    var formData
    formData = "First Name: " + frm.First.value + "\n"
    formData = formData + "Last Name: " + frm.Last.value + "\n"
    formData = formData + "Nickname: " + frm.Nick.value + "\n"
    formData = formData + "Stage Name: " + frm.Stage.value + "\n"
    // Show the data to the user
    return confirm("Here is the form data you entered:" + "\n\n"
    + formData + "\n"
    + "Do you want to submit this data?")
    //-->
    </SCRIPT>

    Does the problem persist if you upload All Files (and not just modified). Do you continue to receive the message even if you choose "After Sending: Stay on Current Page" option? If yes, a site URL would help in identifying the issue.
    Also try inserting a fresh form on a page/new Muse site and see if you're able to replicate the behaviour on different browsers.
    Thanks,
    Vinayak

  • Portlet with MS AJAX framework - how do I get it to work?

    Just curious if anyone knows/has a successful working portlet with MS AJAX toolkit controls? Any samples would be greatly appreciated!!!

    Using ALPortal version 6.1. I am trying to accomplish the same thing. Installed ALDotnetAppAccelerator1.1 which included
    - ALDotNetPortletToolkit
    - ALDotNetWSRPProducer
    - WSE 2.0 SP3
    Using the ModalPopUp AJAX control in a .NET Web app (to be displayed in a portlet), I got the control to appear properly however, when clicking on the control, a javascript error pops up in IE:
    "Could not complete the operation due to error 80020101"
    Any ideas?

  • Help!  Replace form portlet with report portlet

    I have a page with 2 column regions. The right region contains a form portlet based on a stored procedure. When the user submits the form data, I would like the stored procedure to replace the form portlet with the report portlet results.
    How can I do this?
    Thanks,
    Ed

    Hi,
    You can call the report in the form success. But this would replace the page with the report. The other way is to create a page with
    the report portlet and call this page in the success of the form.
    Thanks,
    Sharmila

  • Display a login popup at (browser-enable) form load.

    Hi,
    Help, please.
    I need to pull the employee’s information from a SAP Web Service but in order to do that I need to pass two parameters: UserID and Password.
    What I want to do?
    I want to display
    a login popup when the browser-enable form load. Something like this:
    How can I do that?
    I’m open to ideas and suggestions. I need some guidance, please.
    Thanks in advanced

    Hi Efebo,
    To display a login popup in the InfoPath form, I recommend to add a button in the form and click the button will popup the login form.
     Please follow the link below for detailed code samples:
    Opening a SharePoint 2010 Modal Dialog Box from an InfoPath Form:
    http://msdn.microsoft.com/en-us/library/ie/hh278954.aspx
    Here is a link about consuming SAP Enterprise Services in a Microsoft Office InfoPath Form for your reference:
    http://www.doc88.com/p-64981574795.html
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • HT4009 I'm attempting to down load an app by the name of hudmaniax,upon entering my password for purchase approval I'm prompted to re enter my password a second time followed up with a form to create a security form ...I.e  name of first school attended e

    I'm attempting to down load an app by the name of hudmaniax,upon entering my password for purchase approval I'm prompted to re enter my password a second time followed up with a form to create a security form ...I.e  name of first school attended etc etC.

    This is normal behaviour.  Apple have recently introduced increased security to protect you from fraudulent transactions.  Once you have answered the questions (remember your answers) you will only be asked for them occasionally in future.

  • NeeBeans - Form loaded with errors

    Using NetBeans 6.00 Windows.
    I created a form class extending JPanel and inserted the class in Palette.
    public class ObjPrivUser extends javax.swing.JPanel Then, I created a second class extending JPanel, including the first class.
    public class GrantsByUser extends javax.swing.JPanel {
    private void initComponents() {
    objectPrivUser =  new ObjPrivUser(db);
    private GUI.Panels.ObjPrivUser objectPrivUser;
    ...Everything was ok, when I open the second class I can visualize all components. Until yesterday, when I opened the class and receive a message "form loaded with errors".
    I recreated both classes, but today the same error has occurred.
    Any sugestion?
    Xks,
    Fornari

    Recompile from your source, something is not nice in your file.

  • Problem with enabling thai language in forms

    Hi all,
    I am using
    forms6i,
    oracle10g db(client/server environment),
    NLS_LANG is:thai_thailand.th8tisascii,
    our font standard is:ARIAL
    when i give an i/p via forms the typed value is showing as junk characters.if i change the font for the particular form's field from arial to ms sans serif it is working fine ,but our font standard is arial .plz help me to enabling thai language in forms .and also plz suggest me whether arial font does support to thai language or not .
    Thanks in advance
    Thanks
    Jebesh

    Hi,
    Welcome to OTN forms
    For example:
    select * from a, b where a.no=b.no(+)
    select * from a, b where a.no left outer join b.no
    Thank you

Maybe you are looking for