searchBox with multiple list
In this example the first list gets searched but the second stays with the initial content if you let say change search to āZā. Most likely you will use when() around them.
application searchtestimport mobl::ui::generic
entity Member {
aid : Num
name : String (searchable)
}screen root() {
var search = ""script { if(Member.all().count() == 0) { add(Member(aid=1, name="Terje")); add(Member(aid=2, name="Zef")); add(Member(aid=3, name="Cato")); add(Member(aid=4, name="Nina")); } } header("searchtest") searchBox(search) group { header("List1") list(t in Member.searchPrefix(search)) { item { label(t.aid) " " label(t.name) } } header("List2") list(t in Member.searchPrefix(search)) { item { label(t.aid) " " label(t.name) } } }
}
Submitted by Terje Pedersen on 24 June 2011 at 15:39