0

Wire generic composite component

asked 2013-04-12 15:20:38 +0800

zucci gravatar image zucci
1

Hi, I have an abstract component "CompInput" that extends Div. Another component "Compdatebox" that extends "CompInput".

I want to create a generic component "compGenericRow" that extends Row

@wire("label")
private Label label;

@Wire("compinput")
private CompInput comp;

the zul is

<zk>
   <label/>
   <compdatebox/>
</zk>

When initialize the component "compGenericRow" the label is created but not the generic input component. Else modifing the "compGenericRow"

    @wire("label")
    private Label label;

    @Wire("compdatebox")
    private CompInput comp;

the "CompInput" is created.

How can I initialize the generic component?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-16 03:43:23 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Yes this will not work as the type selector in @Wire do not work as in Java superclass/subclass relationship. The type selector needs to be exact type i.e. compdatebox in your case for SelectorComposer to be able to wire it correctly. Note that your <compdatebox /> will still create an instance of Compdatebox on server-side. It is just not wired if you use @Wire("compinput") for the reason stated above.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-04-12 15:20:38 +0800

Seen: 16 times

Last updated: Apr 16 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More