Skip to content

Instantly share code, notes, and snippets.

@priyankahdp
Created May 13, 2014 11:37
JSP POPUP Form Submit Issue..
package lk.dialog.ist.cms.jsf.controller;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ValueChangeEvent;
import javax.xml.registry.infomodel.Organization;
import edu.emory.mathcs.backport.java.util.TreeMap;
import lk.dialog.ist.cms.bean.ApplicationBean;
import lk.dialog.ist.cms.bean.CardBean;
import lk.dialog.ist.cms.bean.CardProfileBean;
import lk.dialog.ist.cms.bean.OrganizationBean;
import lk.dialog.ist.cms.jsf.alert.MessageBean;
import lk.dialog.ist.cms.jsf.wrapper.CardBeanWrapper;
import lk.dialog.ist.cms.jsf.wrapper.CorporateBeanWrapper;
import lk.dialog.ist.cms.service.ApplicationService;
import lk.dialog.ist.cms.service.CardService;
import lk.dialog.ist.cms.service.OrganizationService;
@ManagedBean
@ViewScoped
public class CorporateManagementController implements Serializable {
private boolean chkParentOrg = false;
private boolean enableAdd = true;
private boolean chkSelectRange = false;
private boolean copAppSelectAll = false;
private boolean copSelectAllRows = false;
private boolean success = false;
private boolean execute= true;
private String currentState = "";
private String message = "";
private Long appId = (long) 0;
private Long corporateId = (long) 0;
private Long corpAppId = (long) 0;
private Long cardAddAppId = (long) 0;
private Integer numberOfCards = null;
private Long fromTxt;
private Long toTxt;
private static final long serialVersionUID = 1L;
@ManagedProperty("#{organizationService}")
private OrganizationService organizationService;
@ManagedProperty("#{userDetails}")
private UserDetails userDetails;
@ManagedProperty("#{applicationService}")
private ApplicationService applicationService;
@ManagedProperty("#{cardService}")
private CardService cardService;
@ManagedProperty("#{messageBean}")
private MessageBean messageBean;
private OrganizationBean organizationBean;
private ApplicationBean applicationBean;
private List<OrganizationBean> organizationBeanList = new ArrayList<OrganizationBean>();
private List<ApplicationBean> applicationBeanList = new ArrayList<ApplicationBean>();
private List<ApplicationBean> availableApplicationBeanList = new ArrayList<ApplicationBean>();
private List<ApplicationBean> applicationBeanListForCorporate = new ArrayList<ApplicationBean>();
private Map<String, CorporateBeanWrapper> parentVsOrganizationList = new HashMap<String, CorporateBeanWrapper>();
private List<CorporateBeanWrapper> corporateBeanWrapperList = new ArrayList<CorporateBeanWrapper>();
private List<CardProfileBean> cardProfileBeanList = new ArrayList<CardProfileBean>();
private List<ApplicationBean> getAppByOrgIDResult = new ArrayList<ApplicationBean>();
List<CardBean> selectedCardList = new ArrayList<CardBean>();
public CorporateManagementController() {
organizationBean = new OrganizationBean();
organizationBean.setStatus(-1);// initial status is set to -1
}
@PostConstruct
public void init() {
addData();
}
public OrganizationService getOrganizationService() {
return organizationService;
}
public void setOrganizationService(OrganizationService organizationService) {
this.organizationService = organizationService;
}
public OrganizationBean getOrganizationBean() {
return organizationBean;
}
public void setOrganizationBean(OrganizationBean organizationBean) {
this.organizationBean = organizationBean;
}
public ApplicationBean getApplicationBean() {
return applicationBean;
}
public void setApplicationBean(ApplicationBean applicationBean) {
this.applicationBean = applicationBean;
}
public boolean isChkParentOrg() {
return chkParentOrg;
}
public void setChkParentOrg(boolean chkParentOrg) {
this.chkParentOrg = chkParentOrg;
}
public boolean isEnableAdd() {
return enableAdd;
}
public void setEnableAdd(boolean enableAdd) {
this.enableAdd = enableAdd;
}
public UserDetails getUserDetails() {
return userDetails;
}
public void setUserDetails(UserDetails userDetails) {
this.userDetails = userDetails;
}
public List<OrganizationBean> getOrganizationBeanList() {
return organizationBeanList;
}
public void setOrganizationBeanList(
List<OrganizationBean> organizationBeanList) {
this.organizationBeanList = organizationBeanList;
}
public ApplicationService getApplicationService() {
return applicationService;
}
public void setApplicationService(ApplicationService applicationService) {
this.applicationService = applicationService;
}
public String getCurrentState() {
return currentState;
}
public void setCurrentState(String currentState) {
this.currentState = currentState;
}
public List<ApplicationBean> getApplicationBeanList() {
return applicationBeanList;
}
public void setApplicationBeanList(List<ApplicationBean> applicationBeanList) {
this.applicationBeanList = applicationBeanList;
}
public List<ApplicationBean> getAvailableApplicationBeanList() {
return availableApplicationBeanList;
}
public void setAvailableApplicationBeanList(
List<ApplicationBean> availableApplicationBeanList) {
this.availableApplicationBeanList = availableApplicationBeanList;
}
public Long getAppId() {
return appId;
}
public Integer getNumberOfCards() {
return numberOfCards;
}
public void setNumberOfCards(Integer numberOfCards) {
this.numberOfCards = numberOfCards;
}
public void setAppId(Long appId) {
this.appId = appId;
}
public MessageBean getMessageBean() {
return messageBean;
}
public void setMessageBean(MessageBean messageBean) {
this.messageBean = messageBean;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public void addBtnHandler() {
this.organizationBean.setOrgType("ORG");
this.organizationBean.setAddedDate(new Date());
this.organizationBean.setAddedUser(userDetails.getUserBean()
.getUserId());
try {
this.organizationService.addOrganization(organizationBean);
this.success = true;
this.message = "Organization successfully added.";
addData();// for refreshing the table and to collect newly added data
} catch (Exception e){
this.success = false;
this.message = "Error occurred while adding new Organization.";
}
setMessageBeanValues(this.success, this.message);
clearBttnHandler();
}
public void editBttnHandler() {
this.organizationBean.setOrgType("ORG");
this.organizationBean.setModifyDate(new Date());
this.organizationBean.setModifyUser(userDetails.getUserBean()
.getUserId());
try {
this.organizationService.editOrganization(organizationBean);
this.success = true;
this.message = "Organization edited successfully";
} catch (Exception e) {
this.success = false;
this.message = "Error occurred while editing Organization.";
}
setMessageBeanValues(this.success, this.message);
clearBttnHandler();
}
public void clearBttnHandler() {
organizationBean = new OrganizationBean();
organizationBean.setStatus(-1);
this.chkParentOrg = false;
this.enableAdd = true;
}
public void addApplicationBttnHandler() {
currentState = "addAppsToOrg";
this.applicationBeanList.clear();
this.availableApplicationBeanList.clear();
this.applicationBeanList = applicationService
.getApplicationByOrgId(organizationBean.getOrgId());
this.availableApplicationBeanList = applicationService
.getAvailableAppByOrgID(organizationBean.getOrgId());
}
public void addAppsToOrgBttnHandler() {
try{
applicationService.addApplicationToOrg(appId, organizationBean
.getOrgId(), numberOfCards, (int) userDetails.getUserBean()
.getUserId());
// update added list
this.applicationBeanList.clear();
this.applicationBeanList = applicationService
.getApplicationByOrgId(organizationBean.getOrgId());
this.availableApplicationBeanList.clear();
this.availableApplicationBeanList = applicationService
.getAvailableAppByOrgID(organizationBean.getOrgId());
this.success = true;
this.message = "Successfully add application to the organization";
}catch(Exception e){
this.success = false;
this.message ="Error occurred while adding application to the organization.";
}
setMessageBeanValues(this.success, this.message);
appId=(long) -1;
numberOfCards = null;
}
public void removeApplicationFromOrg(ApplicationBean applicationBean){
try{
applicationService.removeApplicationFromOrg(applicationBean.getAppId(), organizationBean
.getOrgId(),(int) userDetails.getUserBean()
.getUserId());
this.applicationBeanList.clear();
this.applicationBeanList = applicationService
.getApplicationByOrgId(organizationBean.getOrgId());
this.availableApplicationBeanList.clear();
this.availableApplicationBeanList = applicationService
.getAvailableAppByOrgID(organizationBean.getOrgId());
//applicationBeanList.remove(applicationBean);
this.success = true;
this.message = "Application removed from the " + organizationBean.getName();
}catch(Exception e){
this.success = false;
this.message ="Error occurred while removing from the " + organizationBean.getName();
}
setMessageBeanValues(this.success, this.message);
}
public HashMap<String, CorporateBeanWrapper> getParentVsOrganizationList() {
addData();
return (HashMap<String, CorporateBeanWrapper>) parentVsOrganizationList;
}
public void setParentVsOrganizationList(
HashMap<String, CorporateBeanWrapper> parentVsOrganizationList) {
this.parentVsOrganizationList = parentVsOrganizationList;
}
private void addData() {
parentVsOrganizationList.clear();
corporateBeanWrapperList.clear();
for (OrganizationBean org : organizationService.getParentOrganization()) {
System.out.println("adding element " + org.getName());
CorporateBeanWrapper copWrap = new CorporateBeanWrapper();
copWrap.setOrganizationBean(org);
copWrap.setOrganizationBeanList(new ArrayList<OrganizationBean>());
parentVsOrganizationList.put(org.getName(), copWrap);
}
for (OrganizationBean org : organizationService.getAllOrganizations()) {
if (parentVsOrganizationList.containsKey(org.getParentName())) {
parentVsOrganizationList.get(org.getParentName())
.getOrganizationBeanList().add(org);
}
}
for (Map.Entry entry : parentVsOrganizationList.entrySet()) {
corporateBeanWrapperList.add((CorporateBeanWrapper) entry
.getValue());
}
}
public List<CorporateBeanWrapper> getCorporateBeanWrapperList() {
return corporateBeanWrapperList;
}
public void setCorporateBeanWrapperList(
List<CorporateBeanWrapper> corporateBeanWrapperList) {
this.corporateBeanWrapperList = corporateBeanWrapperList;
}
public void setSelectedOrganizationInfo(OrganizationBean organizationBean) {
setOrganizationBean(organizationBean);
this.enableAdd = false;
}
public void goBackButtonHandler() {
this.currentState = "orgRegistration";
}
public boolean isExecute() {
return execute;
}
public void setExecute(boolean execute) {
this.execute = execute;
}
// //////////Manage corporate cards section ////////////////////////////
public void dropCorporateChangeHandler(/*ValueChangeEvent valueChangeEvent*/) {
applicationBeanListForCorporate.clear();
if(this.corporateId >0){
applicationBeanListForCorporate = applicationService
.getApplicationByOrgId(this.corporateId);
}
this.copAppSelectAll = true;
}
public boolean isChkSelectRange() {
return chkSelectRange;
}
public void setChkSelectRange(boolean chkSelectRange) {
this.chkSelectRange = chkSelectRange;
}
public boolean isCopAppSelectAll() {
return copAppSelectAll;
}
public void setCopAppSelectAll(boolean copAppSelectAll) {
this.copAppSelectAll = copAppSelectAll;
}
public boolean isCopSelectAllRows() {
return copSelectAllRows;
}
public void setCopSelectAllRows(boolean copSelectAllRows) {
this.copSelectAllRows = copSelectAllRows;
}
public Long getFromTxt() {
return fromTxt;
}
public void setFromTxt(Long fromTxt) {
this.fromTxt = fromTxt;
}
public Long getToTxt() {
return toTxt;
}
public void setToTxt(Long toTxt) {
this.toTxt = toTxt;
}
public Long getCorporateId() {
return corporateId;
}
public void setCorporateId(Long corporateId) {
this.corporateId = corporateId;
}
public Long getCardAddAppId() {
return cardAddAppId;
}
public void setCardAddAppId(Long cardAddAppId) {
this.cardAddAppId = cardAddAppId;
}
public Long getCorpAppId() {
return corpAppId;
}
public void setCorpAppId(Long corpAppId) {
this.corpAppId = corpAppId;
}
public List<ApplicationBean> getApplicationBeanListForCorporate() {
return applicationBeanListForCorporate;
}
public void setApplicationBeanListForCorporate(
List<ApplicationBean> applicationBeanListForCorporate) {
this.applicationBeanListForCorporate = applicationBeanListForCorporate;
}
public List<ApplicationBean> getGetAppByOrgIDResult() {
return getAppByOrgIDResult;
}
public void setGetAppByOrgIDResult(List<ApplicationBean> getAppByOrgIDResult) {
this.getAppByOrgIDResult = getAppByOrgIDResult;
}
public List<CardProfileBean> getCardProfileBeanList() {
return cardProfileBeanList;
}
public void setCardProfileBeanList(List<CardProfileBean> cardProfileBeanList) {
this.cardProfileBeanList = cardProfileBeanList;
}
public List<CardBean> getSelectedCardList() {
return selectedCardList;
}
public void setSelectedCardList(List<CardBean> selectedCardList) {
this.selectedCardList = selectedCardList;
}
public void searchBttnHandler() {
cardProfileBeanList.clear();
/* execute=true;
if(!(this.corporateId >0)){
execute = false;
this.success = false;
this.message ="Please select the valid corporate.";
}
if(!this.copAppSelectAll){
if(!(this.corpAppId >0)){
execute = false;
this.success = false;
this.message = "Please select the valid application.";
}
}
if(this.chkSelectRange){
if(this.fromTxt !=null){
execute = false;
this.success = false;
this.message ="Please enter from card did number.";
}
if(this.toTxt !=null){
execute = false;
this.success = false;
this.message = "Please enter to card did number.";
}
}
if(execute){*/
this.cardProfileBeanList = cardService.searchCardsByCorporate(
this.corporateId, this.corpAppId, String.valueOf(this.fromTxt),
String.valueOf(this.toTxt), !this.copAppSelectAll,
this.chkSelectRange);
/*}
else {
setMessageBeanValues(this.success, this.message);
}*/
}
public CardService getCardService() {
return cardService;
}
public void setCardService(CardService cardService) {
this.cardService = cardService;
}
public void chkAllRowsClickHandler() {
if (cardProfileBeanList.size() > 0) {
for (CardProfileBean crdProBean : cardProfileBeanList) {
crdProBean.setSelected(copSelectAllRows);
}
}
}
private void findSelectedCards() {
selectedCardList.clear();
for (CardProfileBean crdProBean : cardProfileBeanList) {
if (crdProBean.isSelected()) {
CardBean crdBn = new CardBean();
crdBn.setCardId(crdProBean.getCardId());
selectedCardList.add(crdBn);
}
}
}
public void addLinkActionHandler() {
this.getAppByOrgIDResult = applicationService.getApplicationByOrgId(this.corpAppId);
findSelectedCards();
if(selectedCardList.isEmpty()) {
messageBean.setStatus("FAIL");
messageBean.setStatusMessage("No cards selected.");
return;
}
/*selectedCardList.clear();
for (CardProfileBean crdProBean : cardProfileBeanList) {
if (crdProBean.isSelected()) {
CardBean crdBn = new CardBean();
crdBn.setCardId(crdProBean.getCardId());
selectedCardList.add(crdBn);
}
}*/
}
public void removeLinkActionHandler() {
}
public void addApplicationToCards() {
try {
cardService.addApplicationToCards(selectedCardList,
this.cardAddAppId, (int) userDetails.getUserBean()
.getUserId());
this.success = true;
this.message = "Application added successfully.";
} catch (Exception e) {
this.success = false;
this.message = "Error occurred while adding new Application.";
}
setMessageBeanValues(this.success, this.message);
this.cardAddAppId = (long) -1;
}
public void removeApplicationFromCards() {
try {
cardService.removeApplicationFromCards(selectedCardList,
this.cardAddAppId, (int) userDetails.getUserBean()
.getUserId());
this.success = true;
this.message = "Application removed successfully.";
this.cardAddAppId = (long) -1;
} catch (Exception e) {
this.success = false;
this.message = "Error occurred while removing new Application.";
}
setMessageBeanValues(this.success, this.message);
this.cardAddAppId = (long) -1;
}
private void setMessageBeanValues(boolean success, String msg) {
if (success) {
messageBean.setStatus("SUCCESS");
} else {
messageBean.setStatus("FAIL");
}
messageBean.setStatusMessage(msg);
}
// ////////////////////////////ends here////////////////////////////////
/*
* public List<Entry<String,CorporateBeanWrapper>> organizationList(){
* return new
* ArrayList<Entry<String,CorporateBeanWrapper>>(parentVsOrganizationList
* .keySet()); //return new
* ArrayList<OrganizationBean>(parentVsOrganizationList.keySet()); }
*/
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form>
<h:panelGroup id="idPanelCopCardSearch" >
<rich:panel style="width:55%;clear:both;" header="Search">
<ui:decorate template="/jsf/templates/two_columns.xhtml">
<ui:define name="left_label">
<h:outputText value="*" style="color:red;"/>
<h:outputText value="Corporate" style="font-weight:bold;margin-left:2px;"/>
</ui:define>
<ui:define name="left_field">
<h:selectOneMenu
value="#{corporateManagementController.corporateId}"
id="iddropCorporate" required="true" requiredMessage="#{commonMessages.valueRequired()}"
validatorMessage="#{commonMessages.valueRequired()}" >
<f:selectItem itemValue="-1" itemLabel="" />
<f:selectItems
value="#{corporateManagementController.organizationService.allOrganizations}"
var="var" itemValue="#{var.orgId}" itemLabel="#{var.name}" />
<f:validateLongRange minimum="0" />
<a4j:ajax execute="@this" render="idPanelCopCardSearch" listener="#{corporateManagementController.dropCorporateChangeHandler()}"/>
</h:selectOneMenu>
<br/>
<h:message for="iddropCorporate" styleClass="validationMessage"
id="msgdropCorporate" />
</ui:define>
</ui:decorate>
<ui:decorate template="/jsf/templates/two_columns.xhtml">
<ui:define name="left_label">
<h:selectBooleanCheckbox style="margin-top:3px !important;"
value="#{corporateManagementController.chkSelectRange}">
<a4j:ajax execute="@this" render="didRangePanel" />
</h:selectBooleanCheckbox>
</ui:define>
<ui:define name="left_field">
<h:outputText value="Select DID Range" style="font-weight:bold;"/>
</ui:define>
</ui:decorate>
<h:panelGroup id="didRangePanel">
<rich:panel style="width:400px;height:41px;border:0px;"
rendered="#{corporateManagementController.chkSelectRange}">
<ui:decorate template="/jsf/templates/two_columns.xhtml">
<ui:define name="left_label">
<h:outputText value="From" style="height:19px;font-weight:bold" />
</ui:define>
<ui:define name="left_field">
<h:inputText value="#{corporateManagementController.fromTxt}" id="idFromTxtInp" required="true" requiredMessage="#{commonMessages.valueRequired()}" converterMessage="number required">
<f:convertNumber integerOnly="true" pattern="#"/>
</h:inputText>
<br/>
<h:message for="idFromTxtInp" styleClass="validationMessage"
id="msgFromTxtInp" />
</ui:define>
<ui:define name="right_label">
<h:outputText value="To" style="height:19px;font-weight:bold" />
</ui:define>
<ui:define name="right_field">
<h:inputText id="idToTxtInp" value="#{corporateManagementController.toTxt}" required="true" requiredMessage="#{commonMessages.valueRequired()}" converterMessage="number required">
<f:convertNumber integerOnly="true" pattern="#"/>
</h:inputText>
<br/>
<h:message for="idToTxtInp" styleClass="validationMessage"
id="msgToTxtInp" />
</ui:define>
</ui:decorate>
</rich:panel>
</h:panelGroup>
<ui:decorate template="/jsf/templates/two_columns.xhtml">
<ui:define name="left_label">
<h:outputText value="Application" style="font-weight:bold;"/>
</ui:define>
<ui:define name="left_field">
<h:selectOneMenu
value="#{corporateManagementController.corpAppId}"
disabled="#{corporateManagementController.copAppSelectAll}"
valueChangeListener="#{corporateManagementController.dropCorporateChangeHandler}"
id="application" required="true"
validatorMessage="#{commonMessages.valueRequired()}">
<f:selectItem itemValue="-1" itemLabel="" />
<f:selectItems
value="#{corporateManagementController.applicationBeanListForCorporate}"
var="var" itemValue="#{var.appId}" itemLabel="#{var.appName}" />
<f:validateLongRange minimum="0" />
</h:selectOneMenu>
<h:selectBooleanCheckbox style="margin-left:30px;"
value="#{corporateManagementController.copAppSelectAll}">
<a4j:ajax execute="@this" render="application" />
</h:selectBooleanCheckbox>
<h:outputText value="Select All" style="font-weight:bold;"/>
</ui:define>
<ui:define name="right_label"/>
<ui:define name="right_field"/>
</ui:decorate>
<div style="text-align: center; width: 80%">
<a4j:commandButton id="corpCardSearchbtn" value="Search"
render="idPanelCopCardSearch copMngCardTbl manageCoporateCardLinks" execute="@form"
action="#{corporateManagementController.searchBttnHandler()}" />
</div>
</rich:panel>
</h:panelGroup>
<p />
<h:panelGroup id="manageCoporateCardLinks">
<a4j:commandLink value="Add Application" immediate="true"
action="#{corporateManagementController.addLinkActionHandler()}"
render="popAddAppId infoPopup"
disabled="#{corporateManagementController.cardProfileBeanList.size() == 0}"
style="font-weight:bold;text-decoration:none;"
oncomplete="if(#{corporateManagementController.selectedCardList.isEmpty()}){
#{rich:component('infoPopup')}.show();
return false;
} else {
#{rich:component('popAddAppId')}.show();
}"/>
<a4j:commandLink value="Remove Application" style="margin-left:15px;font-weight:bold;text-decoration:none;"
immediate="true"
action="#{corporateManagementController.addLinkActionHandler()}"
render="popRemoveAppId infoPopup"
oncomplete="if(#{corporateManagementController.selectedCardList.isEmpty()}){
#{rich:component('infoPopup')}.show();
return false;
} else {
#{rich:component('popRemoveAppId')}.show();
}"/>
</h:panelGroup>
<p />
<rich:dataTable id="copMngCardTbl"
value="#{corporateManagementController.cardProfileBeanList}"
style="width:100%;" var="list">
<rich:column>
<f:facet name="header">
<h:selectBooleanCheckbox label="select all"
value="#{corporateManagementController.copSelectAllRows}">
<a4j:ajax execute="@this" render="copMngCardTbl" listener="#{corporateManagementController.chkAllRowsClickHandler()}"/>
</h:selectBooleanCheckbox>
</f:facet>
<h:selectBooleanCheckbox label="select all"
value="#{list.selected}">
<a4j:ajax execute="@this" render="copMngCardTbl" />
</h:selectBooleanCheckbox>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="DID" />
</f:facet>
<h:outputText value="#{list.cardDid}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="UID" />
</f:facet>
<h:outputText value="#{list.cardUid}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Owenership Type" />
</f:facet>
<h:outputText value="#{list.ownerType}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Card Type" />
</f:facet>
<h:outputText value="#{list.cardType}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Exp. Date" />
</f:facet>
<h:outputText value="#{list.expireDate}">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Status" />
</f:facet>
<h:outputText value="#{list.status == 0?'Inactive' :'Active'}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="ID Type" />
</f:facet>
<h:outputText value="#{list.idType}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="ID Number" />
</f:facet>
<h:outputText value="#{list.idNumber}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Titile" />
</f:facet>
<h:outputText value="#{list.title}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="First Name" />
</f:facet>
<h:outputText value="#{list.firstName}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Last Name" />
</f:facet>
<h:outputText value="#{list.lastName}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Contact No" />
</f:facet>
<h:outputText value="#{list.contactNo}" />
</rich:column>
</rich:dataTable>
</h:form>
<ui:include src="pop_addApp.xhtml"/>
<ui:include src="pop_removeApp.xhtml"/>
</ui:composition>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form>
<a4j:region>
<rich:popupPanel id="popAddAppId" resizeable="false" width="250" height="50" domElementAttachment="form" >
<f:facet name="header">Add Application</f:facet>
<ui:decorate template="/jsf/templates/one_column.xhtml">
<ui:define name="label">Application</ui:define>
<ui:define name="field">
<h:selectOneMenu required="true" requiredMessage="#{commonMessages.valueRequired()}" value="#{corporateManagementController.cardAddAppId}" id="corpDropAppId">
<f:selectItem itemLabel="" noSelectionOption="true"/>
<f:selectItems value="#{corporateManagementController.applicationBeanListForCorporate}" var="var" itemValue="#{var.appId}" itemLabel="#{var.appName}" />
</h:selectOneMenu>
<br/>
<h:message for="corpDropAppId" styleClass="validationMessage" id="msgCorpDropAppId" />
</ui:define>
</ui:decorate>
<p/>
<div style="text-align:right; width: 75%">
<a4j:commandButton id="popAddAppBtn" value="Add" render="infoPopup msgCorpDropAppId" oncomplete="if(#{!facesContext.validationFailed}){ #{rich:component('popAddAppId')}.hide(); #{rich:component('infoPopup')}.show();}" action="#{corporateManagementController.addApplicationToCards()}" />
<h:button value="Cancel" onclick="#{rich:component('popAddAppId')}.hide();return false;"/>
</div>
</rich:popupPanel>
</a4j:region>
</h:form>
</ui:composition>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment