csen

Frequently Asked Questions

Using components in view scripts

You can easily use the List box, combo box and text box in view scripts.

We will start with a simple example showing how to use the combo box programmatically:

1. We will create the combo box and add it to the view.

2. We will create a button next to the combo box, on its press we will call view script function get Item.

getitem

onclick

3. In getItem fuction, we will get value of selected component

var selItem = myscada.getSelectedItem('Comp29328366');

‘Comp29328366’ is an ID of our Combo box. You can find ID in properties window upon clicking on your Combo box.

Once we get the selected item, we will show it by calling alert(selItem);

8.3.3

4. Now we will create a new button. On its press we will call view script function setItem where we will set item in combo box to second item.

8.3.4

Callback function example:

If you want to be notified, when user selects an item in the combo box or list box, or presses and enters into the text box, set up a callback function.

1. Define your callback function in View Script

8.3.5

As you can see, into your callback function, you will get 2 arguments, first is a selected item and second is an index of the selected item.

2. Click on your component in view and fill in the callback function name

8.3.6

3. When user selects an item, your callback function will be called

8.3.7

Setting new values into Components Programmatically

You can easily change the items in your component programmatically. To do so, you can use function setItems:

var items = ['item 1','item 2'];
myscada.setItems('id',items);

Coloring items in List Box

List box allow you to fine tune appearance of each item by specifying the colors and bold face of the font. To do so, use function setItems. Passed items in array will not be strings but objects with additional properties. Simple Example:

8.3.8

Will produce following output

output

Didn't find what you were looking for?

Contact us.
CALL US
  • +420 541 217 220
Or write to us and we will get back to you.
  • Sales department
  • Technical support
  • Service / Complaints
  • Webmaster

AMiT Automation s.r.o.

  • info@amit-automation.cz
  • +420 541 217 220
    +420 549 210 403
    +420 549 210 276

Vídeňská 186/118

619 00 Brno

Czech Republic

Company ID: 276 52 203

TIN: CZ27652203

Česká rada pro šetrné budovy

MODERN ELECTRONICS FOR INDUSTRIAL AUTOMATION AND BUILDING AUTOMATION

Copyright © — AMiT Automation
Login and registration
By registering, you agree to our terms and conditions and the processing of personal data.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Login and registration
By registering, you agree to our terms and conditions and the processing of personal data.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Delete account?
Are you sure you want to delete your account?

This action cannot be undone.
Billing and shipping details

You must be logged in to view this form.

Forgot password

Enter your e-mail address and we will send you a link to reset your password.

Add to list
+ Add new list