Есть ли лучший способ обновить вид, чем с помощью методов установки - PullRequest
0 голосов
/ 27 марта 2020

Я использую Spring с Hibernate. В моем представлении есть флажок (Unicode), который я включаю проверенным (просто Unifode Unifode) с функцией executePhase, как показано ниже:

public void executePhase(int phase, int lp) {

    OrderItemDto orderItemByLpView = this.getOrderItemByLp(lp);
    if (orderItemByLpView != null) {

        orderItemByLpView = ordersService.executePhase(phase, orderItemByLpView, sessionBean.getUser());

            return;
        }
    }

Мой вид x html код:

...
<p:column>
    <p:commandLink value="\u2610" 
                   actionListener="#{this.executePhase(3, item.lp)}"
                   update=":contentForm:productionPlan" 
                   rendered="#{empty item.phase3DateTime}">
        <p:confirm header="bla" message="bla bla" icon="ui-icon-alert" />
    </p:commandLink>
</p:column>
...

Проблема в том, что если я включу его с помощью кнопки commandLink, он не будет обновлять sh без F5, если я не использую сеттеры, такие как:

orderItemByLpView.setPhase1DateTime(orderItemByLpView.getPhase1DateTime());
orderItemByLpView.setPhase2DateTime(orderItemByLpView.getPhase2DateTime());
orderItemByLpView.setPhase3DateTime(orderItemByLpView.getPhase3DateTime());
orderItemByLpView.setPhase1User(orderItemByLpView.getPhase1User());
orderItemByLpView.setPhase2User(orderItemByLpView.getPhase2User());
orderItemByLpView.setPhase3User(orderItemByLpView.getPhase3User());

Как вы можете видеть, сеттеры выглядят ужасно. Есть ли лучший способ? Как делать то, что он делает в фоновом режиме на этих линиях?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...