У меня возникают проблемы с получением значений, заполненных в форме, при нажатии кнопки «Да» в диалоговом окне, данные не отображаются заполненными в соответствующих объектах. Что происходит? Я неправильно обновил кнопку?
Class PostionInformation
public class PostionInformation{
private Box box;
private Position position;
public PostitionInformation(){
box = new Box();
position = new Position();
}
}
Bean publi c void savwPostionFini sh () {Box box = new Box ();
if(this.positionInformation.getBox() != null) {
box = this.positionInformation.getBox();
}
List<Position> list= dao.searchBox(box);
changeInformation(positions);
}
public void chanceInformation(List<Position> postions) {
//List empyty
}
форма x html
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/template.xhtml">
<h:form id="formMain">
<p:messages id="messages" showDetail="true">
<p:autoUpdate />
</p:messages>
<div class="ui-g ui-fluid">
<div class="ui-g-12">
<div class="card card-w-title">
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank form-group" id="formBox">
<p:selectOneMenu id="cbboxBox" value="#{positionMng.positionInformation.box}"
converter="#{boxConverter}" required="true"
immediate="true">
<f:selectItem itemLabel="#{msg.optionBox}"/>
<f:selectItems value="#{positionMng.listaBoxes}" var="box"
itemValue="#{box}" itemLabel="#{box.name}"/>
</p:selectOneMenu>
</p:panelGrid>
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank form-group" id="formSituation">
<h:panelGroup>
<p:outputLabel for="radioSituation" value="#{msg.labelSituation}" />
<p:selectOneRadio layout="responsive" columns="3" id="radioSituation" value="#{positionMng.changeInformation.position.situation}"
converter="positionSituationConverter" required="true"
immediate="true">
<f:selectItems value="#{positionMng.listSituation}" var="position"
itemValue="#{position}" itemLabel="#{position.name}"/>
</p:selectOneRadio>
</h:panelGroup>
</p:panelGrid>
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank form-group">
<p:commandButton icon="ui-icon-save"
value="#{msg.save}" oncomplete="PF('confirmFinish').show()"
process="@this" update=":formMain:finishDialog"
title="#{msg.salvar}"/>
<p:commandButton icon=" ui-icon-closethick" action="#{positionMng.cancel()}"
value="#{msg.cancel}" immediate="true"
title="#{msg.cancel}"/>
</p:panelGrid>
</div>
</div>
</div>
<p:confirmDialog header="#{msg.messageFinish}"
message="#{msg.messageFinishAlteracaoPosicaoLote} #{msg.mensagemContinue}"
widgetVar="confirmFinish" id="finishDialog">
<p:commandButton value="#{msg.yes}" oncomplete="PF('confirmFinish').hide();"
action="#{positionMng.savePositionFinish()}" process="@this"
update=":formMain:formSituation :formMain:formDadosBox" id="yesButton" />
<p:button value="#{msg.no}" onclick="PF('confirmFinish').hide(); return false;" />
</p:confirmDialog>
</h:form>
</ui:define>
</ui:composition>