on 05-23-2009 2:56 PM
Hi,
what is diffeence between context element and context attribute or element and attribute ?
Regards
ertas
For which puposes do you really need those methods. It is grrek to me. I got many anwers
to my questions in my prioir postings but it is not clear to me yet.
get_attribute ( )
get_element( )
Friendly Regards
ertas
Hi Ertas,
In simple terms for you to understand treat the CONTEXT NODE as a table and CONTEXT ATTRIBUTE as a field then
get_element means getting the selected record or row in the table
get_attribute means getting the particular field value in that selected record.
You can check the following code
DATA lo_nd_search_crit TYPE REF TO if_wd_context_node.
DATA lo_el_search_crit TYPE REF TO if_wd_context_element.
DATA ls_search_crit TYPE wd_this->Element_search_crit.
lo_nd_search_crit = wd_context->get_child_node( name = wd_this->wdctx_search_crit ).
get element via lead selection*
lo_el_search_crit = lo_nd_search_crit->get_element( ).
get single attribute*
lo_el_search_crit->get_attribute(
EXPORTING
name = `DATA_DIRECTION`
IMPORTING
value = lv_data_direction ).
The above is the piece of code generated by webdynpro code wizard for a particular CONTEXT ATTRIBUTE DATA_DIRECTION in a CONTEXT NODE for example SEARCH_CRIT in this case.
if you observe the comment **get element via lead selection** following code
it will get the element of the node means selected record of the table
and the next comment **get single attribute* following code
it will get the attribute value for that particular element selected ( record selected )
Regards,
Anil kumar G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what is ment with lead selection ?? I am hearing this expression many times
Regards
ertas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ertas,
A node's element collection can be accessed using a 1-based index value. Exactly one element of the node collection can be marked as the element at lead selection. The lead selection of a context node points to either a single selected node element (value of the lead selection = number of the selected node element) or, if no element is selected, it has the value of the constant IF_WD_CONTEXT_NODE=>NO_SELECTION. The lead selection can be set automatically by the Web Dynpro framework if the context node property
Initialize Lead Selection is set to true. In this case, the first element in a collection will automatically be marked as the element at lead selection. The lead selection can also be set by program source code or it can be set by user actions related to UI elements for example, mark line in table view element, which is bound
to the node).
As how said above the Lead Selection can be used for selecting 1 element from the nodes collection at a time. If you intend to be able to select multiple elements in your components table ui element then you need to go for the "Selection" property instead.
Regards,
Uday
get_element retrieves the reference to an element, either with a special index or the lead selection element.
get_attribute fetches the value of the attribute under the node.
Check this online help
[http://help.sap.com/saphelp_nw70/helpdata/en/32/bf5b4150b38147e10000000a1550b0/frameset.htm]
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.