*/
package org.mxchange.jjobs.beans.business.department;
-import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote;
import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.department.Departments;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
import org.mxchange.jusercore.model.user.User;
/**
*/
private BasicData departmentCompany;
- /**
- * A general department controller (backing bean)
- */
- @Inject
- private JobsDepartmentWebRequestController departmentController;
-
/**
* Assigned headquarter (if apply-able)
*/
*/
private Employable departmentLead;
+ /**
+ * A general department controller (backing bean)
+ */
+ @Inject
+ private JobsDepartmentListWebViewController departmentListController;
+
/**
* Owning user instance (which this department is assigned to)
*/
final Department department = this.createDepartment();
// Is the department not created yet?
- if (this.isDepartmentCreatedByRequiredData(department)) {
+ if (this.departmentListController.isDepartmentAlreadyAdded(department)) {
// Then show proper faces message
this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N
return;
return department;
}
- /**
- * Checks whether the given department is already found in local cache.
- * Please note that this method fully relies on the cache, so you must
- * always fire proper events that add/update/delete entries in cache.
- * <p>
- * @param department Department to check it's address
- * <p>
- * @return Whether the address has been found
- */
- private boolean isDepartmentCreatedByRequiredData (final Department department) {
- // Get full list from other bean
- final List<Department> departments = this.departmentController.allDepartments();
-
- // Default is not found
- boolean isFound = false;
-
- // Now check each entry
- for (final Department dep : departments) {
- // Is same address?
- if (Departments.isSameDepartment(dep, department)) {
- // Found one
- isFound = true;
- break;
- }
- }
-
- // Return flag
- return isFound;
- }
-
}
*/
package org.mxchange.jjobs.beans.business.department;
-import fish.payara.cdi.jsr107.impl.NamedCache;
-import java.text.MessageFormat;
-import java.util.Comparator;
-import java.util.LinkedList;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
-import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
-import org.mxchange.jcontactsbusiness.model.department.Department;
import org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote;
import org.mxchange.jjobs.beans.BaseJobsBean;
*/
private static final long serialVersionUID = 5_028_697_360_461L;
- /**
- * A list of all departments
- */
- private final List<Department> allDepartments;
-
/**
* EJB for administrative purposes
*/
@EJB (lookup = "java:global/jjobs-ejb/department!org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote")
private DepartmentSessionBeanRemote departmentBean;
- /**
- * A list of all departments (globally)
- */
- @Inject
- @NamedCache (cacheName = "departmentCache")
- private Cache<Long, Department> departmentCache;
-
- /**
- * A list of filtered departments
- */
- private List<Department> filteredDepartments;
-
/**
* Default constructor
*/
public JobsDepartmentWebRequestBean () {
// Call super constructor
super();
-
- // Init list
- this.allDepartments = new LinkedList<>();
- }
-
- /**
- * Observes events being fired when a department has been added.
- * <p>
- * @param event Event being fired
- * <p>
- * @throws NullPointerException If the parameter or it's carried instance is
- * null
- * @throws IllegalArgumentException If the branchId is zero or lower
- */
- public void afterDepartmentAddedEvent (@Observes final ObservableDepartmentAddedEvent event) {
- // Validate parameter
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getDepartment() == null) {
- // Throw NPE again
- throw new NullPointerException("event.department is null"); //NOI18N
- } else if (event.getDepartment().getDepartmentId() == null) {
- // Throw it again
- throw new NullPointerException("event.department.branchId is null"); //NOI18N
- } else if (event.getDepartment().getDepartmentId() < 1) {
- // Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("event.department.branchId={0} is not valid", event.getDepartment().getDepartmentId())); //NOI18N
- }
-
- // Add instance to cache
- this.departmentCache.put(event.getDepartment().getDepartmentId(), event.getDepartment());
- this.allDepartments.add(event.getDepartment());
- }
-
- @Override
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
- public List<Department> allDepartments () {
- return this.allDepartments;
- }
-
- @Override
- public Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException {
- // Validate parameter
- if (null == departmentId) {
- // Throw NPE
- throw new NullPointerException("departmentId is null"); //NOI18N
- } else if (departmentId < 1) {
- // Throw IAE
- throw new IllegalArgumentException("departmentId=" + departmentId + " is invalid"); //NOI18N
- } else if (!this.departmentCache.containsKey(departmentId)) {
- // Not found
- throw new DepartmentNotFoundException(departmentId);
- }
-
- // Get it from cache
- final Department department = this.departmentCache.get(departmentId);
-
- // Return it
- return department;
- }
-
- /**
- * Getter for a list of filtered departments
- * <p>
- * @return Filtered departments
- */
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
- public List<Department> getFilteredDepartments () {
- return this.filteredDepartments;
- }
-
- /**
- * Setter for a list of filtered departments
- * <p>
- * @param filteredDepartments Filtered departments
- */
- @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
- public void setFilteredDepartments (final List<Department> filteredDepartments) {
- this.filteredDepartments = filteredDepartments;
- }
-
- /**
- * Initializer method
- */
- @PostConstruct
- public void initializeList () {
- // Is cache there?
- if (!this.departmentCache.iterator().hasNext()) {
- // Get whole list from EJB
- final List<Department> departments = this.departmentBean.allDepartments();
-
- // Add all
- for (final Department department : departments) {
- // Add it to cache
- this.departmentCache.put(department.getDepartmentId(), department);
- }
- }
-
- // Is the list empty, but filled cache?
- if (this.allDepartments.isEmpty() && this.departmentCache.iterator().hasNext()) {
- // Build up list
- for (final Cache.Entry<Long, Department> currentEntry : this.departmentCache) {
- // Add to list
- this.allDepartments.add(currentEntry.getValue());
- }
-
- // Sort list
- this.allDepartments.sort(new Comparator<Department>() {
- @Override
- public int compare (final Department department1, final Department department2) {
- return department1.getDepartmentId() > department2.getDepartmentId() ? 1 : department1.getDepartmentId() < department2.getDepartmentId() ? -1 : 0;
- }
- });
- }
}
}
package org.mxchange.jjobs.beans.business.department;
import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
-import org.mxchange.jcontactsbusiness.model.department.Department;
/**
* An interface for general department controller
*/
public interface JobsDepartmentWebRequestController extends Serializable {
- /**
- * Returns a list of all departments
- * <p>
- * @return A list of all departments
- */
- List<Department> allDepartments ();
-
- /**
- * Retrieves a single company department entity for given id number or
- * throws a proper exception if not found.
- * <p>
- * @param departmentId Company department id to lookup
- * <p>
- * @return Company department instance
- * <p>
- * @throws DepartmentNotFoundException If the id number could not be
- * looked up and solved into an entity
- */
- Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException;
-
}
--- /dev/null
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.department.list;
+
+import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.cache.Cache;
+import javax.ejb.EJB;
+import javax.enterprise.event.Observes;
+import javax.faces.view.ViewScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.department.Departments;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+
+/**
+ * A list bean for departments
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("departmentListController")
+@ViewScoped
+public class JobsDepartmentListWebViewBean extends BaseJobsBean implements JobsDepartmentListWebViewController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 5_028_697_360_462L;
+
+ /**
+ * A list of all departments
+ */
+ private final List<Department> allDepartments;
+
+ /**
+ * EJB for administrative purposes
+ */
+ @EJB (lookup = "java:global/jjobs-ejb/department!org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote")
+ private DepartmentSessionBeanRemote departmentBean;
+
+ /**
+ * A list of all departments (globally)
+ */
+ @Inject
+ @NamedCache (cacheName = "departmentCache")
+ private transient Cache<Long, Department> departmentCache;
+
+ /**
+ * A list of filtered departments
+ */
+ private List<Department> filteredDepartments;
+
+ /**
+ * Currently selected department
+ */
+ private Department selectedDepartment;
+
+ /**
+ * Default constructor
+ */
+ public JobsDepartmentListWebViewBean () {
+ // Call super constructor
+ super();
+
+ // Init list
+ this.allDepartments = new LinkedList<>();
+ }
+
+ /**
+ * Observes events being fired when a department has been added.
+ * <p>
+ * @param event Event being fired
+ * <p>
+ * @throws NullPointerException If the parameter or it's carried instance is
+ * null
+ * @throws IllegalArgumentException If the branchId is zero or lower
+ */
+ public void afterDepartmentAddedEvent (@Observes final ObservableDepartmentAddedEvent event) {
+ // Validate parameter
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getDepartment() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.department is null"); //NOI18N
+ } else if (event.getDepartment().getDepartmentId() == null) {
+ // Throw it again
+ throw new NullPointerException("event.department.branchId is null"); //NOI18N
+ } else if (event.getDepartment().getDepartmentId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("event.department.branchId={0} is not valid", event.getDepartment().getDepartmentId())); //NOI18N
+ }
+
+ // Add instance to cache
+ this.departmentCache.put(event.getDepartment().getDepartmentId(), event.getDepartment());
+ this.getAllDepartments().add(event.getDepartment());
+ }
+
+ @Override
+ public Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException {
+ // Validate parameter
+ if (null == departmentId) {
+ // Throw NPE
+ throw new NullPointerException("departmentId is null"); //NOI18N
+ } else if (departmentId < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException("departmentId=" + departmentId + " is invalid"); //NOI18N
+ } else if (!this.departmentCache.containsKey(departmentId)) {
+ // Not found
+ throw new DepartmentNotFoundException(departmentId);
+ }
+
+ // Get it from cache
+ final Department department = this.departmentCache.get(departmentId);
+
+ // Return it
+ return department;
+ }
+
+ /**
+ * Returns a list of all departments
+ * <p>
+ * @return A list of all departments
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<Department> getAllDepartments () {
+ return this.allDepartments;
+ }
+
+ /**
+ * Getter for a list of filtered departments
+ * <p>
+ * @return Filtered departments
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<Department> getFilteredDepartments () {
+ return this.filteredDepartments;
+ }
+
+ /**
+ * Setter for a list of filtered departments
+ * <p>
+ * @param filteredDepartments Filtered departments
+ */
+ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+ public void setFilteredDepartments (final List<Department> filteredDepartments) {
+ this.filteredDepartments = filteredDepartments;
+ }
+
+ /**
+ * Getter for selected department
+ * <p>
+ * @return Selected department
+ */
+ public Department getSelectedDepartment () {
+ return this.selectedDepartment;
+ }
+
+ /**
+ * Setter for selected department
+ * <p>
+ * @param selectedDepartment Selected department
+ */
+ public void setSelectedDepartment (final Department selectedDepartment) {
+ this.selectedDepartment = selectedDepartment;
+ }
+
+ /**
+ * Initializer method
+ */
+ @PostConstruct
+ public void initializeList () {
+ // Is cache there?
+ if (!this.departmentCache.iterator().hasNext()) {
+ // Get whole list from EJB
+ final List<Department> departments = this.departmentBean.allDepartments();
+
+ // Add all
+ for (final Department department : departments) {
+ // Add it to cache
+ this.departmentCache.put(department.getDepartmentId(), department);
+ }
+ }
+
+ // Is the list empty, but filled cache?
+ if (this.getAllDepartments().isEmpty() && this.departmentCache.iterator().hasNext()) {
+ // Build up list
+ for (final Cache.Entry<Long, Department> currentEntry : this.departmentCache) {
+ // Add to list
+ this.getAllDepartments().add(currentEntry.getValue());
+ }
+
+ // Sort list
+ this.getAllDepartments().sort(new Comparator<Department>() {
+ @Override
+ public int compare (final Department department1, final Department department2) {
+ return department1.getDepartmentId() > department2.getDepartmentId() ? 1 : department1.getDepartmentId() < department2.getDepartmentId() ? -1 : 0;
+ }
+ });
+ }
+ }
+
+ @Override
+ public boolean isDepartmentAlreadyAdded (final Department department) {
+ // Default is not found
+ boolean isFound = false;
+
+ // Now check each entry
+ for (final Department currentDepartment : this.getAllDepartments()) {
+ // Is same address?
+ if (Departments.isSameDepartment(currentDepartment, department)) {
+ // Found one
+ isFound = true;
+ break;
+ }
+ }
+
+ // Return flag
+ return isFound;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.department.list;
+
+import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+
+/**
+ * An interface for general department controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsDepartmentListWebViewController extends Serializable {
+
+ /**
+ * Retrieves a single company department entity for given id number or
+ * throws a proper exception if not found.
+ * <p>
+ * @param departmentId Company department id to lookup
+ * <p>
+ * @return Company department instance
+ * <p>
+ * @throws DepartmentNotFoundException If the id number could not be looked
+ * up and solved into an entity
+ */
+ Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException;
+
+ /**
+ * Checks whether the given department is already found in local cache.
+ * Please note that this method fully relies on the cache, so you must
+ * always fire proper events that add/update/delete entries in cache.
+ * <p>
+ * @param department Department to check it's address
+ * <p>
+ * @return Whether the address has been found
+ */
+ boolean isDepartmentAlreadyAdded (final Department department);
+
+}
import javax.faces.convert.FacesConverter;
import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestBean;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestController;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewBean;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
/**
* Converter for company department id <-> instance
/**
* Company department EJB
*/
- private static JobsDepartmentWebRequestController DEPARTMENT_CONTROLLER;
+ private static JobsDepartmentListWebViewController DEPARTMENT_LIST_CONTROLLER;
@Override
public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Is the instance there?
- if (null == DEPARTMENT_CONTROLLER) {
- // Get bean from CDI directly
- DEPARTMENT_CONTROLLER = CDI.current().select(JobsDepartmentWebRequestBean.class).get();
- }
-
// Is the value null or empty?
if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
// Warning message
// Try to parse the value as long
final Long departmentId = Long.valueOf(submittedValue);
+ // Is the instance there?
+ if (null == DEPARTMENT_LIST_CONTROLLER) {
+ // Get bean from CDI directly
+ DEPARTMENT_LIST_CONTROLLER = CDI.current().select(JobsDepartmentListWebViewBean.class).get();
+ }
+
// Try to get user instance from it
- companyDepartment = DEPARTMENT_CONTROLLER.findDepartmentById(departmentId);
+ companyDepartment = DEPARTMENT_LIST_CONTROLLER.findDepartmentById(departmentId);
} catch (final NumberFormatException ex) {
// Throw again
throw new ConverterException(ex);
ADMIN_ASSIGNED_MANUFACTURER_LABEL=Zugewiesener Hersteller:
BARCODE=Barcode:
ADMIN_CONTACT_DETAILS_HEADER=Kontaktdaten zu {0} {1} {2}:
+ADMIN_DEPARTMENT_DETAILS_HEADER=Daten der Abteilung {0} (Id {1}):
ADMIN_ASSIGNED_MANUFACTURER_LABEL=Assigned manufacturer:
BARCODE=Barcode:
ADMIN_CONTACT_DETAILS_HEADER=Contact data of {0} {1} {2}:
+ADMIN_DEPARTMENT_DETAILS_HEADER=Data of department {0} (Id {1}):
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" rendered="#{empty allowNull or allowNull}" />
<f:selectItems
- value="#{countryController.allCountries()}"
+ value="#{countryListController.allCountries}"
var="country"
itemValue="#{country}"
itemLabel="#{country.countryCode} (#{msg[country.countryI18nKey]})"
<p:ajax
event="rowSelect"
- update=":master:form-list-branch-offices:branchOffice-details"
+ update=":master:form-list-branch-offices:branch-office-details"
oncomplete="PF('branchOfficeDialog').show()"
/>
responsive="true"
closeOnEscape="true"
>
- <p:outputPanel id="branchOffice-details">
+ <p:outputPanel id="branch-office-details">
<p:tabView>
<p:tab title="#{msg.ADMIN_BRANCH_OFFICE_DATA_TAB_TITLE}">
<p:panelGrid columns="2" rendered="#{not empty branchOfficeListController.selectedBranchOffice}">
</ui:define>
<ui:define name="content">
- <h:form id="form-list-department">
+ <h:form id="form-list-departments">
<p:dataTable
id="departmentList"
var="department"
- value="#{departmentController.allDepartments()}"
+ value="#{departmentListController.allDepartments}"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
- filteredValue="#{departmentController.filteredDepartments}"
+ filteredValue="#{departmentListController.filteredDepartments}"
rows="10"
+ rowKey="#{department.departmentId}"
reflow="true"
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_DEPARTMENTS}"
emptyMessage="#{msg.ADMIN_EMPTY_LIST_DEPARTMENTS}"
widgetVar="departmentList"
+ selectionMode="single"
+ selection="#{departmentListController.selectedDepartment}"
+ skipChildren="true"
>
<f:facet name="header">
- <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
- <h:outputText value="#{msg.ADMIN_LIST_DEPARTMENTS_HEADER}" />
+ <p:panelGrid
+ columns="3"
+ layout="grid"
+ columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
+ >
+ <p:spacer />
+
+ <p:panelGrid
+ columns="2"
+ columnClasses="ui-grid-4,ui-grid-8"
+ layout="grid"
+ styleClass="ui-noborder"
+ >
+ <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
+ <p:inputText id="globalFilter" onkeyup="PF('departmentList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+ </p:panelGrid>
+
+ <p:outputPanel>
+ <p:spacer height="4" />
- <h:panelGroup>
<p:commandButton
id="toggler"
type="button"
/>
<p:columnToggler datasource="departmentList" trigger="toggler" />
- </h:panelGroup>
+ </p:outputPanel>
</p:panelGrid>
</f:facet>
+ <p:ajax
+ event="rowSelect"
+ update=":master:form-list-departments:department-details"
+ oncomplete="PF('departmentDialog').show()"
+ />
+
<p:column
headerText="#{msg.ID_HEADER}"
sortBy="#{department.departmentId}"
<links:outputDepartmentAdminDropdownMenu department="#{department}" />
</p:column>
</p:dataTable>
+
+ <p:dialog
+ dynamic="true"
+ modal="true"
+ resizable="false"
+ header="#{msg.ADMIN_SINGLE_DEPARTMENT_DETAILS_HEADER}"
+ hideEffect="fade"
+ showEffect="fade"
+ widgetVar="departmentDialog"
+ position="top"
+ responsive="true"
+ closeOnEscape="true"
+ >
+ <p:outputPanel id="department-details">
+ <p:panelGrid columns="2" rendered="#{not empty departmentListController.selectedDepartment}">
+ <f:facet name="header">
+ <h:outputFormat value="#{msg.ADMIN_DEPARTMENT_DETAILS_HEADER}">
+ <f:param value="#{msg[departmentListController.selectedDepartment.departmentI18nKey]}" />
+ <f:param value="#{departmentListController.selectedDepartment.departmentId}" />
+ </h:outputFormat>
+ </f:facet>
+
+ <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.DEPARTMENT_ID_NUMBER_TITLE}" />
+ <h:outputText value="#{departmentListController.selectedDepartment.departmentId}" />
+ </p:panelGrid>
+ </p:outputPanel>
+ </p:dialog>
</h:form>
<h:form>
type="submit"
value="#{msg.BUTTON_ADMIN_ADD_DEPARTMENT_DATA}"
action="#{adminDepartmentController.addDepartment()}"
- update=":master:form-list-department:departmentList"
+ update=":master:form-list-departments:departmentList"
/>
</p:panelGrid>
</f:facet>
>
<f:converter converterId="CountryConverter" />
<f:selectItems
- value="#{countryController.allCountries()}"
+ value="#{countryListController.allCountries}"
var="country"
itemValue="#{country}"
itemLabel="#{msg[country.countryI18nKey]}"