0

Problem with attribute

asked 2014-07-18 08:20:40 +0800

wigberto gravatar image wigberto
52 4

Good Morning. I would like to use an attribute to change the value and color "status". When I use: "if="@{vm.statusSystem.status eq 'STOP'}">" I works well but it does not update the value, if it change. When I use: "if="@bind(vm.statusSystem.status eq 'STOP')">" It works fine updating the value but not the color.

<attribute name="style"
if="@bind(vm.statusSystem.status eq 'STOP')">
color: #e03534; font-weight: bold;
</attribute>

Thank you very much.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-07-18 10:54:23 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

I prefer to use EL expressions directly inside the attributes. Something like this should do the trick:

<div id="content" 
style="@load(vm.status eq 'STOP' ? 
       'color: #e03534; font-weight: bold;' : 'color:#fff;')" />

Costas

link publish delete flag offensive edit

Comments

Thank you very much Costas.

wigberto ( 2014-07-23 08:35:17 +0800 )edit

You are welcome my friend

cyiannoulis ( 2014-07-23 11:24:51 +0800 )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: 2014-07-18 08:20:40 +0800

Seen: 9 times

Last updated: Jul 18 '14

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