Edit Value property for a generated barcode.

a. My understanding is that the "barcode" that is generated below is based on the "Value" property of the SfQRCodeGenerator control. Is there a way to change the "Value" of the generated BarCode, after it has been generated?

https://blazor.syncfusion.com/documentation/barcode/qrcodegenerator

@using Syncfusion.Blazor.BarcodeGenerator
<SfQRCodeGenerator Width="200px" Height="150px" Value="Syncfusion">SfQRCodeGenerator>

b. Also the documentation says the following: "OnValidationFailed event in the SfQRCodeGenerator is used to trigger when the input is an invalid string." Would you have an example of when the BarCode will not be generated for an invalid string?


8 Replies

SS Sivakumar Sekar Syncfusion Team November 29, 2021 02:37 PM UTC

Hi ajit, 

We have added the sample link and a video link to demonstrate changing the Qrcode value using the input box. OnValidationFailed event will get triggered when entering symbols like roman, mathematical symbols like(∑,√, , etc). Please refer to the below code snippet and sample. 

public async Task OnValidationFailed(ValidationFailedEventArgs args) 
   
        if(val == 0) 
       
            await JsRuntime.InvokeVoidAsync("alert", args.Message); 
            val++; 
       
   



Regards, 
Sivakumar   
  




AG ajit goel November 29, 2021 02:50 PM UTC

Thank you for your response Siva. I have checked the video and the barcode changes when the text is changed. My business requirement is to keep the barcode to be the same, when a url(based on which the barcode is generated) is changed. How can I accomplish this? 

It will help to update the documentation for OnValidationFailed event based on your response above. 



SS Sivakumar Sekar Syncfusion Team November 30, 2021 01:35 PM UTC

Hi ajit, 

On further analysis of the shared query. we suspect, that you would like to change the display text of the QR code generator. Please refer to the below documentation link. 


If we misunderstood your requirement, please share with us more details or a video demonstration of your requirement. This will be helpful for us to proceed further. 

Regards,  
Sivakumar    





AG ajit goel December 1, 2021 03:22 AM UTC

Hello Siva,

My requirement is that we need to generate the barcode based on a user provided url. After the barcode is generated, the user can change the url. However we do not want the barcode to be changed since it could have been distributed to lots of people and applications. 
Eg: user generates the barcode based on a restaurant menu hosted in Amazon S3. He then distributes the barcode on his android and apple applications and also prints it out, to use in his restaurant. 
He now wants to change the restaurant menu to a new amazon s3 url. How would scanning the existing barcode navigate to the restaurant menu in the new amazon s3 url?

Does this make sense? Please help. 



AG ajit goel December 1, 2021 04:20 PM UTC

I have a workaround for my issue. This ticket can be closed. 



MC Mason Channer replied to ajit goel December 1, 2021 04:51 PM UTC

This is not a frontend issue, this is a backend issue. You should be using a WebServer and DB to create urls for your QR codes, that then map to the different S3 URLs in your DB.


I recommend a One to Many table with a QR code being a GUID to many S3 Menu links.


www.example.com/GUID redirects you to s3.amazon.menu.


Then simple create your QR code from the GUID link. Then when they visit the GUID link use javascript to redirect to s3.amazon.menu link, or display the different menus if you really want to.


Syncfusion is a UI library.



AG ajit goel December 1, 2021 05:54 PM UTC

Thank you @MasonChanner, I understood the same and I asked the ticket to be closed. 



SS Sivakumar Sekar Syncfusion Team December 2, 2021 08:05 AM UTC

Hi Ajit, 

Thanks for your update. 

Regards,  
Sivakumar    



Loader.
Up arrow icon