Created
April 25, 2024 12:11
-
-
Save hicglobalsolutions/a4955653d801c447961cbec1d1118ccb to your computer and use it in GitHub Desktop.
swap out the code, and let the magic happen. This is where your Aura Component taps into JsBarcode's enchanting powers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
generateBarcode : function(component, event, helper) { | |
// Reset previous barcode output | |
component.set("v.barcodeGenerated", false); | |
// Get the barcode value and selected format | |
var barcodeValue = component.get("v.barcodeValue"); | |
var selectedFormat = component.get("v.selectedFormat"); | |
// Call helper method to generate the barcode | |
var result = helper.generateBarcode(component, barcodeValue, selectedFormat); | |
// Check if barcode generation was successful | |
if (!result.success) { | |
// Set error message if barcode generation failed | |
component.set("v.errorMessage", result.errorMessage); | |
} else { | |
// Clear any previous error messages | |
component.set("v.errorMessage", ""); | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment