started with some refactoring work on admin - supervisor settings
This commit is contained in:
parent
c7f681cda7
commit
ee1f668baf
@ -47,7 +47,7 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
private SupervisorDao supervisorDao;
|
||||
|
||||
@SpringBean
|
||||
ProjectClassDao projectClassDao;
|
||||
private ProjectClassDao projectClassDao;
|
||||
|
||||
@SpringBean
|
||||
private KeywordDao keywordDao;
|
||||
@ -56,13 +56,14 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
private KeywordTypeDao keywordTypeDao;
|
||||
|
||||
private WebMarkupContainer container;
|
||||
//private SupervisorDataProvider provider;
|
||||
private Label emptyLabel;
|
||||
private SupervisorDaoParams params;
|
||||
private QueryableDataProvider<Employee, SupervisorDaoParams> provider;
|
||||
|
||||
private Component feedbackPanel;
|
||||
|
||||
private DataView<Employee> dataView;
|
||||
|
||||
public AdminManageSupervisorPanel(String id, final Component feedbackPanel__){
|
||||
super(id);
|
||||
feedbackPanel= feedbackPanel__;
|
||||
@ -76,28 +77,25 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
container = new WebMarkupContainer("container");
|
||||
|
||||
//Add info for the user should there be no events to display.
|
||||
emptyLabel = new Label("emptyLabel", "No events to show.");
|
||||
container.add(emptyLabel);
|
||||
emptyLabel = new Label("emptyLabel", "No supervisors matched your search criteria.");
|
||||
//container.add(emptyLabel);
|
||||
emptyLabel.setOutputMarkupId(true); //Needs to be AJAX-enabled.
|
||||
container.setOutputMarkupId(true);
|
||||
//container.add(dataView);
|
||||
add(container);
|
||||
params = new SupervisorDaoParams();
|
||||
updateListView();
|
||||
emptyLabel.setVisible(provider.size()==0); //Rule for the empty label
|
||||
provider = new QueryableDataProvider<Employee, SupervisorDaoParams>(
|
||||
supervisorDao, params);
|
||||
loadUserDataView(provider);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
private void updateListView() {
|
||||
container.removeAll();
|
||||
provider = new QueryableDataProvider<Employee, SupervisorDaoParams>(
|
||||
supervisorDao, params);
|
||||
loadUserDataView(provider);
|
||||
|
||||
|
||||
};
|
||||
};*/
|
||||
|
||||
public void loadUserDataView(IDataProvider<Employee> provider) {
|
||||
DataView<Employee> dataView = new DataView<Employee>("dataView", provider) {
|
||||
dataView = new DataView<Employee>("dataView", provider) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
@ -208,8 +206,8 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
@Override
|
||||
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
|
||||
|
||||
container.removeAll();
|
||||
params = new SupervisorDaoParams();
|
||||
//container.removeAll();
|
||||
//params = new SupervisorDaoParams();
|
||||
List<Keyword> keywords = unitPanel.getSelectedKeywords();
|
||||
keywords.addAll(researchAreaPanel.getSelectedKeywords());
|
||||
|
||||
@ -226,9 +224,10 @@ public class AdminManageSupervisorPanel extends Panel {
|
||||
}
|
||||
|
||||
params.setNameLike(supervisorField.getModelObject());
|
||||
emptyLabel.setVisible(dataView.getItemCount()==0); //Rule for the empty label
|
||||
target.addComponent(container);
|
||||
loadUserDataView(new QueryableDataProvider<Employee, SupervisorDaoParams>(
|
||||
supervisorDao, params));
|
||||
/* loadUserDataView(new QueryableDataProvider<Employee, SupervisorDaoParams>(
|
||||
supervisorDao, params));*/
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user