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.
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);
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.
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
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
3. When user selects an item, your callback function will be called
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);
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:
Will produce following output
Vídeňská 186/118
619 00 Brno
Česká republika
IČO: 276 52 203
DIČ: CZ27652203
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.
Pro zobrazení tohoto formuláře se musíte přihlásit.
Zadejte svůj e-mail, na který vám zašleme odkaz pro obnovení hesla.
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.