Easier mapping of data to selectField? (1)
var data : [(String,String)] = []
script {
foreach(a in Address.all()) {
data.push((a.id,a.fullName));
}
}selectField(something, data)
Is it possible to map entity data to an selectField easier than this in mobl?
Submitted by Terje Pedersen on 7 March 2011 at 15:04
Issue Log
Another question if I have lets say:
entity Musician {
name : String
instrument : Instrument
}entity Instrument {
name : String
manufactor : String
}screen root() {
var m = Musician(name=“Terje Pedersen”)
}If I now want to have a selectField for all Instrument binding to m.instrument how do I do that?
I ran into this recently as well and was also going to ask if there was an easier way to solve this. It doesn’t seem as clean as the mobl language would want it to be. Seems like we need a entity to tuple2 mapper or something?
Log in to post comments