縫い目コンポーネントを作成することはできません。ページスコープはアクティブではありません。 Selectbooleancheckboxを選択します

StackOverflow https://stackoverflow.com/questions/19854475

  •  29-07-2022
  •  | 
  •  

質問

Seam 2.2.2、JSF 1.2。とてもシンプルに聞こえます:a dataTable 各行には、ボタンが呼び出されたときに観察したいチェックボックスがあります。コントローラーがあります:

@Name("MyController")
@Scope(ScopeType.PAGE)
public class MyController {
    private List<MyItem> myItems;

    public MyItem[] getItemsList(boolean excluded) {
            return myItems;
    }

私が持っています MyItem タイプ:

public class MyItem {
    private boolean selected = false;

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        System.out.println("setting to " + selected);
        this.selected = selected;
    }

    ... other things ...
}

これは私のXHTMLです:

<a:form id="formExcludedList">
    <rich:dataTable id="excludeList"
        value="#{MyController.getItemsList(true)}" var="o">
        <rich:column>
            <h:selectBooleanCheckbox id="selectComponent"
                value="#{o.selected}" />
        </rich:column>

チェックボックスをクリックするとき MyItem.setSelected 実行されていません。しかし、私はいくつかのファンキーなロギングを取得しています:(手入れのために手入れされています)

DEBUG createHotDeployment - Using Java hot deploy
DEBUG beginRequest - >>> Begin JSF request for <my page>
DEBUG begin - beginning transaction prior to phase: RESTORE_VIEW(1)
DEBUG begin - beginning JTA transaction
WARN  getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN  getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN  getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN  getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
DEBUG restoreAndLockConversation - No stored conversation
DEBUG commitOrRollback - committing transaction after phase: INVOKE_APPLICATION(5)
DEBUG commit - committing JTA transaction
DEBUG begin - beginning transaction prior to phase: RENDER_RESPONSE(6)
DEBUG begin - beginning JTA transaction
DEBUG commitOrRollback - committing transaction after phase: RENDER_RESPONSE(6)
DEBUG commit - committing JTA transaction
DEBUG endRequest - Discarding conversation state: 7
DEBUG endRequest - After render response, destroying contexts
DEBUG flushAndDestroyContexts - ... et cetera
DEBUG destroy - destroying: ...
DEBUG destroy - destroying: ... et cetera
DEBUG endRequest - <<< End JSF request for <my page>

あなたの助けは大歓迎です!

役に立ちましたか?

解決

いくつかのJSF依存関係が欠けていることが判明しました: jsf-api.jarjsf-impl.jar. 。その後、私のコンテナ(WebSphere)から提供されたものが間違ったバージョンであったため、機能しませんでした。これらの依存関係ジャーと適切なバージョンを適用すると、すべてが良かったです!

他のヒント

JBossが見つからない場合は、このエラーを投げることもあります seam.properties アプリケーションで src/conf ディレクトリ。ファイルは空になる可能性がありますが、スコープがアクティブになるにはそこにある必要があります。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top