How to refer table bean in button action

Hi,
I'm new to adf, but having good knowledge in OAF.
In OAF i use to refer a component by using
OATableBean tbl=(OATableBean)webBean.findChildRecursive("<component id>");
now i can handle my table using tbl object.
Like the above how to handle a table in ADF.
Thanks a lot in advance,
Sundar

No... for refering the particular component in the bean -- you would need to bind the component from the UI page to the managed bean.
Sample.jspx:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document title="Sample.jspx" id="d1">
<af:form id="f1">
<af:commandButton text="commandButton 1" id="cb1" *binding="#{SampleBean.button1}"/>*
<af:commandButton text="commandButton 2" id="cb2" *binding="#{SampleBean.button2}"/>*
</af:form>
</af:document>
</f:view>
</jsp:root>
*SampleBean.java:*
package com.samples.view;
import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
public class SampleBean {
private RichCommandButton button1;
private RichCommandButton button2;
public SampleBean() {
public void setButton1(RichCommandButton button1) {
this.button1 = button1;
public RichCommandButton getButton1() {
return button1;
public void setButton2(RichCommandButton button2) {
this.button2 = button2;
public RichCommandButton getButton2() {
return button2;
Thanks,
Navaneeth

Similar Messages

  • How to use the cases in button action?

    Hi Experts,
    I want to get a prompt message if the field is empty.I got it but at the same time if the field is filled I want the other action to be performed that is to call a BAPI and give me output.How can I give two events for the same action.
    How to use the cases in button action?
    So, please guide me.Urgent need
    Regards
    Nutan

    Hi Nutan,
    if I understand you, then you have a simple validation. Therefore you can use the validation functionality of VC for your components. An alternative could be by writing a new ABAP RFC function module like:
    BAPI Input parameters as input and BAPI output parameters as output and an additional return code or string for a message:
    IF I_FIELD IS INITIAL.
      E_RETURN_CODE = "THE FIELD IS EMPTY."
    ELSE.
      CALL FUNCTION <YOUR_BAPI>
      <BAPI PARAMETERS>
    ENDIF.
    I hope that helps.
    Best Regards,
    Marcel

  • How to intercept the InCopy 'Save' button action?

    Hi,
    I have an InCopy plug-in that can successfully intercept ‘Save’ actions from the File->Save menu (using an Action Filter).
    But in InCopy there is also a Command Bar that contains a ‘Save’ button. The problem is that I cannot work out how to intercept this button action from within the plug-in code.
    I have tried ‘Spy’ and tracing events and so far there does not appear to be any clue to what I should be intercepting to achieve this.
    (the button action does not appear to trigger a FileSave action... which is what I was hoping it would do).

    Thanks for the reply, I am beginning to think that I need to do something similar.
    Did you disable the button via code?
    I know that the class id (boss) for this button is kSaveButtonBoss.
    Regards
    Malcolm

  • How to refresh table column during button method call ?

    Hi,
    I have one table on my screen in which there are 5 rows.
    One of the column of this table is Status with initial value Not Completed.
    Now when I press submit button my 5 processes are started in for loop one by one.
    After completion of 1st process, I am updating 1st row status with Completed and vise a versa.
    But change is reflected on table after by method call over means if my submit action take 5 minutes to finish all 5 process than after 5 minutes, I can see all rows with status Completed while I want it to reflect as soon as I set its status.
    How can I do this ?
    regards,
    devang

    .. or break up the method in 5 methods (for each process a separate method) and with you button you call the first method. then when at the end of the method you call a javascript which updates the first column to completed and the js calls the second method (with queue of client event and serverListener) ... and so on and so on.
    Really not so cool idea but I think it's achievable:)

  • How to map GUI Bean with struts action form?

    Hi,
    I am new to struts and I have to integrate a GUI Based Bean to struts actionform. I am desperately looking for some tips. I would be much gratefull.
    See ya :)

    Hello.
    public vlass MyForm extends ActionForm {
    private MyBean myBean;
    public MyBean getMyBean() {
    return myBean;
    public void setMyBean(MyBean myBean) {
    this.myBean = myBean;
    }

  • ***How to Invoke backing bean method by DOUBLE-CLICK the table ROW!!***

    Hi,
    How can I collect the selected row value & navigate to next page by DOUBLE-CLICK the result table row.
    My application got searchResult page where I am displaying the list of user in result table. Then selecting any one row and navigating to master details page by clicking the continue button. Button Action method will collect the selected row userID which I am forwarding to the masterDetails page.
    Same functionality I want to do by double click the row instead of clicking the button!!. I want to trigger the backing bean method if the user double click the row basically. Please help me in this how to do this?
    Current button action method:
    *public String userSelected() {*
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    return "continue";
    *}*

    Puthanampatti ,
    Yes, I am using the same. Below is my code. I am trying to get the object of the MAIN jspx page region (where I am displaying the fragments) and refresh the one. But cant able to get the object for the region it is returning null. without refresh seems the navigation wont work.
    public void doDbClick(ClientEvent clientEvent) {
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    try{
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "continue");
    System.out.println("region obj -->" +facesCtx.getViewRoot().findComponent("advse1"));
    // Refresh the current region; advse1 is the id of the region component inside jspx page
    AdfFacesContext.getCurrentInstance().addPartialTarget(facesCtx.getViewRoot().findComponent("advse1"));
    catch(Exception e){
    System.out.println("Error is: " +e);
    Is this correct coding to get the region object?? actually the "result table" and "Master details" are 2 different fragments which are linked with task-flow and the task flow is part of main jspx page as a region. I am using that region ID to get the obj, but cant able to get so....!!! any idea

  • Command Button action is bean method.How to pass parameter or reference ID?

    JDEV11gR1PS1/ADF
    A command button action's is bean method, as follows:
    <af:commandMenuItem id="gbl_cmi_1" action="#{tbBean.action1}"/> Bean code is something like
    public String action1() throws IOException {
    if (id.equals.("gbl_cmi_1"))...
    }Therefore, I'd like to be able to find out what the commandButton's ID is, for use in evaluation, etc.
    The reason being is that multiple commandButtons are actually being built dynamically as well, and the action may be a URL redirect. Therefore, I'm using the id to lookup what URL to redirect to.
    Ideas?
    Thanks.

    Hi,
    I think you can use f:attribute inside your commandButton.
    We use f:attribute inside button or link which hold a name/ value and we can read the value from backing bean as :
    public void addItemToCart(ActionEvent evt) {// this the actionListener of button or link
    Map attributes = evt.getComponent().getAttributes();
    String productId = attributes.get("attributeName");
    } Sameh Nassar

  • How show popup on filedownload button action

    Hi Experts,
    Working on jdev 11.1.1.3.0, ADF BC with rich faces.
    I have requirement in my application like i need to show popup and at the same time need to download file. like on selected rows in the table i have validation on each row, if the validation failed rows i need to show in popup to user at the same time i have validation success rows also those rows i need to generate a file and that file i need to download.
    i have written logic in the command button which has fileDownload, here remaing logic is working fine except showing popup. can any one tell me how to solve this issue.
    Edited by: user5802014 on Aug 19, 2010 5:57 PM

    Hi Frank,
    After chaning actionEvent.forceFullSubmit(); now everything is working fine, but now the problem is if i came from another jsff page to the current page then my file download is not happening i am getting on my browers like error on ....
    javascript:
    function customHandler(event) {
    var exportCmd = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pt_region0:1:cb1")
    var actionEvent = new AdfActionEvent(exportCmd);
    actionEvent.noResponseExpected();
    actionEvent.queue();
    Bean:
    if(downloadFile!=null){
    System.out.println("invoking downloads...............................");
    erks.addScript(context, "customHandler();");
    } if (requestClause != null){
    System.out.println("invoke popup");
    executeSactionCheckVO(requestClause);
    //erks.addScript(context, "showPopup();");
    ADFUtils.invokePopup(this.getP2().getClientId(FacesContext.getCurrentInstance()));
    can you please how to avoid this error or can you please tell me how to call filedownload method in another button action.

  • How to add table actions to an Advanced Table programmatically

    We have code in my CO which builds an advanced table dynamically and associates it with a VO. The table comes out looking good - the correct columns and data are displayed.
    I now want to add Table Actions for that particular dynamically created table.
    The code below builds the buttons correctly and they are built/rendered just fine.
    After adding this code to build the FlowLayout bean, add the buttons and associate the it to the TableActions of the advanced table bean, none of the buttons on the page work anymore. Each time I click any button (even if it's a page level button like 'Save' or 'Cancel'), I get the following error:
    +## Detail 0 ##+
    java.lang.NullPointerException
    +     at java.util.Hashtable.get(Hashtable.java:336)+
    I have added debug statements in by CO, but it is never even getting into the ProcessFormRequest
    Below is the code we are using. Can anyone suggest a way to have this flow layout created dynamically like this and not break all button functionality on the page?
    //Create the advanced table
    OAAdvancedTableBean tableBeanP1 = (OAAdvancedTableBean)createWebBean(pageContext, ADVANCED_TABLE_BEAN, null,"Proc1Tab");
    tableBeanP1.setViewUsageName("P100DetailsVO1");
    tableBeanP1.setNumberOfRowsDisplayed(10);
    //Create a new flow layout to be used as the table actions
    OAFlowLayoutBean tableActionBean = (OAFlowLayoutBean)createWebBean(pageContext, FLOW_LAYOUT_BEAN, null, "P1ButtonRegion");
    //Create the "Add Control Group" button for this table:
    OAButtonBean addButtonBean = (OAButtonBean)createWebBean(pageContext, BUTTON_BEAN, null, "P1AddCtrlGroup");
    FireAction FireActionAddGroup = new FireAction();
    FireActionAddGroup.setEvent("AddCtrlGroup");
    Parameter param = new Parameter();
    param.setKey("ProcedureIndex");
    param.setValue("1");
    Parameter[] params = {param};
    FireActionAddGroup.setParameters(params);
    addButtonBean.setPrimaryClientAction(FireActionAddGroup);
    addButtonBean.setText("Add Control Group");
    tableActionBean.addIndexedChild(addButtonBean);
    //Add the table actions bean to the table:
    tableBeanP1.setTableActions(tableActionBean);

    Hello Ashley,
    you are already close to the solution. In BADI QISR1 you simply fill the
    table SPECIAL_DATA e.g.like
      fieldindex = 1
      fieldname = 'FIELD1'
      fieldvalue = 'Value1'
      fieldindex = <n>
      fieldname = 'FIELD1'
      fieldvalue = 'VALUE<n>'
    Then on the Adobe form layout (Adobe Designer), you have to use the table control XFO from the standard library. Here you have to bind then the corresponding column to FIELD1.
    Best regards,
    Simon

  • How to populate form bean (Action form) from Action  (Struts)

    Hello to all..
    I have a problem populating a from bean in struts from Action class...
    What I would like is ..
    1. how can I populate a formbean from Action so when a page (JSP) with tags will be displayed some tags will be set and some no (depends on data from database)..
    example...
    look at the picture...
    http://freeweb.siol.net/peterv6i/ax1.jsp
    I have a AO2.jsp page linked to action2 and also i have a formbean with set/get methods...
    nex step.. when I call action2 I' retrive datas from my database and in Action class I would like to populate formbean which is from page AO3 (which will be displayed)..
    Is this possible? here is my code but work only for 1 user.. if there are 2 or more users on page I get internal server error (Exception)..
    this is my Action class
    public class Action2 extends Action
    public[b] ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    System.out.println("Action2");
    session = request.getSession();
    if (session.isNew()) {
    response.sendRedirect("AO2.jsp");
    AO3formbean frm = new AO3formbean(); <-- this is formbean from page AO3.jsp which I like to populate
    frm.setName("xxxxxx");
    frm.setSurname("ekekelek");
    session.setAttribute("AO3formbean", frm); <-- here I put a formbean in session
    return mapping.findForward("success");
    then the AO3.jsp page will be called which use a AO3formbean... and here problems come... If only one user use the application all is ok.. but when two or more users use the same form with different session the page will not work well.. sometimes i get exception, sometimes white page.. sometimes nonsense datas are displayed..
    Anybody know if is possibile to populate a formbean and store it in session or I must change whole code?
    for example...
    In my form i must enter a car assicurance policy number... (page AO2.jsp)..
    then in the action form I must connect to my database and retrive information from table and populate bean which is also a formbean on the page AO3 which will be desplayed.. (if I'am doing something wrong please let me know the right way)
    best regards

    http://freeweb.siol.net/peterv6i/ax1.jpg

  • Button Action and Table Visibility

    Hi,
    I have created a Submit button and a table UI.
    Requirement is
    1) Intial deployment button and table should be visible (its working fine)
    2) if i click on Submit Button, Table UI should not be visible (its working fine)
    3) if once again i click on Submit Button if Table should be visible ( How to implement this).
    i.e on Action of submit button if table is already visible it should invisible and viceversa.
    Please help.
    Regards,
    Bharath

    Hi Bharath,
        Action button code
    if(tableFlag = true)
      tableFlag = false;
    else
      tableFlag = true; 
    DoModifyView Code:
    if(tableFlag = true)
       wdContext.currentContextelement.setVisible (WDVisibility.VISIBLE);
       tableFlag = true;
    else
      wdContext.currentContextelement.setVisible (WDVisibility.NONE);
      tableFlag = false;
    Declare it static in bottom
    tableFlag = false;
    I try to do work around like this
    Regards, Suresh KB

  • How to Commit table by writting Java code in Managed Bean?

    Hi,
    Can anyone suggest me how to Commit table by writing Java code in Managed Bean?.
    I want to commit table manually after modifying in UI.
    Please suggest me guys.
    Thanks,
    Ramit Mathur

    Hi Friend Copy this two java files with same package of your bean package.
    1,*ADFUtils.java*
    package org.calwin.common.view.utils;(Your package name)
    import java.util.ArrayList;
    import java.util.List;
    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.MethodExpression;
    import javax.el.ValueExpression;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.model.binding.DCParameter;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.binding.AttributeBinding;
    import oracle.binding.BindingContainer;
    import oracle.binding.ControlBinding;
    import oracle.binding.OperationBinding;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.uicli.binding.JUCtrlValueBinding;
    * A series of convenience functions for dealing with ADF Bindings.
    * Note: Updated for JDeveloper 11
    * @author Duncan Mills
    * @author Steve Muench
    * $Id: ADFUtils.java 2513 2007-09-20 20:39:13Z ralsmith $.
    public class ADFUtils
    public static final ADFLogger _LOGGER = ADFLogger.createADFLogger(ADFUtils.class);
    * Get application module for an application module data control by name.
    * @param pName application module data control name
    * @return ApplicationModule
    public static ApplicationModule getApplicationModuleForDataControl(String pName)
    return (ApplicationModule) JSFUtils.resolveExpression("#{data." + pName + ".dataProvider}");
    * A convenience method for getting the value of a bound attribute in the
    * current page context programatically.
    * @param pAttributeName of the bound value in the pageDef
    * @return value of the attribute
    public static Object getBoundAttributeValue(String pAttributeName)
    return findControlBinding(pAttributeName).getInputValue();
    * A convenience method for setting the value of a bound attribute in the
    * context of the current page.
    * @param pAttributeName of the bound value in the pageDef
    * @param pValue to set
    public static void setBoundAttributeValue(String pAttributeName, Object pValue)
    findControlBinding(pAttributeName).setInputValue(pValue);
    * Returns the evaluated value of a pageDef parameter.
    * @param pPageDefName reference to the page definition file of the page with the parameter
    * @param pParameterName name of the pagedef parameter
    * @return evaluated value of the parameter as a String
    public static Object getPageDefParameterValue(String pPageDefName, String pParameterName)
    BindingContainer bindings = findBindingContainer(pPageDefName);
    DCParameter param = ((DCBindingContainer) bindings).findParameter(pParameterName);
    return param.getValue();
    * Convenience method to find a DCControlBinding as an AttributeBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pBindingContainer binding container
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(BindingContainer pBindingContainer, String pAttributeName)
    if (pAttributeName != null)
    if (pBindingContainer != null)
    ControlBinding ctrlBinding = pBindingContainer.getControlBinding(pAttributeName);
    if (ctrlBinding instanceof AttributeBinding)
    return (AttributeBinding) ctrlBinding;
    return null;
    * Convenience method to find a DCControlBinding as a JUCtrlValueBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(String pAttributeName)
    return findControlBinding(getBindingContainer(), pAttributeName);
    * Return the current page's binding container.
    * @return the current page's binding container
    public static BindingContainer getBindingContainer()
    return (BindingContainer) JSFUtils.resolveExpression("#{bindings}");
    * Return the Binding Container as a DCBindingContainer.
    * @return current binding container as a DCBindingContainer
    public static DCBindingContainer getDCBindingContainer()
    return (DCBindingContainer) getBindingContainer();
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute to use for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName, pDescriptionAttrName);
    * Get List of attribute values for an iterator.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName value attribute to use
    * @return List of attribute values for an iterator
    public static List attributeListForIterator(String pIteratorName, String pValueAttrName)
    return attributeListForIterator(findIterator(pIteratorName), pValueAttrName);
    * Get List of Key objects for rows in an iterator.
    * @param pIteratorName iterabot binding name
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(String pIteratorName)
    return keyListForIterator(findIterator(pIteratorName));
    * Get List of Key objects for rows in an iterator.
    * @param pIterator iterator binding
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(DCIteratorBinding pIterator)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getKey());
    return attributeList;
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIteratorName iterator binding name
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(String pIteratorName, String pKeyAttrName)
    return keyAttrListForIterator(findIterator(pIteratorName), pKeyAttrName);
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIterator iterator binding
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(DCIteratorBinding pIterator, String pKeyAttrName)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(new Key(new Object[]
    { r.getAttribute(pKeyAttrName) }));
    return attributeList;
    * Get a List of attribute values for an iterator.
    * @param pIterator iterator binding
    * @param pValueAttrName name of value attribute to use
    * @return List of attribute values
    public static List attributeListForIterator(DCIteratorBinding pIterator, String pValueAttrName)
    List attributeList = new ArrayList();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getAttribute(pValueAttrName));
    return attributeList;
    * Find an iterator binding in the current binding container by name.
    * @param pName iterator binding name
    * @return iterator binding
    public static DCIteratorBinding findIterator(String pName)
    DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(pName);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pName + "' not found");
    return iter;
    * @param pBindingContainer
    * @param pIterator
    * @return
    public static DCIteratorBinding findIterator(String pBindingContainer, String pIterator)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContainer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContainer + "' not found");
    DCIteratorBinding iter = bindings.findIteratorBinding(pIterator);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pIterator + "' not found");
    return iter;
    * @param pName
    * @return
    public static JUCtrlValueBinding findCtrlBinding(String pName)
    JUCtrlValueBinding rowBinding = (JUCtrlValueBinding) getDCBindingContainer().findCtrlBinding(pName);
    if (rowBinding == null)
    throw new RuntimeException("CtrlBinding " + pName + "' not found");
    return rowBinding;
    * Find an operation binding in the current binding container by name.
    * @param pName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pName)
    OperationBinding op = getDCBindingContainer().getOperationBinding(pName);
    if (op == null)
    throw new RuntimeException("Operation '" + pName + "' not found");
    return op;
    * Find an operation binding in the current binding container by name.
    * @param pBindingContianer binding container name
    * @param pOpName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pBindingContianer, String pOpName)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContianer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContianer + "' not found");
    OperationBinding op = bindings.getOperationBinding(pOpName);
    if (op == null)
    throw new RuntimeException("Operation '" + pOpName + "' not found");
    return op;
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName, pDescriptionAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return List of ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Find the BindingContainer for a page definition by name.
    * Typically used to refer eagerly to page definition parameters. It is
    * not best practice to reference or set bindings in binding containers
    * that are not the one for the current page.
    * @param pPageDefName name of the page defintion XML file to use
    * @return BindingContainer ref for the named definition
    private static BindingContainer findBindingContainer(String pPageDefName)
    BindingContext bctx = getDCBindingContainer().getBindingContext();
    BindingContainer foundContainer = bctx.findBindingContainer(pPageDefName);
    return foundContainer;
    * @param pOpList
    public static void printOperationBindingExceptions(List pOpList)
    if (pOpList != null && !pOpList.isEmpty())
    for (Object error: pOpList)
    _LOGGER.severe(error.toString());
    * Programmatic invocation of a method that an EL evaluates to.
    * The method must not take any parameters.
    * @param pEl EL of the method to invoke
    * @return Object that the method returns
    public static Object invokeEL(String pEl)
    return invokeEL(pEl, new Class[0], new Object[0]);
    * Programmatic invocation of a method that an EL evaluates to.
    * @param pEl EL of the method to invoke
    * @param pParamTypes Array of Class defining the types of the parameters
    * @param pParams Array of Object defining the values of the parametrs
    * @return Object that the method returns
    public static Object invokeEL(String pEl, Class[] pParamTypes, Object[] pParams)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    MethodExpression exp = expressionFactory.createMethodExpression(elContext, pEl, Object.class, pParamTypes);
    return exp.invoke(elContext, pParams);
    * Sets the EL Expression with the value.
    * @param pEl EL Expression for which the value to be assigned.
    * @param pVal Value to be assigned.
    public static void setEL(String pEl, Object pVal)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    exp.setValue(elContext, pVal);
    * Evaluates the EL Expression and returns its value.
    * @param pEl Expression to be evaluated.
    * @return Value of the expression as Object.
    public static Object evaluateEL(String pEl)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    return exp.getValue(elContext);
    }

  • Table Button Action - never executes

    Hey Everyone, I have a really strange problem.
    I have a table, which is bound to an ObjectArrayDataProvider. Everything works fine. I then added a command button to one of the colums and bound its action property to the backing bean.
    The problem is; when ever I click the button - the code is never executed.
    <ui:button action="#{Monitor.button_Remove_action}" binding="#{Monitor.button_Remove}" id="button_Remove" text="Remove"/>
    public String button_Remove_action() {
             * Never reaches this code
               doAmazingThings(true);
               return null;
        }

    I am perplexed. Are you using virtual forms? Not
    that that would explain it.
    Do you have the immediate property set to true
    (checked) for any component?
    Do you bypass any phases by calling renderResponse()
    or responseComplete()?No, No and No.
    I have brought the page down to my 1 table with 1 rowgroup with 1 column containing the 1 button.
    Still no go!
    I am dynamically populating the table, if that would matter? In prerender I set the array:
    objectArrayDataProvider1.setArray(getServers());

  • How to refer to Excel tables (ListObjects) in PowerPivot

    I am trying to figure out how to import ListObjects in PP.
    As far as I can tell PP does not seem to "see" range names that refer to entire ListObjects i.e. =T_DTL[#All], while it "sees" ranges that refer to direct cells i.e. =Dtl!$O$3:$V$46.
    Is that correct and is there a way to work around it?
    The reason I am asking is that the tables I want to work with do not necessarily start on line 1 and PP references entire worksheets i.e. Dtl$, as per my example above.I tried different approaches with dynamic ranges but PP refuses to present them as choices
    while Selecting Tables and Views. The only way to achieve what I need is by creating named ranges with hardcoded start and end, which is a bit odd since Tables (ListObjects) are a powerful tool since Excel 2007 and I would expect a stronger integration with
    other powerful tools such as PowerPivot.Apart from the overhead of having to go through each workbook and define a range for every Table I wish to use.
    Am I missing something here?

    My PowerPivot attempt was abruptly broken about a month ago, hence my very late reply.
    Peter is quoting VBA statements on how to refer to a Table (ListObject), which is familiar to me as I am also writing VBA code. Unfortunately my problem is in interactive mode, not in code execution.
    When we open a file's PowerPivot window from within Excel we are prompted to select the tables we want to work with. That is where I cannot see my ListObjects / Tables. I am presented with all ranges that PowerPivot sees as declared in the file that I am
    opening (as in Formulas / Names Manager) EXCEPT for the ListObjects. Those are missing.
    Try it if you will and let me know if this behavior is relevant only to my installation or to yours as well.
    George Thalassinos

  • How to refer a particular filed of a Table data type

    DECLARE
              CURSOR C1 IS SELECT
                                       GLUSR_USR.GLUSR_USR_ID BYER_ID,
                                       GLUSR_USR.GLUSR_USR_ADD1 BUYER_ADD
              FROM
                   GLUSR_USR
              WHERE
                   ROWNUM<=5;
    TYPE TBL_TYPE IS TABLE OF C1%ROWTYPE;
    TBL TBL_TYPE;
    BEGIN
         OPEN C1;
         FETCH C1 BULK COLLECT INTO TBL;
         CLOSE C1;
         FORALL I IN 1..TBL.COUNT
         INSERT INTO SATYA_TEMP VALUES(TBL.BYER_ID,TBL.BUYER_ADD);(How to use a particular field of TBL in this case).
         --INSERT INTO SATYA_TEMP VALUES TBL(I); (I know this)
    END;
    My question is how to refer a particular field of table type..?
    Please suggest.

    Then you have to create a record type and give all the columns inside it as given below.
    Then you can create a variable for this type and use it
    Type IS RECORD OF
    columnname1 table_name.column_name1%type,
    columnname2 table_name.column_name2%type,
    columnname3 table_name.column_name3%type,
    OR Use
    rec table%ROWTYPE;
    Edited by: Geek vishal on Aug 4, 2011 12:54 PM

Maybe you are looking for

  • Using Boolen Operations in Query Designer

    Hi All, Below are the new formula which i have created in query designer 1.Number of years of service 2.Gratuity if years of service is greater than 20. 3.Gratuity if years of service is lessthan 20. Now in report output i need to display Gratuity if

  • Was this database migrated from dev or prod?

    We have several environments (e.g., development, staging, test, training, production).  When migrating a production database to a new version of SQL, we also migrate the related environments. Sometimes the developers want a refresh from production in

  • Along the lines of How to burn DVD's

    I was trying to burn a simple data CD. Dragged the files to the CD in Finder saw the alias, hit burn. After a moment (spinning pinwheel) I get an error message saying: Burning the disc failed because one or more items in "Desktop.fpbf" could not be r

  • Performance issue of Security Audit log

    Hello,           My client would like to activate the Security Audit log on his system. However he will like to know whether there could be any performance issue when activating it. Since I do not have any prior experience, can you please give me you

  • Trying to insert files

    I am trying to create one PDF document from several PDF files that I have.  Each time I try to insert any file, the only thing it does is replicate my first page.  I am using Acrobat 9. I go to Document --> Insert Pages --> From File --> choose my fi