Function overview
Prototype
VisiblePortalRows (
_objName; _portalName )
Parameters
_objName
_portalName
Description
Tags:
Layout Objects Layout Interface
returns the visible portal row numbers as a list, even after scroll.
Examples
Sample input
VisiblePortalRows ( anObjectName ; aPortalName )
Sample output
3¶4¶5¶6¶7 if the portal currently dislays these rows
Function code
/*
VisiblePortalRows ( _objName ; _portalName )
Fabrice Nordmann
v.1, apr 2007
_objName : the name of an object within the portal row
_portalName : the name of the portal layout object
returns the visible portal row numbers as a list, even after scroll.
Based on a crazy Agnès Barouh idea and an insane solution by Alexandre Vial
*/
Let([
$$cf_counter = Case ( $$cf_counter < 1 ; 1 ; $$cf_counter + 1 )
; $portalTop = GetLayoutObjectAttribute ( _portalName ; "top" ) + 1
; $portalBottom = GetLayoutObjectAttribute ( _portalName ; "bottom" ) -1
];
Case ( $$cf_counter = 1 ; Let ([ $$cf_firstRow = "" ; $$cf_lastRow = "" ]; "" ))
&
Case ( IsEmpty ( $$cf_lastRow )
; Case (
GetAsNumber ( GetLayoutObjectAttribute ( _objName ; "top" ; 1 ; $$cf_counter )) >= $portalbottom
; Let ( $$cf_lastRow = $$cf_counter - 1 ; "" )
; GetAsNumber ( GetLayoutObjectAttribute ( _objName ; "bottom" ; 1 ; $$cf_counter )) >= $portalTop
; Let ( $$cf_firstRow = Case ( not IsEmpty ( $$cf_firstRow ) ; $$cf_firstRow & ¶ ) & $$cf_counter ; "" )
)
& VisiblePortalRows ( _objname ; _portalname )
; $$cf_firstRow & Let ([ $$cf_firstRow = "" ; $$cf_lastRow = "" ; $$cf_counter = "" ]; "" )
))
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/107
Prototype: VisiblePortalRows( _objName; _portalName )
Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
Last updated: 15 May 2009
Version: 1.1
*/
// ===================================
/*__LITBR__VisiblePortalRows ( _objName ; _portalName )__LITBR____LITBR__Fabrice Nordmann__LITBR__v.1, apr 2007__LITBR____LITBR____LITBR___objName : the name of an object within the portal row__LITBR___portalName : the name of the portal layout object__LITBR____LITBR__returns the visible portal row numbers as a list, even after scroll.__LITBR____LITBR__Based on a crazy Agnès Barouh idea and an insane solution by Alexandre Vial__LITBR__*/__LITBR____LITBR____LITBR__Let([__LITBR__ $$cf_counter = Case ( $$cf_counter < 1 ; 1 ; $$cf_counter + 1 )__LITBR__ ; $portalTop = GetLayoutObjectAttribute ( _portalName ; "top" ) + 1__LITBR__ ; $portalBottom = GetLayoutObjectAttribute ( _portalName ; "bottom" ) -1__LITBR__];__LITBR____LITBR____LITBR__Case ( $$cf_counter = 1 ; Let ([ $$cf_firstRow = "" ; $$cf_lastRow = "" ]; "" ))__LITBR__&__LITBR__Case ( IsEmpty ( $$cf_lastRow )__LITBR__; Case (__LITBR__ GetAsNumber ( GetLayoutObjectAttribute ( _objName ; "top" ; 1 ; $$cf_counter )) >= $portalbottom__LITBR__ ; Let ( $$cf_lastRow = $$cf_counter - 1 ; "" )__LITBR__ ; GetAsNumber ( GetLayoutObjectAttribute ( _objName ; "bottom" ; 1 ; $$cf_counter )) >= $portalTop__LITBR__ ; Let ( $$cf_firstRow = Case ( not IsEmpty ( $$cf_firstRow ) ; $$cf_firstRow & ¶ ) & $$cf_counter ; "" )__LITBR__ )__LITBR__& VisiblePortalRows ( _objname ; _portalname )__LITBR__; $$cf_firstRow & Let ([ $$cf_firstRow = "" ; $$cf_lastRow = "" ; $$cf_counter = "" ]; "" )__LITBR__))__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/107__LITBR____LITBR__ Prototype: VisiblePortalRows( _objName; _portalName )__LITBR__ Function Author: Fabrice (http://www.fmfunctions.com/mid/37)__LITBR__ Last updated: 15 May 2009__LITBR__ Version: 1.1__LITBR____LITBR__*/__LITBR__// ===================================
Comments
09 December 2009
09 December 2009
doesn't sound silly at all. it's quite tricky to set up (on the layout side)
Try this example and tell me if you encounter any problem.
http://www.bh-a.com/index.php?option=com_content&view=article&id=88&Itemid=84&lang=en#VisiblePortalRows
20 January 2011
(Edited by JeanLuc on 21/01/11 )
26 September 2015