125
Views
10
Comments
Solved
onChange  event not working after addEventListener

I made a reusable component to client side validation For specific reason I use this JavaScript code to manage or handle onChange event
I can't use onChange in component 
>>i just pass ID of input and JQuery inside component will make a validation that is the idea of component<<


after that the onChange of widget in application that using this component not working

that appear like outsystems not support multi listener 

image below in application that using component .




Examble.zip
UserImage.jpg
abderhman salama
Solution

everything is ok i just have an error in js code that causes in remove input widget
thanks all of you

2022-08-03 04-32-50
Ravi Punjwani

Hi Abduerhman,

Can you share your OML file? It seems unclear to me why you need to add two separate listeners, one in your javascript, and another in Outsystems OnChange event.

2025-01-02 13-34-30
Abduerhman Salama

check zip file i attach project and reusable component library

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Abduerhman Salama ,

it must be something specific you are doing, because it is perfectly possible to attach multiple listeners to an onchange, with the regular outsystems event being one of them.

See attached demo.

Can you share a demo demonstrating it doesn't work ?

Dorine

QDR_AddEventListener.oml
2025-01-02 13-34-30
Abduerhman Salama

check zip file i attach project and reusable component library




Examble.zip
2021-09-06 15-09-53
Dorine Boudry
 
MVP
2022-08-03 04-32-50
Ravi Punjwani

(StepX) Upgrading: No need to upgrade Application.

(StepX) Uploading: Uploading Application.

(StepSub) Uploading eSpace: Uploading eSpace FormValidationLibrary.

Foreign Module Error: Your OutSystems subscription only allows uploading modules developed in your environment, or downloaded from the OutSystems Forge. To share this module with the community, upload it at http://www.outsystems.com/goto/forge.

(StepX) Creating Application: Creating Application 'Client_Side_Form_Validation'.

(Warning) Missing eSpace: Required eSpace FormValidationLibrary was not found in this server.

(Warning) Missing eSpace: eSpace FormValidationLibrary was not uploaded and no equal version was found on 'Development' to associate with this Application version. Publication errors may occur.

(StepX) Verifying: Verifying the Application consistency and permission settings.

(Error) Empty Solution: Failed to publish 'Client_Side_Form_Validation' solution because it is empty, or all modules have conflicts.

(StepX) Preparing Deploy: Preparing deploy of 'Client_Side_Form_Validation'.

(StepX) Deploying: Deploying modules of 'Client_Side_Form_Validation'.


2025-01-02 13-34-30
Abduerhman Salama

el.addEventListener('change', ()=>{  console.log('extra change event fired');})
el.addEventListener('change', ()=>{  console.log('and another one');})

not working

2022-08-03 04-32-50
Ravi Punjwani

Hi Abduerhman,

The OAP files you uploaded could not be used due to error details I sent in my previous message.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

el.addEventListener('change', ()=>{  console.log('extra change event fired');})
el.addEventListener('change', ()=>{  console.log('and another one');})

not working 

where is it not working ?  Running my demo app in my environment, it works fine :

Dorine

UserImage.jpg
abderhman salama
Solution

everything is ok i just have an error in js code that causes in remove input widget
thanks all of you

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