Does changing a KeyValuePair trigger the PropertyChanged event in ObservableDictionary?

I am using the ObservableDictionary class available at:
http://blogs.microsoft.co.il/shimmy/2010/12/02/observabledictionaryof-tkey-tvalue-vbnet/
I will, for most of my code, be modifying KeyValuePair items that have already been added, and want an event to be triggered when I make these modifications. Both the Keys and Values properties are there, and they obviously change when a KeyValuePair
is modified, but will that trigger the PropertyChanged event? I was having trouble figuring out when the PropertyChanged event would get triggered, since the only place I could find in the code that raised the event was from inside the OnCollectionChanged
methods. Will the PropertyChanged event be triggered when I modify a KeyValuePair, or do I need to add PropertyChanged events to the KeyValuePair items myself? Any help would be appreciated. Thanks.
Nathan Sokalski [email protected] http://www.nathansokalski.com/

But I don't want to comment on it, I want to ask a question. Look at the existing comment: No reply to that (unless it was done privately).
Nathan Sokalski [email protected] http://www.nathansokalski.com/
So you are saying a comment about something can not be a question? When did that become some kind of planet earth law? And who's enforcing that?
Since the comment capability asks for a name and email address then perhaps shimmy would respond to your comment. You do understand your comment could be something like "If I use your class will changing a key/value pair cause the property changed event
to receive an event?".
But no, perhaps that would be too easy to contact the person that created the class in the first place to ask a question or communicate with on the product.
Since you are using the class then you should be able to determine if an event occurs when a key/value pair is altered. Or do you want somebody here to download and use the class and then provide you with information on how the class works or something?
It's not a simple class to run through. But I'll post it.
It seems to me the OnPropertyChanged sub gets called by the  Private Sub OnCollectionChanged(ByVal action As NotifyCollectionChangedAction, ByVal newItems As IList) which seems relatively simple to figure out.
Imports System.ComponentModel
Imports System.Collections.Specialized
Public Class ObservableDictionary(Of TKey, TValue)
Implements IDictionary(Of TKey, TValue), INotifyPropertyChanged, INotifyCollectionChanged
#Region "Constructors"
Public Sub New()
m_Dictionary = New Dictionary(Of TKey, TValue)
End Sub
Public Sub New(ByVal dictionary As IDictionary(Of TKey, TValue))
m_Dictionary = New Dictionary(Of TKey, TValue)(dictionary)
End Sub
Public Sub New(ByVal comparer As IEqualityComparer(Of TKey))
m_Dictionary = New Dictionary(Of TKey, TValue)(comparer)
End Sub
Public Sub New(ByVal capacity As Integer)
m_Dictionary = New Dictionary(Of TKey, TValue)(capacity)
End Sub
Public Sub New(ByVal dictionary As IDictionary(Of TKey, TValue), ByVal comparer As IEqualityComparer(Of TKey))
m_Dictionary = New Dictionary(Of TKey, TValue)(dictionary, comparer)
End Sub
Public Sub New(ByVal capacity As Integer, ByVal comparer As IEqualityComparer(Of TKey))
m_Dictionary = New Dictionary(Of TKey, TValue)(capacity, comparer)
End Sub
#End Region 'Constructors
#Region "Fields"
Private Const CountString As String = "Count"
Private Const IndexerName As String = "Item[]"
Private Const KeysName As String = "Keys"
Private Const ValuesName As String = "Values"
Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) _
Implements INotifyPropertyChanged.PropertyChanged
Public Event CollectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs) _
Implements INotifyCollectionChanged.CollectionChanged
Private m_Dictionary As IDictionary(Of TKey, TValue)
#End Region 'Fields
Protected ReadOnly Property Dictionary As IDictionary(Of TKey, TValue)
Get
Return m_Dictionary
End Get
End Property
Public Overloads Sub Clear() Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Clear
If Dictionary.Count > 0 Then
Dictionary.Clear()
OnCollectionChanged()
End If
End Sub
Public Sub Add(ByVal item As KeyValuePair(Of TKey, TValue)) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Add
Insert(item.Key, item.Value, True)
End Sub
Public Sub Add(ByVal key As TKey, ByVal value As TValue) Implements IDictionary(Of TKey, TValue).Add
Insert(key, value, True)
End Sub
Public Sub AddRange(ByVal items As IDictionary(Of TKey, TValue))
If items Is Nothing Then Throw New ArgumentNullException("items")
If items.Count > 0 Then
If Dictionary.Count > 0 Then
If items.Keys.Any(Function(key) Dictionary.ContainsKey(key)) Then
Throw New ArgumentException("An item with the same key has already been added.")
Else
For Each i In items
Dictionary.Add(i)
Next
End If
Else
m_Dictionary = New Dictionary(Of TKey, TValue)(items)
End If
OnCollectionChanged(NotifyCollectionChangedAction.Add, items.ToArray)
End If
End Sub
Private Function Remove(ByVal item As KeyValuePair(Of TKey, TValue)) As Boolean _
Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Remove
Return Remove(item.Key)
End Function
Public Function Remove(ByVal key As TKey) As Boolean Implements IDictionary(Of TKey, TValue).Remove
If key Is Nothing Then Throw New ArgumentNullException("key")
Dim item As TValue
Dictionary.TryGetValue(key, item)
Dim removed = Dictionary.Remove(key)
If removed Then OnCollectionChanged() 'FieldsNotifyCollectionChangedAction.Remove, New KeyValuePair(Of TKey, TValue)(key, item)
Return removed
End Function
Default Public Property Item(ByVal key As TKey) As TValue Implements IDictionary(Of TKey, TValue).Item
Get
Return Dictionary(key)
End Get
Set(ByVal value As TValue)
Insert(key, value, False)
End Set
End Property
Private Sub Insert(ByVal key As TKey, ByVal value As TValue, ByVal add As Boolean)
If key Is Nothing Then Throw New ArgumentNullException("key")
Dim item As TValue
If Dictionary.TryGetValue(key, item) Then
If add Then Throw New ArgumentException("An item with the same key has already been added.")
If Equals(item, value) Then Exit Sub
Dictionary(key) = value
OnCollectionChanged(NotifyCollectionChangedAction.Replace, New KeyValuePair(Of TKey, TValue)(key, value),
New KeyValuePair(Of TKey, TValue)(key, item))
Else
Dictionary(key) = value
OnCollectionChanged(NotifyCollectionChangedAction.Add, New KeyValuePair(Of TKey, TValue)(key, value))
End If
End Sub
#Region "ReadOnly methods and properties"
Public Overloads Sub CopyTo(ByVal array() As KeyValuePair(Of TKey, TValue), ByVal arrayIndex As Integer) _
Implements ICollection(Of KeyValuePair(Of TKey, TValue)).CopyTo
Dictionary.CopyTo(array, arrayIndex)
End Sub
Public Overloads ReadOnly Property Count As Integer Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Count
Get
Return Dictionary.Count
End Get
End Property
Public ReadOnly Property IsReadOnly As Boolean Implements ICollection(Of KeyValuePair(Of TKey, TValue)).IsReadOnly
Get
Return Dictionary.IsReadOnly
End Get
End Property
Public ReadOnly Property Keys As ICollection(Of TKey) Implements IDictionary(Of TKey, TValue).Keys
Get
Return Dictionary.Keys
End Get
End Property
Public ReadOnly Property Values As ICollection(Of TValue) Implements IDictionary(Of TKey, TValue).Values
Get
Return Dictionary.Values
End Get
End Property
Public Function Contains(ByVal item As KeyValuePair(Of TKey, TValue)) As Boolean _
Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Contains
Return Dictionary.Contains(item)
End Function
Public Function ContainsKey(ByVal key As TKey) As Boolean Implements IDictionary(Of TKey, TValue).ContainsKey
Return Dictionary.ContainsKey(key)
End Function
Public Function ContainsValue(ByVal value As TValue) As Boolean
Return Dictionary.Values.Contains(value)
End Function
Public Function TryGetValue(ByVal key As TKey, ByRef value As TValue) As Boolean _
Implements IDictionary(Of TKey, TValue).TryGetValue
Return Dictionary.TryGetValue(key, value)
End Function
Public Overloads Function GetEnumerator() As IEnumerator(Of KeyValuePair(Of TKey, TValue)) _
Implements IEnumerable(Of KeyValuePair(Of TKey, TValue)).GetEnumerator
Return Dictionary.GetEnumerator
End Function
Private Function GetIEnumerableEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
Return DirectCast(Dictionary, IEnumerable).GetEnumerator
End Function
Private Sub OnPropertyChanged()
OnPropertyChanged(CountString)
OnPropertyChanged(IndexerName)
OnPropertyChanged(KeysName)
OnPropertyChanged(ValuesName)
End Sub
Protected Overridable Sub OnPropertyChanged(ByVal propertyName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub
Private Sub OnCollectionChanged()
OnPropertyChanged()
RaiseEvent CollectionChanged(Me, New NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset))
End Sub
Private Sub OnCollectionChanged(ByVal action As NotifyCollectionChangedAction,
ByVal changedItem As KeyValuePair(Of TKey, TValue))
OnPropertyChanged()
RaiseEvent CollectionChanged(Me, New NotifyCollectionChangedEventArgs(action, changedItem))
End Sub
Private Sub OnCollectionChanged(ByVal action As NotifyCollectionChangedAction, ByVal newItem As KeyValuePair(Of TKey, TValue),
ByVal oldItem As KeyValuePair(Of TKey, TValue))
OnPropertyChanged()
RaiseEvent CollectionChanged(Me, New NotifyCollectionChangedEventArgs(action, newItem, oldItem))
End Sub
Private Sub OnCollectionChanged(ByVal action As NotifyCollectionChangedAction, ByVal newItems As IList)
OnPropertyChanged()
RaiseEvent CollectionChanged(Me, New NotifyCollectionChangedEventArgs(action, newItems))
End Sub
#End Region 'ReadOnly methods and properties
End Class
La vida loca

Similar Messages

  • What does this mean? and how to I get the propertyChange event

    what does this mean?
    "This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event."
    how would i impliment this to find when the value changes?

    Assign event listener to the target class having this property to that event type PropertyChangeEvent.PROPERTY_CHANGE
    and you'll have it handled post factum. It's better to use setter&getter approach to handle value changes for particular property.

  • How to trigger the valuechange event on button

    Hi All,
    I am working on ADF Application and i have a requirement where i have a valuechange event function associated with the textbox andthe requirement is like the user will enter the value in text box and he/she will press the submit button directly without tab out .I want to trigger my value change event first and if all validation goes right then it should trigger the button event but user will press the butto only once.
    Please reply !!!
    Urgent !!
    Thanks..

    public int validate(){
    int result=0;
    if (value == null){
    //do something
    result=1;
    return result;
    on button click call this
    public String commandButton1_action() {
    if(validate()!=0){
    return null;
    //do rest...
    }

  • Can not trigger the null event!

    Page newPage = new Page("ListAffirmSubmit_Java");
    EventResult result = new EventResult(newPage);
    return result;
    This way can not trigger the null event in the 'newPage'.I want to call the null event to init the viewobject in the 'newPage'.
    Can you tell me the reason or another way to init it?

    I have found a way from the help on line:
    Page nextPage = new Page("ListAffirmSubmit_Java");
    Page redirectPage = RedirectUtils.getRedirectPage(context, nextPage);
    return new EventResult(redirectPage);

  • When I visit a site the color of the link seldom changes to the color I have selected. also even when it does change, it reverts to the unvisited color in a day or so.

    When I visit a site the color of the link seldom changes to the color I have selected. Also even when it does change, it reverts to the unvisited color in a day or so. The history is set to over 300 days and everything is there as far as I can tell.

    Does this problem affect all sites, or only some? Try going to a Google search results page and click a few links. Then, come back a day later and see if they are still visited.
    It may be that the links that get reset are coming from a frameset. Firefox only remembers history from framesets temporarily, which affects sites that use them. (An example would be the craigslist forums)

  • Change pointers to trigger the IDOC

    HI
    I am having a selection screen with fields to create a custom info record (transaction VD51/ VD52 )
    Customer
    material
    salesorganisation
    distribution channel
    division
    if we can use change pointers to determine when procedure is triggered.
    Please provide the steps for that (including change document)or we need to check the CDHDR table using the following fields.
    Plz suggest

    Change pointers is the one of the IDOC processing method in ALE.
    In this once we make the config to any of messages type , if any changes are made in sending system then IDOC will be posted directly to destination with user interation.
    Changes pointers are configured using BD50,BD51,BD53,BD61.
    Change pointers are stored in tables BDCP and BDCPS (or BDCP2 in case of high-performance setting) - like CDHDR and CDPOS for change documents (but this is not a controlling table!).
    1. Do you really need change pointers?
    You need change pointers to distribute changes with the ALE SMD tool. If you do not use this tool, you do not need to write change pointers.
    You can deactivate change pointers and activate them again with the transaction BD61.
    2. Do you really need to activate change pointers for this messages type?
    If some messages types are no longer to be distributed by change pointers, you can
    deactivate change pointers for this message type.
    You can deactivate change pointers for the message type
    and reactivate them again in transaction BD50.
    For reduced message types, deactivate the change pointer with the
    Reduction tool (transaction BD53).
    Applications which write change documents will also try to write change pointers for ALE operations. These are log entries to remember all modified data records relevant for ALE.
    Most applications write change documents. These are primarily log entries in the
    tables CDHDR and CDPOS.
    Change documents remember the modified fields made to the database by an
    application. They also remember the user name and the time when the modification
    took place.
    The decision whether a field modification is relevant for a change document is
    triggered by a flag of the modified field’s data element. You can set the flag with
    SE11 by modifying the data element.
    For the purpose of distributing data via ALE to other systems, you may want to
    choose other fields, which shall be regarded relevant for triggering a distribution.
    Therefore R/3 introduced the concept of change pointers, which are nothing else
    than a second log file specially designed for writing the change pointers which are
    meant to trigger IDoc distribution via ALE.
    So the change pointers will remember the key of the document every time when a
    relevant field has changed.
    Change pointers are then evaluated by an ABAP which calls the IDoc creation, for
    every modified document found in the change pointers.
    The Change pointers are written from the routine CHANGEDOCUMENT_CLOSE
    when saving the generated change document. So change pointers are automatically
    written when a relevant document changes.
    The following function is called from within CHANGEDOCUMENT_CLOSE in order to write the change pointers.
    CALL FUNCTION 'CHANGE_POINTERS_CREATE'
    EXPORTING
    change_document_header = cdhdr
    TABLES
    change_document_position = ins_cdpos.
    Activation of change pointer update :
    Change pointers are log entries to table BDCP which are written every time a transaction modifies certain fields. The change pointers are designed for ALE distribution and written by the function CHANGE_DOCUMENT_CLOSE.
    Change pointers are written for use with ALE. There are ABAPs like RBDMIDOC
    which can read the change pointers and trigger an IDoc for ALE distribution.
    The change pointers are mainly the same as change documents. They however can
    be set up differently, so fields which trigger change documents are not necessarily
    the same that cause change pointers to be written.
    In order to work with change pointers there are two steps to be performed
    1) Turn on change pointer update generally
    2) Decide which message types shall be included for change pointer update
    R3 allows to activate or deactivate the change pointer update. For this purpose it
    maintains a table TBDA1. The decision whether the change pointer update is active
    is done with a Function Ale_Component_Check
    This check does nothing else than to check, if this table has an entry or not. If there is an entry in TBDA1, the ALE change pointers are generally active. If this table is empty, change pointers are turned off for everybody and everything, regardless of the other settings.
    The two points read like you had the choice between turning it on generally or
    selectively. This is not the case: you always turn them on selectively. The switch to
    turn on generally is meant to activate or deactivate the whole mechanism.
    The change pointers which have not been processed yet, can be read with a function
    module.
    Call Function 'CHANGE_POINTERS_READ'
    The ABAP RBDMIDOC will process all open change pointers and distribute the
    matching IDocs.
    When you want to send out an IDoc unconditionally every time a transaction
    updates, you better use the workflow from the change documents.
    Reward if useful

  • How to trigger the exit event of a subform?

    hi there,
    we added some code to the exit event of a subform to do some validation, but we found out that
    if the user save the form after filling it and without clicking somewhere outside the subform,
    the exit event will not be trigger, so the code will not check ,then the form got saved with errors.
    could you pls tell us how to solve this?
    br.
    zj

    Hi,
    Instead of writin code in Subform just write the code in exit of the individual field.
    thanks,
    Amish.

  • Does changes in ViewRowImpl update the model?

    Hi, I have two related application modules A and B.
    Using A, I get a ViewRowImpl from UI using iterator binding and getCurrentRow() method and update some data.
    I do not post changes in database.
    In B, I tried to get an instance of the same ViewRowImpl using the findByKey() method. The data contained in ViewRowImpl does not contain the changes happened earlier in A.
    I also tried to relate A and B and get an instance of A from B using a getter from AppModuleImpl but again the ViewRowImpl got using findByKey() does not contain changes?
    Why does changes in a ViewRowImpl doesn't update the Data Model?
    I also tried findInCacheByKey() method but nothing changed
    Any comment will be helpful.
    Thanks.
    Edited by: IliasS on 2 Ιαν 2012 2:35 πμ

    Even if making B nested in A i didn't managed to get a ViewRowImpl with updated fields.
    I tried to use the B's service methods directly from UI through pageDef or
    indirectly calling a wrapper method in A's appModuleImpl that uses B's method.
    In A's service method I get the updated VOImpl,
    in B's service method I get an outdated VOImpl.
    Really I can't imagine an EJB container to handle object relational model in such a problematic way....

  • How to trigger the "click" event using javascript in LC8?

    I have 2 button in the form. I don't want the user to click the button1 directly (invisible now). but I want the user click the button2 and then do some checking. after checking is finisined,  the script will continue to trigger the button1 "click" event. How to trigger the button1 "click" event through javascript in LC 8? Thanks.

    button2.execevent("click");

  • Is it possible to trigger the next event from within the event case?

    I have a rather complicated event that is triggered by a change in value of a particular button in the interface. In some cases, I want to alter that button's value when handling other events. But when I do this, the event handling a change in value for that button does not get triggered. Is there a way to make sure the value change event gets handled at the next iteration of the while loop in which the event structure sits?
    Solved!
    Go to Solution.

    Hi Mike,
    Thanks! I was using properties and did not previously know what the value(signaling) was. Knowing this will really help me clean up a lot of redundant code.

  • How to define custom event and how to trigger the defined event

    hi,guys
    hurry issue....................hope get help.
    I am using oracle weblogic 10gr3 portal.and we choiced java portlet.as of now,we got some question about custom Event.hope you can give some idea....
    thank you so much.
    question detail:
    1.for java portlet ,how to define custom event.
    2.how to trigger this event.
    3 about the data,may be sometime need to transit Biz data.
    auctully,I just want to implements between two portlets communicate.
    for example:
    existing portletA,portletB.
    portletA is a list,like:
    A AA <button>
    after I click this buttom,then portletB will be effect,it means they are interact with each other.
    does anybody hit this issue before,if you solved pls share me .
    thank you for you help....

    Hello,
    Please note that everything below applies to JSR168 portlets ONLY- JSR286 portlets and other portlet types handle events a little differently.
    From inside your JSR168 portlet you can send an event during processAction or when receiving another event by using the PortletBackingContext object, such as:
    import javax.portlet.ActionResponse;
    import javax.portlet.ActionRequest;
    import javax.servlet.http.HttpServletRequest;
    import com.bea.netuix.servlets.controls.portlet.backing.PortletBackingContext;
    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
    HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute("javax.servlet.request");
    PortletBackingContext portletBackingContext = PortletBackingContext.getPortletBackingContext(httpRequest);
    portletBackingContext.fireCustomEvent("customEvent", "This is a custom event");
    To receive an event, in your .portlet file you just need to put in a "handleCustomEvent" tag specifying which method to call when the event is received, such as:
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
    <netuix:javaPortlet title="Listening Portlet" definitionLabel="yourPortletName">
    <netuix:handleCustomEvent event="customEvent" eventLabel="customEvent" filterable="true" description="custom event handler">
    <netuix:invokeJavaPortletMethod method="processCustomEvent"/>
    </netuix:handleCustomEvent>
    </netuix:javaPortlet>
    </portal:root>
    Then, in your receiving portlet the method "processCustomEvent" would receive the event, such as:
    public void processCustomEvent(ActionRequest actionRequest, ActionResponse actionResponse, Event event)
    The event payload can be any Serializable object you want, but for forward-compatibility with JSR286 it would be ideal if it had a valid JAXB binding.
    Kevin

  • Does Changing of Mobiles Deletes the Data

    Well My Nokia handset is Nokia3230 & i want to Change it to nokia N73 or any other Handset.
    i have Many SMS & Contacts saved on my Nokia 3230 so i Want all those SMS & Contacts on my New Handset also i want to Know is that Possible if so what is the Procedure for it?
    Please Help.
    Well the SMS are saved on the Memory Card i Think.

    No. If my memory serves me right, SMS won't be ever be stored on your memory card rather it will just stay in your phone memory.
    Using PC Suite:
    To backup to your memory card:
    select Tools > Memory from the main menu
    select Options > Backup phone mem.

  • I am trying to trigger a custom event using a program but does not work ..

    HI ....i am trying to trigger a custom event of a custom object type using a program but does not work. If trigger the same event using SWUE it works.
    below is the code...
    {Key = '0010001115'. "Sales Order Number (hard-coded)
    CALL FUNCTION 'SWE_EVENT_CREATE'
      EXPORTING
        objtype                       = 'ZXXXXXXXF'
        objkey                        = KEY
        event                         = 'ZEVENT'
      CREATOR                       = ' '
      TAKE_WORKITEM_REQUESTER       = ' '
      START_WITH_DELAY              = ' '
      START_RECFB_SYNCHRON          = ' '
      NO_COMMIT_FOR_QUEUE           = ' '
      DEBUG_FLAG                    = ' '
      NO_LOGGING                    = ' '
      IDENT                         =
    IMPORTING
      EVENT_ID                      =
      RECEIVER_COUNT                =
    TABLES
      EVENT_CONTAINER               =
    EXCEPTIONS
      OBJTYPE_NOT_FOUND             = 1
      OTHERS                        = 2}
    Please guide me if i am missing something.

    Hi Sunny,
    I think you should try creating the event using FM SAP_WAPI_CREATE_EVENT.
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
      EXPORTING
        OBJECT_TYPE             =  'ZXXXXXXXF'
        OBJECT_KEY              = key
        EVENT                   = 'ZEVENT'
    *   COMMIT_WORK             = 'X'
    *   EVENT_LANGUAGE          = SY-LANGU
    *   LANGUAGE                = SY-LANGU
    *   USER                    = SY-UNAME
    *   IFS_XML_CONTAINER       =
    IMPORTING
       RETURN_CODE             = rcode
       EVENT_ID                = event_id
    * TABLES
    *   INPUT_CONTAINER         =
    *   MESSAGE_LINES           =
    *   MESSAGE_STRUCT          =
    Regards,
    Saumya

  • Not able to get changed values in the SAVE EVENT in ServHPartnerDet view

    Hi Experts,
    I am new CRM WEB IC, i have requirement like need to access four IBASE fields from BupaIbaseDetail and need to display those fiedls in ServHPartnerDet view. I am able display the fields and its values in the target view. But when user press change button and changes those four fields and press save button not able get the changed values in to the SAVE EVENT.Anyone please help me in this.
    IBHEADER , IBASEADDRESS  are the CONTEXT NODE CREATED in target view. I have binded IBHEADER to CuCoIbase custom controller and getting four fields data from IBASEADDRESS. below is the code for CREATE_CONTEXT_NODES.
    METHOD create_ibaseaddress.
      DATA:
        model        TYPE REF TO if_bsp_model,
        coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
        entity       TYPE REF TO cl_crm_bol_entity,              "#EC *
        entity_col   TYPE REF TO if_bol_entity_col.             "#EC *
      model = owner->create_model(
          class_name     = 'ZL_CRM_IC_SERVHPDET_CN00'
          model_id       = 'IBaseAddress' ).                    "#EC NOTEXT
      ibaseaddress ?= model.
      CLEAR model.
      coll_wrapper =
        ibheader->get_collection_wrapper( ).
    TRY.
          entity ?= coll_wrapper->get_current( ).
        CATCH cx_sy_move_cast_error.
      ENDTRY.
      IF entity IS BOUND.
        TRY.
            entity_col = entity->get_related_entities(
                            iv_relation_name = 'FirstLevelComponent' ).
          CATCH cx_crm_genil_model_error.
        ENDTRY.
        TRY.
            entity ?= entity_col->get_current( ).
          CATCH cx_sy_move_cast_error.
        ENDTRY.
        CLEAR entity_col.
        IF entity IS BOUND.
          TRY.
              entity_col = entity->get_related_entities(
                              iv_relation_name = 'ComponentAddress' ).
              ibaseaddress->set_collection( entity_col ).
            CATCH cx_crm_genil_model_error.
          ENDTRY.
        ENDIF.
      ENDIF.
    ENDMETHOD.

    Code i have written in the CREATE_CONTEXT_NODE method for my custom context nodes( IBHEADER,IBASEADDRESS).
    this  CREATE_IBHEADER some data related to IBASE header then from this reading the IBASEADDRESS contextnode fields for displaying in the ServHPartnerDet. It is working fine but After changing the four fields values in the ServHPartnerDet view and trying to save, then context is not reading the new values it gives the old values only.
      TRY.
          lr_coll_wr = ztyped_context->ibaseaddress->get_collection_wrapper( ).
          IF lr_coll_wr IS BOUND.
            lr_entity ?= lr_coll_wr->get_current( ).
          ENDIF.
        CATCH cx_crm_genil_model_error.
      ENDTRY.
      CALL METHOD lr_entity->if_bol_bo_property_access~get_property_as_value
        EXPORTING
          iv_attr_name = 'BUILDING'
        IMPORTING
          ev_result    = lw_building.
    the building has got result of old value no the new value.
    method CREATE_IBHEADER.
        DATA:
          model        TYPE REF TO if_bsp_model,
          coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
          entity       TYPE REF TO cl_crm_bol_entity,    "#EC *
          entity_col   TYPE REF TO if_bol_entity_col.    "#EC *
        model = owner->create_model(
            class_name     = 'ZL_CRM_IC_SERVHPDET_CN01'
            model_id       = 'IBHEADER' ). "#EC NOTEXT
        IBHEADER ?= model.
        CLEAR model.
    bind to custom controller
      DATA:
          cuco TYPE REF TO cl_crm_ic_cucoibase_impl,
          cnode TYPE REF TO cl_bsp_wd_context_node.
      cuco ?= owner->get_custom_controller(
            'CuCoIbase' ).                                      "#EC NOTEXT
      cnode ?=
        cuco->typed_context->ibaseheader.
      coll_wrapper = cnode->get_collection_wrapper( ).
      ibheader->set_collection_wrapper( coll_wrapper ).
    endmethod.

  • How to use the ONF4 event in REUSE_ALV_GRID_DISPLAY?

    I am able to use the methods for BUTTON_CLICK and HOTSPOT_CLICK for a report that outputs ALV Grid using REUSE_ALV_GRID_DISPLAY.
    But I am not able to trigger the ONF4 event.
    How to enable this?
    Thanks,

    hi look at the code ...may be helpful for u..
    TYPE-POOLS SLIS.
    DATA: BEGIN OF T_OUT_FOR_F4 OCCURS 0,
            BUKRS LIKE T001-BUKRS,
            BUTXT LIKE T001-BUTXT,
          END   OF T_OUT_FOR_F4.
    PARAMETERS: P_BUKRS TYPE BUKRS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.
      PERFORM F4_FOR_BUKRS.
    *&      Form  F4_FOR_BUKRS
          text
    -->  p1        text
    <--  p2        text
    FORM F4_FOR_BUKRS.
      DATA: IT_FIELDCAT TYPE  SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
            IT_REPORT   TYPE  SY-REPID,
            ES_SELFIELD TYPE  SLIS_SELFIELD.
    Get data
      SELECT BUKRS BUTXT FROM T001 INTO TABLE T_OUT_FOR_F4
      WHERE BUKRS = '0001' OR BUKRS = 'US01'.
    Get field
      IT_REPORT = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME     = IT_REPORT
                I_INTERNAL_TABNAME = 'T_OUT_FOR_F4'
                I_INCLNAME         = IT_REPORT
           CHANGING
                CT_FIELDCAT        = IT_FIELDCAT[].
      LOOP AT IT_FIELDCAT.
        IT_FIELDCAT-KEY = SPACE.
        IF IT_FIELDCAT-FIELDNAME = 'BUTXT'.
          IT_FIELDCAT-KEY = 'X'.
        ENDIF.
        MODIFY IT_FIELDCAT.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
        I_TITLE                       =
        I_SELECTION                   = 'X'
        I_ZEBRA                       = ' '
        I_SCREEN_START_COLUMN         = 0
        I_SCREEN_START_LINE           = 0
        I_SCREEN_END_COLUMN           = 0
        I_SCREEN_END_LINE             = 0
        I_CHECKBOX_FIELDNAME          =
        I_LINEMARK_FIELDNAME          =
        I_SCROLL_TO_SEL_LINE          = 'X'
          I_TABNAME                     = 'T_OUT_FOR_F4'
        I_STRUCTURE_NAME              =
          IT_FIELDCAT                   = IT_FIELDCAT[]
        IT_EXCLUDING                  =
        I_CALLBACK_PROGRAM            =
        I_CALLBACK_USER_COMMAND       =
        IS_PRIVATE                    =
        IMPORTING
          ES_SELFIELD                   = ES_SELFIELD
        E_EXIT                        =
        TABLES
          T_OUTTAB                      = T_OUT_FOR_F4
       EXCEPTIONS
         PROGRAM_ERROR                 = 1
         OTHERS                        = 2
      IF SY-SUBRC  0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        READ TABLE T_OUT_FOR_F4 INDEX ES_SELFIELD-TABINDEX.
        P_BUKRS = T_OUT_FOR_F4-BUKRS.
      ENDIF.
    ENDFORM.                    " F4_FOR_BUKRS

Maybe you are looking for

  • Free item tick automataclly in PO

    Dear Members, I have some problem while creating PO. When i am creating the PO "Free Item" indicator is automatically tick.When i uncheck the tick it is showing me the condition tab but when i save the PO again free item indicator is automatically  c

  • Opening search bar results in a new tab

    My search bar opens the results in a new tab, but, when I click on one of the links on the results page, FF no longer remembers the search results page (ie. the Back button does not work). This problem goes away if I set the search bar results to ope

  • Support for Logical Databases PNP/PNPCE

    On this topic I would like to know: 1. Will SAP will continue to support PNP or will support for PNP be eventually phased out? 2. Were can I find the official SAP document that covers the introduction of PNPCE? 3. Where is it stated officially by SAP

  • Why do I keep having to enter my Apple password when I already added it to the keychain?

    This seems to happen at every opportunity for a password request - new device adds an email account, making a purchase (free or paid) on the App Store, logging in to the Apple website, doing just about anything with iCloud.  I have a very complex pas

  • Lenovo T400 LCD Problem (shut off and bezel light abnormality )

    Hello !!! This is regarding a problem with the Thinkpad T400. The problem is -- When the lid is at ~65 degrees , everything works fine. Whereas , when the lid is raised to viewing angle of arounbd 90 degrees , it goes to sleep AND , I noticed that th