0

Calling custom component constructor with params from zul

asked 2015-10-14 09:08:58 +0800

WilliamB gravatar image WilliamB
1609 1 6

Greetings,

Is there a way to force ZK to call a custom component constructor with parameter instead of always calling the parameterless constructor and setters ?

Let's say I've a customComponent "Cust" that has 2 constructor

private class Cust {

    private String label;

    public Cust() {

    }

    public Cust(final String pLabel) {
        label = pLabel;
    }

    public void setLabel(final String pLabel) {
        label = pLabel;
    }
}

Is there a way for the zul to call the constructor with param instead of the empty constructor and setter when i write the tag like this

<cust label="test" />
delete flag offensive retag edit

Comments

I am afraid that may be impossible to do that, may I ask what's your concern about this?

jumperchen ( 2015-10-15 04:01:54 +0800 )edit

Just avoid having to add aftercompose to have my other attr set.

WilliamB ( 2015-10-15 08:35:20 +0800 )edit
Be the first one to answer this question!
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: 2015-10-14 09:08:58 +0800

Seen: 25 times

Last updated: Oct 14 '15

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