0

Composer set value from Class as static property

asked 2016-06-16 12:29:16 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

updated 2016-06-16 12:33:38 +0800

I need to set a value to a component using composer

<textbox maxlength="XXXXXX"/>

i need to set maxlength property from a static property in other class like this

public final class NotComposerClass
{
     public final static int MAX_LENGTH_TO_SET=1000;
}

How can i set NotComposerClass.MAXLENGTHTO_SET value to the textbox without using the composer or without create a separated method in the composer is this possible?

thanks a lot. and best regards.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-17 01:49:18 +0800

MDuchemin gravatar image MDuchemin
1346 1 4
ZK Team

updated 2016-06-17 02:44:49 +0800

Hi Javiut,

In ZK 8, you can access the static members of any class in zul, as long as you import it first: https://www.zkoss.org/wiki/ZUMLReference/ZUML/ProcessingInstructions/import

the result would be something like:

<?import com.foo.NotComposerClass?>

...

<textbox maxlength="${NotComposerClass.MAX_LENGTH_TO_SET}"/>

Regards, MDuchemin

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: 2016-06-16 12:29:16 +0800

Seen: 12 times

Last updated: Jun 17 '16

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