Ticket #368 (closed defect: fixed)
Sync issue: selection-control depending on another control, value set with setWireValue
| Reported by: | svr | Owned by: | mpo |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | modules/kauri-forms | Version: | trunk |
| Keywords: | async selection-control selection control depends setwirevalue | Cc: | kauri-discuss@… |
Description
This is the fconf:
var fconf = {
"members": {
"parent": {
"base": "string"
},
"child": {
"base": "string",
"control": {
"base": "selection-control",
"depends": {"parent": "/parent"},
"options": {
"uri": "${publicUri('service:/main/service/children/parent/{parent}')}",
"labelTemplate": "{description}",
"valueTemplate": "{id}"
}
}
}
}
}
var testForm = new jQuery.org.kauriproject.forms.Form("form", fconf);
testForm.setWireValue({"parent" : "216"},true);
I know the parent and I want to have all children entries available in the selection-control.
When this is executed, the selection-control is still empty. Eventhough there is a call to the service and a json object is returned. When you put an alert above the setWireValue line, everything is perfect. Same can be accomplished when setting:
$.ajaxSetup({
async: false,
});
I couldn't reproduce this with the samples because I think the ajax response is too fast.
Change History
Note: See
TracTickets for help on using
tickets.
(In [1717]) fixes #368
Tracking the last issues request for refresh-options avoids updating the options with results that came in too late.
(this should allow for better responsiveness then the async: false approach suggested in the issue)