0

MVC Controller [closed]

asked 2013-04-08 14:30:30 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2615 3 8
http://emrpms.blogspot.in...

Hi

I want to change the button caption based on the MVC Controller Boolean variable.

Here is my code.

<button label="@{controller.makeAsReadOnly ?'Ok':'Cancel'}" mold="trendy" id="cancel" sclass="mybutton button blue small"/>

But it giving the following error

Expecting character, ,, in "?'Ok':'Cancel'".

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Senthilchettyin
close date 2013-04-10 14:24:05

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-04-08 23:26:22 +0800

Matze2 gravatar image Matze2
773 7

As far as I remember, MVC data binding only supports bean properties, but no operators. You have to write a getter method which contains your "?:" operation instead. Or use ZK6 binding, but you know that :).

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-04-08 14:30:30 +0800

Seen: 20 times

Last updated: Apr 08 '13

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