Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357509 - Hierarchy of master fields on a form
Summary: Hierarchy of master fields on a form
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 11:14 EDT by Pi CLA
Modified: 2011-10-10 12:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pi CLA 2011-09-13 11:14:16 EDT
Build Identifier: 

We have the following case: field A is master of field B and field B is master of field C.
In this case there is a problem when opening a form in Modify Mode.
The fields B and C are declared as slave fields since they are at least once a slave.
The master fields are filled in first. Field B is not filled in because it is declared a slave field.
Now in the case that field C would be filled in first it remains empty because its master (C) is empty.

In my opinion there should be no logic like this. Just let the selected data get in the fields. We don't want to trick the users, do we?

Reproducible: Sometimes

Steps to Reproduce:
1. take form with at least a 3 chain of master fields
2. edit entity (opens form)
3. randomly last slave is filled in or not
Comment 1 Ivan Motsch CLA 2011-09-14 10:44:28 EDT
This is just one view of the topic. Many developers use that master-trigger to do some logic, regardless whether the value change was done by the user or by loading the form with a form data.

Applying your proposed solution would break this code.

However if your form should not fire any master-slave triggers during load either mark the slaves as getConfiguredMasterRequired=false or simply override execChangedMasterValue in the slave fields. That way you have full control over what happens when the master value changes.

For example use the following code to only clear slave values when the form is loaded and not when it is loading:

protected void execChangedMasterValue(Object newMasterValue) throws ProcessingException {
  if(getForm().isFormLoading()){
    //do nothing
  }
  else{
    //a value change happened on the open form (by the user)
    setValue(null); //OR super.execChangedMasterValue(newMasterValue);
  }
}
Comment 2 Ivan Motsch CLA 2011-09-14 10:45:34 EDT
This is not a bug and requires no fix. see previous comment.
Comment 3 Matthias Zimmermann CLA 2011-10-10 12:30:11 EDT
ticket closed