[ADF, JDev12.1.3] af:table - how to select by program level 1 (on the updating of the table)?

Hallo,

I have an af:table that displays the result of a custom search form.

I need to update the properties of some of the buttons every time that a row in the table is selected.

I would like to handle this in a SelectionListener I associated with the table.

public void myTableSelectionListener(SelectionEvent selectionEvent) {
  ELUtils.invokeEL("#{bindings.SearchEmployee1.collectionModel.makeCurrent}",
                   new Class[] { SelectionEvent.class },
                   new Object[] { selectionEvent });
  Row selectedRow = (Row) ELUtils.evaluateEL("#{bindings.SearchEmployees1Iterator.currentRow}");
  System.out.println(selectedRow.getAttribute("Name") + " - " + selectedRow.getAttribute("Surname"));
}

I noticed the System.out.println prints the values of the selected line only when the user clicks on a line while that no value does print when the grid is recharged after clicking the search button.

To resolve this problem, I guess I need to select by program level 1 in the table whenever the grid is charged, but I have not found a working method to do this.

You kindly explain how to select by program level 1 of an af:table?

Thank you

Federico

Hi Federico
only for research you can handle this in your action of the search button (because your selection listener code works for another action), after research get the current row of your table (it would be the first rows) and run your code

If you are using af:query, then override default query listener to run custom code

See -Ashish Awasthi (Jdev/ADF) Blog: the substitution of the listener default query, validation in the field of af: query-Oracle ADF

Thank you

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] af:table: how to perform certain actions when the user clicks on a line?

    Hallo,

    When a line of my af:table is selected, I'd like to perform actions; in particular, I have to toggle a button based on the values of a group of fields to the selected line.

    What are the possible approaches to achieve this?

    Thank you

    Federico

    Use a generic selection listener (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/23-generic-table-selection-listener-169162.pdf) and call your actions here before or after the selection of the new current line.

    Timo

  • How to select when several shapes overlap in the page layout view

    When changing the opinion of EM structure layout, it is common to have several forms and/or port objects overlap in the same place. How to choose the object you want in this case?

    In general in any layout view, when you select objects that overlap, the smaller form will be selected by default.  Hold down the Ctrl + Shift, and then to the same place to scroll through all the objects that are under the mouse.

  • I have a spot for use at other comments, how do I install programs like word on the comments page

    I have a guest spot for use to third parties, on my computor. How can I install programs like 'Word' and e-mail on the page 'comments '.

    There are many limitations on the guest account, this is why you cannot see Word or are unable to open it.

    Instead of using the guest account, create a new standard user account, it should provide access to most of the programs, but is still limited.

    http://support.Microsoft.com/kb/279783

  • I'm running mse how to stop a program at startup to the top

    How do I change start programs when running microsoft security essentials,

    Use windows defender, but understand that this is blocked during execution of mse.

    also my pc is very slow the beginning upward since installing mse, is this normal?

    How do I change start programs when running microsoft security essentials,

    Use windows defender, but understand that this is blocked during execution of mse.

    also my pc is very slow the beginning upward since installing mse, is this normal?

    The quickest way to disable a startup program, in addition to the use of Windows Defender...

    Start button > in the search box, type msconfig > press > start up tab > here is the list of startup programs.

    To disable, uncheck the box in front.

    To activate... check the box opposite.

    Be careful, make sure you know for sure the program that you turn off will NOT affect the performance of the system.

  • How to know which programs are connecting to the internet?

    Hello

    How to know which programs or files are connected to the internet, including files and programs Microsoft?

    Thanks and greetings

    In Windows 7, use Ctrl + Shift + Esc instead of Ctrl + Alt + Delete. It lets you in the Manager of tasks more quickly. Select the performance tab, click the resource monitor and Network tab.  Network connections are included.

  • [ADF, JDev12.1.3] af:table: new record... is possible to set up where it should appear?

    Hallo,

    When I use the operation CreateInsert on an af:table the new record (often... not always) appears at the top of the table.

    If the selected line is at the bottom of the display: table, the vertical scroll bar is not auto-scroll to the top of the table so that the user cannot see where the new line to fill.

    How can I solve this?

    Is it also possible to make the new line to fill that appear at the bottom of the table?

    Thank you

    Federico

    Here are two articles on this subject

    http://mjabr.WordPress.com/2011/07/02/how-to-control-the-location-of-the-new-row-in-aftable/

    And

    Luc Bors Weblog: ADF 11g: how to control when a new row is inserted

    Timo

  • [ADF, JDev12.1.3] af:table: why validation occurs whenever I add a new line of CreateInsert?

    Hallo,

    do you have any idea why in my af:table validation occurs as soos I added a new line of the CreateInsert operation?

    I click on the CreateInsert button and in the line just added the validation message is shown.

    In other tables that I have on the same page, this does not happen.

    Another note: in the other af:tables I can insert 1 more new records of CreateInsert and post them all while in this af:table this does not work well.

    If I CreateInsert a new record, I fill it and then, without committing, I CreateInsert againg... a new record is added but denomination (see picture) of the previously completed registration field is empty

    Thank you

    Federico

    PS

    After clerks/rollbacking it is recommended to rerun the iterators?

    Well, the adf has bugs (or "features" in the terminology of the Oracle)

    You can try to experiment with the property "partialSubmit" button, or "changeEventPolicy = none" on the iterator.

    PS

    After clerks/rollbacking it is recommended to rerun the iterators?

    Generally no.

    By default, adf will be re - run your after cancellation.

    Dario

  • [ADF, JDev12.1.3] 'Enter LOV': how to show the magnifying glass (but not the inputText)?

    Hallo,

    I have associated with an LOV entry field (FieldA) and I configured the LOV to return the value for the field LOV itself plus other 2 values to fill other 2 fields (FieldB and FieldC).

    So I have:

    FieldA |... | (Magnifier)

    FieldB |... |

    FieldC |... |

    I would like to see the magnifying of the LOV FieldA field but not his inputText.

    Is it possible to do this? If so, how?

    Could I choose the magnifying glass should appear next to what area?

    Thank you

    Federico

    You can add: contentStyle = "" display: none; "to your component LOV;"

    Dario

  • [ADF, JDev12.1.3] Why dynamic region is not spend if I re - call the currently displayed workflow?

    Hallo,

    I have a page with a dynamic region that is managed by a range backingBean bean.

    Functions "startBtf...". "are called when a menu item is clicked.

    The workflow as BTF3 is called by two different functions and each function passes a different value (used by a component of router) to the workflow through the hash table.

    The problem is that startBtf3_Search is called after the startBtf3_Create (and vice versa) the dynamic region is not updated.

    How can I solve this problem?

    Thank you

    Federico

    public class MainDynamicRegion {
      private HashMap parameters = new HashMap();
    
      public MainDynamicRegion() {
      }
    
      public TaskFlowId getDynamicTaskFlowId() {
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        String currentTaskflowId = (String) adfFacesContext.getPageFlowScope().get("CurrentTaskflowId");
        if (currentTaskflowId == null || currentTaskflowId.trim().equals("") == true) {
          currentTaskflowId = "/WEB-INF/empty-btf.xml#empty-btf";
          }
        return TaskFlowId.parse(currentTaskflowId);
      }
    
      private void setCurrentTaskflowId(String currentTaskflowId) {
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.getPageFlowScope().put("CurrentTaskflowId", currentTaskflowId);
      }
    
      public void startBtf1(ActionEvent actionEvent) { 
        this.setCurrentTaskflowId("/WEB-INF/btf-1.xml#btf-1");
        this.parameters.clear();
      }
    
      public void startBtf2(ActionEvent actionEvent) { 
        this.setCurrentTaskflowId("/WEB-INF/btf-2.xml#btf-2");
        this.parameters.clear();
      }
    
      public void startBtf3_Search(ActionEvent actionEvent) {
        this.setCurrentTaskflowId("/WEB-INF/btf-3.xml#btf-3");
        this.parameters.clear();
        this.parameters.put("mode", "S");
      }
    
      public void startBtf3_Create(ActionEvent actionEvent) {
        this.setCurrentTaskflowId("/WEB-INF/btf-3.xml#btf-3");
        this.parameters.clear();
        this.parameters.put("mode", "C");
      }
    
      public void setParameters(HashMap parameters) {
        this.parameters = parameters;
      }
    
      public HashMap getParameters() {
        return parameters;
      }
    }
    

    The workflow as BTF3 is called by two different functions and each function passes a different value (used by a component of router) to the workflow through the hash table.

    The problem is that startBtf3_Search is called after the startBtf3_Create (and vice versa) the dynamic region is not updated.

    How can I solve this problem?

    You call the taskflow even without leaving the previous.

    To update the workflow, you have several options:

    -Give taskflow refresh 'ifNeeded' parameter and change the value of the input parameter (unfortunately, it is not applicable to your usecase because you use the parameter mapping and not point settings so setting change cannot be detected)

    -use the property RefreshCondition

    For more details, see: 23 by using task flows in regions (12 c (12.1.3))

    BTW,

    currentTaskflowId = "/WEB-INF/empty-btf.xml#empty-btf";
    

    Instead, you can change the return type for getDynamicTaskFlowId() to a string and use an empty string ("" ") instead of emptying the BTF (and in this case you don't need even of TaskFlowId.parse (part)).

    Dario

  • [ADF, JDev12.1.3] Scope of session bean: it can contain attributes related to the Value property of user interface components?

    Hallo,

    I have a defined session bean in which I put a string attribute that is bound to the Value property of an InputText in my testPage.

    public class SessionClass {
    
      private String text;
    
      public void setText(String text) {
        this.text = text;
      }
    
      public String getText() {
        return text;
      }
    }
    

    When I run the testPage, it is not displayed.

    Perhaps this kind of linking is not possible?

    Thank you

    Federico

    Never use prefix in scope to the standard servlet scopes (request, session, application)

    So it would be: #{sessionClass.text}

    Dario

  • How to select lines if a column has the same first and last characters?

    Hello

    I have a scenario that one of the columns in the table of the student is having names student, (Ex) John, Mary, Donald, Ana, Maria. In this case how can we write a query to retrieve lines for the values if the first and the last character of the student of identical names? Production is expected to be Donald, Ana.

    Frank answers the question in the subject of your post, but looking at your examples, I think you wanted

    WHERE lower (SUBSTR (student_name, 1, 1)) - 1 character

    low = (SUBSTR (student_name,-1)) - last character

  • How can I remove programs I already uninstalled the uninstall of a program from the list in windows 7 Home premium?

    I already uninstalled Google Drive, but it is still showing in my Uninstall list, twice. I am using Windows 7 Home Premium (SP1)

    Hello

    Refer to this link, try the steps and try it to uninstall Google drive to check if that helps:

    The process of installing or uninstalling a program may fail for several reasons. This article describes the following issues (click on each question for corresponding resolution):

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article: http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    How to solve problems when you install or uninstall programs on a Windows computer

    See also: steps to uninstall Google Reader for the desktop of your Windows PC or Mac application.

    It will be useful.

  • How can I remove programs from starting when the system boots.

    REMOVE AN ARTICLE FROM THE START UP PROGRAMS

    Whenever I start my computer, it opens and begins to operate more than one program automatically. One is pinned to the taskbar, but others are not. How can I tell the computer which I do not wish for the programs at startup? Any help you might be able to give is gratefully received. Thank you.

    Download Autoruns http://technet.microsoft.com/en-us/sysinternals/bb963902

    Start the program and click the Connect tab uncheck the entries that you do not want to start.

    Not uncheck anything that you are not sure you know what it is. Your computer may not work correctly or may not even start.

    You can also look at the options of programs that start automatically. It may be possible to disable them.

    Look in the startup folder in the start all programs Menu. Right click and delete any entries that you don't want.

  • How to 'select content' of an element of the page in javascript?

    in the GUI, in the menu object, there are selection-> content, there is also a button on the Panel to "select content". How using javascript? or what is the command line to write in 'select content' of a pageItem? can anyone help?

    Try the following:

    var container = app.selection[0];
    if(container.allPageItems.length > 0)
    {
        app.select(container.allPageItems);
    };
    

    It's something that you can't in the user interface.

    See the example following a group of rectangles has been pasted inside another rectangle.

    All rectangles are selected and the Group:

    Uwe

Maybe you are looking for