| RadioButtonGroup with LookupCall [message #1105160] |
Mon, 09 September 2013 08:48  |
Jan Put Messages: 4 Registered: August 2013 |
Junior Member |
|
|
Hi,
I have created an AbstractPageWithTable with a variable DossierNr that is properly initialized. From that page I open a form where I created an invisible field to store that DossierNr. On the form there is a radiogroup linked to a master field (DossierNr) and a lookupcall.
public class KinGroup extends AbstractRadioButtonGroup<Long> {
@Override
protected String getConfiguredLabel() {
return TEXTS.get("Kin");
}
@Override
protected Class<? extends LookupCall> getConfiguredLookupCall() {
return ClientLookupCall.class;
}
@Override
protected Class<? extends IValueField> getConfiguredMasterField() {
return DossierNrField.class;
}
}
Now i have the following problem:
Whenever I launch the form with following code:
HeirForm form = new HeirForm();
form.getDossierNrField().setValue(getDossierNr());
form.startNew();
form.waitFor();
if (form.isFormStored()) {
reloadPage();
}
the initialization of the masterfield DossierNr is too late, so the getDataByAll is already called before the setValue call of the DossierNrField is executed.
I also tried the execPrepareLookup of the form, but then the masterfield isn't yet initialized either.
Is there another exec function I should be using or can I trigger the RadioButtonGroup to call the lookup call again? Any ideas?
Thx,
Jan Put
|
|
|
|
| Re: RadioButtonGroup with LookupCall [message #1105748 is a reply to message #1105299] |
Tue, 10 September 2013 04:21  |
Jan Put Messages: 4 Registered: August 2013 |
Junior Member |
|
|
Hi Jeremie.
That did the trick. I had already found a workaround by calling an execPrepareLookup in the form class that I could override at form instantiation
HeirForm form = new HeirForm() {
@Override
protected void execPrepareLookup(LookupCall call) {
ClientLookupCall clLookup = (ClientLookupCall) call;
clLookup.setDossierNr(HeirTablePage.this.getDossierNr());
super.execPrepareLookup(call);
}
};
, but your sollution is much more elegant and easier to use when instantiated in multiple locations. Thx!!
[Updated on: Tue, 10 September 2013 04:25] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01490 seconds