02-24-2010 01:17 PM
Please explain the the fieldchangenotify(int context) function...
what does this function actually do and when it is used and whats the concept of context here ??
02-24-2010 02:24 PM
This method belongs to the interface FieldChangeListener. You implement this interface in your class, in order to be notified when the contents of a field is changed. You then pass a reference of your listener implementation to the field in question using Field.setChangeLIstener(). Now your method is called whenever the value of the field is changed.
All of this is in the javadocs.
Have you looked at the sample programs that ship with the JDE? I would certainly advise this.
02-24-2010 02:48 PM
I wonder if RexDoug is explaining
public void fieldChanged(Field field, int context)
protected void fieldChangeNotify(int context)
fieldChangeNotify is a method on the Field class.
Other processing for the Field should call this when they change the state of the Field in a way that a FieldChangeListener might be interested in seeing.
Mostly you do not need to override this function, but you can call it. Specifically if you are creating your won Field, then you will probably want to call it when you know the Field's state as changed. For example, if you create a Custom Button, and your processing pricks up and processes a navigationClick, then you should call fieldChangeNotify() to tell any listener that the button has been clicked.
When you call fieldChangeNotify you can pass a context that can be used by the FieldChangeListener to identify what caused the Field to change - and they can query the Field to determine its current state.
If you are not bothered about FieldChangeListeners you can completely ignore this method.
Hope that is clear and I've answered the right question.