相关疑难解决方法(0)

action和actionListener之间的差异

是什么区别actionactionListener,什么时候应该使用actionactionListener

jsf action actionlistener jsf-2

385
推荐指数
3
解决办法
25万
查看次数

了解PrimeFaces进程/更新和JSF f:ajax执行/呈现属性

究竟是什么process,并update在PrimeFaces p:commandXxx组件和executerenderf:ajax标签?

哪个在验证时有效?什么是update属性做,而不是更新的值从后端组件?不要process属性绑定值模型?究竟是什么@this,@parent,@all@form在这两个属性?

下面的例子工作正常,但我对基本概念有点困惑.

<p:commandButton process="@parent"
                 update="@form"
                 action="#{bean.submit}" 
                 value="Submit" />
Run Code Online (Sandbox Code Playgroud)

jsf process updates primefaces

181
推荐指数
4
解决办法
22万
查看次数

在onclick事件之前执行p:commandLink操作?

我有一个p:commandLink单击启动对话框.此外还有一个动作,必须启动对话框之前执行,因为对话框取决于动作填充的内容.

如何在没有 javascript的情况下启动弹出窗口之前运行操作?

<p:commandLink action="#{service.computePrefetch(_var)}" onclick="dlg.show()"/>
Run Code Online (Sandbox Code Playgroud)

jsf primefaces

4
推荐指数
1
解决办法
2万
查看次数

ajax更新完成后如何调用js函数

我有一个 ajax commandButton,当我点击它时,它会更新我使用的表单并在 onclick 方法上调用一个 js 函数。

问题:一个字段起初是不可见的,我使用style="display:none"forinvisibilty。当我单击按钮时,它会更新表单数据并显示:none 仍然存在。在 onclick 命令上,我使用 js 函数style="display:nonestyle="display:block".

这是我的 js 函数:

setTimeout(function() {
PF('field').jq.css('display', 'block');
}, delay);
Run Code Online (Sandbox Code Playgroud)

我使用延迟来等待更新完成其工作。

这是我的命令按钮:

<p:commandButton ajax="true" update="form" onclick="jsFunc();"</p:commandButton>
Run Code Online (Sandbox Code Playgroud)

但是我想确定 ajax update 什么时候完成它的工作,然后我想调用 js 函数。

做这个的最好方式是什么 ?

提前致谢。

javascript jsf primefaces

3
推荐指数
1
解决办法
2820
查看次数

p:commandButton不能显示p:对话框

我在单击时显示对话框有问题。这是显而易见的,但我无法发现该错误。我已经坚持了好几天,这太疯狂了。你能帮我吗。

<h:form id="form">

<p:commandButton
    rendered="#{characterBean.characterSession.characterName ne null}"
    value="#{characterBean.characterSession.title.titleName}"
    icon="fa fa-fw fa-edit" onclick="PF('dlg').show();"
    update="@form"/>

<p:dialog id="titleDetail" header="#{i18n['title.yourTitles']}"
    widgetVar="dlg" dynamic="true" closable="false" resizable="false"
    showEffect="fade" hideEffect="fade">
    <h:panelGroup>
        <p:messages autoUpdate="true" />
        <h:selectOneMenu id="titleSelect" converter="#{titleConverter}"
            value="#{characterBean.characterSession.title}">
            <f:selectItems value="#{characterBean.titleUnlocked}" var="t"
                itemValue="#{t}" itemLabel="#{t.titleName}" />
        </h:selectOneMenu>
        <hr />
        <h:panelGrid columns="2" style="width: 100%; text-align:center">
            <p:commandButton value="#{i18n['general.submit']}"
                icon="fa fa-check"
                actionListener="#{characterBean.updateCharacterTitle}"
                oncomplete="PF('dlg').hide();" update="@form" />

            <p:commandButton value="#{i18n['general.cancel']}"
                icon="fa fa-close" action="#{characterBean.submitCancel}"
                oncomplete="PF('dlg').hide();" update="@form" process="@this" />
        </h:panelGrid>
        <p:remoteCommand name="updateForm()" process="@this" update="@form" />
    </h:panelGroup>
</p:dialog>

</h:form>
Run Code Online (Sandbox Code Playgroud)

jsf primefaces

1
推荐指数
1
解决办法
43
查看次数

标签 统计

jsf ×5

primefaces ×4

action ×1

actionlistener ×1

javascript ×1

jsf-2 ×1

process ×1

updates ×1