この問題が発生しました。私はh:formの中に2つのテーブルをラップします。また、異なるh:formタグでネストした表をラップしようとしました。だから私の目標は、ユーザーがチェックボックスをクリックするとサーバー側で解雇されるリスナーです。私はすべての入力を送信したくないので、execute = "@ this"を使用します.1つの属性のjavascriptイベントは起動されますが、サーバーのリスナーは決して使用しません。チェックボックスをクリックすると、要求がサーバーに送信されるのがわかります。それがなぜ呼び出されないのか分かりません。f:Ajaxリスナーは起動しません。予期しない動作
VIEW:
<h:form>
<table id="trades">
<th class="image_cell"></th>
<th>Type</th>
<th>Portfolio</th>
<ui:repeat var="trade" value="#{controller.errorTrades}">
<tr class="trade error">
<td class="image_cell error"><h:graphicImage styleClass="expandable" url="resources/images/plus.png"></h:graphicImage></td>
<td id="type" class="error">#{trade.type}</td>
<td class="error">#{trade.portfolio}</td>
</tr>
<tr class="operations">
<td id="#{trade.murexId}" class="operation_row" colspan="4">
<table id="operations">
<tr class="header">
<th class="empty_cell"></th>
<th class="operation_cell">Operation</th>
<th>Time Transaction</th>
<th>Comment</th>
<th id="delete">Delete</th>
</tr>
<ui:repeat var="operation" value="#{trade.operationsSortList}">
<tr class="operation">
<th class="empty_cell"></th>
<td id="operation" class="operation_cell color">#{operation.operation}</td>
<td class="color">#{operation.time}</td>
<td class="color">#{operation.coment}</td>
<td class="color checkbox">
<h:selectBooleanCheckbox title="delete">
<f:ajax execute="@this" event="click" listener="#{controller.onDelete}" onevent="onDeleteProcess" />
<f:attribute name="murexId" value="#{trade.murexId}" />
<f:attribute name="operationId" value="#{operation.id}" />
</h:selectBooleanCheckbox>
</td>
</tr>
</ui:repeat>
</table>
</td>
</tr>
</ui:repeat>
</table>
</h:form>
はCONTROLLER:
@ViewScoped
public class Controller
{
private ArrayList trades;
private ArrayList errorTrades = new ArrayList();
.......code
public boolean onDelete(AjaxBehaviorEvent event)
{
long murexId = 0;
BigDecimal operationId = null;
boolean result = false;
Trade trade;
Iterator itop;
Operation operation;
......code
return true;
}
}
誰かが私を助けることができれば、私はそれを本当に感謝します。
おかげ
ajaxリスナーメソッドは 'void'を返す必要があります。多分それが問題です。 –
使用しているJSF impl/versionは何ですか?初期のMojarraのバージョンには、ネストされた ''にいくつかの特有の問題があります。代わりに ''を使用して、それらを除外してください。 –
BalusC
ブール値を返すとうまくいくと思いますが、voidを使っても動作しません。私はJSF 2.1を使用しています。私は多くのCSSを使用しており、で実装する方が簡単です。何か案が? –
bribon