VisiblePortalRows ( )

Function stats

Average user rating
37
107
9999
Support
FileMaker 8.5 +
Date posted
05 December 2008
Last updated
15 May 2009
Version
Recursive function
Yes

Author Info
 Fabrice

76 functions

Average Rating 4.4

author_avatar



 

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

*/
// ===================================

 

Comments

Zerocool
09 December 2009



I know this may sound silly.. but i cant figure out how to use the function. How do I call this funtion(objectName)&(portalName)?
  General comment
Fabrice
09 December 2009



Hi,
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
  General comment
JeanLuc
20 January 2011



Magnifique fonction, elle semble fonctionner aussi avec les tables externes filtrées !
(Edited by JeanLuc on 21/01/11 )
     Feature request
Rob P
26 September 2015



No longer seems to work in FM 14
 Bug report

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Layout  (15)
Interface  (15)
Text  (14)
Variables  (12)
Filter  (11)
Layout Objects  (11)
Design  (10)
Array  (8)