Datagrid can't not find stack
JosepM
jmyepes at mac.com
Fri May 7 14:24:58 EDT 2010
Bonjour Andre,
Bonjour,
Thanks a lot Joseph for this post, very relevant to this list named
"HOW to use Revolution", among an ocean of "OT"! :-))
:-D
I just created
1 - a stack "TrialJosep"
a data grid on it named "dgjosep" with 2 columns : "name" and "forename"
and a button whose script is " topLevel stack "pickTheData"
2 - a substack "pickTheData"
on it 2 fields : one to enter a name
the other to enter a forename
and a button "OK" whose script is :
on mouseUp
local tInfo,
-------
put fld "fldName" & tab & fld "fldForeName" into tInfo
put tInfo
close this stack
dispatch "addLine" to grp "dgJosep" of cd 1 of stack "TrialJosep"
with tInfo
end mouseUp
Code from the Button on the main stack that open the substack.
In the substack only I have some fields that are as I said filled manually
or from the database.
on mouseup
go stack ss_newcustomer of stack "s_document" as sheet
set itemdel to tab
put item 1 of dialogdata into tCliente[1]["CUSTOMER_NAME"]
put item 2 of dialogdata into tCliente[1]["CUSTOMER_TAXNUMBER"]
put item 3 of dialogdata into tCliente[1]["CUSTOMER_ADDRESS"]
put item 4 of dialogdata into tCliente[1]["CUSTOMER_ZIPCODE"]
put item 5 of dialogdata into tCliente[1]["CUSTOMER_CITY"]
put item 6 of dialogdata into tCliente[1]["CUSTOMER_STATE"]
put item 7 of dialogdata into tCliente[1]["CUSTOMER_COUNTRY"]
## Rellenar los datos del cliente, numero documento y fecha
put empty into fld lbl_datos_cliente
put tCliente[1]["CUSTOMER_NAME"] & return after fld lbl_datos_cliente
put tCliente[1]["CUSTOMER_TAXNUMBER"] & return & return after fld
lbl_datos_cliente
put tCliente[1]["CUSTOMER_ADDRESS"] & return after fld lbl_datos_cliente
put tCliente[1]["CUSTOMER_ZIPCODE"] && tCliente[1]["CUSTOMER_CITY"] &
return after fld lbl_datos_cliente
put "(" & tCliente[1]["CUSTOMER_STATE"] & ")" after fld lbl_datos_cliente
end mouseup
Then from the main stack. I have two buttons, one to add and other to delete
rows from the datagrid.
It's here when I try to add a row the error occur.
Button add:
on mouseUp
put the dgNumberOfLines of group "dg_lineas" of this stack into tFilas
if tFilas<10 then
put "0" & tFilas+1 into tLinea
else
put tFilas+1 into tLinea
end if
dispatch "addLine" to group "dg_lineas" of this stack with tLinea
dispatch "ResetList" to group "dg_lineas" of this stack
end mouseUp
I don't see where can fail... :(
Seems working well here (I hope I have correctly understood your
problem?)
If yes, might be "close this stack" before adding the line is important
Button "OK" from the substack
on mouseUp
put fld f_NOMBRE & tab & fld f_NIF & tab & fld f_DIRECCION & tab & fld
f_CP & tab & fld f_POBLACION & tab & fld f_PROVINCIA & tab & fld f_PAIS into
tDatosCliente
set the dialogdata to tDatosCliente
close this stack
end mouseUp
Salut,
Josep
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Datagrid-can-t-not-find-stack-tp2133926p2135496.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list