0

Upgrade ZK3 to ZK5.0.9 textbox.setStyle not working on server event

asked 2011-12-30 20:43:55 +0800

andrelins gravatar image andrelins
39

Hi all,

I'm upgrading a fairly large application from ZK3 to ZK5. All my forms validate fields, for example on onChange of a textbox. The forms created in Java (not in ZUL) have event handlers.

I noticed that this works:

public void onEvent(Event e) throws Exception
{
<...>
Textbox t = (Textbox)e.getTarget();
t.setValue( "Any text" );
}

SUCCESS: I see "Any text" on the textbox after onEvent returns.


But the code below DOES NOT WORK:

public void onEvent(Event e) throws Exception
{
<...>
Textbox t = (Textbox)e.getTarget();
t.setStyle("background-color: LightSalmon");
}

FAIL: I don't see the background color change after onEvent returns.

This used to work on ZK3, and now all my forms are broken. How do I make setStyle() work on Java event handling please?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-01-02 18:26:48 +0800

andrelins gravatar image andrelins
39

I found the answer to it myself after quite some trial and error:

t.setStyle( "background: LightSalmon;" );

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-12-30 20:43:55 +0800

Seen: 202 times

Last updated: Jan 02 '12

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