Search in sources :

Example 1 with ChooseFormDialog

use of org.activityinfo.ui.client.component.chooseForm.ChooseFormDialog in project activityinfo by bedatadriven.

the class DropPanelDropController method chooseReference.

private void chooseReference(final FieldWidgetContainer container, final FormField formField) {
    final ChooseFormDialog dialog = new ChooseFormDialog(this.formDesigner.getResourceLocator());
    dialog.choose(new ChooseFormCallback() {

        @Override
        public void onChosen(CatalogEntry entry) {
            ReferenceType type = (ReferenceType) formField.getType();
            type.setRange(ResourceId.valueOf(entry.getId()));
            formField.setLabel(entry.getLabel());
            container.syncWithModel();
        }

        @Override
        public void onCanceled() {
            container.removeFromForm();
        }
    });
}
Also used : ChooseFormCallback(org.activityinfo.ui.client.component.chooseForm.ChooseFormCallback) ChooseFormDialog(org.activityinfo.ui.client.component.chooseForm.ChooseFormDialog) SubFormReferenceType(org.activityinfo.model.type.subform.SubFormReferenceType) ReferenceType(org.activityinfo.model.type.ReferenceType)

Aggregations

ReferenceType (org.activityinfo.model.type.ReferenceType)1 SubFormReferenceType (org.activityinfo.model.type.subform.SubFormReferenceType)1 ChooseFormCallback (org.activityinfo.ui.client.component.chooseForm.ChooseFormCallback)1 ChooseFormDialog (org.activityinfo.ui.client.component.chooseForm.ChooseFormDialog)1