正如标题所示,当我点击a4j:commandLink时,该方法执行完美并更新我需要的表。a4j:commandLink从xhtml擦除javascript
问题是,页面的js在a4j:commandLink发布到bean之后正在消失。
编辑:为了更清楚一点,当我的意思是js消失时,会发生什么情况是,当我在Mozilla Firebug中查找页面的JavaScript时,它不显示它。 这是正常的吗?我究竟做错了什么?任何最好的方法呢?
的代码是:
<h:panelGroup id="examplePanel" >
<h:panelGroup rendered="#{not empty exampleBean.list}">
<table id="listDataTable" width="100%" cellspacing="0"
cellpadding="0" border="0" style="margin-left: 0pt; width: 716px;">
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
<th class="shortCol">col4</th>
</tr>
</thead>
<tbody>
<a4j:repeat value="#{exampleBean.list}" rowKeyVar="itStatus" var="item">
<tr>
<td>
<h:outputText value="#{exampleBean.exampleShow(item)}" />
</td>
<td>
<h:outputText value="#{exampleBean.exampleShow(item)}" />
</td>
<td>
<h:outputText value="#{exampleBean.exampleShow(item)}" />
</td>
<td>
<h:commandLink action="#{exampleShow(item)}" ></h:commandLink>
</td>
</tr>
</a4j:repeat>
</tbody>
</table>
</h:panelGroup>
</h:panelGroup>
<h:outputLabel value="* #{locale.name}:" />
<h:inputText value="#{exampleBean.exampleName}"
disabled="#{not exampleBean.edit}" id="exampleName" />
<div class="button search">
**<a4j:commandLink action="#{exampleBean.objetToTable}" value="#{locale.create}" render="exampleTurnPanel" ></a4j:commandLink>**
</div>
在此之前,我使用的是H:commandLink用F:AJAX内部。但是有了这个,这个bean没有这个值,因为POST永远都不会完成。正确?
<h:commandLink action="#{exampleBean.objetToTable}" value="#{locale.create}">
<f:ajax execute="examplePanel" render="examplePanel" onevent="setExampleTableCss"/> </h:commandLink>
REGARDS。
如果将JavaScript代码移到“exampleTurnPanel”组件外部,会更好。如果这不起作用,请隔离问题并确保它是错误(或不是)。 –