0

I want to take different value from label(value) and pass to @bind object

asked 2017-01-27 08:13:04 +0800

Radoslav86 gravatar image Radoslav86
13 3

I have commbobox with two comboitems valid and invalid

<combobox readonly="true"
value="@load(vm.status.isValid eq 'Y'? 'valid':'invalid')"
<comboitem label="Valid" value="@bind(vm.status.isValid)"/>
<comboitem label="Invalid" value="@bind(vm.status.isValid)"/>

</combobox>

I want to pass to IsValid "Y" for valid label and "N" for invalid label. Can someone please help

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-02-01 03:56:02 +0800

JustinFrost gravatar image JustinFrost
139 1 6

If I am understanding the question, there is a isValid method on your viewModel, if so then you reference this using the property name not the method name, eg:

<comboitem label="Valid" value="@bind(vm.status.valid)"/>
<comboitem label="Invalid" value="@bind(vm.status.valid)"/>
link publish delete flag offensive edit
0

answered 2017-02-01 06:28:31 +0800

Radoslav86 gravatar image Radoslav86
13 3

No , isValid is field from entity "status". The solution I use is :

<combobox readonly="true" value="@load(vm.status.isValid eq 'Y'? 'Valid':vm.status.isValid eq 'N'?'InValid':'')"                        disabled="@bind(vm.disabledComponent)"                                  selectedItem="@bind(vm.status.isValid)">                                    <comboitem label="Valid" value="Y" />

<comboitem label="InValid" value="N"/> </combobox>

Thus the user will see valid and invalid, but I will take value of "Y" and "N" for my field "IsValid" from "status" entity.

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: 2017-01-27 08:13:04 +0800

Seen: 31 times

Last updated: Feb 01 '17

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