Hi Jeroni,
Steal some ideas from the following ...
Using an INPUT with UNBUFFERED and the master fields disabled enables you to use the UNBUFFERED functionality where if you change a value it is immediately refreshed on the screen.
The dummy field displays on Vista as a 1 pixel that flashes, you may have to alter the style on other platforms to get something that is as invisible as I've managed to get it. By having it the first folder tab now has something it can attach the focus to so hence the first folder tab is displayed when you enter the dialog.
Hope that helps,
Reuben
<StyleList>
<Style name=".dummy" >
<StyleAttribute name="fontSize" value="1pt"/>
<StyleAttribute name="border" value="no" />
</Style>
</StyleList>
LAYOUT
FOLDER f1
PAGE p1(TEXT="Master")
GRID
{
[m01 ]
[m02 ]
[m03 ]
[d]
}
END
END
PAGE p2(TEXT="Detail")
TABLE
{
[d01 ][d02 ][d03 ]
}
END
END
PAGE p3 (TEXT="SubDetail")
TABLE
{
[s01 ][s02 ][s03 ]
}
END
END
END
END
ATTRIBUTES
d = formonly.dummy, INVISIBLE, STYLE="dummy";
m01 = formonly.mfield1;
m02 = formonly.mfield2;
m03 = formonly.mfield3;
d01 = formonly.dfield1;
d02 = formonly.dfield2;
d03 = formonly.dfield3;
s01 = formonly.sfield1;
s02 = formonly.sfield2;
s03 = formonly.sfield3;
INSTRUCTIONS
SCREEN RECORD master(mfield1,mfield2,mfield3);
SCREEN RECORD detail(dfield1,dfield2,dfield3);
SCREEN RECORD subdetail(sfield1,sfield2,sfield3);
IMPORT util
DEFINE master RECORD
mfield1, mfield2, mfield3 STRING
END RECORD
DEFINE detail DYNAMIC ARRAY OF RECORD
dfield1, dfield2, dfield3 STRING
END RECORD
DEFINE subdetail DYNAMIC ARRAY OF RECORD
sfield1, sfield2, sfield3 STRING
END RECORD
MAIN
DEFINE dummy CHAR(1)
OPTIONS INPUT WRAP
CALL ui.Interface.LoadStyles("20081114a")
OPEN WINDOW w WITH FORM "20081114a"
CALL populate()
DIALOG ATTRIBUTES(UNBUFFERED)
INPUT dummy FROM dummy
END INPUT
INPUT master.* FROM master.* ATTRIBUTES(WITHOUT DEFAULTS=TRUE)
END INPUT
DISPLAY ARRAY detail TO detail.*
END DISPLAY
DISPLAY ARRAY subdetail TO subdetail.*
END DISPLAY
BEFORE DIALOG
CALL dialog.setFieldActive("master.mfield1",0)
CALL dialog.setFieldActive("master.mfield2",0)
CALL dialog.setFieldActive("master.mfield3",0)
ON ACTION next
CALL populate()
DISPLAY master.* TO master.*
ON ACTION previous
CALL populate()
DISPLAY master.* TO master.*
ON ACTION close
EXIT DIALOG
END DIALOG
END MAIN
FUNCTION populate()
DEFINE i,j INTEGER
LET master.mfield1 = util.Math.rand(100)
LET j = util.Math.rand(100)+1
CALL detail.clear()
FOR i = 1 TO j
LET detail[i].dfield1 = util.Math.rand(100)
END FOR
LET j = util.Math.rand(100)+1
CALL subdetail.clear()
FOR i = 1 TO j
LET subdetail[i].sfield1 = util.Math.rand(100)
END FOR
END FUNCTION