Barcode Control

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

Barcode Control

#1

Postby Segi » Wed Nov 18, 2015 4:26 pm

Is it possible to dynamically set the value of a barcode control in one of my scripts ?

I want to dynamically create a custom barcode with a value of my choice but I don't see a value or text property to set its value.
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Thu Nov 19, 2015 3:55 pm

Hi Segi,

It looks like there is a bug and you cannot access the text through the barcode control.

But you can change the text through the barcodes text reference.

Click on the "Barcode Text" property of the Barcode Control to select the text reference. Make a note of the text reference for the barcode text e.g Txt2ZEG9f

Then in javascript you can change the text directly:

Code: Select all

texts.Txt2ZEG9f.text = "999999999";
Or you can create a different text in the texts manager with a more meaningful name: eg. barcodeText

Then select the text in the "Barcode Text" property on the barcode control and change the text reference to your new text.

Then change the new text in your Javascript.

Code: Select all

texts.barcodeText.text = "999999999";
Hope this helps.

Steve
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#3

Postby Segi » Thu Nov 19, 2015 4:07 pm

Steve

I am getting an error that texts is not defined in my before page event where I try to set the barcode value.

I have one line in my Before page event script. TXT24 is obviously the text reference for this particular control.

texts.TXT24.text="Foo";

The error is:

com.ebasetech.ufs.runtime.events.rhinojavascript.JavascriptExecutionHandler$RhinoScriptException: ReferenceError: "texts" is not defined. (TESTMENU_BP#4)

The 2nd method that you mentioned won't work for me as far as creating a text in the texts manager because I need the control to be dynamically changed.
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#4

Postby Steve » Thu Nov 19, 2015 4:18 pm

Hi Segi,

I did not realize but texts.<textId> was introduced in version 5.

You can use an FPL script to change the text though:

Code: Select all

set text TXT24= '222222222';
Steve
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#5

Postby Segi » Thu Nov 19, 2015 4:38 pm

Steve

thanks,

I am in the process of upgrading now to 5.0.1 which was released today. I have no plans on using FPL.
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#6

Postby Steve » Fri Nov 20, 2015 11:28 am

Hi Segi,

On closer inspection of the Barcode control you can update the text in JavaScript using this:

Code: Select all

  controls.MyBarcodeControl.message.text = "11233343444";
It is not obvious as the documentation is missing.

This is supported from version 4.4

Kind regards

Steve
0 x


Who is online

Users browsing this forum: No registered users and 22 guests