34
Views
2
Comments
Endless loop when moving from a InputBox to another InputBox using Onblur
Application Type
Traditional Web
Service Studio Version
11.10.20 (Build 41551)

Hello! from Japan. My English might be not good enough.


I'm making a page for Traditional web. version11

There are two Input widget (A & B) and both has a screen action starts from Onblur.

And all the InputBox has to be Onblur.

"document.getElementById('" + Input_A.Id + "').click();"

"document.getElementById('" + Input_B.Id + "').click();"

Both Action takes about 2~3sec. to be done.


First type on InputA, and then when I click InputB the Endless loop appears.

I think It's happening because of InputAAction isn't done yet,

but the cursol goes to InputB and tries to go back to InputA or something probably=)


I searched for resolution and it seems to use "Promise"? from JavaScript.

But I don't know how to write JavaScript codes in Outsystems correctlly.

I have only used .click() like above.

So I want to know,

 1.How to write JavaScript codes for Promise in Outsystems.

 2.Where should it be? In the Action using "RunJavaScript" or write in Extended properties.

 3.Is my predict above correct? Is there any solutions else?


P.S. I cannot put any Image or OML because It's Confidential content, sorry.

2023-03-16 16-29-51
Paulo Rosário

Hello Seiichiro,

In JavaScript ( JS ), the "focus" event is triggered when an element receives focus, either through a user clicking on it or using the "tab" key to navigate to it.

 The "blur" event is triggered when an element loses focus, either through the user clicking elsewhere on the page or using the "tab" key to navigate away from it. 

These events can be used to create custom behavior for form elements, such as validating user input or updating the display when an element is focused or blurred. 

To achieve this in Outsystems when can use the onblur and onfocus options available in the input extended properties section.

To force input to be in focus or to lose that focus we can use some JS code similar to the one you are using:

document.getElementById('" + Input_B.Id + "').focus();

document.getElementById('" + Input_B.Id + "').blur();

I do not think that for your case on need promises, but this link has more information about how to use JS in traditional Outsystems.

Hope it helps!

Paulo Rosário


UserImage.jpg
Seiichiro Yada

Hello Paulo,

Thank you for the reply.

sorry to be late for the reponse.


What I want to do is click Input_B After Onblur Input_A and the actionA triggers, 

but I want to wait for actionA end first, either I click Input_B while ActionA is moving.

And also I want to do the same thing when clicking Input_B to Input_A.


Is this correct how to write in the entended properties?

onfocus,

document.getElementById('" + Input_B.Id + "').focus(); 

onblur,

document.getElementById('" + Input_B.Id + "').blur(); 


Seiichiro Yada

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