fix template

This commit is contained in:
Anton Romanov 2019-11-28 07:52:42 +04:00
parent 6b90d7b0c0
commit 4c4c1b2015
3 changed files with 88 additions and 48 deletions

View File

@ -30,7 +30,7 @@ public class FacesUtil {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, summary, detail);
FacesContext fc = FacesContext.getCurrentInstance();
fc.getExternalContext().getFlash().setKeepMessages(true);
fc.addMessage(null, message);
fc.addMessage("messages", message);
}
public static void showDangerMessage(String summary, String detail) {

View File

@ -38,7 +38,7 @@
</f:facet>
</p:menubar>
<div class="ui-fluid">
<p:growl id="messages"/>
<p:growl id="messages" for="messages"/>
<ui:insert name="content">Content</ui:insert>
</div>
</div>

View File

@ -17,57 +17,97 @@
border: none;
padding: 0px;
}
#mainForm\:paperPanel > tbody > tr {
border: none;
}
#mainForm\:paperPanel > tbody > tr > td {
border: none;
}
</style>
<p:panel id="panel" header="Статья" style="margin-bottom:10px;">
<h:panelGrid columns="2" cellpadding="5">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="name" value="Название:"/>
<p:inputText id="name" required="true" value="#{paperView.paper.title}"/>
<p:outputLabel for="@next" value="Статус:"/>
<p:panelGrid columns="2" id="paperStatus">
<p:selectOneMenu id="status" required="true" value="#{paperView.paper.status}"
converter="paperStatusConverter">
<p:ajax update="mainForm:paperStatus" process="@this"/>
<f:selectItems value="#{paperView.paperStatuses}"
var="status"
itemLabel="#{status.statusName}"
itemValue="#{status}"/>
<p:panelGrid cellpadding="5" id="paperPanel">
<p:row>
<p:column>
<h:outputLabel value="Название:"/>
</p:column>
<p:column>
<p:inputText id="name" required="true" value="#{paperView.paper.title}"/>
<p:message for="name"/>
</p:column>
<p:column>
<p:link href="/conference/conferenceList.xhtml" value="Статья участвует в конференции"/>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel for="paperStatus" value="Статус:"/>
</p:column>
<p:column>
<p:panelGrid columns="2" id="paperStatus">
<p:selectOneMenu id="status" required="true" value="#{paperView.paper.status}"
converter="paperStatusConverter">
<p:ajax update="mainForm:paperStatus" process="@this"/>
<f:selectItems value="#{paperView.paperStatuses}"
var="status"
itemLabel="#{status.statusName}"
itemValue="#{status}"/>
</p:selectOneMenu>
<ui:include src="paperStatusFragment.xhtml">
<ui:param name="paper" value="#{paperView.paper}"/>
<ui:param name="shortMode" value="true"/>
</ui:include>
</p:panelGrid>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel for="type" value="Тип:"/>
</p:column>
<p:column>
<p:selectOneMenu id="type" value="#{paperView.paper.type}"
converter="paperTypeConverter">
<f:selectItems value="#{paperView.paperTypes}"
var="type"
itemLabel="#{type.typeName}"
itemValue="#{type}"/>
</p:selectOneMenu>
<ui:include src="paperStatusFragment.xhtml">
<ui:param name="paper" value="#{paperView.paper}"/>
<ui:param name="shortMode" value="true"/>
</ui:include>
</p:panelGrid>
</p:column>
</p:row>
<p:outputLabel for="@next" value="Тип:"/>
<p:selectOneMenu id="type" value="#{paperView.paper.type}"
converter="paperTypeConverter">
<f:selectItems value="#{paperView.paperTypes}"
var="type"
itemLabel="#{type.typeName}"
itemValue="#{type}"/>
</p:selectOneMenu>
<p:outputLabel for="@next" value="Комментарий:"/>
<p:textEditor widgetVar="editor2" value="#{paperView.paper.comment}" height="300"
style="margin-bottom:10px" placeholder="Комментарий"/>
<p:row>
<p:column>
<p:outputLabel for="comment" value="Комментарий:"/>
</p:column>
<p:column>
<p:textEditor id="comment" widgetVar="editor2" value="#{paperView.paper.comment}" height="300"
style="margin-bottom:10px" placeholder="Комментарий"/>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel for="authors" value="Авторы:"/>
</p:column>
<p:column>
<p:selectCheckboxMenu id="authors" value="#{paperView.paper.authors}" multiple="true"
converter="#{userConverter}">
<f:attribute name="collectionType" value="java.util.HashSet"/>
<f:selectItems value="#{paperView.authors}"
var="author"
itemLabel="#{author.userAbbreviate}"
itemValue="#{author}"/>
</p:selectCheckboxMenu>
</p:column>
</p:row>
<p:outputLabel for="@next" value="Авторы:"/>
<p:selectCheckboxMenu id="authors" value="#{paperView.paper.authors}" multiple="true"
converter="#{userConverter}">
<f:attribute name="collectionType" value="java.util.HashSet"/>
<f:selectItems value="#{paperView.authors}"
var="author"
itemLabel="#{author.userAbbreviate}"
itemValue="#{author}"/>
</p:selectCheckboxMenu>
<p:commandButton action="#{paperView.save}" value="Сохранить" ajax="true" process="@form"
update="messages"/>
</h:panelGrid>
<p:panelGrid columns="1">
<p:link href="/conference/conferenceList.xhtml" value="Статья участвует в конференции"/>
</p:panelGrid>
</h:panelGrid>
<p:row>
<p:column>
<p:commandButton action="#{paperView.save}" value="Сохранить" ajax="true" process="@form"
update="messages @form"/>
</p:column>
</p:row>
</p:panelGrid>
</p:panel>
</ui:define>
</ui:composition>