Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Shiva, I think there is some gap in your understanding of what traversal is about. Let me explain.</p> <p>You can add any number of Item (s) to Form. The framework manages the following for all Item(s) built-in into MIDP</p> <ol> <li>Positioning and rendering of all Item(s)</li> <li>Scrolling, when there are more number of items that can fit in the screen.</li> <li>Handling screen commands and Item commands.</li> </ol> <p>But when you extend CustomItem and implement your own item, complete control lies within the implementation. Consider a case where a Form contains a TextField and CustomItemImpl and you would want to toggle between TextField and CustomItemImpl. Since key handling, command handling and rendering is all in the control of CustomItemImpl, there must be a way in which framework must know when you want the TextField to have control and when the control needs to be passed on to CustomItemImpl.</p> <p>Here is where traverse() method in CustomItem steps in. You return false when you are done with rendering and capturing data in CustomItemImpl and return true when you want to retain the control within the CustomItemImpl.</p> <p>Let me elaborate further. Suppose you are implementing a TreeItem. When the focus is on TreeItem, you would like to do the following:</p> <ol> <li>Select a node</li> <li>Expand or Collapse nodes</li> <li>Navigate the nodes</li> </ol> <p>All the above functionality forms part of your TreeItem implementation. However when you move KEY_UP past the fist node of the tree or KEY_DOWN past the last node of the tree, you would like to move over to TextField / any other item adjacent to this TreeItem. The way in which you let the framework know your intention is </p> <ol> <li>Return false in traverse() method when KEY_UP is selected while focus is on first node of the tree</li> <li>Return false in traverse() method when KEY_DOWN is selected while the focus is on last node of the tree.</li> </ol> <p>Hope this clarifies your query. I would strongly suggest you to have a look at this particular <a href="http://www.ibm.com/developerworks/wireless/library/wi-developui/" rel="nofollow">example</a> for more concrete illustration.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload