How to get the command button component id  in bean class?

Hi All,
I'm using adf 11g.
I'm having three command button , which have some similar code to use on fire of these buttons.
if it possible to catch the component id in bean , i can use the code with little parameter passing .

Hi,
You can get the command button from the actionEvent (if you are writing a generic actionListener) and from it, you can get the Text of the command button. Using which, you can process accordingly.
If the text also same, then set some client attribute for the command button (check out [url http://docs.oracle.com/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_clientAttribute.html]af:clientAttribute), and from the actionListener, get the client attribute using getClientAttribute method and process accordingly.
-Arun

Similar Messages

  • How to get the list of component?

        How to get the list of component through java API in Adobe CQ5?

    There are probably more than a few ways, but here is a little component .jsp code that uses the jcr query api to pull out all the components and list them on a page.  If I know CQ, there might be a way to ask for a list of components another way though, maybe through another API, or possibly a .json url, I might remember reading something about that, somewhere, lol, but this at least gets you the list in a somewhat simple way.
    Code Example:
    <%@include file="/apps/psul/components/global.jsp"%>
    <%@ page import="javax.jcr.*,
                       javax.jcr.query.*"
    %>
    <%
       // Login to create an anonymous session on the default workspace
       Session session = resourceResolver.adaptTo(Session.class);
           //Declare a query for all the components in the system
           String SQL = "select * from cq:Component";
    //side note: if you want just the components in your site area, then make the query more like below...
    //  SQL = "select * from cq:Component where jcr:path like '/apps/yoursitename/%'";
           QueryManager qm = session.getWorkspace().getQueryManager();
           Query query = qm.createQuery(SQL, Query.SQL);
           QueryResult result = query.execute();
           NodeIterator nodes = result.getNodes();
           while (nodes.hasNext()) {
               Node node = (Node)nodes.next();
               %>
                    <p><%=node.getName() %> (<b><%=node.getPath() %></b>)</p>
    <%     } %>

  • How to get the current JSF phase in backing bean?

    How to get the current JSF phase in backing bean?
    Edited by: jimmy6 on Nov 27, 2007 7:27 AM

    I am using phasetracker to trace it also.I want to know whether it is it render response phase. I know FacesContext.getCurrentInstance().getRenderResponse() work for normal jsf component but it will not work for qiupukit datatable. FacesContext.getCurrentInstance().getRenderResponse() will not return true in the following phase. Why?
    [ INFO] 27-11-07 16:20:21 : BEFORE RENDER_RESPONSE(6) (http-80-Processor23)
    I want the 'get' method of datatable being called in response phase to reduce the number of calling because i put the query in 'get' method there. Actually i still straggling with the best practice to code the datatable...

  • How to get the UserTransaction object in  stateless session bean

    Hi, I am using jboss server and jdk5 version and using EJB.
    My Application flow :
    JSP à Action(Struts) à Service Locator à Session bean à Entity Bean(cmp) à DB.
    I tried to get the UserTransaction object in my Action. Its my code.
    InitialContext ctx = new InitialContext();
    UserTransaction uTrans = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    After used uTrans.begin(),uTrans.commit() and uTrans. rollback () also.
    Its working fine .
    But, I used the the same code inside in my session bean its not working.
    Stateless Session Manager Bean code :
    public class SampleManagerBean implements SessionBean {
    public void ejbCreate() throws CreateException {  }
    public void ejbRemove() {  }
    public void ejbActivate() {   }
    public void ejbPassivate() {   }
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
         public void createSample() throws EJBException
         try{
                   InitialContext ctx = new InitialContext();
                   UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
              }catch(Exception e) {
              System.out.println(“ Exception === > “+e)
    Its throws the error ie: javax.naming.NameNotFoundException: UserTransaction not bound
    How to get the UserTransaction object in my session bean. Kindly give solution the above errors.
    - Thendral

    first of all, you could just use sessionContext.getUserTransaction(). however, that would only work if your bean is using bean-managed transactions. the default is container-managed transaction, in which case you cannot get a UserTransaction object. if you want to manage transactions, you need to add the TransactionManagementType.BEAN annotation to your ejb.

  • How to get the parent window in sub-child controller class in javafx?

    how to get the parent window in sub-child controller class in javafx?

    You can get the window in which a node is contained with
    Window window = node.getScene().getWindow();Depending when this is invoked, you might want to check the Scene is not null before calling getWindow().
    If the window is a stage that is owned by another window, you can get the "parent" or "owner" window with
    Window owner = null ;
    if (window instanceof Stage) {
      Stage stage = (Stage) window ;
      owner = stage.getOwner();
    }

  • How to get the Search Button from RichQuery Component

    Hello All,
    How can I get the Search Button from RichQuery Componennt, I could do not locate from getChildren, getFacets
    any ideas ?
    Thank you,

    Not even able to get it from getViewRoot findComponent("clientId");
    which is not good, RichQuery component can be inside popup and I do not want to add an extra button just to close the popup window
    Any ideas ?
    Thank you,

  • How to get the Dynamic UI component value from JSFF page to any managedbean

    HI ,
    We have list of bean objects in jSF page we are iterating the list of bean using the forEach loop and displaying the value into Input type text (UI component) value filed .
    If we try to get the UI component value in Managed bean we are not getting the dynamic values .
    The below piece of code used to retrieve the dynamic values from the JSF page doesn't have any form :
    UIComponent component = null;
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext != null) {
    UIComponent root = facesContext.getViewRoot();
    component = findComponent(root, componentId);
    then component type casting to the based on UI component which we trying to access and getting the value as " NULL " ..Please let me know how to get the dynamic values form the JSF ?
    Please let me know if any other approach or any changes required on above ?
    Thanks

    Hi,
    the root problem is this
    <h:inputText id="it3" value="#{familyList.ctn}" />
    <tr:commandButton text="Save" id="cb3"Note how each row writes to the same managed bean property, thus showing the same data. Instead your managed bean should expose a HashMap property that you then apply values to using a key/value pair. The key could be the ID of the field, which then you also should dynamically define e.g. cb<rowIndx>. The command button could then have a f:attribute assigned that has the row HahMap key as a value. This way you truly create value instances for the object
    Frank

  • How to get the back button if we to go the 2nd drill down report??

    Hi,
    I have a drill down report for the main report. And have detailed drill down as in 1st report>2nd report>3rd report.
    But once i goto drill down, the return button is there which directs to main report i.e. 2>1,
    But once i goto 3rd, i do not get the back button so that i can access reports in 3>2>1, instead its going directly to 1st from 3rd.
    hope i have made the point clear.
    Someone suggest me how do i get the back button??
    Thanks!!

    use the below code in Narrative view
    <script&gt;
    function goBack()
    window.history.back()
    </script&gt;
    <input type="button" value="Back" onclick="goBack()"&gt;
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 13, 2013 12:08 AM

  • How to get the printer button to appear

    The buttons on my printer should say scan, copy & print.
    They are now saying scan, copy & copy.   how do I get the print button back, as I cannot print

    Hi,
    What is the exact printer model? is it the HP Photosmart C4385?
    The following model does not provide any fax capabilities as you may find by its datasheet below:
    http://cdn.cnetcontent.com/b6/14/b6144c8e-0a16-4ce3-a66d-2eb03e86f4d9.pdf
    If I misunderstood your pritner model, please clarify the exact model.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How to get the command line interface for WRT160NL router

    hi,
    How can I get the command line interface for WRT160NL router. please suggest.

    If you’re trying to access the web-based interface of your router, just use its default IP address (192.168.1.1). The Username is left blank and the Password is "admin". Here’s a quick link on how to do that.

  • ADF Faces: How to get the ADF BindingContainer in a managed bean?

    Hi,
    I not sure how to get the BindingContainer instance from inside of a managed bean method. I have tried the following config, but it does not work in all situations.
      <managed-bean>
        <managed-bean-name>backing_showBooks</managed-bean-name>
        <managed-bean-class>view.backing.ShowBooks</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
          <property-name>bindingContainer</property-name>
          <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
          <value>#{bindings}</value>
        </managed-property>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1showBooks.jsp-->
      </managed-bean>When an ActionListener- method of my ShowBooks bean is called the property bindingContainer is NULL!!
    Is there a save way to get the BindingContainer in my bean??
    Any hints are welcome.
    Thanks,
    Markus

    Maybe I just need another pair of eyes but when I set this up as explained and watch it in the debugger my method public void setBindingContainer(DCBindingContainer bc) gets called but bc is null. Can anyone help?
    Thanks
    Backing Bean-
    private DCBindingContainer bindingContainer;
    public void setBindingContainer(DCBindingContainer bc) {
    this.bindingContainer = bc;
    public DCBindingContainer getBindings() {
    return bindingContainer;
    //I just threw this method on there in case I was missing something & I also
    //tried using a getBindingContainer method above but that didn;t work.
    public void setBindings(DCBindingContainer bindings) {
    this.bindingContainer = bindings;
    adf-faces.conf entry
    <managed-bean>
    <managed-bean-name>backing_VunerabilityDetail</managed-bean-name>
    <managed-bean-class>viewcontroller.backing.VunerabilityDetail</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>bindingContainer</property-name>
    <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
    <value>#{bindings}</value>
    </managed-property>
    <!--oracle-jdev-comment:managed-bean-jsp-link:1VunerabilityDetail.jsp-->
    </managed-bean>

  • How to get the 'info' button working again in Spotlight?

    The 'info' button to get info about an item in the search results window of Spotlight is no longer working for me. I have tried reindexing and trashing the preference file in the user library, with no luck. Any idea how to get this functionality back?
    Thanks
    Chris

    I have the same problem after installing Safari 3, the more info icon in the spotlight results no longer works.
    Dan

  • How to get the None button on my account payment page

    I would like to remove my old credit card info from my account and start using only gift and prepaid iTune cards.  However, the None button is not showing on the page.  Is there some sort of pathway that I need to go through to get the button or do I have to have some other support for this function?

    I NEED TO GET MY ITUNE CARD TO MY ACCOUNT

  • Anyone know how to get the "emojes" button off?

    I dislike emojes.  I like being able to dictate my messages.  After the recent update the mic symbol next to the space bar has been replaced with a Happy Face.  Anyone know how I can get the mic back?

    Dictation is not listed as an option to enable. But I was able to get rid of the emoji keyboard. Yay!  Still no "mic" for dictation, though.

  • How to get the status of Javascript inside a java class

    Hi,
    Can anybody let me know the way by which I can get the status of Javascript (enabled/disabled) in browser inside a Java Class.
    I do have a trick -
    <input type="hidden" name="jstatus" value="disabled">
    <input type="submit" name="submit" onClick="doChecking()">
    <script language= javascript>
    function doChecking()
    document.form.jstatus.value = "enabled";
    submit();
    Now inside our java class we can check the value of "jstatus" if it is disabled then it is disabled else it is enabled.
    Ha ha wat a stupid trick...... ;-)
    Plz let me know a real approach to determine the Javascript status.
    Cheers !!!
    Irshad

    Actually, I don't think that trick is stupid at all. Javascript and Java are normally in no way related (javascript is just plain text content to your servlets / jsp's). So a good way of getting such information to your server is submitting it, like you do.
    Another possibility would be to do it with Ajax in the background, but that all depends on what you do with the information.

Maybe you are looking for

  • Using Printable with an Image 5TH POSTING

    I am trying to print out an image with the following code: public class print_panel extends JPanel implements Printable{ Image the_image; public print_panel(Image i){ the_image = i; public int print(Graphics g, PageFormat pf, int p) throws PrinterExc

  • [solved] Troubleshoot ssh with keys (works from LAN, not WAN)

    I'm trying to set up ssh so that I can connect to my work computer from home. It is pretty much essential that I keep the work box as secure as possible at all times. (So I can't disable the firewall, come home and test it because IT would not be at

  • How to delete account members with no data (EPMA)

    Hi all, I loaded an account hierarchy coming from SAP in EPMA and now that I have the data into my cube I need to remove all the branches which bottom have no data. I have a list of all used account, and the EPMA ads file, how would you approach this

  • Formatting a date like: Friday 24th January

    Formatting a date like: Friday 24th January Is there any way using the Java API to get the 'th' or 'st' bits on the numbers. I can't see it in java.text.SimpleDateFormat Thanks.

  • Why Mac crashes when I run the clean speech ring of osx and then run the RestoreTime Machine?

    Why Mac crashes when I run the clean speech ring of osx and then run the RestoreTime Machine? Could it be that I run restore the setup from a usb drive. I've done thisbefore and when it has not been a problem. Does anyone have a good answer on this s