Force submit on drop-down select

Hi
I want to change what is displayed according to a single dorp-down
The only way i know how is by using a form-single containing a drop-down + submit button and a dynamic container.

  1. can i add the content of the container dialog
  2. is there a way to do this with less tags?
  3. more importantly, can i force the submit to happen directly on drop-down select

any ideas on how to do this?

This, also like how your other post would need to use javascript and this would be done by editing the template files.

amazing news

@jonesde has already done this for now (Thanks David):

it is only a couple of lines, so anyone interested can copy the code directly into their project

WARNING: only works with qvt for now according to the commit message

usage (after copying the code):

<drop-down submit-on-select="true">
2 Likes

Is there an equivalent to this for fields other than drop downs? For example, if I want to save changes when a task description is updated without requiring the user click a button.

Pretty sure that’d require a bit more work (and js) as that’d require a post request on every edit.

I don’t think that’s implemented.

Are you looking for something like a form-single with a single text field that gets submitted with the user presses enter while the text box is focused? I think that’ll work fine with qapps, possibly with vapps, not likely with plain old html under /apps (not using Vue JS). With plain HTML if you don’t have a submit button then hitting enter in an input field will not submit the form (for whatever really weird reason…).

An alternative is for text on something like a summary page the is editable when clicked on. There are a few of these on the TaskSummary.xml screen (with the editable element, easy to search for).

1 Like

Interesting… I just looked at the code for that screen. Editable certainly seems like what I am looking for. I have been on that screen many times and never noticed something as being editable when clicked on. I just tried it in my local environment and nothing happens when I click on task name, description, etc. that are in an editable element.
Demo is down so I am not able to check there. What is the expected behavior? Should it become editable when clicked on? What triggers the save, the field losing focus?

Never mind I figured it out. This works in vapps but not qapps.

Oh yeah, that never was implemented for qapps… still needs a Vue component for editable.