1

I am in a situation where I need to call a Class method and execute some tasks, which will return some data and need to set the same data to Struts bean and display the same dynamically in jsp page

<tr>
 <td><s:select id="selectProductCode" list="#session['UDM_Product_Codes']" name="selectProductCode" onchange="callXmethod(this);" /></td>
 <td><s:textfield theme="simple" name="assignedProductBean.assignedProductKey" value="" /></td>
 <td><s:select label="selectRole" id="selectRole" name="roleList" list="assignedProductBean.roleList" /></td>
 <td><b><s:a href="javascript:createRole()">CREATE</s:a></b></td>
 <td></td>
 <td></td>
</tr>

As shown in the code. as soon as i select Product, I need to call some method in my action class, which sets some data to bean again, based on which rest of the two fields depends

4

1 に答える 1

1

私はまだあなたが直面している問題がわかりません。あなたが説明していることはかなり可能です、あなたがAjax(Jquery)の世話をする必要があるすべてです。あなたはあなたのActionクラスに値を渡して戻ることができるAjaxメソッドを作成することができます結果。

JSONベースの通信ははるかに柔軟であり、jQueryはJSONを優れた方法で補完し、すぐに使用できる多くの機能を提供するため、 Struts2-Jqueryプラグインを確認することをお勧めします。

これがすべて一緒にどのように機能するかを確認するための1つの例です

于 2012-08-13T07:59:07.317 に答える