Selection Cardinality & setSelected

Hi,
What is selection cardinality?
What is the difference between these2 context node methods
wdContext.node<Context>().setLeadSelection(int);
wdContext.node<Context>().setSelected(int, boolean );
and How does Selection cardinality affects the setSelected  property.
Thanks & Regards
Veerabhadram

Hi
Cardinality
========
The cardinality property is composed of a pair of values that control the maximum and minimum number of elements may contain at runtime.
The cardinality property may have four possible values:
• 0..1 Zero or one
• 0..n Zero or more
• 1..1 One and only one
• 1..n One or more
The first part of the cardinality describes the minimum number of element ’s element collection may contain. This value is either zero or one, and is stored as a Boolean value. This value can be obtained at runtime by calling the method node.getNodeInfo().isMandatory().
The second part of the cardinality describes the maximum number of elements ’s element collection may contain. This value is either a 1 or an n (meaning many) and is stored as a Boolean value (false = 1, true = n). This value can be obtained at runtime by calling method node.getNodeInfo().isMultiple().
If has a cardinality of 1..<something>, then it can be assumed that after the context has been initialised, there will be at least one element present in the node collection. This element is known as the default element and cannot be deleted!
If you attempt to perform some action on a node that would violate the constraints of the cardinality, then you will get a runtime exception in the context. E.G., trying to add a second element to a node of cardinality 0..1, or trying to delete the last element from a node of cardinality 1..n.
Thanks
Hazrath

Similar Messages

  • Error On Selection Cardinality doesnot allow multiple selection

    Hi All,
    Every one... Am new to SAP am learning WebDynpro Java..
    Now am working on Multiple selection on a table But it is giving Error
    Like:
    Failed to Process reques. Please Contact Your System Administrator.
    Root Case is :
    com.sap.tc.webdynpro.progmodel.ContextException Node (....) Selection Cardinality doesnot allow multiple selection ....
    Please Help Me..

    Hi Ramesh,
    please check the property of the node which you are using.
    check the Cardinality  property, for multi select it must be 0.n or 1 . n.
    Hope thiw will help
    Regards
    Narendra

  • What is collection cardinality and selection cardinality

    hi all,
    i have created a node for that i have to assign the cardinality and selection cardinality.
    what is the meaning if i create a node and assign this cardinality 0.n means this is applicable to both (selection and collection)
                                                                                    1.n
                                                                                    1.1
                                                                                    0.1

    check this thread
    Cardinality
    Thanks
    Bala Duvvuri

  • Breifly xplain  wht lead selection ,cardinality &singleton&supply function

    Hi Friends ...
                 Let plz xpalin in breif   wht is lead selection ,cardinality &singleton&supply function and how these all helpfull whtz the relation ship between while creating a table...
    itz bit urgent for me am working with dynamic tables and am in confuse...plz make it out this query...

    Lead selection
         Leadselection is the property which is used to get the index of the selected row of the table
    "OnLeadSelect" is the method used to fire an action when a row is selected
         The Method wdContext.<node>().getLeadSelection() can be used to
    find out the index of the selected element.
    Cardinality
    Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.
    Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.
    All context nodes are collections.
    A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).
    The cardinality property controls the number of elements a node collection may hold at runtime.
    Every context node has a property called Cardinality. This property is composed of two values that
    taken together, describe the maximum and minimum number of elements the node collection may hold
    at runtime.
    Cardinality Minimum: 0 or 1
    Cardinality Maximum: 1 or n
    Therefore, there are four possible cardinality values (specified as <Min>..<Max>)
    0..1 Zero or one elements permitted
    0..n Zero or more elements permitted
    1..1 One and only one element permitted
    1..n One or more elements permitted
    Singleton
    All independent nodes are forced to be singletons. This is because the context root node has one and only one element.
    Singleton is  boolean
    TRUE : One instance will be created for all te nodes
    FALSE : Every Element in the parent node collection,there will be a distinct instance of the child node.
    Why Singleton
         -Efficiency
         -Less Memory
         -Lazy Data Access(Creates instance only when needed,till then it will remain unprocessed)
    Supply functions
         Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node
    changes. When a singleton child node is declared, you must also write an accompanying supply function.
    The Web Dynpro Framework will then automatically call your supply function when the lead selection
    in the parent node changes.
    Regards
    Chaitanya.A

  • Webdynpro table line selection

    Hi,
    I am working on an application in which I need to show some details of the selected entry of the table in a seperate frame below the table.
    For example, user selects entry number 3, I need to show the details of entry number  3, in the seperate frame. Once he selects another entry, i need change the details accrodingly.
    Currently, by default it is selecting 1st entry and shows the corresponding details. But when I select another entry, it dumps giving the following exception :-
    com.sap.tc.webdynpro.progmodel.context.ContextException: Node(InvoiceDetailsView.Z_BAPI_INVOICE_READ.Output.X_Park_Dtl): selection cardinality does not allow multiple selection
        at com.sap.tc.webdynpro.progmodel.context.Node.setSelected(Node.java:853)
        at com.sap.tc.webdynpro.clientserver.data.DataContainer.updateSelection(DataContainer.java:533)
        at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateSelection(AbstractAdapter.java:787)
        at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter._clearAndSetMultipleSelection(TableAdapter.java:11801)
        at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter.access$6100(TableAdapter.java:116)
    Please let me know how to solve this issue. Thanks.
    Hari

    Set selectionMode of the Table UI element to "auto".
    Armin

  • A better way than a global temp table to reuse a distinct select?

    I get the impression from other threads that global temp tables are frowned upon so I'm wondering if there is a better way to simplify what I need to do. I have some values scattered about a table with a relatively large number of records. I need to distinct them out and delete from 21 other tables where those values also occur. The values have a really low cardinality to the number of rows. Out of 500K+ rows there might be a dozen distinct values.
    I thought that rather than 21 cases of:
    DELETE FROM x1..21 WHERE value IN (SELECT DISTINCT value FROM Y)
    It would be better for performance to populate a global temp table with the distinct first:
    INSERT INTO gtt SELECT DISTINCT value FROM Y
    DELETE FROM x1..21 WHERE value IN (SELECT value FROM GTT)
    People asking questions about GTT's seem to get blasted so is this another case where there's a better way to do this? Should I just have the system bite the bullet on the DISTINCT 21 times? The big table truncates and reloads and needs to do so quickly so I was hoping not to have to index it and meddle with disable/rebuild index but if that's better than a temp table, I'll have to make do.
    As far as I understand WITH ... USING can't be used to delete from multiple tables or can it?

    Almost, but not quite, as efficient as using a temporary table would be to use a PL/SQL collection and FORALL statements and/or referencing the collection in your subsequent statements). Something like
    DECLARE
      TYPE value_nt IS TABLE OF y.value%type;
      l_values value_nt;
    BEGIN
      SELECT distinct value
        BULK COLLECT INTO l_values
        FROM y;
      FORALL i IN 1 .. l_values.count
        DELETE FROM x1
         WHERE value = l_values(i);
      FORALL i IN 1 .. l_values.count
        DELETE FROM x2
         WHERE value = l_values(i);
    END;or
    CREATE TYPE value_nt
      IS TABLE OF varchar2(100); -- Guessing at the type of y.value
    DECLARE
      l_values value_nt;
    BEGIN
      SELECT distinct value
        BULK COLLECT INTO l_values
        FROM y;
      DELETE FROM x1
       WHERE value = (SELECT /*+ cardinality(v 10) */ column_value from table( l_values ) v );
      DELETE FROM x2
       WHERE value = (SELECT /*+ cardinality(v 10) */ column_value from table( l_values ) v );
    END;Justin

  • SQL select query having more than 1000 values in 'IN' clause of predicate.

    Hi,
    We are executing a select query from a table and showing it through a front end screen. When the count of values given in the 'IN' clause of predicate are exceeding 1000 , it is throwing error.
    eg. select * from Employees where emp.Id. in('111',123','121','3232',........1001 Ids)
    We are using Oracle version 10.2.0.
    Please suggest how to tackle such issue.
    Regards,
    Naveen Kumar.C.
    Edited by: Naveen Kumar C on Aug 30, 2008 10:01 PM

    Use a nested table:
    create or replace type numbertype
    as object
    (nr number(20,10) )
    create or replace type number_table
    as table of numbertype
    create or replace procedure tableselect
    ( p_numbers in number_table
    , p_ref_result out sys_refcursor)
    is
    begin
    open p_ref_result for
         select *
    {noformat}     from   employees
         ,        (select /*+ cardinality(tab 10) */ tab.nr
                   from   table(p_numbers) tab) tbnrs
         where id = tbnrs.nr;
    end;
    /{noformat}
    Using nested tables will reduce the amount of parsing because the sql statement uses binded variables! The cardinality hint causes Oracle to use the index on employees.id.

  • How to bind internal table values with RootUIElement(Table) from select Que

    Hello Friends,
           In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...
         I written coding also but i dont know to bind internal table values with Table... My code as follows,
    method onactionsearch .
       data:
         Node_Node_Flight                    type ref to If_Wd_Context_Node,
         Elem_Node_Flight                    type ref to If_Wd_Context_Element,
         Stru_Node_Flight                    type If_View1=>Element_Node_Flight ,
         itab TYPE STANDARD TABLE OF sflight.
    navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
       Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    @TODO handle not set lead selection
       if ( Node_Node_Flight is initial ).
       endif.
    get element via lead selection
       Elem_Node_Flight = Node_Node_Flight->get_Element(  ).
    @TODO handle not set lead selection
       if ( Elem_Node_Flight is initial ).
       endif.
    alternative access  via index
    Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).
    @TODO handle non existant child
    if ( Elem_Node_Flight is initial ).
    endif.
    get all declared attributes
       Elem_Node_Flight->get_Static_Attributes(
         importing
           Static_Attributes = Stru_Node_Flight ).
    select * from sflight into CORRESPONDING FIELDS OF TABLE itab
      WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.
    Node_Node_Flight->bind_table( new_items = itab ).
    endmethod.
    Plz reply me asap...!

    Hi,
    What I understood from your coding is...
    * navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
    Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    You are reading values from the above node and binding the values to the same node.Am i right?
    Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.
    One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.
    Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.
    Go throgh this link
    Web Dynpro for ABAP: Tutorials for Beginners
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM

  • Ora-1460 during select using table(cast(type))

    Hi all!
    I've got a problem with a query that fails with a ora-1460 at random time intervals. This is a 10.2.0.3 version database running on a sun os.
    We've managed to reproduce this error controlled when running an analyze on the table in question at the same time this query runs.
    The error looks like this:
    Unexpected system error, see server log for details. Root message is: org.apache.ojb.broker.PersistenceBrokerSQLException: * SQLException during execution of sql-statement: * sql statement was 'SELECT A0.ID,A0.LOCK_VERSION,A0.CLASS_NAME,A0.DESCRIPTION,A0.NAME,A0.EXTERNAL_ID,A0.ORDER_NUMBER,A0.LEVEL_ID,A0.ROOT_AH_ID,A0.DIFF_END_DATE,A0.DIFF_START_DATE,A0.SUPPORTED_BY_ASS_CAL,A0.CATEGORY_ROLE_ID FROM CATEGORY A0 WHERE A0.ID IN (select /*+ cardinality(1) */ * from table(cast( ems_string_to_table(?) as ems_table_of_number_type ))union select /*+ cardinality(1) */ * from table(cast( ems_string_to_table('') as ems_table_of_number_type)))' * Exception message is [ORA-01460: unimplemented or unreasonable conversion requested ] * Vendor error code [1460] * SQL state code [72000]
    ems_string_to_table is a function thats populates a type with a unknown number of values. Though, the length of the string never exceeds 4k.
    ems_table_of_number_type is a type define as "table of numbers".
    Has anybody seen this error before, or have any idea why this should be?
    Best regards,
    Heyers

    There is an IN clause constaraint i.e max number of characters you can pass from Oracle .Please check your select inner query which might be resulting to cross more than the boundary IN clause ,

  • How to use OracleParameter whith the IN Operator of select statement

    Hi,
    I am having problems using the OracleParameter when used in a query with a IN operator.
    Following Example:
    oraCommand.Parameters.Add(":List", strMylist ); //or Array???
    The SQL command:
    SELECT * FROM XXX WHERE XXX.YYY IN (:List);
    What datatype must the value of :List be?
    regards
    Stefan

    Let's use a collection of User Defined Types (UDT's).
    First create a table with 1 million rows:
    create table employees (id number(10) not null primary key, name varchar2(100) );
    insert into employees
    select level l, 'MyName'||to_char(level)
    from dual connect by level <= 1e6;
    1000000 rows created
    commit;
    exec dbms_stats.gather_schema_stats(USER, cascade=>TRUE);No we turn to the C# code:
    Let's select employees with id's 3 and 4.
    Collection type MDSYS.SDO_ELEM_INFO_ARRAY is used because if we use this already predefined Oracle type we don't have to define our own Oracle type. You can fill collection MDSYS.SDO_ELEM_INFO_ARRAY with max 1048576 numbers.
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
        [OracleCustomTypeMappingAttribute("MDSYS.SDO_ELEM_INFO_ARRAY")]
        public class NumberArrayFactory : IOracleArrayTypeFactory
          public Array CreateArray(int numElems)
            return new Decimal[numElems];
          public Array CreateStatusArray(int numElems)
            return null;
        private void Test()
          OracleConnectionStringBuilder b = new OracleConnectionStringBuilder();
          b.UserID = "sna";
          b.Password = "sna";
          b.DataSource = "ora11";
          using (OracleConnection conn = new OracleConnection(b.ToString()))
            conn.Open();
            using (OracleCommand comm = conn.CreateCommand())
              comm.CommandText =
                  @" select  /*+ cardinality(tab 10) */ *  " +
                  @" from employees, table(:1) tab " +
                  @" where employees.id = tab.column_value";
              OracleParameter p = new OracleParameter();
              p.OracleDbType = OracleDbType.Array;
              p.Direction = ParameterDirection.Input;
              p.UdtTypeName = "MDSYS.SDO_ELEM_INFO_ARRAY";
              p.Value = new Decimal[] { 3, 4 };
              comm.Parameters.Add(p);
              int numPersons = 0;
              using (OracleDataReader reader = comm.ExecuteReader())
                while (reader.Read())
                  MessageBox.Show("Name " + reader[1].ToString());
                  numPersons++;
              conn.Close();
        }The index on employees.id isn't used when one omits hint /*+ cardinality(tab 10) */. This index is created by Oracle because id is the primary key column.
    Edited by: wateenmooiedag on Dec 30, 2009 2:45 AM

  • How to set the cardinality property as 1..n for a dynamically created node

    Hi...everybody
        I am creating Dropdown by index UI element and the
    context atrributes dynamically.To bind multiple data to a dropdown
    the cardinality property of the node should be 0..n or 1..n,
    But i could not set the property of the dynamically created context node to 0..n ...
    can any body suggest me..
    I implemented the following code in WDDoModify View
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
              null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    I could successfully display one value in the drop down,by adding the following code before the line tc.addchild(dbyindex);
    IWDNode node1=wdContext.getChildNode("DynamicNode",0);
    IWDNodeElement nodeElement=node1.createElement();
    nodeElement.setAttributeValue("Value","Hello");
    node1.addElement(nodeElement);
    but when
    i am trying to bind multiple values i am getting Exception ,,,,

    hi
    you are getting the exception because of cardinality property.
    i.e   true,false and
    you are trying to add morethan one element.
    so,if you want to add morethan one than one element you have to set the cardinality property to true,true (or) false,true.
    In your code do the following modification for changing the cardinality.
    For 0..n -->false,true
          1..n-->true,true
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
    null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    hope this will solve your problem.
    In addchild(..) the parameters are
    addChild("Name ,
                    Element class for model node ,
                    Is singleton? ,
                    Cardinality ,
                    Selection cardinality ,
                    Initialise lead selection? ,
                    Datatype ,
                    Supplier function ,
                     Disposer function);
    Regards
    sowmya

  • Problem with multiple table row selection

    Hi all
           I have a rfc which fetches me a bunch of records and displays them in a table,say A.
           I have to select multiple records from this table and hit a button to navigate to next screen..where I will review the selected entries from table A..
           Cardinality is 0..N,Selection cardinality is 1..N.
    and selection mode as "multi"
    But I am not able to select multiple entries in tableA..
    Pl send me some sample code which would help me solving this issue...
    Thanks in advance

    hi,
    this is the code i have written.
    int size = wdContext.nodeHeader().size();
           IPrivateGetView.IItemElement e1 = wdContext.createItemElement("instance");
           for(int i=0;i<size;i++)
           if(wdContext.nodeHeader().isMultiSelected(i))
               e1.setDel(wdContext.nodeHeader().getHeaderElementAt(i).getDel());
                wdContext.nodeItem().addElement(e1);
    // i am trying to add the selected rows from one table to another table.
    By using above logic i couldn't select more than one row.
    Can u help me how to select more than one row and add them to another table.
    Thanks in advance.

  • Drop Down List By Key - Including a blank selection

    Hi all,
    In R/3 ABAP, when we reference a data element(with domain) from the data dictionary into a textfield(as dropdown) in a screen, we will be able access the domain values via the F4. The dropdown in ABAP will always include a blank field for selection.
    But in Java webdynpro, I successful bind a model attribute from the model into the dropdown list but when I click on the dropdown list, it contains the domain value but there's no blank field for selection. The page did initial display blank but after selecting other values, I cannot select back the blank field.
    I'm using the DropDownByKey with selectedKey binded to a value attribute that "type = com.sap..." model attribute. (imported field with domain and fixed emuneration)
    How can I configure/code the dropdown list to include that blank field for selection?
    Your help or advise is much appreciated. Thanks
    Best Regards,
    Jansen

    Jansen,
    I suggest you to use DropdownbyIndex UI element and set the <b>initializeLeadSelection</b> to <i>false</i> and <b>selection cardinality</b> to <i>0:1</i> of the corresponding context node. As a result, it will display a blank line.
    If you want to use Dropdownbykey then add one element with blank value.
    Bala

  • Multiple selection for itemlistbox

    hi
          as soon  as i click on the  itemlistbox
      iam getting this exception  
               Gfuel  i have binded it to the data source of the
            itemlistbox  and  gfuel  is the structure i am gettin it from the  backend .
    com.sap.tc.webdynpro.progmodel.context.ContextException: Node(SampleView.Zlgf001_Outfit_Match_Input.Output.G_Fuel): selection cardinality does not allow multiple selection
    can any one help me ?

    hi
          thanks for the response
             but the node  iam getting it from the backend
                 so i cannot change the cardinality 
              is any thing can be through coding  or  set
       cardinality in the backend.

  • Programmatically setting selected tab - problem

    Hi,
    I have two pages. On the first one is a tab set with three tabs. I have the following scenario:
    I go on the third tab and then on the page two. When I go back on the page one, I want that third tab is selected, but always is selected the first one. In the prerender method of the page one I set if I back from page two, third tab to be selected with setSelected method of tab set component. But, it doesn't work.
    What I should do?

    Hi,
    Yes, you can set the selected tab programmatically. You can set it thus
    tab3.setSelectedChildId("tab3");
    This will set the tab with the id tab3 as the selected tab.
    In case tab3 has children, then you can set one of them as the selected thus:
    tab3.setSelectedChildId("tab7");
    Hope this helps
    Cheers
    Girish

Maybe you are looking for

  • HT4489 How I import my contacts from my old phone Nokia C5-03 to Iphone 5S ?

    I am not able to transfar my nokia contact to Iphone 5S .. please help me...

  • I'm unable to sync my iphone via itunes

    i dropped my iphone on its back... the phone is still working - when i call it, it rings,,, however, the screen is blank and black... i tried to restart it using the home buttom and top button... still didn't turn on. i'm trying to sync my iphone via

  • Create authorization check for a report

    Hi, I need to create an authorization check for a report. It means that I need to restrict the usage of the report to couple of users ( 'USER1' and 'USER2' ). How can I do that? I did read through a lot of threads regarding this piece got a bit confu

  • Mobility tags in WegLogic Portal 9.2

    Has anyone successfully used the mobility tags <mm:layout> and <mm:group> in WebLogic Portal 9.2 in the way described, for example, on page 62 of the WebLogic Mobility Server User Guide (I'm looking at v3.5, Sept 2006)? I am trying to user a differen

  • Calendar has started crashing when switching to month view?

    I have an iPad with iOS 7.1.1. This morning the calender started crashing every time I went to the month view. It is fine in day view. Stranly, Planner Plus app is doing the same thing? It seems something that both apps use is causing it to crash.  H