KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting the current selected record in 4D from a 4D Ajax Framework Portlet
PRODUCT: 4D Web 2.0 Pack | VERSION: 1.0 | PLATFORM: Mac & Win
Published On: February 21, 2007

PLEASE NOTE: This Tech Tip applies to 4D Web 2.0 Pack version 1.0

When utilizing the 4D Ajax Framework and Developer Defined Windows, you may at times want to obtain the currently selected record from a Portlet. You can do this with a few simple DDW calls and then a check to make sure there is a record in place. Your code could be similar to the following:


ARRAY LONGINT($Recordnumber_al;0)
C_POINTER($TablePointer_p)

$TablePointer_p:=DAX_Dev_DDW_GetAttributes ("TablePointer")
DAX_Dev_DDW_GetAttributes ("RecordNumbers";->$Recordnumber_al)

If (SIZE OF ARRAY($Recordnumber_al)>0)
     GOTO RECORD($TablePointer_p->;$Recordnumber_al{1})
     If (RECORDS IN SELECTION($TablePointer_p->)>0)
          ` you have a record to work with!
     End if
End if