How to create an action programmatically

Hello
In fact, I create a button dynamically. This function works very well.
But I'm not able to add actions to this button.
beacue samplebutton.setAction must MethodBinding objetc and I'm not able to create the same...
No idea how can I link any action to the button programmatically?

That's right, you can use this method to generate an expression of the action listener method. But this time, you should use cb.addActionListener instead of cb.setActionExpression. Also, your method must have an ActionEvent parameter.
Then, you can use the ActionEvent getSource() property to get the button for your method.

public static MethodExpression actionListenerMethodExpression (String actionListenerName) {}
MethodExpression methodExpression = null;

Class [] argumentTypes = new class [1];
argumentTypes [0] = ActionEvent.class;

FacesContext facesCtx = FacesContext.getCurrentInstance ();
Application app = facesCtx.getApplication ();
ExpressionFactory elFactory = app.getExpressionFactory ();
ELContext elContext = facesCtx.getELContext ();

methodExpression = elFactory.createMethodExpression (elContext, actionListenerName, null,
argumentTypes);

try {}
methodExpression.getMethodInfo (elContext);
} catch (Exception e) {}
e.printStackTrace ();
}
MethodExpression return;
}

Published by: user3562460 on July 13, 2010 06:03

Tags: Java

Similar Questions

  • How to create an action link that goes to a section that is 'hidden' in the same page

    Hello

    OBIEE 11, I have a dashboard page that has section 1 as a guest, 2 which shows an analysis that contains a chart and article 3 that shows the details of the graph. I have an action to link this graphic article 2 connection to the details in section 3. However, I would like my report to the do not appear in article 3 as long as you press the link of action. Is there a way to 'Hide section 3 until you press the link action?' Thank you!

    Hello

    Try to avoid the double-display: How to create an action link that goes to a section that is 'hidden' in the same page

    Felipe_Idalgo meets the other post (and he posted the best answer to your needs), in order to continue the other thread instead of opening another.

  • How to create a connection programmatically.

    Hi all.

    Could someone provide a link or for example on how to create a link stripped? I mean, the links I created to date, "static links": setting properties in the section "links" column for the item: link text, target, page, clear the cache, name, value. It's very well, however, it may be the case when you want to create a link, to go to a certain page, say one interactive report, but in such a way so that the link (and its attributes) must be created on the flash, base conditions. Yet once, access a given interactive report, with certain conditions: for example, based on the customer, the value of the product, or a combination of them.

    How could you do something like that...?

    Thanks in advance...!

    I think you're looking for this http://www.oracle.com/technetwork/issue-archive/2010/10-mar/o20browser-098978.html

  • How to create an action to crop to a specific image format?

    I have images of different sizes that I need to all be cropped to a specific aspect ratio in the center of the image and stretching on the side or at the top and bottom edges according to the use of the maximum portion of the image.  To do this, how do you define an action.

    If I had to do it by hand, I would use the rectangle selection rectangle, change to report fixed and drag from one side to the other.  They move the selection towards the Center (the best I could).  Then do Image < harvest?

    But I need to automate this process and have the placed exactly in the Center.  Is it possible to automate in action?  If so, how?

    FYI, I have CS5 (and CS6).  I'm comfortable with the image processor.  So as long as I have a put action in place, I can process all my images using the image processor.

    I also have lightroom 4 If there is a way to do it.

    Post edited by: DVDmike

    Yes, I wrote AspectRatioSelection to take the orientation of the document into account use of ratio you set facing the direction of the documents.  So easy to save an action with landscapes and Portraits of cultures for a 4 X 6 paper. You will notice that the dialog box has two fields of numbers not a width and height fields no orientation is implicit. His companion LongSidePrintLength.jsx let him, you set the correct printing resolution after the harvest of the report l / h.

    I have create a plugin where you can specify an absolute format that he too had an orient option to work like AspectRatioSelection.  So with that plugin would be able to crop a landscape to portrait and portrait to landscape. Hover the compositional changes of image, so when you do often, you can't get an acceptable composition.  The dialog box has also become difficult to describe for me.  I better program then I in English.  The box width and height meaningless East and not absolute proportions and was not easy to explain. What is the air.

    znarkus wrote:

    Thanks for these scripts!

    I noticed one (for me) issue with AspectRatioSelection however: even if I put the report l / h at 6:4 he decided to crop images 4:6.

    He works with images that are portrait, but those who are more square are cut in 4:6.

    I'm not your more square thing.  If you have two documents one 4 x 6 and 6 x 4 which is more square?

    How it works biased on you the guidance documents. If your document is larger then top this landscape so it more big wide it a Portrait. If we place the default plugin this landscape.

    So it makes no difference if you set 4 and 6 or 6 and 4 or 3 and 2 or 2 and 3

    Landscape and square paper will see landscape with a selection or path or 3:2 aspect ratio selection is rectangle or oval

    Documents of portraits will be able to see a selection of Portrait with a 2:3 aspect ratio selection or a path it is rectangle or oval

    Post edited by: JJMack

  • How to create an 'Action' in the PS?

    I said that it's easier than a script, which is attractive.

    Thank you

    Matt

    Look at my package of shares craft. http://www.mouseprints.NET/old/DPR/JJMacksCraftingActions.zip

    Contains:

    Action Actions Palette Tips.txt

    Action creating Guidelines.txt

    Action dealing with Image Size.txt

    Strengthened through scripts functions.txt Photoshop action

    Action of CraftedActions.atn example set includes an example action http://www.mouseprints.net/old/dpr/WM900x600.jpg tattoo

    Sample Photoshop Actions.txt CraftedActions the value stored in a text file. This file contains a few additional observations that I inserted describing how the actions.

    12 scripts for actions

  • How to create dynamic action of the link column in the classic report

    I have an apex page to display a modal window using jquery. In the modal window, I have a classic report with a column of link I want to capture its click event.
    I thought I could create a dynamic action with selection of type = jquery selector. Not sure if I need to do anything on the link column and do not know the syntax
    jquery selector. Would appreciate help or direction?

    Always zip code using .

    ...\
    

    tags as described in the FAQ.

    I created a region of report with the following query:

    Select empno, ename, 'SELECT' from emp
    where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
    or :P2_SEARCHPU is null)
    

    There is no alias specified for the "SELECT" column, Oracle uses so the content of the column as a default alias. It comes

    'SELECT'
    

    Instead of

    SELECT
    

    The necessary jQuery selector would be:

    td[headers="\'SELECT\'"] a
    

    However the need to release the single quote everywhere is a ticking time bug. SELECT an Oracle reserved word means use it as any type of identifier is either too smart.

    You should always use a valid Oracle identifier as an alias explicit when a column contains a literal value or a complex expression:

    select
        empno
      , ename
      , 'SELECT' link_text
    from
        emp
    where
        (  ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
         or :P2_SEARCHPU is null)
    

    APEX will use the column alias LINK_TEXT as the ID attribute of the column header and the cells in the column will reference it in their headersattributes. The jQuery selector is:

    td[headers="LINK_TEXT"] a
    
  • RE: How to create check boxes programmatically

    Hi all

    I use Jdeveloper 11.1.2.3.0

    I have an input field and the ok button in my fragment.

    If I give that entered 5 into the text field and click on the ok button so I get 5 checkboxes as output.

    so can someone share the logic necessary for the foregoing.

    Thank you

    SyAM

    so you can get the value of inputtext filed using the component as no binding.

    then get value of inputtext on action button ok to help listener

    int num = Interger.parseInt (no.getValue ());

    for (int i = 1; i)<=num>

    {

    RichSelectBooleanCheckbox r1 = new RichSelectBooleanCheckbox();

    R1. SetValue (true);

    R1.setID ("c" + String.valueOf (i));

    mainlayout.getChildren () .add (r1);

    }

  • IDCS5 - how to create the IAssignedStory programmatically?

    Hi all

    Here's my problem:

    I need get the yet unassigned stories (not even for the unassigned InCopy content), export them and assign them to the unassigned InCopy content...

    I tried to export using ISnnipetExport and create the link via the LinkManager, but they do not automatically assign it to do anything

    What I need, is something like the export InCopy menu in ID, but without user interface.

    Any help would be appreciated.

    Thank you

    Gustavo

    It has been a while since I worked with export & assignments and I do not have the practical documentation, but you should be able to export a story using ISnippetExport::ExportInCopyInterchange and bind it with IStoryUtils::CreateLink (you'll want to pass kInCopyImportProviderBoss as a supplier of import). To assign stories, look in IAssignmentMgr on kSessionBoss; IAssignmentMgr::CreateAssignmentCmd, specifically.

  • How to create a rule of action to subtract from the Ips event log manager console express?

    How to create a rule of action to subtract from the Ips event log manager express console?, some unknown has a guide?

    Thank you.

    Sent by Cisco Support technique iPad App

    Hello

    http://www.Cisco.com/en/us/products/sw/secursw/ps2113/products_tech_note09186a0080bc7910.shtml

    HTH

    Luis Silva

    "If you need IDP (planning, design, implementation) assistance do not hesitate to contact us.

    http://www.Cisco.com/Web/partners/tools/pdihd.html

  • How to use PL/SQL to create dynamic action to set the value of a selection by another list?

    Hello

    I would like to know how to use PL/SQL to create dynamic action to set the value of a list of selection by another selection list.

    1.PNG

    I wish can create dynamic action to manage the two above the Room select list (: P9_ROOM) and building (: P8_BUILDING).

    When you select "1074" in the bathroom, building highlights like "BRM BLD 5"

    When you select 'Area of the black box' in the room, building must assign the value "7 BLD BRM"

    When the room is Null, building should also be Null.

    I thank you,

    Alice

    I forgot to mention, for the PL/SQL Code, because you are working with items in the selection list, the return values are different from the display on your LOV values, you must instead use the return values.

    Thank you

    Erick

  • How to create a my Signature (signature with the tablet of manufacturing) Action?

    How to create a my Signature (signature with the tablet of manufacturing) Action?

    I use PSCS6?

    I have no problem making an action of signature if I pick a font and then type in my name,

    but to make a real action of my signature seems impossible.

    Hello

    There is a very cool technique to do by your signature in a Photoshop brush.  Once this is a brush, you can change the size and place the signature everywhere where you want.

    Google "Photoshop brush signature" or something similar and you will see a lot of tutorials.  Try this one:

    Photoshop reference guide | Creating a custom brush Signature | Peachpit

    Basically, you sign your signature on a blank piece of paper, then you scan in a JPG or TIFF file, then you open that file in PS to create a brush.

    I hope this helps.

    John

  • After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    You can batch process using the image processor script and no user action should still be included in the process.  Check out our menu file > Scripts > image processor.

  • Can I create an action to move the last page to the first?  I can only find how to manually drag the pages, and I need to make it simpler when there are a lot of pages.

    Can I create an action to move the last page to the first?  I can only find how to manually drag the pages, and I need to make it simpler when there are a lot of pages.

    Yes, you can do it using a script. This code should do the trick:

    this.movePage (this.numPages - 1, -1);

  • How to create action links in OBIEE 10.1.3.4.1

    Hi gururs,


    I have a requirement where they need an action link to sibel data but in 10 g it has no option in the Woods down the value for values coloumn interaction, how to create it in 10g can tell me all the step by step procedure?

    You asked OBI sitting OBIEE 10 g Platform and also the integration of OBIEE with Siebel CRM.

    Reference http://download.oracle.com/docs/cd/E14847_01/bia.796/e14843/anyinstadmnappintegrate.htm#i1011592

    Once you have the configuration of integration, you get the action link to the terms of the interaction of the value of column in OBIEE.

    Hope its clear

  • How to create the drop-down list Actions?

    Hello

    I was wondering how to create this list drop-down list action in Adobe Livecycle when I choose a list item, it shows some fields of text under it.

    That is to say.

    Im having a drop down list which is having 2 1 list items is Yes and 2nd is no.

    Untitled.png

    Now, if I want to show some fields of text under it when I choose Yes and hide certain text fields when I choose No, what should I do?

    I also wanted to know that how to display the text fields in the pop-up box when I choose Yes.

    Thanks in advance!

    When you change the layout of a document in some way, you must save the PDF in dynamic PDF. Your currently saved him in the designer as a static pdf that's why nothing happens. Just do a file-> save as and select Dynamic PDF from the list. When you preview it the next time it will be set dynamic pdf.

Maybe you are looking for