TextEntry Controller

Section 6

In the "RGA" iPhone view, section 6 has a textEntry controller. a textfield(1, above) for you to enter a text message to sent to a textBox(2, below) in the RGA Example.exe or vice versa.

Now, you will learn how to recreate this controller in "myRGA" iPhone view.

Add a new section

Right click the "view" node then select "add section." Right click the "title" node of the new "section" node and enter "Sent Message" in the pop-up.

Select a controller type

Find the "row" node under the new section and right click "controller" node. Select "add textEntry" from the options.

Set placeHolder

Right click the "placeHolder" and enter "[Enter Text Message for PC]." The place holder message will appear as default text by default prior to any message has been sent or received.

Select a keyboard type

Right click the "keyboardType" node and select "default." Apple iPhone OS offers several keyboard types as sown below:

ASCII (default)

URL

EmailAddress

NumberPad

PhonePad

NamePhonePad

NumbersAndPunctuation

Connect the textEntry controller (of iPhone view) to the RGA example.exe (Windows app)

To connect the textEntry to the "Remote Message" textBox in RGA example.exe, right click the "source.dataName" node (4), then select "Remote Message" from the pull-down list.

How is the "Remote Message" textBox variable exposed for MONITORING?

Open Form1.cs in the RGA Example Visual Studio project and double click the textBox (1, figure above). It should jump to the following code:

private void textBox1_TextChanged(object sender, EventArgs e)
{
INFOMATO.WCF.DataExchangeService.servicePostData("RGA", "Remote Message",
textBox_remoteMessage.Text);

}

Every time the textBox (named textBox_remoteMessage) value changes, the above function is executed. We call up the function INFOMATO.WCF.DataExchangeService.servicePostData to inform iQuipment PC to update the value for "Remote Message" in "RGA" view.

How is the "Remote Message" textBox variable exposed for REMOTE CONTROL?

Similar to the handling of the segments control, when you tap the "Done" key on your iPhone, it will trigger the event INFOMATO.WCF.DataExchangeService.clientSetDataEvent which, in turn, calls up DataExchangeService_clientSetDataEvent for event handling.

void DataExchangeService_clientSetDataEvent(string viewName, string dataName, object dataValue)
{
if (viewName.ToLower() == "RGA".ToLower())
{
switch (dataName.ToLower())
{
...
case "remote message":
this.UpdateTextGUIObject(this.textBox_remoteMessage, dataValue.ToString());
break;
...
}
}
}

In the UpdateTextGUIObject function call, we took care of UI thread-safe issues when updating the textBox value. Windows UI thread-safe coding is discussed in greater detail in the section on segments controllers.

Previous Lesson: Picker controller of text type Table of Contents Next Lesson: How to troubleshoot