nicklockwood / FXForms

[DEPRECATED]
Other
2.93k stars 339 forks source link

FXFormFieldOptions help with id/text values #389

Open RamblasPro opened 9 years ago

RamblasPro commented 9 years ago

Currently in the process of writing an app using the fantastic fxforms. Currently captures order details and scans barcodes however, I am now stuck with using FXFormFieldOptions where I want to use id/text.

The problem that I have is that the data that I want appearing against the "Sales Type" should come from the underlying database.. so I have a table called “saleType” in this table we have 2 fields ‘id’ and ’text’.

What I want is the 'text' to appear in the list to the user however I want the 'id' to also be returned so that I can save it against the main ‘order’ table (for example in the ‘order.saleTypeId' field).

I am not sure the way to go with this I have looked at NSDictionary and FXFormFieldValueTransformer but could not see how?

Any help would be appreciated