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.
Barcode Control
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
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:
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.
Hope this helps.
Steve
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";
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";
Steve
0 x
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 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.
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
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
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:
Steve
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';
0 x
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi Segi,
On closer inspection of the Barcode control you can update the text in JavaScript using this:
It is not obvious as the documentation is missing.
This is supported from version 4.4
Kind regards
Steve
On closer inspection of the Barcode control you can update the text in JavaScript using this:
Code: Select all
controls.MyBarcodeControl.message.text = "11233343444";
This is supported from version 4.4
Kind regards
Steve
0 x
Who is online
Users browsing this forum: No registered users and 23 guests