Last updated on February 24, 2016

Widget: Plain Text


This widget is used to display static plain text within an application. Depending on its location in the application layout, a Plain Text widget is commonly used as:

  • Titles and headers preceding another widget.
  • Descriptions for elements such as photos and graphical content.
  • Labels for specific content in the layout.

This article provides the instructions to add and configure a Plain Text widget.

Adding a Plain Text Widget

To add a Plain Text widget to your Signs application, follow the instructions in the Adding Widgets section in the Managing Widgets article and select the Plain Text widget in the Widget Library.


Configuring a Plain Text Widget

To configure a Plain Text widget’s properties, please follow the instructions below:

  1. In your Signs application’s layout, click the Plain Text widget name under the Widgets section.


  2. In the Widget Properties window, configure the common tabs as per this article: Configuring Widget Properties.

  3. In the Widget Properties window, click the APPEARANCE tab.


  4. In the PROPERTY section, type in the text that you wish to display.


  5. Change the widget font type, size, alignment, and color, in the STYLE section.


    When selecting/customizing the font size, you may choose to define a custom size that is measured based on pixels. Select the Custom option from the Size drop-down menu and you will have the option to define the pixel size of your font.


Adding Dynamic Text

  1. In the Widget Properties window, click the APPEARANCE tab.

  2. In the PROPERTY section, select the Dynamic Text checkbox to activate the dynamic text field feature.


  3. Key in the text source and set the refresh interval. You can also set the maximum number of words to be displayed. Add a delimiter if necessary.

    Note

    Click update to update the editor with your text source. By default, null is displayed.

  4. Click Apply to confirm your settings when finished.

Xpath Expressions in Dynamic Text

This feature enables designers to include customized Xpath (XML Path Language) expressions when creating dynamic queries from XML files via the properties of a text widget. The below is sample code from www.w3schools.com/dom/books.xml.

<bookstore>
 <book category="cooking">
   <title lang="en">Everyday Italian</title>
   <author>Giada De Laurentiis</author>
   <year>2005</year>
   <price>30.00</price>
 </book>
 <book category="children">
   <title lang="en">Harry Potter</title>
   <author>J K. Rowling</author>
   <year>2005</year>
   <price>29.99</price>
 </book>
 <book category="web">
   <title lang="en">XQuery Kick Start</title>
   <author>James McGovern</author>
   <author>Per Bothner</author>
   <author>Kurt Cagle</author>
   <author>James Linn</author>
   <author>Vaidyanathan Nagarajan</author>
   <year>2003</year>
   <price>49.99</price>
 </book>
 <book category="web" cover="paperback">
   <title lang="en">Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
   <price>39.95</price>
 </book>
</bookstore>

Sample Xpath: /bookstore/book[1]/title

Output: Everyday Italian

Adding Xpath Expressions to Dynamic Text

To add the Xpath Expressions to Dynamic Text in your Plain Text widget, follow the instructions below:

  1. In the Widget Properties window, click the APPEARANCE tab.

  2. In the PROPERTY section, select the Dynamic Text checkbox to activate the dynamic text field feature.


  3. Key in the text source and set the refresh interval. Ensure your text source is an XML file.


  4. Select the PROPERTIES tab, and click the Edit button.


  5. In the same window, click the Add New Property button.


  6. Input the Key and Value, and click OK to save the entry.

    Note

    In this example, custom.text.dynamic.xmlquery was assigned as the Key, and /bookstore/book[1]/title was assigned as the Value. This expression fetches the title from the first book.

  7. Click Finish to complete the process.

  8. To confirm that the XML query is working, click the APPEARANCE tab. The text in the widget will now be updated (Everyday Italian) as a result of the dynamic text query for the first book title in the code of the XML file.