leave input in input field after create new data

Hi guys, 

I would like to use a detail screen to fill in data into a table. The user needs to input 3 data. Two of them are the same for some inputs one is changing. 

I want my system to leave the 2 inputs in the input field after create or updating the table and only clear the third one for a new input. 

Actually this might be easy but I have no idea how to do it...

Thank you! 

Tobias 

Hi Tobias, 

From what I understand is, you want to update a details form.After updating ,you want 2 of the inputs to retain the value while the 3rd one is to be left blank. Is it correct?


Regards,

Priya 

Hi Priya, 

thanks for replying! 

This is what I trying to do.

Regards 

Tobias 

Hi Tobias.


First thing you need to do is to understand how to build your data model. Using your example, do you want to have a list of values for the third field per each pair of fields 1 and 2? In this case, you'll need to create 2 entities, one to store the 2 first fields and another one to store the third field, and to related to the first table.

This way, every time you hit the Save button, you'll CreateOrUpdate the record in the first table, Create a new record in the second table, and then refresh the aggregations and the screen elements.

You can have a TableRecords in your screen to list the values from the second table.


If that's not the case, and if you need the 3 fields in the same table, it would be weird, UX-wise, to store the 3 fields but presenting one of them as empty.


Hope I've helped

Solution

Hi Tobias,


not sure I got your requirement right, but this is how i understood : 

allow the user to add multiple records in the table one after the other, where for many consecutive inserts, some of the values are the same, so it would be nice to have those already prefilled for the next insert based on what was filled for the previous insert ?


How you could do that is 

- the screen has input variables for those fields

- in the preparation of the screen assign the form variable to these input variables

- in the screen action for the save button, instead of ending with an end node, end with a 'destination' node, with the destination being the same screen, and passing into the input variables the form variables


I made a small OML to demonstrate, see the "AddManyProductsQuickly" screen


This works well for a screen that only does consecutive inserts, don't think it would work if you tried adding updates into the mix

Solution

Hi Dorine,  

this is exactly what I was looking for! Thank you ! We want to scan barcodes into an storage place and it might be 100 of codes per place. 

I just wandering if there is a posibility that the focus of the input stays in the input field. 

after scanning I have an onchange action creates the data. It also clears only the input field now but the cursor looses focus on this field. Is there an oportunity to set the new focus to this input field? something like default field or starting field? 

Thank you! 

Tobias

Hi Tobias,


you could work with the extended attribute 'autofocus' on the desired input field, like so : 



However, you should maybe explore this html attribute further, but I think you can't dynamically have it on or off (for example by setting value to true or false).  As far as I can tell, having the property there will allways set that field to autofocus, even when first opening the screen.  That might or might not be acceptable for your client.