when server's down, datas on board table disappear in Liferay - liferay

i'm on 7.2.
i've been making board with configurationPid function of liferay, but it's not working what i think.
here's the thing
I set up three types of board to use preferences function of liferay.
From divCd information of preferences releated with board portlet keys, i can search boards specific datas.
But the problem is that when i shut down the server, datas diappear only for notice board! (divCd - 1 : NOTICE , divCd - 2 : FAQ, divCd -3 : QNA)
This phenomenon only happend to board table. 
I didn't notice there's problem in my code because in dev server (local server) i've never seen this before.
This only happen in published server. When published server's down, datas of notice board disappear! (not happend to other table yet. :) ) Blow away for real!
I guess anyone in my company have never seen this (disappearing problem!).
So, because i used configurgationPid function to make reusable board
(Notice board, FAQ board, QNA board), configurationPid is quite suspicious for me. But I couldn't find this trouble shooting cases.
I'm gonna show you all my codes that used for this!
If you know any reasons why board data deleted, Please somebody help me. 
Minor helps can alse be helpful for me! 
flow
register board types
image => enter image description here
Board types can be defined here! and JSP file show theses
configuration.jsp
<%# page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%# page import="com.liferay.portal.kernel.util.Constants"%>
<%# page import="com.osp.board.constants.OSPBoardWebPortletKeys" %>
<%# page import="com.osp.board.constants.OSPBoardWebActionKeys" %>
<%# page import="java.util.Map"%>
<%# include file="../../init.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Board Configuration</title>
</head>
<body>
<liferay-portlet:actionURL portletConfiguration="<%= true %>" var="boardDivActionURL">
<liferay-portlet:param name="target" value="boardDiv"/>
</liferay-portlet:actionURL>
<liferay-portlet:actionURL portletConfiguration="<%= true %>" var="boardActionURL">
<liferay-portlet:param name="target" value="board"/>
</liferay-portlet:actionURL>
<liferay-portlet:actionURL portletConfiguration="<%= true %>" var="boardRemoveURL">
<liferay-portlet:param name="target" value="boardRemove"/>
<liferay-portlet:param name="targetedDivCd" value=""/>
</liferay-portlet:actionURL>
<%
long divCd = Long.parseLong(portletPreferences.getValue("divCd", "0"));
String originalBoardPlid = portletPreferences.getValue("originalBoardPlid", "");
boolean mainListYn = Boolean.parseBoolean(portletPreferences.getValue("mainListYn",""));
String originalBoardPortletName = portletPreferences.getValue("originalBoardPortletName", "");
%>
<c:set var="divCd" value="<%= divCd %>"/>
<c:set var="originalBoardPlid" value="<%= originalBoardPlid %>"/>
<c:set var="mainListYn" value="<%= mainListYn %>"/>
<c:set var="originalBoardPortletName" value="<%= originalBoardPortletName %>"/>
<div class="sheet sheet-lg panel-group panel-group-flush my-5">
<div class="panel">
<form action="${boardActionURL}" method="POST">
<aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" />
<div class="panel-heading">
<a class="collapse-icon sheet-subtitle" data-toggle="collapse" href="#portletInfoContentBody" aria-expanded="false" aria-controls="portletInfoContentBody">
Portlet Information
<span class="collapse-icon-closed">
<svg class="lexicon-icon lexicon-icon-angle-right" focusable="false" role="presentation" viewBox="0 0 512 512">
<path class="lexicon-icon-outline" d="M396.394 255.607c-0.22-6.936-2.973-13.81-8.272-19.111l-227.221-227.221c-11.026-11.059-28.94-11.059-39.999 0-11.058 11.026-11.058 28.941 0 39.999l206.333 206.333c0 0-206.333 206.333-206.333 206.333-11.058 11.058-11.058 28.973 0 39.999 11.059 11.059 28.972 11.059 39.999 0l227.221-227.221c5.3-5.3 8.053-12.175 8.272-19.111z"></path>
</svg>
</span>
<span class="collapse-icon-open">
<svg class="lexicon-icon lexicon-icon-angle-down" focusable="false" role="presentation" viewBox="0 0 512 512">
<path class="lexicon-icon-outline" d="M256 384c6.936-0.22 13.81-2.973 19.111-8.272l227.221-227.221c11.058-11.026 11.058-28.941 0-39.999-11.026-11.058-28.94-11.058-39.999 0l-206.333 206.333c0 0-206.333-206.333-206.333-206.333-11.059-11.058-28.973-11.058-39.999 0-11.059 11.058-11.059 28.972 0 39.999l227.221 227.221c5.3 5.3 12.174 8.053 19.111 8.272z">
</path>
</svg>
</span>
</a>
</div>
<div id="portletInfoContentBody" class="panel-body collapse show">
<div class="alert alert-info">
PortletKey : ${portletKey}
<br/>
Plid : ${plid}
</div>
<c:choose>
<c:when test="${empty boardDivs}">
<aui:select name="divSort" label="board-config-property-name-divsort" helpMessage="board-config-property-explain-divsort" disabled="true">
</aui:select>
</c:when>
<c:otherwise>
<aui:select name="preferences--divCd--" label="board-config-property-name-divsort" helpMessage="board-config-property-explain-divsort">
<option value="0"> </option>
<c:forEach items="${boardDivs}" var="boardDiv">
<c:if test="${boardDiv.divCd eq divCd}">
<option value="${boardDiv.divCd}" selected="selected">${boardDiv.divName}</option>
</c:if>
<c:if test="${boardDiv.divCd ne divCd}">
<option value="${boardDiv.divCd}">${boardDiv.divName}</option>
</c:if>
</c:forEach>
</aui:select>
</c:otherwise>
</c:choose>
<div class="form-group">
<label>
<input type="hidden" name="<portlet:namespace/>preferences--mainListYn--" id="<portlet:namespace/>preferences--mainListYn--" value="${mainListYn}"/>
<input class="toggle-switch" type="checkbox" id="mainListYn" ${mainListYn ? 'checked="true"' : ''}>
<span class="toggle-switch-label">
<liferay-ui:message key="board-config-property-name-mainlistyn"/>
<liferay-ui:icon-help message="board-config-property-explain-mainlistyn"/>
</span>
<span aria-hidden="true" class="toggle-switch-bar">
<span class="toggle-switch-handle" data-label-off="no" data-label-on="yes">
</span>
</span>
</label>
</div>
<aui:input name="preferences--originalBoardPortletName--" label="board-config-property-name-originalboard-portletname" helpMessage="board-config-property-explain-portletname" value="${originalBoardPortletName}">
</aui:input>
<aui:input name="preferences--originalBoardPlid--" label="board-config-property-name-originalboard-plid" helpMessage="board-config-property-explain-plid" value="${originalBoardPlid}">
</aui:input>
<div class="d-flex justify-content-end">
<button type="submit" class="btn btn-primary"><liferay-ui:message key="save"/></button>
</div>
</div>
</form>
</div>
</div>
<div class="sheet sheet-lg panel-group panel-group-flush my-5">
<div class="panel">
<form action="${boardDivActionURL}" method="POST" id="boardTypeList">
<div class="panel-heading">
<a class="collapse-icon sheet-subtitle" data-toggle="collapse" href="#boardDivContentBody" aria-expanded="false" aria-controls="boardDivContentBody">
<liferay-ui:message key="board-config-property-boarddiv-title"/>
<span class="collapse-icon-closed">
<svg class="lexicon-icon lexicon-icon-angle-right" focusable="false" role="presentation" viewBox="0 0 512 512">
<path class="lexicon-icon-outline" d="M396.394 255.607c-0.22-6.936-2.973-13.81-8.272-19.111l-227.221-227.221c-11.026-11.059-28.94-11.059-39.999 0-11.058 11.026-11.058 28.941 0 39.999l206.333 206.333c0 0-206.333 206.333-206.333 206.333-11.058 11.058-11.058 28.973 0 39.999 11.059 11.059 28.972 11.059 39.999 0l227.221-227.221c5.3-5.3 8.053-12.175 8.272-19.111z"></path>
</svg>
</span>
<span class="collapse-icon-open">
<svg class="lexicon-icon lexicon-icon-angle-down" focusable="false" role="presentation" viewBox="0 0 512 512">
<path class="lexicon-icon-outline" d="M256 384c6.936-0.22 13.81-2.973 19.111-8.272l227.221-227.221c11.058-11.026 11.058-28.941 0-39.999-11.026-11.058-28.94-11.058-39.999 0l-206.333 206.333c0 0-206.333-206.333-206.333-206.333-11.059-11.058-28.973-11.058-39.999 0-11.059 11.058-11.059 28.972 0 39.999l227.221 227.221c5.3 5.3 12.174 8.053 19.111 8.272z">
</path>
</svg>
</span>
</a>
</div>
<div id="boardDivContentBody" class="panel-body collapse show">
<div class="form-group">
<div class="table-responsive-md">
<table class="table table-bordered">
<!-- <colgroup>
<col width="5%">
<col width="16.5%">
<col width="25.5%">
<col width="10%">
<col width="23%">
<col width="6%">
<col width="8%">
</colgroup> -->
<thead>
<tr>
<th scope="col" class="text-center"><liferay-ui:message key="table-index"/></th>
<c:forEach items="${locales}" var="locale">
<th scope="col" class="text-center">Title(${locale})</th>
</c:forEach>
<th scope="col" class="text-center"><liferay-ui:message key="board-config-property-boarddiv-column-content"/></th>
<th scope="col" class="text-center"><liferay-ui:message key="board-config-property-boarddiv-column-name"/></th>
<th scope="col" class="text-center"><liferay-ui:message key="board-config-property-boarddiv-column-fileuse"/></th>
<th scope="col" class="text-center"><liferay-ui:message key="board-config-property-boarddiv-column-popupuse"/></th>
<th scope="col" class="text-center"><liferay-ui:message key="board-config-property-boarddiv-column-replyuse"/></th>
<th scope="col" class="text-center"></th>
</tr>
</thead>
<tbody data-entity="boardDiv">
<c:choose>
<c:when test="${empty boardDivs}">
<tr data-nodata="true">
<td class="text-center text-danger" colspan="8">
<liferay-ui:message key="board-config-property-boarddiv-result-noboarddiv"/>
</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach items="${boardDivs}" var="boardDiv" varStatus="vs">
<tr>
<input type="hidden" name="<portlet:namespace/>idx" value="${vs.count}"/>
<input type="hidden" name="<portlet:namespace/>divCd" value="${boardDiv.divCd}"/>
<td scope="col" class="text-center">${vs.count}</td>
<c:forEach items="${locales}" var="locale">
<c:set var="titleKey" value="title_${locale}"/>
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>title_${locale}_${vs.count}" value="${boardDiv[titleKey]}" maxlength="30"/>
</td>
</c:forEach>
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>content_${vs.count}" value="${boardDiv.content}" maxlength="30"/>
</td>
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>divName_${vs.count}" value="${boardDiv.divName}" maxlength="30"/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>fileUploadUseYn_${vs.count}" ${boardDiv.fileUploadUseYn ? 'checked="true"' : ''}/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>popupYn_${vs.count}" ${boardDiv.popupYn ? 'checked="true"' : ''}/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>replyYn_${vs.count}" ${boardDiv.replyYn ? 'checked="true"' : ''}/>
</td>
<td scope="col" class="text-center">
<button class="btn btn-default" type="button" data-target-entity="remove" data-event="remove" data-div-cd="${boardDiv.divCd}">
<i class="icon-trash"></i>
</button>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
<div class="d-flex d-flex justify-content-between">
<button type="button" class="btn btn-outline-dark" data-target-entity="boardDiv">
<i class="icon-plus"></i>
Board Type
</button>
<button type="submit" class="btn btn-primary"><liferay-ui:message key="save"/></button>
</div>
</div>
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
$('#mainListYn').on('change', function(){
$('#<portlet:namespace/>preferences--mainListYn--').val($(this).prop('checked'));
});
$(document).on('click','[data-target-entity]', function(){
var target = $('[data-entity="'+$(this).data('targetEntity')+'"]');
if($(target).find('[data-nodata="true"]').length > 0){
$(target).empty();
}
var targetType = $(this).data("targetEntity") || "";
if(targetType == "remove"){
var targetedDivCd = $(this).data('divCd') || '';
if(targetedDivCd != ""){
$.ospConfirm({
modalDialogClass : 'modal-md',
title : '<liferay-ui:message key="board-app-delete-modal-title"/>',
confirmText : '<liferay-ui:message key="board-app-notice-delete-modal-btn"/>',
body : '<liferay-ui:message key="board-app-delete-modal-body"/>',
closeText : '<liferay-ui:message key="board-app-delete-cancel"/>',
onSubmit : function(result){
if(result){
var actionURL = "${boardRemoveURL}";
actionURL +="&_com_liferay_portlet_configuration_web_portlet_PortletConfigurationPortlet_targetedDivCd=" + targetedDivCd;
window.location = actionURL.toString();
}
}
});
}else{
$(this).closest("tr").remove();
}
return;
}
var idx = $(target).find('tr').length + 1;
if('content' in document.createElement('template')){
var tmpl = document.querySelector('#boardDivTmpl');
var clone = document.importNode(tmpl.content, true);
$(clone).find("tr").prepend(
$('<input/>').attr({
type : 'hidden',
name : '<portlet:namespace/>idx',
value : idx
}),
$('<input/>').attr({
type : 'hidden',
name : '<portlet:namespace/>divCd',
value : 0
})
);
var tds = clone.querySelectorAll("td");
tds.forEach( (td, i) => {
if(i == 0){
$(td).text(idx);
}else{
if($(tds).eq(i).find('input').length > 0){
var input = $(td).find('input:eq(0)');
var bName = $(input).attr('name');
var aName = bName.replace('_idx', '_'+idx);
$(tds).eq(i).find('input:eq(0)').attr('name', aName);
}
}
});
$(target).append(clone);
} else{
var input = $('<input/>').addClass('form-control'),
checkbox = $('<input/>').attr('type', 'checkbox'),
appendTd = $('<td/>').addClass('text-center');
$('<tr/>').append(
$('<input/>').attr({
type : 'hidden',
name : '<portlet:namespace/>idx',
value : idx
}),
$(appendTd).clone()
.text(idx),
$(appendTd).clone()
.append(
$(input).clone().attr('name', '<portlet:namespace/>title_ko_KR_'+idx)
),
$(appendTd).clone()
.append(
$(input).clone().attr('name', '<portlet:namespace/>title_en_US_'+idx)
),
$(appendTd).clone()
.append(
$(input).clone().attr('name', '<portlet:namespace/>content_'+idx)
),
$(appendTd).clone()
.append(
$(input).clone().attr('name', '<portlet:namespace/>divName_'+idx)
),
$(appendTd).clone()
.append(
$(checkbox).clone().attr('name', '<portlet:namespace/>fileUploadUseYn_'+idx)
),
$(appendTd).clone()
.append(
$(checkbox).clone().attr('name', '<portlet:namespace/>popupYn_'+idx)
),
$(appendTd).clone()
.append(
$(checkbox).clone().attr('name', '<portlet:namespace/>replyYn_'+idx)
)
).appendTo(target);
}
});
});
</script>
<template id="boardDivTmpl">
<tr>
<td scope="col" class="text-center"></td>
<c:forEach items="${locales}" var="locale">
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>title_${locale}_idx"/>
</td>
</c:forEach>
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>content_idx"/>
</td>
<td scope="col" class="text-center">
<input type="text" class="form-control" name="<portlet:namespace/>divName_idx"/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>fileUploadUseYn_idx"/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>popupYn_idx"/>
</td>
<td scope="col" class="text-center">
<input type="checkbox" name="<portlet:namespace/>replyYn_idx"/>
</td>
<td>
<button class="btn btn-default" type="button" data-target-entity="remove">
<i class="icon-trash"></i>
</button>
</td>
</tr>
</template>
If you save for delete, you can see if they exists on my table!
image => enter image description here
but, It was not simple if i need to use OSP_BoardDiv.
In main page, I must know exact plid to get to the right board type.
For this, I should set plid, divCd before you main page for preview of
notice board. And i set it on html tags.
image => enter image description here
If board types are set, i can read information from BoardRender.
And the next thing is all the same. Controlling data with action,
render, resources ... but i can't find any problem on my codes!
I must get plId infos to nevigate user to get to the right board. So, I access to xml datas of the PortletPreferences table. If portletId is same with board portlet and divCd is same, get datas!
BoardRender.java
package com.osp.board.web.board.command;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.model.PortletPreferences;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand;
import com.liferay.portal.kernel.service.PortletPreferencesLocalServiceUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.WebKeys;
import com.osp.board.constants.ConstantsPagePath;
import com.osp.board.constants.OSPBoardWebPortletKeys;
import com.osp.board.model.Board;
import com.osp.board.model.BoardDiv;
import com.osp.board.service.BoardDivLocalServiceUtil;
import com.osp.board.service.BoardLocalServiceUtil;
import com.osp.constants.CustomRoleConstants;
import com.osp.constants.MessageConstants;
import com.osp.constants.SiteNameConstants;
import com.osp.search.constants.OSPSearchPortletKeys;
import com.osp.util.CustomUtil;
import com.osp.util.OSPPropertiesUtil;
import com.osp.util.OSPUsersUtil;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.osgi.service.component.annotations.Component;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
#Component(
immediate = true,
property = {
"javax.portlet.name=" + OSPBoardWebPortletKeys.BOARD_PORTLET_KEY,
"mvc.command.name=/",
"javax.portlet.version=3.0"
},
service = MVCRenderCommand.class
)
public class BoardRender implements MVCRenderCommand {
private static final Log _log = LogFactoryUtil.getLog(BoardRender.class);
#Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
String isMainPage = renderRequest.getPreferences().getValue("mainListYn", "false");
String jspPage = ConstantsPagePath.OSP_BOARD_LIST;
String escapeTag = "<(/)?([a-zA-Z]*)(\\\\s[a-zA-Z]*=[^>]*)?(\\\\s)*(/)?>";
long divCd = Long.parseLong(renderRequest.getPreferences().getValue("divCd", "0"));
try {
if(divCd > 0) {
BoardDiv boardDiv = BoardDivLocalServiceUtil.getBoardDiv(divCd);
Map<String, Object> boardDivMap = new HashMap<String, Object>();
boardDivMap.put("title", boardDiv.getTitle(themeDisplay.getLanguageId()));
// permission check start.
String divName = GetterUtil.getString(boardDiv.getDivName(), "FAQ").toUpperCase();
boolean permission = false;
if(isMainPage.equals("true")) {// write only portal, site admins.
List<PortletPreferences> searchPreferences = null;
String searchNamespace = "";
String siteName = CustomUtil.strNull(OSPPropertiesUtil.getPortalSiteName(),"1");
renderRequest.setAttribute("siteName", siteName);
if(siteName.equals(SiteNameConstants.BIO)) {
searchPreferences = PortletPreferencesLocalServiceUtil.getPortletPreferences().stream().filter(pp -> pp.getPortletId().equals(OSPSearchPortletKeys.TOTAL_LIST_SEARCH_PORTLET_KEY)).collect(Collectors.toList());
searchNamespace = PortalUtil.getPortletNamespace(OSPSearchPortletKeys.TOTAL_LIST_SEARCH_PORTLET_KEY);
}else {
searchPreferences = PortletPreferencesLocalServiceUtil.getPortletPreferences().stream().filter(pp -> pp.getPortletId().equals(OSPSearchPortletKeys.MATERIAL_LIST_SEARCH_PORTLET_KEY)).collect(Collectors.toList());
searchNamespace = PortalUtil.getPortletNamespace(OSPSearchPortletKeys.MATERIAL_LIST_SEARCH_PORTLET_KEY);
}
if(searchPreferences != null) {
long searchPlid = searchPreferences.get(0).getPlid();
renderRequest.setAttribute("searchPlid", searchPlid);
renderRequest.setAttribute("searchNamespace", searchNamespace);
}
List<PortletPreferences> boardPrefereneces = PortletPreferencesLocalServiceUtil.getPortletPreferences().stream().filter(pp -> pp.getPortletId().equals(OSPBoardWebPortletKeys.BOARD_PORTLET_KEY)).collect(Collectors.toList());
Map<String, Map<String, Object>> resultMap = new HashMap<String, Map<String,Object>>();
List<BoardDiv> boardTypeList = BoardDivLocalServiceUtil.getBoardDivListWithBoardName();
for(PortletPreferences pp : boardPrefereneces) {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
InputSource is = new InputSource();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
is.setCharacterStream(new StringReader(pp.getPreferences()));
Document document = docBuilder.parse(is);
document.getDocumentElement().normalize();
if(document.getElementsByTagName("value").getLength() > 0 ) {
NodeList valueList = document.getElementsByTagName("value");
String nodeValue = "";
for(BoardDiv bdiv : boardTypeList) {
for(int i = 0; valueList.getLength() > i; i++) {
Node valueNode = valueList.item(i);
nodeValue = valueNode.getTextContent();
if(String.valueOf(bdiv.getDivCd()).equals(nodeValue)) {
Map <String, Object> dataMap = new HashMap<>();
dataMap.put("plid",pp.getPlid());
dataMap.put("portletId",pp.getPortletId());
dataMap.put("divCd", nodeValue);
resultMap.put(bdiv.getContent().toUpperCase(), dataMap);
break;
}
}
}
}
}
List<Board> boardListForMainNotice = new ArrayList<Board>();
List<Board> boardListForMainFaq = new ArrayList<Board>();
for(BoardDiv bdiv : boardTypeList) {
if("NOTICE".equals(bdiv.getContent().toUpperCase())) // notice
boardListForMainNotice = BoardLocalServiceUtil.getBoardListByDivcdSiteGroupIdsForMain(bdiv.getDivCd(), themeDisplay.getScopeGroupId(), 0, 3, themeDisplay.getLanguageId());
if("FAQ".equals(bdiv.getContent().toUpperCase())) // faq
boardListForMainFaq = BoardLocalServiceUtil.getBoardListByDivcdSiteGroupIdsForMain(bdiv.getDivCd(), themeDisplay.getScopeGroupId(), 0, 4, themeDisplay.getLanguageId());
}
for(Board board : boardListForMainNotice) {
board.setTitle(board.getTitle(LocaleUtil.KOREA));
board.setCreateDate(board.getCreateDate());
board.setContent(board.getContent(LocaleUtil.KOREA).replaceAll(escapeTag, ""));
}
for(Board board : boardListForMainFaq){
board.setTitle(board.getTitle(LocaleUtil.KOREA));
board.setCreateDate(board.getCreateDate());
board.setContent(board.getContent(LocaleUtil.KOREA).replaceAll(escapeTag, "").replaceAll(" ", "<br>").replaceAll("<br>", ""));
}
renderRequest.setAttribute("boardInfos", resultMap);
renderRequest.setAttribute("boardListForMainNotice", boardListForMainNotice);
renderRequest.setAttribute("boardListForMainFaq", boardListForMainFaq);
jspPage = ConstantsPagePath.OSP_MAIN_BOARD_LIST;
}else if("QNA".equals(divName)) {// admins or writer.
permission = themeDisplay.getPermissionChecker().isSignedIn();
}else if("FAQ".equals(divName)||divName.equals("NOTICE")) {
permission = OSPUsersUtil.isRegularRole(themeDisplay.getUser(), CustomRoleConstants.ADMINISTRATOR);
if(!permission) permission = OSPUsersUtil.isSiteRole(themeDisplay.getUser(), themeDisplay.getScopeGroupId(), CustomRoleConstants.SITE_ADMINISTRATOR);
}else {
_log.debug("##### DivName '"+divName+"' is not supported yet.");
_log.debug("##### Check role like FAQ(Write only admins.).");
permission = OSPUsersUtil.isRegularRole(themeDisplay.getUser(), CustomRoleConstants.ADMINISTRATOR);
if(!permission) permission = OSPUsersUtil.isSiteRole(themeDisplay.getUser(), themeDisplay.getScopeGroupId(), CustomRoleConstants.SITE_ADMINISTRATOR);
}
renderRequest.setAttribute("permission", permission);
// permission check end.
renderRequest.setAttribute("boardDiv", boardDivMap);
}else {
SessionErrors.add(renderRequest, MessageConstants.SEARCH_ERROR);
}
} catch (Exception e) {
_log.error(e);
jspPage = ConstantsPagePath.OSP_MAIN_BOARD_LIST;
renderRequest.setAttribute("permission", false);
SessionErrors.add(renderRequest, MessageConstants.SEARCH_ERROR);
}
// session message print.
String msgType = ParamUtil.getString(renderRequest, "msgType", "");
if(msgType.equals("error")) {
SessionErrors.add(renderRequest, ParamUtil.getString(renderRequest, "ssMsg", ""));
}else if(!msgType.equals("")) {
SessionMessages.add(renderRequest, ParamUtil.getString(renderRequest, "ssMsg", ""));
}
SessionMessages.add(renderRequest, PortalUtil.getPortletId(renderRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
return jspPage;
}
public static void main(String[] args) {
}
}
BoardConfig.java
package com.osp.board.web.board.config;
import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
import com.osp.board.constants.OSPBoardWebPortletKeys;
import aQute.bnd.annotation.metatype.Meta;
#ExtendedObjectClassDefinition(
category = "board",
scope = ExtendedObjectClassDefinition.Scope.SYSTEM
)
#Meta.OCD(
id = OSPBoardWebPortletKeys.BOARD_CONFIG_PORTLET_KEY
)
public interface BoardConfig {
}

Related

Laravel : How download custom blade table as excel

I have this table in blade file in laravel app:
<form method="POST" action="{{url('/download')}}" id="download_form">
#csrf <!-- {{ csrf_field() }} -->
<table class="table font-weight-bold w-100" id="excel_table">
<thead class="table-primary">
<tr>
<th class="text-center">#</th>
<th class="text-center">ناڤ</th>
<th class="text-center">كوم</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">{{$counter}}</td>
<td class="text-right table-primary">{{$student->name}}</td>
<td class="text-center table-primary">{{$sub_total}}</td>
</tr>
</tbody>
</table>
<div>
<input type="hidden" name="file_contente" id="file_contente">
<input type="hidden" value="{{$stage}}" name="stage" id="">
<input type="hidden" value="{{$group}}" name="group" id="">
<button type="submit" id="download" class="btn btn-success">Download to excel</button>
</div>
</form>
</div>
<script>
$(document).ready(function() {
$('#download').click(function() {
var table_content = '<table>';
table_content += $('#excel_table').html();
table_content+= '</table>';
$('#file_content').val(table_content);
$('#download_form').html();
})
})
</script>
the controller is :
public function download(Request $req)
{
$temporary_html_file = './tmp_html/' . time() . '.html';
file_put_contents($temporary_html_file, $req->file_contente);
$reader = IOFactory::createReader('Html');
$spreadsheet = $reader->load($temporary_html_file);
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
$filename = $req->stage." ".$req->group . '.xlsx';
$writer->save($filename);
header('Content-Type: application/x-www-form-urlencoded');
header('Content-Transfer-Encoding: Binary');
header("Content-disposition: attachment; filename=\"".$filename."\"");
readfile($filename);
unlink($temporary_html_file);
unlink($filename);
}
I get error :
file_put_contents(./tmp_html/1634558222.html): failed to open stream:
No such file or directory
How can I solve it ? what is the mistake i did?
Edit
after I created the temp_html folder in public folder I get this error :
./tmp_html/1634560521.html is an Invalid HTML file.

Add people picker to sharepoint online web part

I have this code and want to add the people picker from https://social.technet.microsoft.com/wiki/contents/articles/37728.sharepoint-online-step-by-step-client-side-people-picker-control.aspx#Full_Code
import { Version } from '#microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneTextField
} from '#microsoft/sp-webpart-base';
import { escape } from '#microsoft/sp-lodash-subset';
import styles from './FinanceSysAccWebPart.module.scss';
import * as strings from 'FinanceSysAccWebPartStrings';
import { SPHttpClient, SPHttpClientResponse } from '#microsoft/sp-http';
import { IListItem } from './app/interfaces/IListItem';
export interface IFinanceSysAccWebPartProps {
listName: string;
}
export interface ISpFxPureWebPartProps {
description: string;
}
export default class FinanceSysAccWebPart extends BaseClientSideWebPart<IFinanceSysAccWebPartProps>
{
private listItemEntityTypeName: string = undefined;
public render(): void {
this.domElement.innerHTML = `
<div class="${ styles.financeSysAcc }">
<div class="${ styles.container }">
<div class="${ styles.row }">
<div class="${ styles.column }">
<span class="${ styles.title }">Finance System Access Request Form</span>
<p class="${styles.description}">Name: ${escape(this.properties.listName)}</p>
<table>
<tr>
<td>First Name: </td>
<td><input id="txtFirstName" name="txtFirstName" type="text" /></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input id="txtSurName" name="txtSurName" type="text" /></td>
</tr>
</table>
<div class="ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}">
<div class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
<div class="status"></div>
<ul class="items"><ul>
</div>
</div>
</div>
</div>
</div>
</div>
`;
//let FirstName = (<HTMLInputElement> document.getElementById("txtFirstName")).value;
this.setButtonsEventHandlers();
}
What's the best way to do this? I can't see script tags in a webpart.
Use native JavaScript in SPFx solution would be more complex than classic page and no compile error/tip.
I would suggest you use #pnp/spfx-controls-react People Picker in your solution.
Demo thread

Angular2 dependent dropdown based on selected value

Here am trying to append a dependent drop down based on value drop down (you can see in my HTML code for value drop down).I have wrote a onchage method to get appear dependent dropdown in html.Here i have dependent drop down for only three(i.e, Services Performed, Products Sold, Gross Retail) selected values of my values dropdown. Now am getting the dependent dropdowns, but when i have change the another drop down i.e, 2nd or 3rd ...etc dropdown ,then the previous drop down is getting disappear and latest changed dropdown value is getting appear.
so, please help me to solve it.
my HTML code is
<table class="table table-bordered-light">
<tbody>
<tr class="grey_th">
<td>Step</td>
<td>Action</td>
<td>Value</td>
<td>Number</td>
<td>Sample Calculation</td>
</tr>
<tr *ngFor="let row of rows; let i = 'index'">
<td [innerHTML]="row.step"></td>
<td>
<select [class.disabled]="i==0" [(ngModel)]="row.operator" name="action" style="width: 100%">
<option *ngFor="let actions of actionsStaticData; let i='index'" value="{{actions.id}}" id="actions{{i}}">{{actions.action}}</option>
</select>
</td>
<td>
<tr>
<td>
<div>
<!-- here i have wrote onchange method **onValueChange()** and passing i also along with the value -->
<
[(ngModel)]="row.operand" style="width: 100%" (change)="onValueChange($event.target.value, i)">
<option *ngFor="let values of valuesStaticData; let i='index'" value="{{values.value}}" id="values{{i}}">{{values.value}}</option>
<option value="-" disabled="disabled">-----</option>
<option *ngFor="let values of scalesData; let i='index'" value="{{values.Id}}" id="values{{i}}">{{values.Name}}</option>
</select>
</div>
</td>
<td>
<div class="ml-15" *ngIf='rowLength == i'>
<select [(ngModel)]="row.operandSubOption" style="width: 100%">
<option *ngFor="let values of servicesList; let i='index'" value="{{values.value}}" id="values{{i}}">{{values.Name}}</option>
</select>
</div>
</td>
</tr>
</td>
<td>
<input type="text" [(ngModel)]="row.numeral">
</td>
<td> {{row.result}}{{toFix}}</td>
<td>
<a style="color: #000;" (click)="addRows()" *ngIf='showPlus == true'>
<span class="f-plus">
<i class="fa fa-plus" aria-hidden="true"></i>
</span>
</a>
<a *ngIf='showPlus == false'>
<!-- <span class="del">
<i class="fa fa-plus disable" aria-hidden="true"></i>
</span> -->
</a>
<a (click)="deleteFieldValue(row, i)" *ngIf='hideDelete==true' data-toggle="tooltip" data-placement="top" title="Remove">
<span class="f-minus">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</span>
</a>
</td>
</tr>
</tbody>
</table>
my typesript code is
onValueChange(value, i) {
if (value === 'Services Performed') {
this.rowLength = i;
this.servicesList = '';
this.setupCompMethodService.getServices()
.subscribe(data => {
this.servicesList = data['result'];
this.rows[i]['operandSubOption'] = this.servicesList[0].Name;
});
}
if (value === 'Products Sold') {
this.rowLength = i;
this.servicesList = '';
this.setupCompMethodService.getInventoryGroupData()
.subscribe(data => {
this.servicesList = data['result'];
this.rows[i]['operandSubOption'] = this.servicesList[0].Name;
});``
}
if (value === 'Gross Retail') {
this.rowLength = i;
this.servicesList = '';
this.setupCompMethodService.getProductLineDetails()
.subscribe(data => {
this.servicesList = data['result'];
this.rows[i]['operandSubOption'] = this.servicesList[0].Name;
});
}
}

Saving contenteditable Content Changes

Good Day! I am a newbie in asp.net MVC 5 and is working on a form where one cell is editable then it will be saved in the database, along with the values of the other cells. I've managed to make the cell editable using contenteditable="true" . This is my View:
<div class="container">
#using (Html.BeginForm())
{
#Html.AntiForgeryToken()
#Html.ValidationSummary(true)
<div class="col-lg-12">
<div class="col-lg-6"></div>
<div class="col-lg-6">
<div class="form-horizontal">
<div class="form-group">
#Html.LabelFor(m => m.CUSTOMER_ID, "Customer Name", new { #class = "control-label col-md-2" })
<div class="col-md-10">
#Html.DropDownList("CUSTOMER_ID", ViewBag.CustomerName as IEnumerable<SelectListItem>, "--Select Customer--", new { #class = "form-control" })
</div>
</div>
<div class="form-group">
#Html.LabelFor(model => model.ORDER_DUE_DATE, "Due Date", htmlAttributes: new { #class = "col-lg-5" })
<div class="col-lg-7">
#Html.TextBoxFor(model => model.ORDER_DUE_DATE, "{0:yyyy-MM-dd}", new { #class = "form-control", #type = "date" })
#Html.ValidationMessageFor(model => model.ORDER_DUE_DATE, "", new { #class = "text-danger" })
</div>
</div>
</div><!--form-horizontal-->
</div>
</div><!--col lg 12-->
<table id="tbl_orderItems" class="table table-striped table-bordered table-hover dt-responsive nowrap" cellspacing="0">
<thead>
<tr>
<th>Item Code</th>
<th>Quantity</th>
<th>Unit</th>
<th>Item Description</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
#if (TempData["listOrder"] != null)
{
foreach (var items in TempData["listOrder"] as List<ebms.ViewModels.OrderItems>)
{ #Html.HiddenFor(modelItem => items.Id)
<tr>
<td>#items.PRODUCT_CODE</td>
<td contenteditable="true">#items.iQuantity</td>
<td>#items.MEASUREMENT_NAME</td>
<td>#items.ITEM_DESCRIPTION</td>
<td>#items.tmpStatus</td>
<td>
#Html.ActionLink("Remove", "Remove", new { id = items.Id },
new { onclick = "return confirm('Are sure want to remove?');" })
</td>
</tr>
}
}
</table>
<div id="menu1">
<ul>
<li>
<center><a>Select an Item</a></center>
<ul>
<li><a href='#Url.Action("Products", "Sales")'>Products </a></li>
</ul>
</li>
</ul>
</div>
<div class="form-group">
<div class="col-lg-3 pull-right">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</div>
}
</div>
I've put the contenteditable="true" in the quantity because it is the cell that should be editable. Most of the other values in there are from this form:
It will then be passed on to this form and the quantity should be editable.
Then the Customer will be chosen and the Order Due Date will be put in there as well. My problem is, the value that is typed to the editable cell is not saved in to the database. Can someone help me on how to use contenteditable="true" properly and then save it to the database? Thank you in advanced!

JSF APPLY_REQUEST_VALUES lifecycle not call during POST request process

I create JSF form with Jquery Diaolg. When I submit my form , the request doesn't invoke my bean method on first click but calls it at second click. I implement a PhaseListener to debug and found out that during first click only RESTORE_VIEW and RENDER_RESPONSE were called. My Question is what can cause this.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:forseti="http://xmlns.jcp.org/jsf/composite/components"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<ui:composition >
<div jsf:id="modal-wizard-edit" class="modal">
<div id="user-profile-3" class="modal-dialog">
<div class="modal-content" style="width:800px;">
<div id="modal-content">
<form class="form-horizontal" jsf:id="personne-morale-edit-form" jsf:prependId="false">
<div class="modal-header no-padding">
<div class="table-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<span class="white">×</span>
</button>
Results for "Latest Registered Domains
</div>
</div>
<div class="tabbable" style="margin-top: 20px; margin-left: 20px;margin-right: 20px; margin-bottom: 20px;">
<ul class="nav nav-tabs padding-16">
<li class="active">
<a data-toggle="tab" href="#edit-basic">
<i class="green ace-icon fa fa-pencil-square-o bigger-125"></i>
Etat civil/Identité
</a>
</li>
</ul>
<div class="tab-content profile-edit-tab-content">
<div id="edit-basic" class="tab-pane in active">
<div class="row">
<div class="col-xs-6 col-lg-6 col-md-6 col-sm-6">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="edit-raison-sociale">Raison sociale:</label>
<div class="col-xs-12 col-sm-9">
<input id="edit-raison-sociale" type="text" jsf:value="#{personneMoraleBean.selectedPersonneMorale.raisonSociale}"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="edit-ifu">IFU:</label>
<div class="col-xs-12 col-sm-9">
<input id="edit-ifu" type="text" jsf:value="#{personneMoraleBean.selectedPersonneMorale.ifu}"/>
</div>
</div>
</div>
<div class="col-xs-6 col-lg-6 col-md-6 col-sm-6">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="nature_juridique_edit">Nature juridique:</label>
<div class="col-xs-12 col-sm-9">
<h:selectOneMenu class="chosen-select" id="nature_juridique_edit" value="#{personneMoraleBean.selectedPersonneMorale.natureJuridique}" p:data-placeholder="#{bundle.champNatureAffaireClassification}" required="true" >
<f:selectItem itemValue="" itemLabel="" />
<f:selectItems value="#{personneMoraleBean.listeNatureJuridiques}" var="item" itemValue="#{item}" itemLabel="#{item.libelle}" />
<f:converter converterId="natureJuridiqueConverter" />
</h:selectOneMenu>
</div>
<script src="../../resources/components/chosen.jquery.min.js"></script>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="secteur_edit">Secteurs d'activités:</label>
<div class="col-xs-12 col-sm-9">
<h:selectManyListbox class="multiselect" id="secteur_edit" value="#{personneMoraleBean.selectedPersonneMorale.secteurs}" p:data-placeholder="#{bundle.champNatureAffaireClassification}" p:multiple="" required="true" >
<f:selectItems value="#{personneMoraleBean.listeSecteurActivites}" var="item"
itemLabel="#{item.libelle}" itemValue="#{item}"/>
<f:converter converterId="secteurActiviteConverter"/>
</h:selectManyListbox>
</div>
</div>
<script src="../../resources/js/bootstrap-multiselect.min.js"></script>
<script type="text/javascript">
$('#secteur_edit').multiselect({
enableFiltering: true,
buttonClass: 'btn btn-white btn-primary',
templates: {
button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
ul: '<ul class="multiselect-container dropdown-menu"></ul>',
filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="fa fa-search"></i></span><input class="form-control multiselect-search" type="text"/></div></li>',
filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default btn-white btn-grey multiselect-clear-filter" type="button"><i class="fa fa-times-circle red2"></i></button></span>',
li: '<li><label></label></li>',
divider: '<li class="multiselect-item divider"></li>',
liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
}
});
</script>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="telephone_edit">Telephone:</label>
<div class="col-xs-12 col-sm-9">
<forseti:phoneNumber id="telephone_edit" value="#{personneMoraleBean.selectedPersonneMorale.telephone}"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 20px; margin-left: 20px;margin-right: 20px; margin-bottom: 20px;">
<div class="clearfix col-sm-12 ">
<button type="submit" jsf:id="submit-morale-edit" class="btn btn-primary btn-block" jsf:action="#{personneMoraleBean.doEdit}">
Block Button
</button>
</div>
</div>
</form>
</div>
</div><!-- /.span -->
</div><!-- /.user-profile -->
</div><!-- PAGE CONTENT ENDS -->
<script type="text/javascript">
function ajaxMonitoringFinishEdit(data) {
if (data.status == "success") {
$('#modal-wizard-edit').modal('hide');
}
}
</script>
</ui:composition>
</html>
This is my form code source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forseti.controller.personne;
import forseti.ejb.NatureJuridiqueFacade;
import forseti.ejb.PersonneMoraleFacade;
import forseti.ejb.SecteurActiviteFacade;
import forseti.jpa.personne.NatureJuridique;
import forseti.jpa.personne.PersonneMorale;
import forseti.jpa.personne.SecteurActivite;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
/**
*
* #author Gildasdarex
*/
#Named(value = "personneMoraleBean")
#ViewScoped
public class PersonneMoraleBean implements Serializable {
/**
* Creates a new instance of PersonneMoraleBean
*/
#Inject
private PersonneMoraleFacade personneMoraleFacade;
#Inject
private SecteurActiviteFacade secteurActiviteFacade;
#Inject
private NatureJuridiqueFacade natureJuridiqueFacade;
private PersonneMorale newPersonneMorale;
private PersonneMorale selectedPersonneMorale;
private List<PersonneMorale> listePersonneMorales;
private SecteurActivite selectedSecteurActivite;
public PersonneMoraleBean() {
}
#PostConstruct
public void init() {
newPersonneMorale = new PersonneMorale();
selectedPersonneMorale = new PersonneMorale();
}
public PersonneMorale getNewPersonneMorale() {
return newPersonneMorale;
}
public void setNewPersonneMorale(PersonneMorale newPersonneMorale) {
this.newPersonneMorale = newPersonneMorale;
}
public PersonneMorale getSelectedPersonneMorale() {
return selectedPersonneMorale;
}
public void setSelectedPersonneMorale(PersonneMorale selectedPersonneMorale) {
this.selectedPersonneMorale = selectedPersonneMorale;
}
public List<PersonneMorale> getListePersonneMorales() {
listePersonneMorales = personneMoraleFacade.findAll();
return listePersonneMorales;
}
public List<SecteurActivite> getListeSecteurActivites() {
return secteurActiviteFacade.findAll();
}
public List<NatureJuridique> getListeNatureJuridiques() {
return natureJuridiqueFacade.findAll();
}
public SecteurActivite getSelectedSecteurActivite() {
return selectedSecteurActivite;
}
public void setSelectedSecteurActivite(SecteurActivite selectedSecteurActivite) {
this.selectedSecteurActivite = selectedSecteurActivite;
}
public void doCreate() {
newPersonneMorale.setId(newPersonneMorale.getIfu());
personneMoraleFacade.create(newPersonneMorale);
listePersonneMorales = personneMoraleFacade.findAll();
}
public void doDel() {
personneMoraleFacade.remove(selectedPersonneMorale);
}
public void doEdit() {
System.out.println("edit "+selectedPersonneMorale.getId());
System.out.println("edit "+selectedPersonneMorale.getIfu());
System.out.println(selectedPersonneMorale.getRaisonSociale());
System.out.println(selectedPersonneMorale.getNatureJuridique());
System.out.println(selectedPersonneMorale.getSecteurs().size());
personneMoraleFacade.edit(selectedPersonneMorale);
}
public void doRemoveSecteur() {
selectedPersonneMorale.getSecteurs().remove(selectedSecteurActivite);
personneMoraleFacade.edit(selectedPersonneMorale);
listePersonneMorales = personneMoraleFacade.findAll();
}
public void passItemMoraleSecteur(PersonneMorale personneMorale, SecteurActivite secteurActivite) {
selectedPersonneMorale = personneMorale;
selectedSecteurActivite = secteurActivite;
}
public void passItem(PersonneMorale item) {
selectedPersonneMorale = item;
System.out.println("getItem "+selectedPersonneMorale.getId());
}
}

Resources