| 4D v20.1GET LIST ITEM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v20.1
 GET LIST ITEM 
         | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET LIST ITEM ( {* ;} list ; itemPos | * ; itemRef ; itemText {; sublist ; expanded} ) | ||||||||
| Parameter | Type | Description | ||||||
| * | Operator |   | If specified, list is an object name (string) If omitted, list is a list reference number | |||||
| list | ListRef, String |   | List reference number (if * omitted), or Name of list type object (if * passed) | |||||
| itemPos | * | Operator, Longint |   | Position of item in expanded/collapsed list(s) or * for the current item in the list | |||||
| itemRef | Longint |   | Item reference number | |||||
| itemText | String |   | Text of the list item | |||||
| sublist | ListRef |   | Sublist list reference number (if any) | |||||
| expanded | Boolean |   | If a sublist is attached: TRUE = sublist is currently expanded FALSE = sublist is currently collapsed | |||||
The GET LIST ITEM command returns information about the item specified by itemPos of the list whose reference number or object name is passed in list.
If you pass the first optional * parameter, you indicate that the list parameter is an object name (string) corresponding to a representation of the list in the form. If you do not pass this parameter, you indicate that the list parameter is a hierarchical list reference (ListRef). If you only use a single representation of the list, you can use either syntax. Conversely, if you use several representations of the same list, the syntax based on the object name is required since each representation can have its own expanded/collapsed configuration and its own current item.
Note: If you use the @ character in the name of the list object and the form contains several lists that match with this name, the GET LIST ITEM command will only apply to the first object whose name corresponds.
The position must be expressed relatively, using the current expanded/collapsed state of the list and its sublist. You pass a position value between 1 and the value returned by Count list items. If you pass a value outside this range, GET LIST ITEM returns empty values (0, "", etc.).
After the call, you retrieve:
hList is a list whose items have unique reference numbers. The following code programmatically toggles the expanded/collapsed state of the sublist, if any, attached to the current selected item:
 $vlItemPos:=Selected list items(hList)
 If($vlItemPos>0)
    GET LIST ITEM(hList;$vlItemPos;$vlItemRef;$vsItemText;$hSublist;$vbExpanded)
    If(Is a list($hSublist))
       SET LIST ITEM(hList;$vlItemRef;$vsItemText;$vlItemRef;$hSublist;Not($vbExpanded))
    End if
 End ifRefer to the example of the APPEND TO LIST command.
									GET LIST ITEM PROPERTIES
									
									List item parent
									
									List item position
									
									Selected list items
									
									SET LIST ITEM
									
									SET LIST ITEM PROPERTIES
									
	Product:  4D
	Theme:  Hierarchical Lists
	Number:  
        378
        
        
        
	
	Modified:  4D v11 SQL  
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	4D Language Reference ( 4D v20)
	
	
	4D Language Reference ( 4D v20.1)
	
	
	
 Add a comment
Add a comment