Documentation

Toggle Menu

Textfield

The switch is a simple tile which is best used for on/off functions.

Settings

Tag

This is a unique String ID assigned to this tile and is used (by you) to identify what tile sent what data by your script.
Note that this is case sensitive, and cannot contain any white space.

Size

This modifies the size of the button as it appears on your screen. Its units of measurement is tiles. Since each tile that can have its size modified is aware of its surroundings, the numeric steppers used to adjust the tile size will stop you from overlapping with other tiles or going over the edge of the screen.

Keyboard

Here you can set the keyboard type and the return key type for the tile.

Return Key Types

  • Done

  • Emergency Call

  • Go

  • Google

  • Join

  • Next

  • Return

  • Route

  • Search

  • Send

  • Yahoo

Keyboard Types

  • ASCII Capable

  • Decimal Pad

  • Default

  • Email Address

  • Name Phone Pad

  • Number Pad

  • Numbers and Punctuation

  • Phone Pad

  • Twitter

  • URL

  • Web Search

Text

Here you can set the appearance of the text on the tile. You can set the font, the font size, and the text alignment.

Text Alignment

  • Centre

  • Justified

  • Left

  • Natural

  • Right

Note that the font you choose may affect the performance of the app as it may take longer to render.

Action

Here you can set the action for the tile to take when the text value of the tile has changed, when the keyboard is dismissed, or when the return key is pressed. With this you can either:

  • Clear Text

  • Send Action → "\\\\VALUE CHANGED//" | "\\\\KEYBOARD DISMISSED//" | "\\\\RETURN//"

  • Send Text

Note that you can pick more than one action. If clear and send are both picked. The data will be sent, then cleared.

Content

Here you can set the placeholder or the text value of the textfield for UI purposes.
Note that the text setting will not change regardless of what you type into the textfield on the controller. The text setting will be loaded by default when the controller is loaded, so is good if there is a certain String you'd like to send.

Input

This tile accepts input so you can use the send message function built into the server to send a value to this tile. This tile only accepts String.

  • StringSting Data → Set the text of the textfield to the String.

Usage Demo

Set the textfield's value to Hello Everyone so that when the user connects he/she can quickly say hello.

                            self.force.sendMessage("Jordan's iPhone", "messageTextField", "Hello Everyone")
                            

Output

The following is what data is sent from this tile to the server/your script. It is in the format:
Action → Data TypeValue

  • Textfield Value Changed (Send Text)→ StringTile's String Value

  • Textfield Value Changed (Send Action) → String"\\\\VALUE CHANGED//"

  • Textfield Keyboard Dismissed (Send Text)→ StringTile's String Value

  • Textfield Keyboard Dismissed (Send Action) → String"\\\\KEYBOARD DISMISSED//"

  • Textfield Return Key Pressed (Send Text)→ StringTile's String Value

  • Textfield Return Key Pressed (Send Action) → String"\\\\RETURN//"

Note that a tile's tag is always sent to the server for identification purposes.

Usage Demo

Send the data sent by a device to all the other devices' text boxes, like a group chat.

                            def forceServerDidReceiveData(self, deviceName, senderTag, data):
                                if senderTag == "messageTextField":
                                    self.force.sendMessage(None, "messageThread", deviceName + ": " + data)