0

他のパネルが行くべき場所を定義したパネルがあります。多数の継承があるだけでなく、アプリケーション全体で使用されるため、継承があってはなりません。

「含めたい」コンポーネントは、パネル自体も拡張します。コンポーネント 2 の実装とは無関係に、マー​​クアップ 1 を使用してコンポーネント内でのようなことができるようにしたいと考えています。

それは可能ですか?私は継承がどのように機能するかを完全に認識しています。しかし、構成についてはあまりありません...

スタックトレース:

Last cause: The component(s) below failed to render. Possible reasons could be that: 1) you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered), 2) if your components were added in a parent container then make sure the markup for the child container includes them in <wicket:extend>.

1. [BlockingAjaxSubmitLink [Component id = link_language_add]]
2. [ListView [Component id = language_placeholder]]
3. [ListItem [Component id = 0]]
4. [LanguagePanel [Component id = language]]
5. [WebMarkupContainer [Component id = container_name]]
6. [TextField [Component id = name]]
7. [Component id = feedback_name]
8. [WebMarkupContainer [Component id = container_proficiency]]
9. [TextField [Component id = proficiency]]
10. [BlockingAjaxLink [Component id = link_remove]]
11. [ListItem [Component id = 1]]
12. [LanguagePanel [Component id = language]]
13. [WebMarkupContainer [Component id = container_name]]
14. [TextField [Component id = name]]
15. [Component id = feedback_name]
16. [WebMarkupContainer [Component id = container_proficiency]]
17. [TextField [Component id = proficiency]]
18. [BlockingAjaxLink [Component id = link_remove]]

これらのコンポーネントはすべてフォーム内にあるか、少なくともそこにあるはずです。

4

2 に答える 2

1

なるほど....そうですね、次のようなパターンを維持してみてください: ページ -> フォーム -> パネル。また、コンポーネントをフォームにもパネルにも配置しないようにしてください。

public class Page extends WebPage{

private MyForm myForm;

public Page(){
myForm = new()....;
  }

}

public class MyForm extends Form<T>{

  public MyForm(String id){
    super(id);
  }

}

public class MyPanel extends Panel{

//your components

  public MyPanel(String id){
   super(id);
  }

}

[wicket:extend]

  [form wicket:id="myForm"]

    [div wicket:id="myPanel"/]

  [form]
[/wicket:extend]

[wicket:panel]

[div wicket:id="myPanel"]

[/div]

[/wicket:panel]
于 2013-08-13T17:33:06.170 に答える