Page 1 of 1

[updated]-data from mainstack --> dg of substack ??

Posted: Mon Jun 15, 2015 3:38 pm
by shawnblc
I have a datagrid (DataGridFiles1) in a substack. I'm trying to add this data from the main stack to the grid in the substack.
My file is uploading to the server fine, my flds are populating fine, just not able to transfer that data to the datagrid in the substack.

What am I doing wrong?

Here's my code.

Code: Select all

put fld "fldDate" & tab & fld "lblLink" & tab & fld "lblFacility" & tab & the label of button "documentMenu" into theRowData
--put "Date" & cr & "Facility" & cr & "Category" & cr & "Document" into theDataColumns

put the dgNumberOfLines of me +1 into theLineNo
dispatch "AddLine" to group "DataGridFiles1" with theRowData, theDataColumns, theLineNo

Re: Uploading file from mainstack, put data in dg on substac

Posted: Mon Jun 15, 2015 4:04 pm
by dunbarx
Hi.

We would need more info about those other handlers, like "addLine".

Craig Newman

Re: Uploading file from mainstack, put data in dg on substac

Posted: Mon Jun 15, 2015 4:10 pm
by shawnblc

Re: Uploading file from mainstack, put data in dg on substac

Posted: Mon Jun 15, 2015 4:15 pm
by bangkok
If the DG is on a substack, you have to... say it. Explicitly :)

Code: Select all

dispatch "AddLine" to group "DataGridFiles1" of cd "mycd" of stack "mysubstack" with theRowData, theDataColumns, theLineNo
I see another -potential- problem in your script.

Code: Select all

put the dgNumberOfLines of me +1 into theLineNo
Does it mean that the DG on your substack is like a mirror of the DG on your main stack ? With the same number of lines ?

If not, then your script is wrong. You need to get the dgNumberOfLines not of "me" but of the DG on your substack, before to add a line in the substack.

Like :

Code: Select all

put the dgNumberOfLines of group "DataGridFiles1" of cd "mycd" of stack "mysubstack" into theLineNo
add 1 to theLineNo

[updated]-data from mainstack --> dg of substack ??

Posted: Tue Jun 16, 2015 7:09 pm
by shawnblc
Maybe this image will help better understand what I'm trying to accomplish. The datagrid on the right is my substack "Filing Cabinet".

When the upload file button is pushed, I want to populate the datagrid in the substack.

Note: the upload is working perfectly.

Update: Got it now, but when I add to the datagrid a second time, it rewrites line 1 of the dg instead of creating a new line (row).