Ticket #278 (closed enhancement: fixed)

Opened 3 years ago

Last modified 21 months ago

dont refresh list when it depends on a empty value

Reported by: bc Owned by: mpo
Priority: major Milestone: 0.4
Component: modules/kauri-forms Version: trunk
Keywords: Cc:

Description

It would be nice if you could tell the selection control not to refresh when it depends on a empty field

eg.
"gemeente": {

"control": {

"base": "selection-control",
"depends": {

"land_postcode": "/adres/land"

},
options: {

"uri": "/business/{land}/detail",
"valueTemplate": "{postcode}",
"labelTemplate": "{naam}"

}

}

}

calls the url "/businessdetail when land (input control) is empty.

regards

Bert

Change History

comment:1 Changed 3 years ago by mpo

  • Status changed from new to closed
  • Resolution set to wontfix
  • use uritemplate features to prevent double /
  • there doesn't seem to be a generic way to prevent the request when the other value changes

comment:2 Changed 21 months ago by mpo

  • Status changed from closed to reopened
  • Resolution wontfix deleted

Reopening to optimize the common use case of double ajax-requests upon form init.
Point is that often right after form init there will be a set-wire-value, so in the end:

  • the first ajax request (during init) was really not needed at all
  • it's a pain that only to avoid exceptions special accommodation is required at the server (jax/rs routes not existent)

The proposal towards a generic solution is thus:

  • provides a "requireddeps" property allowing for values: true or "all" (for all) or ["selection of", "named dependencies", "in a list"] - defaults to 'false' for current behavior
  • let the refresh option check up on the dependencies before actually resolving the uri template and sending out the ajax request

Note: in case of not satisfied dependencies the existing list of options should be reset to [] (empty array, possibly nullable).

comment:3 Changed 21 months ago by mpo

  • Status changed from reopened to closed
  • Resolution set to fixed

In [1950]:

Allow checking for required dependencies before doing remote options-refreshes.
This avoids needless error-calls to backend-uris that don't exist.
It also fixes #278

Note: See TracTickets for help on using tickets.