[Wicket-ja-user 353] IComponentResolverとPanelについて

Back to archive index

古川 烈 r_f_315****@hotma*****
2009年 7月 6日 (月) 17:43:10 JST


古川です、
IComponentResolverでPanelを使用しようとして悩んでおります。


IComponentResolverを実装したHogeHogePageクラスのresolveメソッドで、

    public boolean resolve( MarkupContainer container, MarkupStream markupStream, ComponentTag tag ) {
        // 省略
        container.autoAdd( new MyPanel("panel"), markupStream );
        // 省略
    }

としているのですが、

[ HogeHogePage.html ]
    <html>
        <head>
        </head>
        <body>
            <wicket:container wicket:id="panel" myAttribute="hogehoge" ></wicket:container>
        </body>
    </html>

となっているHTMLに対して

[ MyPanel.html ]
    <html>

        <head>

        </head>

        <body>
            <wicket:panel>
                <div>
                    <p wicket:id="myLabel"></p>
                </div>
            </wicket:panel>

        </body>

    </html>

の様なパネルを自動的にadd()したいのですが、
WicketMessage: Failed to handle: <wicket:container wicket:id="panel">. It might be that no resolver has been registered to handle this special tag.  But it also be that you declared wicket:id=miss in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.となって、エラーとなってしまいます。

wicket:container を使用せずに div を使用すると問題なく動作するのですが、
出力後のHTMLソースが、

        <div myattribute="hogehoge" id="panel">

            <div>

                <p id="myLabel">MyPanelで作ったLabelの文字列</p>
            </div>

        </div>

となってしまい、無駄にdivのネストが発生してしまいます。
普通 Panel等は一定のデータの塊をブロックタグ等で括って再利用するために作ると思うので、
できれば、<wicket:panel>タグの階層をブロックタグの子要素に落とすようなやり方では対処したくありません。

この問題の解決方法のわかる方、どうかご教示頂けませんでしょうか?

以上、よろしくお願い申し上げます。


_________________________________________________________________
便利!ケータイへのHotmailアラートはこちら
http://clk.atdmt.com/GBL/go/153791840/direct/01/
-------------- next part --------------
HTMLの添付ファイルを保管しました...
Download 



Wicket-ja-user メーリングリストの案内
Back to archive index