Studio for iPhone Top Tips

This section provides tips, tricks, and best practices for using Studio for iPhone controls.

      When you make a navigation list visible, you should call the Invalidate method in order to ensure that some specific item types have invalidated correctly. For instance, if your navigation list has a C1NavigationListSliderItem or a C1NavigationListInputItem, you will need to add the call the Invalidate method as in the following example:

 

function onClientClick_List1() {

var navList1 = Sys.Application.findComponent("<%=List1.ClientID%>");
navList1.set_displayVisible(true);

// Invalidate all currently visible items

navList1.invalidate();


viewPort.scrollContentToOrigin();
}

 

      When you design your Web site or application, keep in mind the display metrics of the iPhone browser. To learn more, see Safari Layout on the iPhone.

      You can create a confirm dialog box using JavaScript. For task-based help about creating a confirm dialog box, see Creating a Confirm Dialog Box.

      For a performance boost, try to avoid full-page postbacks whenever possible. You can prevent full postbacks using Studio for iPhone's client-side object model. Below are a few examples that illustrate how to avoid postbacks:

You can access Studio for iPhone controls on the client-side, such as in the following example:

 

var navList = $find("<%=C1NavigationList1.ClientID%>");

  

You can execute client-side code upon Web application load, as in the following example:

 

Sys.Application.add_load(function() {

// some code goes here

});  

 

You can create a Web service and population the C1NavigationList on the client side, such as the following example:

Example

You can create navigation list items on the client side, as in the following example:

Example

You can access navigation list items on the client side, such as in the following examples:

      Using the navigation list item's index

      Using the navigation list item's command code

      Using the navigation list item's command argument

      Using the navigation list item's text

             


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.