PDA

View Full Version : [CLOSED] [MODERN] selectfield won't bind properly to numeric values



jorgemanrubia
19 Aug 2015, 2:04 AM
Hi,

This fiddle reproduces the problem:

se9

To reproduce, just pick a person in the first combo, and see how the second field changes to [object object].

When binding a "selectfield" to a numeric value, it is initially properly set: it sets the proper record from the value field. But when changing the value with the select, it then sets and publishes the record itself. This invalidates using "selectfields" in many scenarios (such as setting foreign key values). It doesn't happen in classic.

I know that I could bind the combo to "{selectedPerson}" and this example would work, but I am interested in using the combo to change numeric values (foreign keys) in other records. As mentioned, that works in classic.

Thanks

mitchellsimoens
19 Aug 2015, 6:12 AM
Instead of binding the selectfield to '{selectedPerson.id}', change it to be '{selectedPerson}':

sf0

jorgemanrubia
19 Aug 2015, 6:15 AM
Thanks Mitchell,


Yep, I know that fixes the example (I pointed it out in my original post indeed):



I know that I could bind the combo to "{selectedPerson}" and this example would work, but I am interested in using the combo to change numeric values (foreign keys) in other records. As mentioned, that works in classic.


But this doesn't fix my use case: setting a foreign key in the record I am editing. In classic I can do that. But with modern I can't. Any hint on this?

devnullable
17 Sep 2015, 2:19 AM
Hi,

I have similar problem with binding of select field on Modern toolkit. Binding seems to bind Model, not value. In my example I want to set invoice object's invoiceCustomerAbbr Property from selected Contact's contactAbbr. Instead it binds selected Contact object to invoice. ValueField property is correctly set to contactAbbr on select field.

u1p

svenna
16 Feb 2016, 2:38 AM
This issue should be opened again. It's easy to reproduce and still a problem (6.0.1)

When creating a form:
e.g. Order, and I want to include two select fields, one for Contact, and one for Projects, I'm not able to use binding :(