Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

How to set the Text property of a label with JavaScript?

How to set the Text property of a label with JavaScript?

HmiGuide
Community Moderator
Community Moderator

I want to set the displayed text of a iq-label with javascript. There is an example which dynamically changes the precision of numbers.

Which is very similar. I tried to find the information in the "developers manual WebIQ COnnect 2.10 API documentation", but I could not find it. Even not the information for setting the precision, which is part of the example below.

2021-12-17_17h15_45.png

https://developer.community.boschrexroth.com/t5/Smart-HMI-WebIQ-Designer-and/dynamic-precision-on-di...

Can anybody:

1. Provide an example how to do this
2. Explain where I can find the information how to read/write the data (item, text, precision, width, height, ...) of the existing widgets.

Regards

2 REPLIES 2

webiq-sk
Frequent Contributor

Hello,

1. this is the suggested solution:

webiqsk_0-1639986938358.png

2. Information on the web framework can be found in "WebIQ Visuals Reference" documentation - however in this case only digging into the source code for this widget will lead to a solution (visuals-controls.js). The "WebIQ Connect 2.10 API" documentation is for the server, not for the web framework.

HmiGuide
Community Moderator
Community Moderator

I couldn't find visuals-controls.js, but in controls-bundle.js I found the function updateText().

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist