Hi,
Below is the use case required.
user clicks Edit button in the browse screen, the edit screen opens
Edit Screen contains few tabs (lets say 5 tabs) , based on one specific field from browse screen I want to hide/show few tabs in edit screen.
Thanks,
Saurabh
shiryaeva
(Olga Shiryaeva)
March 13, 2018, 10:09am
#3
Hi,
You can create multiple editor screens and open one of them depending on the passed parameter. It is a common case, and you can get some ideas from lots of similar questions here:
I am trying to create an associated entity from the browse screen of the parent entity. I have an entity, Activity, which is the parent entity has many Contact Attempt entities associated. I want to be able to create a Contact Attempt for the...
I am working on a database to track packages received and packages shipped. A package is received, the contents are processed and inspected, and then the package is shipped out again. When a user is receiving a package, he will create an instance on...
Hi, I have a list of customers and they may have several delivery addresses. So in the customer edit, I have a table with all the address this particular customer have with a button to create a new address. When I click on create, it opens the...
Hi, My scenario is this. I have an entity with a lot of attributes to display. So, while I have a master editor page with all attributes displayed / editable, I also want to create “shortcut” editor pages on the master page that updates different...
shiryaeva
(Olga Shiryaeva)
March 15, 2018, 5:35am
#4
Also, if need only to hide/show tabs, use the setVisible() method for the tabs of the TabSheet.
For example:
public class PersonBrowse extends AbstractLookup {
@Named("personsTable.edit")
private EditAction personsTableEdit;
@Inject
private CheckBox hideTabs;
@Override
public void init(Map<String, Object> params) {
personsTableEdit.setWindowParamsSupplier(()-> ParamsMap.of("hide", hideTabs.isChecked()));
hideTabs.addValueChangeListener(e ->
personsTableEdit.setWindowParamsSupplier(() ->
ParamsMap.of("hide", hideTabs.isChecked())));
}
}
public class PersonEdit extends AbstractEditor<Person> {
@Inject
private TabSheet tabSheet;
@WindowParam(name = "hide", required = true)
private boolean hideTabs;
@Override
public void init(Map<String, Object> params) {
super.init(params);
hideTabs = (boolean) params.get("hide");
tabSheet.getTab("addressTab").setVisible(hideTabs);
tabSheet.getTab("phoneTab").setVisible(hideTabs);
}
}
1 Like
Thanks very much . it worked