Get Element

From IShell Wiki

Jump to: navigation, search

The Get Element command lets users find element Targets at runtime without specifying the URL directly. You can find targets by name or with parent/child relationships. Group elements together in iShell is a great way to organize like items and to simplify your programming tasks.


The command provides you with 6 options in searching for elements.

  • First Child - Returns the target of the first child of an element. In the simple screen shot below the if you target the "Image" element. This would return the target of the "Data" element.
  • Child At - Returns the child at a numeric position. You should use this in conjunction with Count to make sure there is an element at the location you are trying to get.
  • Child Name - This searches for a child element by the name of the element. This is case sensitive. This only searches one level deep. In the screen shot below. You can use the name "Data" and target the element "Image" and this will return the target of the found element.
  • Last Child - Returns the Target of the last child of an element.
  • Count - Returns the number of children elements of another element. This only counts one level deep.
  • Parent Element - Returns the parent elements target of a child.

The result is void if an element is not found. Don't forget that the "Root" of a document is an element as well. So in the sample screen shot below. The Parent Element will return the target to the "Root" document.

Image:Get_Element.png


Comments

The iShell Wiki is a community endeavor. Please add your comments regarding the Get Element Command, including how it can best be utilized in an iShell project.

This command along with Duplicate Command and the Attributes Itself and Parent help you create very dynamic iShell applications.

Personal tools