When we click on custom error message(link) it should focus on input when it is null
Question
Application Type
Reactive

I have one requirement when we click on save, if input is null then when we click on custom error message link it should focus input widget. Here input widget is  web block and handler is in screen, Please find oml file attached below. Can anyone help me with this ?

test.oml

Hi Reddy Sai,

Please find attached working sample and URL 

https://dbaghel.outsystemscloud.com/test123/test?_ts=637861529954794572

Best Regards

Devendra


test.oml

Thanks @Devendra Singh Baghel, It is working fine but what if in case I have more than three inputs

HI Reddy,

Instead of Bool you can use structure as a Input in you web block in which you will have information which input you need to focus and based on that you can set the focus in input in your web block.

Best Regards

Dveendra


Hi @Devendra Singh Baghel, can you please give the oml file for multiple inputs scenario

Hello @Reddy Sai,

Outsystems provides us one client action "SetFocus" you can use that action in your action logic.

You just need to set your input widget ID to "SetFocus" action.


Also you can refer below forum link for more understanding.

https://www.outsystems.com/forums/discussion/54799/react-focus-on-an-input-field/


Regards,

Narendra Bhangale.

Hi Reddy Sai,

Please find attached working sample and URL 

https://dbaghel.outsystemscloud.com/test123/test?_ts=637861529954794572

Best Regards

Devendra


test.oml

Thanks @Devendra Singh Baghel, It is working fine but what if in case I have more than three inputs

HI Reddy,

Instead of Bool you can use structure as a Input in you web block in which you will have information which input you need to focus and based on that you can set the focus in input in your web block.

Best Regards

Dveendra


Hi @Devendra Singh Baghel, can you please give the oml file for multiple inputs scenario

Hi Reddy,

Please find attached oml file for multiple input scenario

Best Regards

Devendra


test.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.