cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to be notified when a context attribute was changed?

Former Member
0 Kudos

Hi,

Is there a way to be notified when a context attribute had been changed?

All I need to know is that its value was changed, and then do something not related to the context.

I tried using the calculated feature but it seems that it does not help here.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Valery,

Can you please give a code snippet and explain the method you explained so that I can work on it?

It would be very helpful if you could mail me the same to Noufal_Kareem@satyam.com

Thanx and regards

Noufal

Former Member
0 Kudos

Noufal,

The code I'm referring to is right from my current work, and it would take some time to place it in separate context.

However on next Monday I plan to publish new post to my weblog where this topic will be covered.

VS

Former Member
0 Kudos

Please check /people/valery.silaev/blog/2005/06/29/apojo--almostplain-old-java-objects-as-model

VS

Former Member
0 Kudos

Hi,

if the context attribute is changed, the value will be automatically reflected to the fields that r mapped to it so only thing is u urself have to get the value and check if its changed or not as was told by bharatwaj.

Regards,

Sirisha

Former Member
0 Kudos

Erez,

Do you need "push" type of notifications (be notified on every change) or "pull" type (check yourself for changes, say, before saving data).

For second case Bharathwaj R provide you an answer.

For former case:

if this is not a model node already (Dynamic RFC) then you can do the following:

1. Create regular JavaBean with onPropertyChange notifications.

2. Import JavaBeans model in your project.

3. Create model nodes based on the model from [2] and subscribe to onPropertyChange events of model object.

VS

Former Member
0 Kudos

Hi,

I do need push type notification, so i'll try your suggestion.

Thanks, Erez

Former Member
0 Kudos

Hi,

I am sorry but i tried to create a JavaBean with

onPropertyChange notifications, but i just didn't succeed.

I have created a new "EJB module project" but i could not find where i define the notifications.

Thanks, Erez

Former Member
0 Kudos

You are confusing EJB (Enterprise JavaBean) and plain JavaBean. You may create JavaBean directly in WD project as regular JavaClass. You only have to follow naming conventions for getter/setter methods as well as methods to add/remove listeners.

VS

Former Member
0 Kudos

Hi,

I have succeeded creating EJB and it worked as you said.

But it does not really help me since i need to define all the attributes that i need in the context, in the java class (javaBean).

This context is very big it has a lot of nodes, and a lot of attributes in it, so it will be very hard and complicated to define all of them in the java class.

Thanks, Erez

Former Member
0 Kudos

Erez,

Then try to provide more detailed overview of what you'd like to achive (from use case prospective). Probably we will find a workaround.

VS

Former Member
0 Kudos

Hi,

I need to present some backend data in a WD.

I have no problem creating what i need in the context and then initilize it, and then all users can see all the data.

The problem is that this data can be changed so i need to know when a certain user chnaged a value, and when he chnages it i need to set the correct value in the backend.

So this is the reason i need this value change notification.

Thanks, Erez

Former Member
0 Kudos

Hi,

Dont allow the users to change the data in the VIEW form(make them diabled or show as text view so that the user willl not be able to enter any data) And if they wantt to change the data, provide this facility in other view, create some other form or View that will have text boxes and the users will enter the new values and once they click submit button write othere RFC that will insert or update these values into ur Back end.. Thus when u retrieve the data from the back end u 'll not face any problem as its updated u'll get the changed values.Sorry if i understood ur scenario in a wrong perspective, but there is nothing like notifying the context change so u'll be using two RFC's for retrieving the data for viewing and for updating this might help u.

Regards,

Sirisha.

Former Member
0 Kudos

Thanks a lot,

It sounds like a good idea, and i am sure it wil solve my problem.

Erez

Former Member
0 Kudos

Hi,

If its just a context attribute why cant you store the initial value and when u need to check if its changed get the value again and check with the initial value..

If its inside a node make use of wdContext.node<name>.isChanged()

wdContext.node<name>.isChangedByclient().

Regards

Bharathwaj