Current selected element of table ( using tree  )

Hi experts ,
                     I am using a tree by table UI in which master. I want to know text of current selected element of table (which is one of the column of table ) . as table is dynamically expanding or collapsing upon expanding or closing master column.
so i used follwing code in do modify view to get it
IWDTable tab =  (IWDTable) view.getElement("Table1");
                    tab.mappingOfOnLeadSelect().addSourceMapping("row", "element");     
public void onActionOnrowSelect
(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, int element )
    //@@begin onActionOnrowSelect(ServerEvent)
    //@@end
but above code also give me current row (an integer value) .
but its not solving my problem . as current row elemt is always not going to be same row in which table (data source for table).
can any body have solution ?
Regards
abhay

Hi Abay,
IWDTable tab = (IWDTable) view.getElement("Table1");
tab.mappingOfOnLeadSelect().addSourceMapping(IWDTreeNodeType.IWDOnLoadChildren.NODE_ELEMENT,"element");
datatype of the <b>element</b> should be <b>IWDNodeElement</b>
Or
You can use
IWDNodeElement IWDNode.getTreeSelection()
Ex: wdContext.nodeA().getTreeSelection()
Regards
Ayyapparaj

Similar Messages

  • How to get a node selection in a table using Arraylist

    Hi All,
      Can someone help me with the code to get the node selected value from a table and then set that values to input fields?
    Early response would be much appreciated.
    Thanks
    Uday

    Dear Uday,
    Please user the isMultiSelected inside the for loop and iterate through all the rows selected to set in the arraylist.
    Refer to this might help: delete records from table
    if(wdContext.node<Node Name>().size()>0)
                // Iterate through the context Node
                for(int i=0;i<wdContext.node<Node Name>().size();i++)
           if(wdContext.node<Node Name>().isMultiSelected(i))  {
                      // Set the ArrayList here for the Lead Selected elements of the Table multiple selected rows
                            }else {
                                   // Set the ArrayList here for the Lead Selected elements of the Table single selected rows
    Best Regards
    Arun Jaiswal
    Edited by: Arun Jaiswal on Dec 10, 2011 2:04 PM

  • How to read the current selection in a table.

    Hello Experts,
    I've this issue with the web dynpro. I have a Adaptive Webservice Model in web dynpro. And I have three tables in the UI. When a row is selected in the first table, the second table is populated with the appropriate data (using a method in the web service.) the same applies to the third table, when the a row is selected in the second table, the third table has to be populated with the appropriate data. The methods in the web service are all working fine. However, in web dynpro, I am not able to figure out on how I read the selected row in a table. Any information on how to resolve this would be really really helpful.
    <
    wdContext.currentGetMailElement().setProfileID("-Should be read from the selected row in the table.");
    wdThis.wdGetMailControllerController().executeGetMail();
    >
    regards,
    Sam.

    Hi Samuel,
    I didnt clearly understood  your problem. When you are selecting a particular row in a table you are executing a web service named Get Mail. Are you passing any input parameter(any selected row data)  while executing a web service. And when you get the response node where you have a attribute in the node getmail. Am I right.
    If this is the case, then first check if the GetMail node is present or not by comparing it will null or checking its size. If the node is null then you will not get attribute as the element itself is null as nothing is retrieved in response. And if the node is not null then the element at 0th position is selected by default. you can retreieve the attribute by directly using the following code
    if(wdContext.nodeGetMail() !=null)
        String profileId= wdContext.currentGetMailElement().getProfileID();
    Check if this works for you.
    Regards,
    Ardhendu Sarkar

  • Multiple row selection in ADF Table using addition column with checkbox

    I am using ADF table(Jdeveloper11g) and i want to selecte multiple rows it may be more than one OR all rows.
    For that i added one Column to the table with Header Delete and checkbox
    <af:table....
    <af:column sortProperty="Delete" headerText="Delete" width="100"
    sortable="false">
    <af:selectBooleanCheckbox label="#{row.favoriteId}"
    valueChangeListener="#{Mybean.onCheck}"
    id="checkbox" autoSubmit="true">
    </af:selectBooleanCheckbox>
    </af:column>
    </af:table>
    backing bean:Here i added code to get Value of one column with id favoriteId and use an arrayList(listForDelete) to monitor the state of the checkboxes
    public void onCheck(ValueChangeEvent valueChangeEvent) {
    BindingContainer bindings = getBindings();
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)bindings.get("getUserFavoritesByUserIDIterator");
    if (iterBind != null && iterBind.getCurrentRow() != null) {
    RichSelectBooleanCheckbox ch = (RichSelectBooleanCheckbox)valueChangeEvent.getSource();
    if (!ch.isSelected()) {
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.add(issueId);
    else
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.remove(issueId);
    Problem is that when i select single row checkBox, onCheck() method of backing bean gets called multiple times(equals to the number of rows)
    I think this is beacuse of <af:selectBooleanCheckbox id is same that is "checkbox" but i am not sure.Even i tried to assign some unique id but no any success in assigning Id with value Expression.
    I also find related post
    Re: ADF Table Multiple row selection by Managed Bean
    but that is related to Select All rows or Deselect all rows from table.
    From the simillar post i follow the steps given by Frank.but problem with below step
    ->have an af:clientAttribute assigned to the checkbox with the following EL #{row.key} ,here I added <af:clientAttribute name="#{row.key}"></af:clientAttribute> and i am getting error
    Error(64,37):  Static attribute must be a String literal, its illegal to specify an expression.
    Please let me know if any one had already implemented same test case.
    Thanks for all help
    Jaydeep
    Edited by: JaydeepJ on Aug 7, 2009 4:42 AM

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • Read Infopackage selection from a table using ABAP

    Hello Experts,
    I have a flat file consisting of 3 columns which I want to use as selection fields for the Infopackage. Now, is it possible to load this flat file to an ODS or a master data table and then write some ABAP  in the Infopackage to read the values of the columns and populate the selection fields.
    This is what I want: The columns of the flat file are  - Company Code, Doc number, Fiscal Year
    Now, I loaded this file into a tables (around 2 million records) and then use ABAP to populate the entire file into the selection tab of the Infopackage.
    What would be the best approach for this?
    Thanks in advance
    Vivek

    Hi,
    It's possible in theory. Just one thing, too many selections in an InfoPackage may not work (I remember about 1,000 or 10,000, not very sure).
    I'd like suggest loading a range rather than so many selections. For example, say you have below documents:
    1000
    1001
    1005
    1010
    Then just load from 1000 to 1010, and create a start routine in your update rule/transformation. There you can do this:
    1. select records from the table where you store flat file, using the same selection (1000 to 1010)
    2. For every records in DATA_PACKAGE, using READ TABLE statement to check whether that record exist in the table. If not exist then simply delete it from DATA_PACKAGE
    I think that would have much better performance. Let us know if you have further questions.
    Regards,
    Frank

  • Hotmail style - select rows in table  (using checkboxes)

    Hi!
    I have a table that is bound to a CachedRowSet.
    Each row in the table has a checkbox. You check each of the row you want to delete, and the click a "delete" button bellow the the table. And the checked rows will be deleted!
    If it is possible, it should also work with paging.
    How do I implement this?
    I still find it hard to understand the JSF way of handling submits, I am use to the old request/response way of do this.
    Regards, Niels Peter

    Hi Niels,
    It is not clear if you are using Sun Java Studio Creator to build your webapplication using JSF. If you are then a sample application called AppModel demonstrates exactly what you are looking for. This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    In case you are not using Creator then you would have to post your query in the appropriate forum as this forum is exclusively for discussions related to Creator.
    Going through the AppModel sample application might still give you an idea if you can download the IDE and run this application.
    Hope this helps
    Cheers
    Giri

  • Select from multiple tables using max

    I have these 3 tables listed below and I want to write an sql that would give me
    WORKER_ACCOUNT.Name along with his latest status (which can be derived from WORK_LOG.Status for max(WORK_LOG.Log_ID) )
    I want NULL for missing status.
    Any help appreciated
    DROP TABLE WORKER_ACCOUNT;
    CREATE TABLE WORKER_ACCOUNT
    NAME VARCHAR2(255) NULL,
    ID INTEGER NULL
    INSERT INTO PANDORA_SVC.WORKER_ACCOUNT VALUES ('John Doe', 51);
    INSERT INTO WORKER_ACCOUNT VALUES ('Jane Doe', 52);
    DROP TABLE WORK_ASSIGNMENT;
    CREATE TABLE WORK_ASSIGNMENT
    WORKER_ID INTEGER NULL,
    WORK_ID INTEGER NULL
    INSERT INTO WORK_ASSIGNMENT VALUES (51, 101);
    INSERT INTO WORK_ASSIGNMENT VALUES (52, 102);
    DROP TABLE WORK_LOG;
    CREATE TABLE WORK_LOG
    WORK_ID INTEGER NULL,
    LOG_ID INTEGER NULL,
    STATUS VARCHAR2(255) NULL
    INSERT INTO WORK_LOG VALUES (101, 1, 'INITIATED');
    INSERT INTO WORK_LOG VALUES (101, 2, 'INVESTIGATING');
    INSERT INTO WORK_LOG VALUES (101, 3, 'FILING REPORT');
    COMMIT;
    Edited by: 811677 on Feb 22, 2011 11:10 PM

    try it please
    with data as
    (select wa.worker_id, wc.name, nvl(wl.status,'MISSING') status , nvl(wl.log_id,-1) LOG_ID
    from work_log wl, work_assignment wa, worker_account wc
    where wl.work_id(+)=wa.work_id
    and wa.worker_id(+)=wc.id)
    select worker_id, name, status
    from data a
    where
      log_id = (select max(b.log_id ) from data b
                  where a.worker_id = b.worker_id
                group by b.worker_id)or
    with data as
    (select wa.worker_id, wc.name, nvl(wl.status,'MISSING') status , nvl(wl.log_id,-1) LOG_ID
    from work_log wl, work_assignment wa, worker_account wc
    where wl.work_id(+)=wa.work_id
    and wa.worker_id(+)=wc.id)
    select worker_id, name, status, log_id from
    (select worker_id, name, status, log_id, max(log_id) over (partition by worker_id order by worker_id) max_log
    from data )
    where log_id = max_logEdited by: Mahir M. Quluzade on Feb 23, 2011 11:37 AM

  • Selecting data from a table using Execute Immediate in 9i

    Hi,
    I was wondering how I would be able to do a SELECT on a table using EXECUTE IMMEDIATE. When I tried it (with the proc below), I got the following below. Can anyone tell me what I am doing wrong?
    Using Scott/Tiger I tried this:
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL;
    7* END;
    SQL> /
    Procedure created.
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL>
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    erec emp%rowtype;
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL into erec;
    7* END;
    SQL> /

  • JTree: view of selected element

    I have a tree object with departments and employees. When the user selects a department or an employee I want to show an edit panel what the user can use to update the department or employee data. To do this, I have implemented the TreeListener.valueChanged method, like below:
    public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (node == null) return;
    JUTreeNodeBinding tnb = (JUTreeNodeBinding)node.getUserObject();
    if (tnb == null) return;
    RowSetIterator rsi = tnb.getParentRowSetIterator();
    if (rsi == null) return;
    ViewObject vo = tnb.getParent().getViewObject();
    if ("mypackage1.EmployeeViewImpl".equals(vo.getClass().getName()))
    jSplitPane1.add(pEmployee, JSplitPane.RIGHT);
    JUIteratorBinding iter = panelBinding.findIterBinding("EmployeeViewIter");
    if (iter == null) return;
    iter.bindRowSetIterator(rsi, false);
    iter.rangeRefreshed(null);
    rsi.setCurrentRow(rsi.getRow(tnb.getRowKey()));
    else
    jSplitPane1.add(pDepartment, JSplitPane.RIGHT);
    As you can see I use a very dirty way to check the type of the currently selected element. But what is the proper way to do this?

    Hi,
    I think I want to do something similar.
    When I use JList component I can easy take selected row:
    MyViewRowImpl r = (MyViewRowImpl) myList.getSelectedValue();
    When I try to get selected row in similar way from JTree:
    Object o = jTree1.getLastSelectedPathComponent();
    I have got only string representation of this row. Is it possible to get selected row object.
    Krzysztof

  • Why do i get integer values instead of decimals when selecting a mysql table through an oracle xe DB?

    Hi
    My company just started a new project that implies migrating every hour operational data from a mysql database located at another company to our main DB (oracle10gR2). Between these two DB, we have an oracle XE DB which contains the database links to both DB and a procedure to get (from mysql) and insert (oracle10g) the values. What happens is that in the mysql DB, the values have decimals and, when i select the table in oracle, i only see integer values (no decimals). Here is an example of the select i use:
    SELECT "v_hour", "v_date", "v_type", "v_tabstamp","v_value"
    FROM "tab1"@mysql;
    How can i work around this problem?
    Many thanks!

    Maybe just a HS_LANGUAGE setting issue.
    You could try that:
    1a) in the gateway init file, please set HS_LANGUAGE=GERMAN_GERMANY.WE8ISO8859P1
    2a) now open a new SQL*Plus session ans select from your table using the gateway based database link
    => if the values are now including the decimal part then your foreign database is set up to use a comma as the decimal separator and you have to make sure that the HS_LANGUAGE contains a territory that uses as decimal separator a comma.
    If you still do not get the decimal values, then change it to:
    1b) HS_LANGUAGE=american_america.we8iso8859P1
    2b) Make sure you start again a new SQL*Plus session (the gateway init file is only read when you use the database link in your session for the first time (or explicit closed it before). Select again from your table.
    => is the decimal part now visible?
    More details can be found in the gateway note: Gateway and Decimal Digits(Doc ID 1453148.1) available from My Oracle Support portal.
    - Klaus

  • How do I execute "Select count(*) from table " in OCI

    Hi,
    I am new to OCI and so this question may seem stupid. I would like to know how to execute the query "select count(*) from <table>" using OCI V8 functionality? Also after how do I get the result into a integer datatype? I have gone through most of the demo programs but is is of little help to me.
    Thanks in advance...
    Regards,
    Shubhayan.

    Hi,
    Here is sample code to give you some idea how to do it. If you want some more info let me know.
    Pankaj
    ub4 count;
    // Prepare the statement.
    char szQry = "SELECT count() FROM T1";
    if(OCI_ERROR == OCIStmtPrepare(pStmthp, pErrhp, (unsigned char*)szQry, strlen(szQry), OCI_NTV_SYNTAX , OCI_DEFAULT) )
         cout << "Error in OCIStmtPrepare" << endl;
         exit(1);
    // Bind the output parameter.
    OCIDefine *pDefnpp;
    if(OCI_ERROR == OCIDefineByPos ( pStmthp, &pDefnpp, pErrhp, 1,
    &count, sizeof(ub4), SQLT_INT,
    (dvoid *) 0, (ub2 *) 0, (ub2 *) 0,
                        OCI_DEFAULT) )
         cout << "Error in OCIDefineByPos" << endl;
         exit(1);
    if(OCI_ERROR == OCIStmtExecute(pSvchp, pStmthp, pErrhp, 1, 0, NULL, NULL, OCI_DEFAULT) )
         cout << "Error in OCIStmtExecute" << endl;
         exit(1);

  • How to know current selection rectangle

    Hello,
    I need to know (with SDK) the current selection rectangle.
    I use listener to create my action fonction but listener let to Set a selection but not Get.
    If someone can help me...
    Thanks

    There is a bounds to a selection of a document. BEWARE: This is the bounding rectangle of the selection. If you have a selection with holes in it then you may not be getting what you expect.

  • Getting Selected Project in Aperture using AppleScript

    Is it possible to get a reference to the currently selected project in Aperture using AppleScript? In other words, is it possible to get the project containing the currently selected image (which I can get by using "selection")? If possible, how can I do it?

    GIve this a try:
    tell application "Aperture"
    set x to selection
    set x to item 1 of x
    tell library 1
    get value of other tag "MasterLocation" of x
    end tell
    end tell
    One thing that helps to answer similar questions is to ask for properties of objects. That can reveal more about an object. Another way to help answer these kinds of questions is to ask for available tags in Exif, IPTC, and "other tags" of a particular image version. That will tell you all the available tags that have values assigned for a particular image version. You can then explore those tags to see if what you are looking for is available.
    Hope that helps.
    Message was edited by: lenny

  • Issue in the PDF at the time of Using current context element

    Experts,
    For retrieving the values in the WebDypro applications, I have used the current context element. Using that current context element I have generated the PDF.
    I have faced critical issue, if the two different persons are accessing the same PDF button at a same time in the different system.
    Both of them have selected the different values in the table (different id). But in the output it displays the same results (same id) for both the persons.
    The PDF displays the correct results (different id) at different time interval for both the persons.
    We are facing this issue, only if both the persons are clicking the PDF button at the same time.
    Could you please anyone give the solution for this problem?
    Application developed using WebDynpro Java NW2004
    Kind Regards,
    Hariprasath R

    Hi,
    First u invalidate() the current context element.
    after that u put data in current context element.
    Regards,
    Sunaina Reddy T

  • Inspecting the current selection using the HTML5 SDK

    I have been banging my head against the wall trying to get what I thought would be something very simple working.
    What I want to do is have an InDesign panel, the contents of which changes based on the current selection on the page.
    Now, I can access the event "afterSelectionChanged" in the native scripting environment, but there appears to be no way for the native environment to trigger an event in the HTML5 panel unless I use a C++ hybrid extension and call the PlugPlugDispatchEvent() method.
    The events available in the HTML5 API are incredibly limited and don't seem to include any selection-based events.
    This makes it nigh-on impossible to use an HTML5 panel as an inspector of any kind without making an overly complex hybrid extension, which I want to avoid.
    Is this correct? If so, it seems amazingly short-sighted. If there is a way to do this, can someone please show me the way?

    Hi Samuel,
    I didnt clearly understood  your problem. When you are selecting a particular row in a table you are executing a web service named Get Mail. Are you passing any input parameter(any selected row data)  while executing a web service. And when you get the response node where you have a attribute in the node getmail. Am I right.
    If this is the case, then first check if the GetMail node is present or not by comparing it will null or checking its size. If the node is null then you will not get attribute as the element itself is null as nothing is retrieved in response. And if the node is not null then the element at 0th position is selected by default. you can retreieve the attribute by directly using the following code
    if(wdContext.nodeGetMail() !=null)
        String profileId= wdContext.currentGetMailElement().getProfileID();
    Check if this works for you.
    Regards,
    Ardhendu Sarkar

Maybe you are looking for

  • How to update Sold to Party for a contract

    Hi Gurus, I got a strange and fuzzy requirement. My client wants to update the Sold-to-party in 2011 for the contracts created in 2010 with any status and with any sub-sequent documents to that particular contract. I know SAP wont support on this. be

  • Why does not my Pages app work?

    I have got a problem with Pages. Since I have been using the IWork for many years,  I am aware how to do it. Now I updated the apps and I can not open it when I turn on the ICloud. There is no problem with Keynote and numbers. Only the Pages. When I

  • My phone is in recovery mode and doesn't turn on, what do I do?

    I tried to back it up to my computer because I didn't have anymore iCloud storage space.  It was supposed to upgrade but then went on upgrade mode and only thing I can do to get it off this mode is to connect it to iTunes and restore the phone to its

  • IBook 1099 Tax Form to Publishers

    Does Apple send out 1099 tax forms to publishers? I have not received one. (But I have from Amazon and Barnes & Noble) I went through iTunes Connect "Contact Us" without a specific answer to my question, so I thought I would ask on here. If you are a

  • Make Lightroom browse like iPhoto?

    Is there a way to browse the Lightroom Library the same way that iPhoto allows you to browse the library? Example: In iPhoto all my "events" (folders) are listed based on how I want to sort them (generally by date) on one screen in a grid view. If I