ClientListener on Button -  Programmatically

Hello,
Requirement : I need to Create a command button and when you hover your mouse on it, a function has to be called . Everything has to be done programmatically.
My Procedure: I have already created a RichCommandButton programmatically with a binding to a function(HandleImagePress) which triggers when I click the button. This function inturn creates, populates and displays the necessary information in the form of a popup. However , With the new requirement, I am just supposed to hover onto my button to trigger this function (HandleImagePress). I believe I need to create ClientListener and so I tried it. But it doesnt work the way I want ... :-(
This is what I have tried:
public void handleImagePress(ActionEvent event){
// There is code to create , populate and display and popup . It works fine
private UIComponent ImageButton(UIComponent parent){
RichCommandButton img = new RichCommandButton();
String imagestyle = "width:120pt; height:120.0pt;margin:10.0pt;";
img.setInlineStyle(imagestyle);
// Compose method expression to invoke action event handler when button is pressed.
FacesContext fctx = FacesContext.getCurrentInstance();
Application application = fctx.getApplication();
ExpressionFactory elFactory = application.getExpressionFactory();
ELContext elContext = fctx.getELContext();
MethodExpression methodExpression =null;
// Make sure the EL expression references a valid managed bean method. Ensure the bean scope is properly addressed.
methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {ActionEvent.class});
// Create the command button action listener reference.
MethodExpressionActionListener al = null;
al= new MethodExpressionActionListener(methodExpression);
img.addActionListener(al);
// Add new command button to parent component and PPR the component for the button to show.
parent.getChildren().add(img);
ClientListenerSet set = img.getClientListeners();
*if (set == null) {*
set = new ClientListenerSet();
img.setClientListeners(set);
set.addBehavior("new AdfShowPopupBehavior('popup',AdfRichPopup.ALIGN_AFTER_END,null,'mouseOver')");
// set.addListener("mouseOver", "handleImagePress");
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(parent);
return img;
With this code, I need to click on image atleast once to create a popup . Is it possible to call the function without clicking but by just hovering on it? (bcoz the HandleImagePress function takes care of everything regarding to popup)
Help will be greatly appreciated :-)
Thank You

Thank You for the reply, I have created a command button in Jdeveloper, ADF Faces component. It doesn't have "addMouseMotionListener" . So i have tried this way,
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
I have tried adding a Mouse event instead of an Actionevent this way ..
public void handleImagePress(MouseEvent event){
int m = event.MOUSE_ENTERED;
System.out.println(m);
System.out.println("--mouse clicked");
System.out.println(event.MOUSE_CLICKED);
//code to create , display, popup
private UIComponent ImageButton(UIComponent parent){
//I have changed the following line..
methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {MouseEvent.class});
But it complains java.lang.IllegalArgumentException: argument type mismatch, when I click on the button.
Please let me know of a work around with this issue.

Similar Messages

  • Adding parameters to button programmatically

    H All,
    I have an requirement to pass the parameters of an single row selected by user to the next page. It is an advance table in iReceivables page. I have created an button in the advance table using personalization and when the user clicks on the button the values(1 to 3) will be forwarded to the next page.
    Can some one assist me on how to add parameters to an button programmatically.
    Regards,
    Ramakrishnan

    You cannot achieve this without Action (PPR)
    1. You need to extend the controller and programmatically configure the PPR on Button Click.
    Add Following code in PR:
    OAButtonBean button = (OAButtonBean) webBean.findChildRecursive("<ID of Button added by personalization>") ;
    // Assuming you need to pass just one parameter, PK of VO.
    Hashtable paramsWithBinds = new Hashtable(1);
    paramsWithBinds.put ("PKparam", new OADataBoundValueFireActionURL((OAWebBeanData)webBean,
    "{$<View Attribute name of the PK>}"));
    button.setFireActionForSubmit("<EVENT NAME OF PPR ON BUTTON CLICK>", null, paramsWithBinds,false, false);
    2.
    Add following Code in PFR:
    if("<EVENT NAME OF PPR ON BUTTON CLICK>".equals(pageContext.getParameter("event"))) {
    System.out.println("WE ARE IN HANDLE OF BUTTON CLICK");
    System.out.println( pageContext.getParameter("PKparam")) ;
    // PKParam is set in PR for the Primary Key of VO.
    //Now you can pass this as a parameter to your Next page.
    Regards,
    Prince
    http://princekapoor82.blogspot.com
    typo fixed.
    Edited by: Prince on Oct 11, 2011 11:20 PM

  • How to create button programmatically and assign trigger for it and add code

    is that possible ?
    How can I create item a button for example programmatically (at run time)
    and create trigger (when-button-pressed) programmatically and write a code
    in the trigger body as well programmatically.
    thankx

    Hello David
    I used the way list and go button which is more safer than creating buttons because
    you can populate the list on fly.
         | dropdown list     \/
              | go button |
    PROCEDURE populate_user_function_list IS
         rg_list_id RECORDGROUP;
         ret_code     NUMBER;
    BEGIN
         rg_list_id := FIND_GROUP('RG_LIST');
         IF NOT ID_NULL(rg_list_id) THEN
              DELETE_GROUP(rg_list_id);
         END IF;
         rg_list_id := CREATE_GROUP_FROM_QUERY('RG_LIST','SELECT FUNCTION_ID, FUNCTION_ID FROM SMS_ROLE_FUNCTION WHERE SMS_ROLE_FUNCTION.DB_ROLE ='||''''||:GLOBAL.USER_ROLE||''''||' ORDER BY SEQUENCE_NO');
         ret_code := POPULATE_GROUP(rg_list_id);
         --Populate record group.
              IF ret_code <> 0 THEN
              bell;
              MESSAGE('Record Group could not be populated');
              RAISE FORM_TRIGGER_FAILURE;
              END IF;
         POPULATE_LIST('DYNAMIC_BLK.USER_FUNCTION','RG_LIST');
         DELETE_GROUP(rg_list_id);
    END;
    --this is the button to go the user selection
    begin
         if :DYNAMIC_BLK.USER_FUNCTION is not null then
              --go to selected form
              call_form(:DYNAMIC_BLK.USER_FUNCTION,NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,NO_SHARE_LIBRARY_DATA);     
         else
              bell;
              message('Please select a function');
         end if;
    end;

  • Release 12.1.3 Delivery Opts Button - Programmatically

    Hi ,
    I need to send the Invoice report as PDF attachment. Similar to the way it is sent in the Delivery Opts Button. The concurrent request is submitted programmatically. I need add the values to parameter Email . Is there any standard program similar to FND_REQUEST.ADD_LAYOUT or FND_REQUEST.SUBMIT_REQUEST to achieve the same?
    Thanks
    GM

    Hi,
    Please see
    Re:How to Email Output of Concurrent Program to set of Users .
    How to send output of a XML report to certain email Ids
    send pdf email attachment
    Thanks

  • Making a button programmatically not change its 'physical' state when pressed

    I have this button:
    which changes into this when pressed:
    How do i programmatically make the button not change into its 2nd state when pressed? do i use property nodes? if so, how?
    thanks

    If you use the Colors Property Node, you can change the colors dynamically, so you can set it all green when you need it, then change it back to green and red.
    The only way you can intercept the button press is to use the Mouse Down? event in the event structure.  You will need to verify a left mouse click and then Discard the event.  That will be your inidcation the button has been pressed.  However, you will still need to track your state to not discard the event in the situations where you want the button to actuate.
    It is much easier to dynamically change the colors.

  • I need to call the Run continously button programmatically from MFC application .

    I have create Labview application from sample VI and with help of VirtualInstrument class I am to access the methods like Run ,SetControlValue and getControlvalue .But for VI we have Run continously button also .how do I programmatically call the Run continously button opteration from my applciation using VI methods.

    "Run Continuously" is not something that should be used in an application. (There are very few legitimate uses for continuous run, e.g. to quickly play with a few input parameters while debugging a subVI independent of the main application. The equivalent in your case would be to just place the run invocation in a loop and call it repeatedly. This is definitely not the way to do it!)
    Why don't you simply place a big while loop around all the code inside the VI that needs to run continuously?
    See also THIS recent discussion.
    LabVIEW Champion . Do more with less code and in less time .

  • How can i click a button Programmatically

    Dear sir;
    there is way to run a button in a form Programmatically?
    thank you Dear.

    Dany,
    Yes you can.
    Here is example.
    Let's say you want to close a form Goods Receipt PO when it loads
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And _
                       pVal.FormTypeEx = "143" And pVal.BeforeAction Then
    SBO_App.Forms.Item(FormUID).Items.Item("2").Click()
    end if
    'This simulates the user clicking on the cancel button (item ID 2 on the form)
    Please close the posts that are handled by assigning points.

  • Subpanel control button programmat​ically

    Hello,
    I'm fairly new in Labview and do not master all aspects.
    I have developped a "driver" VI, which allows me to control an instrument (communication via TCP-IP). This works fine.
    I now want to use this "driver" VI inside a test VI, which will control the instrument in an automated way.
    I'm loading the "driver" VI in a subpannel of my main VI, and I can effectivelly see it loaded, and can use it also, as if it was standing alone ...
    So far, so good.
    Now, I need to programmatically control the instrument, to execute test sequences e.g.   . I need to have the main VI sending commands to the VI in the sub-panel, changing set values, "clicking" on buttons ... all this automatically.
    What is the best way to control the elements in the subpanel, in a similar way as with property nodes if the elements would be in the main VI ?
    Thanks in advance for any useful tip.
    J.F. 
    Solved!
    Go to Solution.

    Hello,
    Here is a little example. As you will see, it consists in :
    1) from "VI reference" ->  you get "front panel reference"
    2) from "front panel reference" -> you get "all control references"
    3) from "all control references" -> you get "a given control reference" (found by its label text)
    4) from "a given control reference" -> you can use its "value property" as usual (read or write mode)
    Hope it helps...
    J.
    Attachments:
    subpanel.zip ‏46 KB

  • Changing default button programmatically

    I have a set of 3 buttons on a form, and one is designated as the default button. When it is selected, I would like a different button to become the default, but I can't find a reference to a suitable property in the set_item_property built-in.
    The question is simple, "How do I do this?"
    TIA,
    Mark.

    and always all of the button have to be enabled?
    otherwise (i had this situation) you can
    set all the 3 button as default but only
    one enabled and when the user click on the
    default button set the other button enabled
    and the button pressed disabled
    ~
    speedy

  • How do I convert a shape to a button programmatically in actionscript 3?

    Hello,
        I am passed all the information I need to draw a shape in FlashVars. After I draw the shape, how can I convert this shape to a button using actionscript? Thanks in advance for your help.
    Regards,
    Nilang

    u can directly draw in  a Sprite or add the Shpe as child of a Sprite,like this
    var shape:Shape= new Shape();
    shape.graphics.beginFill(0xff3345);
    shape.graphics.drawRect(0,0,100,30);
    var btn:Sprite=new Sprite();
    btn.buttonMode=true;
    btn.addChild(shape)
    addChild(btn)

  • How to remove particular button programmatically in runtime?

    Hi
    I want to remove or hide_view a button in runtime
    prgramatically.
    I have tried "hide_view" statement without success.
    Can anyone tell me how to do that?
    Thanks.

    Have you tried:
    set_Item_property('button_name',visible,property_false)

  • Hiding Save Button Programmatically

    Is there a way within the Adobe PDF Reader OCX control to hide the Save button and
    prevent the user from bringing it up?  We want to lock down the way files are saved (we'll be adding our own save button).

    I don't have an answer ready for you, you but may get more information in IE8 if you use the Developer Tools (F12). When running the Developer Tools you can switch the document mode. E.g. if your run in Quirks Mode, you can get unexpected results. Switch to another mode and see what happens. This helped me a lot to see the differences between rendering in IE and FF.
    The mode is controlled by the Doctype defined in the page template.

  • How to disable programmatically created Submit Button in ProcessFormRequest

    Hi All,
    I'm working on an issue where i have created an Upload button Programmatically. The upload button should get disabled after it is clicked. The code for the upload button creation is as below. This has been added in the processRequest of CO.
    OASubmitButtonBean oasb;
    oasb =
    (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,
    OAWebBeanConstants.BUTTON_SUBMIT_BEAN,
    null,
    "BUTTON_SUBMIT");
    oasb.setID("Upload");
    oasb.setUINodeName("Upload");
    oasb.setEvent("Upload");
    oasb.setText("Upload");
    Now, when i handle the upload button click in the processFormRequest, i should also disable the button at the end. I followed the below method in the processFormRequest but it threw a null pointer exception at the point where i have disabled the button.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    String strEvent = pageContext.getParameter(EVENT_PARAM);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (strEvent.equals("Upload"))
    OASubmitButtonBean oasb2 = (OASubmitButtonBean)webBean.findIndexedChildRecursive("Upload");
    oasb2.setDisabled(true); --- this is where the null pointer exception gets thrown
    I'm not sure if this is the way to go about it. Could you please let me know how to handle the above request?
    Regards,
    Shreyas
    Edited by: user11258661 on Mar 28, 2012 7:15 AM

    Hi Ram,
    Thank you for the response. I have created the button programmatically. So I'm not sure how to add the newly created button to the webBean as child. I'm new to OAF. So could you please elaborate. A code snippet might help.
    Thanks in advance.
    Regards,
    Shreyas

  • Programmatically click a button

    I have a button with a latch action, and I want to control the click of the button programmatically, so that when the case is true, the button is clicked and it then returns to its default value.
    Can someone please tell me how to do this?
    Thanks in advance!
    Solved!
    Go to Solution.

    I just fixed my problem.
    I used a flat sequence, and in it a 2 local variables of a button, in the first frame of the flat sequence, I wired a true to the button and in the next frame a false to the button. I also wired a local variable of this same button to the stop of the while loop, and now everytime the condition is met the loop stops and starts again.
    I forgot to mention that I had to remove the mechanical action of the button in order for me to control it programmatically.
    Attachments:
    change button state.PNG ‏12 KB

  • Error message on unclicked Radio Button

    Hello all, I was wondering how I can generate a unique error message on a required radio button on my form. I have designated the radio button as required already, but instead of the generic "missing fields" error message I would like it to generate a specific one saying "Form Must Be Reviewed with Supervisor Prior to Submission" in addition to the one that pops up when other required fields are not filled.

    One way to do it is to use 2 submit buttons.
    You want to hide the real submit button and use a "fake" submit button (just a regular button) to check the value of the field. If the field is ok then you click the real submit button programmatically.
    On the Click event of the fake submit button (JavaScript):
    if (RadioButtonList.rawValue == "") {
         xfa.host.messageBox("Form Must Be Reviewed with Supervisor Prior to Submission");
    else {
         EmailSubmitButton1.execEvent("click");
    Hope that helps!

Maybe you are looking for

  • Previous purchased do not show up in app store....

    Just bought a new iPad.  Something strange happening here. When I click on the "previous purchases" button on the iPad, I get a blank screen - none of the purchases actually show up. But, the strange part is, that if I click on a blank part of the sc

  • How do i view backed up iPhoto library from a macbook pro, onto my air?

    Im trying to import my images or view them at least, from my time machine back ups from a now defunct macbook pro, onto my new Macbook Air. As an artist, I need to have these on file for my work.

  • Closing account and opening a prepaid one and activating prepaid phone

    >> Duplicate post removed to comply with Verizon Wireless Terms of Service.  See When to call to close account when contract ends << Message was edited by: Verizon Moderator

  • Qt freezes during play... constantly

    I upgraded to QT 7 and bought Pro, and ever since the image freezes often during play. I have to restart or redownload the movie to get it unstuck; sometimes changing Views (small to full screen) will nudge it. 10.3.9. This happens on both of my comp

  • AP Creditor Cleansing

    Hi All, We are about to undertake a cleansing exercise on our creditor records. An initial workshop has raised a few issues in data entry and the subsequent difficulties in reporting on vendors and transaction types. I am certain that these issues mu