【问题标题】:<a4j:commandLink> its not calling the action<a4j:commandLink> 它没有调用动作
【发布时间】:2013-04-24 03:01:23
【问题描述】:

我正在尝试创建指向新创建记录的链接,并且在成功创建链接后,我将链接包含在成功消息面板中,但我无法使用标签调用操作。

以下是我的代码:

<div class="panel-success">
<a4j:outputPanel id="succes_submit">
 <rich:notify stayTime="1000" rendered="#{user.accountsSaved}"
                styleClass="panel-success fsgui-input-panel-success">
<f:facet name="summary">
   <a4j:commandLink ajaxSingle="true" action="#{user.metod}"
         value="#{user.accSeriesInfo.number} :"oncomplete="#{rich:component('details-update')}.show();">                                   

<f:setPropertyActionListener target="#{orgseries.accSeriesInfo}" value="#{dataItem}" />
</a4j:commandLink>
<h:outputText value="Record updated successfully "></h:outputText>
</f:facet>
</rich:notify>
</a4j:outputPanel>
</div>

我尝试使用 h:commandLink 而不是 a4j:commandLink 在这里我可以调用该操作但无法呈现或执行 onComplete 操作。

谁能告诉我哪里出错了,

提前致谢。

【问题讨论】:

  • 代替action属性试试actionListener
  • 您好,感谢您的回复,仍然无法正常工作:(
  • 在 a4j:commandLink 组件之间使用 a4j:support 组件并尝试一次
  • 你有没有提到这种方式的方法 public void metod(ActionEvent event) { //body} 修改action属性改为actionListener后。
  • 我尝试使用 actionListener 仍然没有进展 :( ,而不是 我尝试使用 在这里我能够调用该操作但无法呈现或执行 onComplete 操作。

标签: jsf-2 richfaces commandlink


【解决方案1】:

我找到了将链接包含在rich:notify 标记中的解决方案

<div class="panel-success" id="success_submit_div">
<a4j:outputPanel id="stru_succes_submit">
 <rich:notify stayTime="1000" rendered="#{emp.saveSuccess}">
<f:facet name="summary">
<h:form>
<a4j:commandLink immediate="true" action="#{emp.getInfo}"  value="# {emp.empId}:"   oncomplete="#{rich:component('edit-Emp-Details')}.show();">
</a4j:commandLink>
<h:outputText value="#{ isEdit ? messages['common.app.save.success'] : messages['employee.create.success']}"></h:outputText>
</h:form>   
</f:facet>
</rich:notify>
</a4j:outputPanel>
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    • 1970-01-01
    • 2014-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多