0

ある列に a があり、ice:dataTable別の列に a があります。はfalse に設定されています。 1行で(クリックで)チェックボックスを選択すると、clickActionは起動されません(これまでのところ、とても良いため)。 しかし、この後に同じページのボタンをクリックすると、アクションバインディングに関係なく、rowSelectorが起動されます。なんで? これを防ぐためのアイデアはありますか?ice:rowSelectorice:selectBooleanCheckboxice:rowSelectortoggleOnInput
toggleOnInput
clickAction

これが私のページ定義です:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ice="http://www.icesoft.com/icefaces/component"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html">
    <f:view>
        <ice:form>
            <ice:commandButton value="Test" />

            <ice:dataTable id="dataTable"
                       value="#{PageBean.data}"
                       var="entity">
                <ice:column>
                    <ice:selectBooleanCheckbox />
                </ice:column>
                <ice:column>
                    <ice:outputText value="#{entity.name}" />
                    <ice:rowSelector clickAction="#{PageBean.clickAction}" toggleOnInput="false" />                 
                </ice:column>
            </ice:dataTable>
       </ice:form>
    </f:view>
</html>
4

2 に答える 2

1

ページ内の他のボタンとデータ テーブルに別のフォームを作成してみることができます。フォームをネストするべきではありませんが、複数のフォームを持つことができます。

またselectionAction、それぞれの行がクリックされたときに呼び出す Action メソッドを実行している場合は、属性を使用することをお勧めします。

これがあなたを助けることを願っています

于 2012-05-30T06:14:30.820 に答える
0

次のように指定されたコマンド ボタンを使用していることがわかります。

ice:commandButton

The ice:commandButton tag displays a button which can be linked to an action in 
a backing bean method by specifying the bean and the method in the actionListener
attribute. The button can be replaced by an image by specifying the URL of the  
image in the image attribute.

Beanメソッドに支えられていることがはっきりとわかります。コードを徹底的にチェックしてください。

于 2012-05-21T15:11:09.497 に答える