CommandButton onClick() action problem

Hi every one ,
I want to execute an Ajax function when clicking on submit button before submitting the page like this :
<h:commandButton value="Go" onclick="myFun();" action="#{myController.getPropertyName}"/>where this javascript function will show a yes/no message then an Ajax function will be executed according to the user choice.
The problem is that the j.s function is not even executed but the action is submitted directly.
And from what i understood is that JSF reserves onclick() function to execute "action" property, that's why it can't feel the onclick() i wrote.
I also tried using onmousedown() instead but still the action is submitted directly.
Any suggestions ?

Hesham wrote:
Yes, i thought so but i can't change the JSF version used in the project, so is there a way to overcome this ?Perhaps one of the other events fired by the button will be sufficient (e.g., onmouseup). You could also try to implement your own component for this.

Similar Messages

  • Commandbutton onclick, action

    i've a situation where i want to execute action of a commandbutton prior to executing onclick event.
    Is it possible?
    i've back process(action) populating inbox.value and onclick event, copying value from child window to parent window...dialog doesn't work for me...had to do this manually.
    OR is it possible for me to bind the action to the onclick event?
    Thank you very much for your help.

    Hi,
    onClick is a JavaScript event and will always execute before the button's action.
    Frank

  • Making a commandButton's action dependant on a javascript function's result

    Hi guys,
    I have a command button "Login". I have a managed bean "userLoginInfoBean" with session scope whose "loginToSystem" method I want to call when user clicks on Login button.
    <h:commandButton id="loginButton" type="submit" value="Login" style="font-family: Verdana; font-size: 8pt" action="#{userLoginInfoBean.loginToSystem}">So far so good. Its working perfect.
    Now before calling the action, I want to call a javascript function isGoAhead(). This javascript function will return true or false. Only when it returns true then I want to call the action.
    How can I do it in JSF?
    Thanks

    I know using onclick attribute I can call my javascript function "isGoAhead()"
    <h:commandButton id="loginButton" type="submit" value="Login" style="font-family: Verdana; font-size: 8pt" onclick="isGoAhead();" action="#{userLoginInfoBean.loginToSystem}">But the question is how to make sure that the commandButton's action only gets called if the return value from "isGoAhead()" is true?
    Thanks

  • How to call JSP function from onClick Action

    Hi
    I am trying to call a jsp function, onclick of a checkbox. This jsp function will in turn connect to the database and gets related information. I dont want to submit the data inorder to avoid posting and getting of huge data. Is there a simple way to call a jsp function from the users onClick action.
    Appreciate anyones help!!!
    Thanks alot
    Joe

    So, i have to submit the form to call the jsp function. Basically yes.
    Sorry for the shortness of the answer, but I am pretty sure we have had this conversation (or one very much like it) before.
    Java/JSP runs on the server, generates an html page, and stops running.
    Javascript runs on the client in the web browser, once the page is loaded.
    You cannot call java code from javascript.
    The only way you can run java code again is to make a request - either by submitting a form, or clicking a link.
    If you don't want to refresh the current page, you CAN get tricky with javascript and multiple frames. You submit to another frame, and when it loads, it uses javascript onload event to call back and modify the main frame. Its tricky to get going, and very easy to break, so I don't normally recommend it.
    Good luck,
    evnafets

  • Help with onclick action

    Can someone help? I am struggling with a working code. I used this code before when I was testing as a gif animation. I didn't like the clarity of the gif and want to do this in edge but am relatively new to it.
    <img src="http://pacificoauto.com/AutoGroupemails/Ford%20Black%20Friday/electrifiedshopnowsmaller.gi f" alt="" onclick='javascript:(this.src=="http://pacificoauto.com/AutoGroupemails/Ford%20Black%20Friday/electrifiedshopnowsmaller.gi f"?this.src="http://pacificoauto.com/AutoGroupemails/sonatathon/savings_burst.gif":"")' />
    What I would like to do is pause a looping animation on mouseover and start a different animation onclick. If this isnt possible maybe just how can I create the onclick action?
    Please please help this is driving me nuts!!! Thanks in advance!

    Sure there must be a way for Automator to look in /Folder/ and it's sub folders and find 1.mpg, 2.mpg and 3.mpg and rename them.
    There is, but with your current setup-other .mpgs in the same folder-there's no real way to specify those three files in a single action.
    An alternative that would probably work out better-put the files into a static folder. That way you can use the Get Specified Finder Items. Then after the Rename-
    1.Get Specified Finder Items on the static Folder-
    Break the action flow by clicking on Files/Folders and selection Ignore Results.
    3. Get Folder Contents
    2. New Folder (under your /Folder/ folder)
    Then, if you want:
    4. Get Specified Finder Items on the static Folder-
    Break the action flow by clicking on Files/Folders and selecting Ignore Results
    5. Get Folder Contents
    6. Move to Trash

  • Commandbutton onclick and actionlistener happen at same time

    I started a thread previously with a similar issue, but the title of that thread really doesn't describe the current problem. Sorry for double posting, but I would delete that thread if I could.
    I have a command button as:
    <h:commandButton id="saveCloseFoil" type="submit"
    onclick="javascript:saveText();"
    action="#{Item.saveOptionAction}"
    value="#{propertiesBundle.saveCloseSubmitLabel}"
    actionListener="#{Item.setFoilTextToBean}" />
    The saveText() javascript function copies the text from a text editor to a field defined as:
    <h:inputHidden id="hiddenTextField" value="" />
    The actionlistener should take the value from the hidden field, and put it in the backing bean. The Action then saves that value in its correct place in the database.
    The problem is that the onclick and actionlistener are firing at the exact same time(i am verifying this by using the firefox javascript debugger breakpoints for the javascript and JDeveloper breakpoints for the actionlistener. Both breakpoints stop at the same time.)
    The strange thing is that in another place in our applicate we have an almost identical button:
    <h:commandButton tabindex="3" type="submit" id="submit"
    onclick="javascript:setBrowserSettings();"
    action="#{Login.loginAction}"
    actionListener="#{Login.setBrowserOSSettings}"
    value="#{propertiesBundle.loginLabel}">
    </h:commandButton>
    in which the onclick is run first, then the actionlistener, then the action. I verified this using the exact same method as with the button I am working on now.

    I use both IE6 and Firefox. I mentioned FF because I am unable to debug the problem as accurately in IE6 due to the very limited javascript debugging available for it.
    I also have tried the return true; in the onclick, and tried it again, with no change.

  • CommandButton's Action method doesn't  work

    Hi all
    My English isn't very good
    I use jdeveloper 11.1.1.3.0
    I have SelectOneRadio with two options. When I select each option two PanelGroupLayouts' visible should change:
    <af:selectOneRadio id="sor1" layout="horizontal"
    binding="#{Bean1.sor_Value}"
    valueChangeListener="#{Bean1.chg_sor}"
    autoSubmit="true">
    <af:selectItem label="1" value="1" id="si1"/>
    <af:selectItem label="2" value="2" id="si2"/>
    </af:selectOneRadio>
    public void chg_sor(ValueChangeEvent valueChangeEvent) {       
    if (sor_Value.getValue().toString().equals("1")) {
    pgl_1.setVisible(true);
    pgl_2.setVisible(false);
    } else {
    pgl_1.setVisible(false);
    pgl_2.setVisible(true);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl_1);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl_2);
    In each pgl I have a commandButton with a method related to theirs' action property. but When I click each button nothing happen and their related method don't run.
    but when I use rendered instead of visible in method: "chg_sor" , buttons' action method work well but in this case another error occurs because I can't ppr components that are not rendered.
    I don't know how solve this problem?
    Habib

    Thanks Frank
    In each pgl I have inputText with required=True. and if required field is null and pgl become invisible(visible = false) so the button's Action method on the other pgl(visible = true) doesn't run.
    why this happen?
    Habib
    Edited by: Habib Eslami on Feb 19, 2013 10:00 PM

  • Regarding JSF Default action problem in IE

    Hi,
    I am using Jsf:Default action inside my submit button.In my form I have row of two buttons submit and reset.When I use my tab focus on reset button and when I am clicking enter submit default action is getting fired rather reset action.More over if I am using spacebar after tab focus reset button is called as expected.The problem identified is only with IE browsers
    In case of Mozilla,default action is overridden by tab focus action and working properly.
    Please advise me how to solve this issue in IE
    Note:The j4j:defaultAction custom component included in the j4j tag libraries allows you to define the default action for a form by adding <j4j:defaultAction /> as a child tag to the commandButton tag.
    http://www.jsftutorials.net/defaultActionTag.html
    Edited by: Ravishankar_R on Mar 24, 2010 12:09 AM

    Amit,
    Thanks for your answer. I fixed it using javascript .First I got all the buttons in the DOM and did a check to find if there is any current focus using document.activeElement.type="button" else to go with default submit action.
    Thanks,
    Ravi

  • Rendered attribute of commandButton preventing action method from executing

    When I add a rendered tag to my commandButton it'll only execute the method intermittantly. After a lot of testing, I've narrowed down the problem so I now know when it does and does not work properly.
    If rendered="true" it always works fine
    If rendered="#{issue.update}" and isUpdate() is simply "return true;" it'll always work correctly
    If rendered="#{issue.update}" and isUpdate() is simply "return this.getId() != 0;" it will not execute the action specifiied, however the page does refresh.
    It's also interesting to note that on the rendered page, the button is always shown only when it should be. So when the action fails to execute, the button is shown on the screen.
    In the case that doesn't work, I debugged through and noticed that isUpdate() is called six times for a single page refresh. By printing a stacktrace for each call, I discovered that it's called once in the ApplyRequestValues stage of the lifecycle and the other five times are from RenderResponse (I have the stacktraces, let me know if they'd be worth posting). This method is only referenced once and only on the jsf page, never in the java code... but I'll go back and try to understand why it's calling it so many times later.
    The first time isUpdate() is called, it will retrun false because the value for id has not yet been assigned, which makes sense. This causes a "false" to be returned from isUpdate() and this is what is causing the action to not be executed. If I debug through and change the return value to be true here (only the first time) the action is updated. So my question is, what's going on here? I don't understand why is isUpdate() called so many times, why is it called so early in the lifecycle, and why the call in the apply request values stage determines whether or not it executes the action?
    Now, as a workaround, I put a binding on the id, and tried to use that value. That exposed another problem with my page which requires some explanation... Here are the relevent sections of the page and backing bean...
    issue.jsp
    <h:outputText value="#{issue.init}" />
    there's a datatable here which displays all issues and has a commandLink to edit the issues (immediate="true"). It posts back to this page and passes an ID on the URL.
    <h:inputHidden id="id" value="#{issue.id}" binding="#{issue.idBinding}" />
    <h:inputText id="name" value="#{issue.name}" required="true" />
    <h:commandButton id="updateIssue" value="Update" action="#{issue.updateIssue}" rendered="#{issue.update}" />
    Issue.java
    getInit() will get the id from the FacesContext (specifically, the URL) and load the data from the database.
    On the rendered page in my web browser:
    After clicking on an edit link, the page is loaded and the name is filled in, the update button is on the screen, and everything looks good.
    When I view source, I see that the hidden input for id is set to zero. I'm still trying to figure out why this is the case since all the other parameters are set properly. I stepped through getInit() and it is, indeed setting the id property properly.
    So when I added the binding to get the value from there instead of via the local values, I found that it always got zero (presumedly because that's what is rendered in the HTML code). This means that isUpdate() still returns false on the first call, and my attempt at a workaround fails! So, just as a test, I used some "javascript on the URL" trickory to set the id field to "10". That worked just fine. So the root of the problem is that issue.id is not loading. I put code in the getId() method to always look at the binding and then faces context and put the id into this.id if it found a non-null and non-zero value. It now returns the correct value all of the time but the HTML produced still says the value is zero.
    I've spent about 4 hours on this issue and I'm to the point where I need advice from someone who is more educated on how JSF works. I know the inputHidden get the vaule for the HTML tag it produces from getId() because when I hard code that to always return 10, it works. But when I leave it to return the proper value, the debug statements say it's returning the proper value, but the HTML always says it's zero. This isn't an acceptable solution anyway because I use getId() in the datatable to display the IDs of each of the issues; I just wanted to see if it'd work and it didn't.
    Here's my latest getInit() method (which returns the value from the URL when called from the datatable, but not when called from the inputHidden.
        public int getId() {
            if(getIdBinding() != null && !getIdBinding().isLocalValueSet()) {
                if(getIdBinding().getSubmittedValue() != null) {
                    int temp = Integer.parseInt((String)getIdBinding().getSubmittedValue());
                    if(temp != 0) {
                        this.id = temp;
                        log.info("Got binding value of "+this.id);
            FacesContext ctx = FacesContext.getCurrentInstance();
            if(ctx != null) {
                Map<String, String> map = ctx.getExternalContext().getRequestParameterMap();
                    if(map != null) {
                    String given_id = map.get("id");
                    if(given_id != null) {
                        // if given an ID and no action, we load the data
                        try {
                            log.info("Got value from FacesContext of "+given_id);
                            int temp = Integer.parseInt(given_id);
                            if(temp != 0)
                                this.id = temp;
                        } catch(NumberFormatException e) {
                            // if what's passed in isn't an integer, we leave everything at default values
            return this.id;
        }Thanks in advance,
    Adam

    I'm clicking a link which will load data into a form. In the form there is a field called "id" which has a value of something other than zero. I press the update button (which is only rendered when the id is non-zero), it submits the form. When the restore view happens, the id is the default value of 0 because it has not yet applied the values from the form to the backing bean. Therefore the rendered attribute of update button (isUpdate()) will return false, and the update() method does not get queued.
    When I switch my backing bean to session level, the restore view already has the id loaded, even before the values from the form are applied, so everything works as expected. The problem was that I needed to have the correct return values before any values have been loaded into the member variables.
    As a solution to this, I made some private boolean variables called isNew and isUpdate. Both of them are true by default. This makes sure that the isNew() and isUpdate() methods (attached to the render attribute of my command buttons) return true in the restore view phase. When I read in the id from the URL or hidden input, it'll update the boolean values accordingly, which makes sure the buttons are rendered properly. This allowed me to set the backing bean back to the request scope, which make me happy. <img class="emoticon" src="images/emoticons/grin.gif" border="0" alt="" />
    Thank you Mr. De Campo. You gave me exactly what I was looking for... a better understanding of how thigns work, and (indirectly) a clean solution to my problem.

  • PA40 - Termination/Leaving Action - problems delimiting IT0014

    Hi all,
    For an upgrade from ecc 4.7 tot ECC 6.0 (ehp 4) I am testing some actions.
    I've tested the Hire action and this test was successful. No Iu2019m testing the Termination/Leave Action. When I want to save the Organizational Assignment screen I get a message that the delimiting of IT0014 has failed.
    Is anyone familiar with this problem? If so, could you tell me what I can do to solve this problem?
    Thank you in advance!

    Hi Ashley,
    Please check SAP Note 1016799.
    Regards,
    Dilek

  • On (release) action problem - how to fix the loading issue?

    Hi,
    I'm making a progress with the website in Flash. I have pretty much things already done. Motion tweens that change alpha in percentage ammount are working correctly - I've used them for loading pages but I encountered a one tiny problem...
    Describing the website: there are buttons that - when you click - play an animation (motion tween with alpha changing) to load a proper page that is pinned with a particular button. So: home button loads the home page, bio button loads the bio page etc. All pages go with the motion tween - they fade in the website (from alpha 0% to 100%). Everything is fine and the website with everything works just perfect! But: there's one thing that doesn't keep me calm. When I open my website in a browser to test it and I click on each button to load pages - everything is ok, but when I want to click the same button few times - other things are being loaded by clicking the same button.
    For instance: I click the "bio" button once and it loads my biography page with the motion tween as I described before. But when I want to click it secondly or thirdly it doesn't load my biography page anymore but a page before that one (in this case: home page). When I click it again the button loads my bio page again. So - in sum - it doesn't load the same page all the time, but randomly: the proper one or the one before (in the timeline).
    My AC code for each button is simple, for example:
    on (release) {
        gotoAndPlay(173);
    Also I've got the "actions" layer that carries stop(); command in places that are for it.
    I tried with _root.gotoAndPlay and also with frame_number +1 and always the same problem.
    I hope it isn't anything serrious and can be fixed.
    I'll be very grateful for help.
    Greets!
    J.J.

    As I explained in my post: I test my website in the browser (firefox), I click on a particular button which loads a particular section. It works with all buttons but sometimes when I click the button an incorrect section appears.
    For example: I click biography button, and the biography section appears. Then I click contact button and contact section appears. Then when I want to see biography section again and click on the biography button, the biography section doesn't appear but the other section appears, for instance: home section, about section, gallery section or other from what I have.
    Concluding from the entire description I've placed above in the topic I don't know why this thing happens and I need some help how to fix this issue of loading sections firstly correct and then, after some clicking - incorrect.
    I hope I really presented it clearly.

  • Oh no... Big PS Actions problems.

    Good Morning!
    I'm in a right old pickle, and could you some Photoshop wizardery.
    I'll go in to as much detail as possible, so try not to get lost...
    We  have lots of Actions setup for the various products we design. These  Actions when run, will take the image/product we have and resize, save,  resize again, and save again in various locations across a network.  We've had these actions since way back, like CS2, and they've worked  like a dream right through to CS5 for a short while, then all of sudden,  BOOM, when it comes to the save file command in the action, its  starting renaming the file to a file thats already in the destination  folder - resulting in wrong file names for images, let me explain  further...
    example:
    i have a destination folder called MUSIC POSTERS (one of many folders the action saves to) on a backup computer on the network.
    In this folder i have:
    GUNS N ROSES.jpg
    MOTORHEAD.jpg
    EMINEM.jpg
    If  i take a new poster, say motorhead.eps and run the action, it will  resize ok, but the save command will then place the name EMINEM in the  save dialog!? resulting in us having a motorhead poster called  EMINEM.jpg and the original EMINEM.jpg file overwritten!
    I'm  aware of the fact that if when writing an Action and you manually type a  file name into the dialog, it will record that name and use from there  on out, but i certainly didnt do this, and it's worked fine for years.
    Upon  looking in all the folders it saves to - it saves correctly to only one  folder, this folder is on the same drive as 2 of the other folders  which it doesnt save correctly to 0 which makes me think its not a  problem with the drive on the network (because its managing to save at  least one correctly.)
    I've tried a couple  troubleshooting's - re-written the action many times, tried storing and  loading/using the actions from a folder on my Artwork Partition (my  computer is partitioned into SYSTEM, and ARTWORK), and also tried  storing and loading/using the actions from within Photoshops Actions  folder within the applications folder.
    Problem No.2 -  occassionally the steps within actions will rearrange themselves,  duplicate themselves, or even remove themselves!
    Any clues please?
    just downloaded and installed latest patch, still no luck.
    The same actions are installed on 5 machines (each working from there own locally stored copies of the actions) and we all have the same problem, how can they all have corrupt!?

    Good Morning!
    I'm in a right old pickle, and could you some Photoshop wizardery.
    I'll go in to as much detail as possible, so try not to get lost...
    We  have lots of Actions setup for the various products we design. These  Actions when run, will take the image/product we have and resize, save,  resize again, and save again in various locations across a network.  We've had these actions since way back, like CS2, and they've worked  like a dream right through to CS5 for a short while, then all of sudden,  BOOM, when it comes to the save file command in the action, its  starting renaming the file to a file thats already in the destination  folder - resulting in wrong file names for images, let me explain  further...
    example:
    i have a destination folder called MUSIC POSTERS (one of many folders the action saves to) on a backup computer on the network.
    In this folder i have:
    GUNS N ROSES.jpg
    MOTORHEAD.jpg
    EMINEM.jpg
    If  i take a new poster, say motorhead.eps and run the action, it will  resize ok, but the save command will then place the name EMINEM in the  save dialog!? resulting in us having a motorhead poster called  EMINEM.jpg and the original EMINEM.jpg file overwritten!
    I'm  aware of the fact that if when writing an Action and you manually type a  file name into the dialog, it will record that name and use from there  on out, but i certainly didnt do this, and it's worked fine for years.
    Upon  looking in all the folders it saves to - it saves correctly to only one  folder, this folder is on the same drive as 2 of the other folders  which it doesnt save correctly to 0 which makes me think its not a  problem with the drive on the network (because its managing to save at  least one correctly.)
    I've tried a couple  troubleshooting's - re-written the action many times, tried storing and  loading/using the actions from a folder on my Artwork Partition (my  computer is partitioned into SYSTEM, and ARTWORK), and also tried  storing and loading/using the actions from within Photoshops Actions  folder within the applications folder.
    Problem No.2 -  occassionally the steps within actions will rearrange themselves,  duplicate themselves, or even remove themselves!
    Any clues please?
    just downloaded and installed latest patch, still no luck.
    The same actions are installed on 5 machines (each working from there own locally stored copies of the actions) and we all have the same problem, how can they all have corrupt!?

  • Ps CS6 Action problem: New document created with "Preset: Clipboard" is misnamed

    Ps CS6 v13.0.1
    OS X 10.6.8
    In an Action, File > New with "Preset:  Clipboard" ignores the specified document name and uses one of the following names when the clipboard definitely does hold valid content:
    1. The name that was applied by the previous invocation of File > New in a session.
    2. No name if Action is run before File > New has been used in current session.
    Only when the clipboard has no valid content will the newly created document be given the specified name.

    The Color Profile seems to work differently between CS5 and CS6.   In CS5 when I use menu File>New and there is something in the clipboard I see Preset clipboard as the dedault setting and see my current Photoshop color setting profile set in as the color profile. I pasted a ProPhoto selection into the clipboard.  When I do the same in CS6 and use File>New I see Preset Clipboard as the default setting but the color profile is not my Photoshop Color setting its ProPhotoRGB the same as I pasted into the clipboard.  However if I close CS6 down. Then start CS6 and do menu File>New I see Preset Clipboard as the default setting and the corol profile is my Photoshop color setting profile sRGB not ProPhotoRGB that in the clibpoard. So I feel the copy to clipboard from Photoshop triggers something internally to change the profile in CS6 it not something that gets set in the clipboard for the ProPhotoRGB override does not happen if I shut Photoshop down and restart it.
    I think I like the CS6 change. Noel I wrote that for you I want you to know I don't think CS6 is all bad. This change should help one from getting profiles mismatches.  CS6 is still the buggest Phoshop around.  It does not stop working as smuch as it did befor the 13.0.1 update. And when it does there a chance Autosave may save the day. The last Photoshop stop working message I got from windows was when I tried to run a script.  There were no open document so nothing to recover. After terminating CS6 and restarting it the script work without a problem.

  • H:commandButton - jsf navigation problem

    Dear All,
    I changed the first page of my application from pageA.jsf to pageB.jsf in the index.jsp file:
    <jsp:forward page="/pages/pageB.jsf" />
    The pageB.jsp is a new page that I just created.
    (I have
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    in the web.xml )
    in the B.jsp I have two "h:commandButton" :
    <td><h:commandButton id="submitB1" value="Upload" action="submitB1"/></td>
    <td><h:commandButton id="submitB2" value="Search" action="submitB2"/></td>
    and in the face-config.xml I have
    <navigation-rule>
    <from-view-id>/pages/pageB.jsp</from-view-id>
    <navigation-case>
    <from-outcome>submitB1</from-outcome>
    <to-view-id>/pages/pageB1.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>submitB2</from-outcome>
    <to-view-id>/pages/pageB2.jsp</to-view-id>
    </navigation-case>
    I can load the pageB but cannot be navigated to pageB1 or B2. Before I changed pageA.jsf to pageB.jsf, the nevigation worked well.
    Anyone has any idea of what would be the cause please help me out.
    Thank you very much in advance for your help

    In the future, please use code tags to post code. This way they will be nicely formatted and (much) better readable, otherwise likely everyone will ignore it. Press the CODE button to get them and use Preview tab to preview.
    However on the new page it seems there is no view root. The bean for the new page is never accessed as it cannot be found.What does the appserver logs say?

  • How to capture the onclick action htmlb to Portal component?

    <%     if (Bean.getSpoofValue().equalsIgnoreCase("spoof=yes"))
                        {%>
              <hbj:form id="spoof" >
                   <hbj:gridLayout
                        id="myGrid2"
                        rowSize="10"
                        columnSize="10"
                        cellSpacing="10"
                        cellPadding="0"
                        debugMode="false"
                        width="85%">
                        <hbj:gridLayoutCell
                             id="gridCell51"
                             rowIndex="4"
                             columnIndex="1"
                             horizontalAlignment="LEFT"
                             verticalAlignment="TOP"
                             style=""
                             width="100%">
                             <hbj:textView
                                  text="Enter the Customer Number to Spoof: "
                                  id="tv4"
                                  tooltip="Total Funds"
                                  design="HEADER2"
                                  encode="true">
                             </hbj:textView>
                             <hbj:inputField id="spoofCust" value="" maxlength="10" />
                             <hbj:button id="submit" text="Submit" onClick="onSubmit"/>
                        </hbj:gridLayoutCell>
                   </hbj:gridLayout>
    </hbj:form><%}%>
    This is my action JSP page this action I need to utilize on basis of click.
    I am using two java class one extends PageProcessorComponent and second one extends AbstractPortalComponent
    In firrst java class I am utilizing that action But APComp only unable use this action.
    How do I capture this in APComponent?
    Please provide the solution I tried some methods but no result suggest me any body?
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

    Hi Lohi,
    In AbstractPortalComponent, you should capture events by your selves in the doContent method:
    protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response) {
            IPageContext iPageContext = PageContextFactory.createPageContext(request, response);
         Event event = iPageContext.<b>getCurrentEvent();</b>
         if (null != event && "<b>onSubmit</b>".equalsIgnoreCase(event.getAction()))
    protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    RadioButtonGroup rbg = new RadioButtonGroup("radioGroup");
    rbg.setColumnCount(2);
    RadioButton r1 = rbg.addItem("rb_one", "one");
    RadioButton r2 = rbg.addItem("rb_two", "two");
    RadioButton r3 = rbg.addItem("rb_three", "three");
    RadioButton r4 = rbg.addItem("rb_four", "four");
    RadioButton r5 = rbg.addItem("rb_five", "five");
    rbg.setSelection("rb_one");
    rbg.setOnClick("rbgEvent");
    TextView text = new TextView("status");
    text.setTooltip("Radio button status");
    text.setText("no event");
    IPageContext iPageContext = PageContextFactory.createPageContext(request, response);
    Event event = iPageContext.getCurrentEvent();
    if (null != event && "rbgEvent".equalsIgnoreCase(event.getAction()))
    System.out.println("event invoked");
    RadioButtonClickEvent evt = (RadioButtonClickEvent) event;
    String selectedRadio = evt.getKey();
    rbg.setSelection(selectedRadio);
    text.setText(selectedRadio);
    Form sampleForm = iPageContext.createFormDocument("form");
    sampleForm.addComponent(rbg);
    sampleForm.addComponent(text);
    iPageContext.render();
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

Maybe you are looking for

  • Display hidden fields in output list when submitting a report from another

    I have a report A that is submitting another report B and exporting the list to memory. Report B is a standard report and cannot be executed on its own. SUBMIT ReportB                      WITH p_select = p_select            EXPORTING LIST TO MEMORY

  • Old mouse broke, How do I pair a new magic mouse?

    The magic mouse that came with the desktop broke, so I bought a new 1, but now I have now idea how to pair it with the computer. I checked the page that explains how to do it but I got no other mouse to click here and there like it says, so what do I

  • Graph in forms

    Hello members ,, i made a master detail graph in graph builder 6i ,, Master graph = 'Pie chart" Detail graph = "Bar Chart" when i click on the Pie chart, detail Bar chart change according to Master Chart but when i call it in the form 6i , the graph

  • Material on SAP Query

    Hi, I need material on SAP Query (not BW!!). Can you provide me with a link, or training material? Thank you. Tad

  • Displaying large images in MIDP 2.0

    Hello, I've been building a little file browser in MIDP 2.0. Now I'd like to add some file opening in, too. Videos and sound can be played quite easily using the MMAPI. But images are a tougher case. I haven't found any way to display images using th