Going crazy with dgText

Éric Miclo eric.miclo at wanadoo.fr
Sun Nov 14 17:39:21 EST 2010


Le 14 nov. 2010 à 23:11, zryip theSlug a écrit :

> On Sun, Nov 14, 2010 at 9:53 PM, Éric Miclo <eric.miclo at wanadoo.fr> wrote:
>> Hello,
>> 
>> I've a little script that populates a dataGrid with a tab delimited text (titles are located in the first line).
>> In the IDE everything works fine but once the application is built the dataGrid is always empty.
>> I've tried everything I could think of but didn't get it.
>> 
>> Here is the script (located in the preOpenStack handler of a one card stack):
>> 
>>  if the cParamétrageDesItems of this stack is not empty then
>>    set the dgData of group "Paramétrage items" to empty
>>    dispatch "ResetList" to group "Paramétrage items"
>>    put the cParamétrageDesItems of this stack into itemListWithTitle
>>    set the dgText ["true"] of group "Paramétrage items" to itemListWithTitle
>>    dispatch "ResetList" to group "Paramétrage items"
>>    set the cParamétrageDesItems of this stack to empty
>>  end if
>> 
>> If someone has an idea why it doesn't work once built I'd be very happy.
> 
> Hi Éric,
> 
> Assuming the cParamétrageDesItems property is not empty and the
> datagrid library is included:
> 
> 1) First, try to remove the lines -> dispatch "ResetList" to group
> "Paramétrage items"
> The resetList command is useful if you have to reset a dg after a
> change in a template. The refresh of the data is took in care when you
> set new datas with the dgText or dgData properties.
> However in some case, when the indexes are not properly set, reset the
> datagrid with a resetList could result of an empty dg.
> If the indexes are empty, the problem could be the preOpenControl of
> the datagrid was not executed.
> You can check the indexes by using the dgIndexes property of a datagrid.
> 
> 2) Try to populate the dg with the pFirstLineContainsHeaders parameter
> set to false. When set to true the data will be mapped by matching the
> names of the column in the datagrid and the first line of the data.
> If by setting the pFirstLineContainsHeaders to false, you get data,
> this could be a problem in the columns names.
> 
> 
> Best regards,
> -- 
> -Zryip TheSlug- wish you the best! 8)
> http://www.aslugontheroad.co.cc

Hi,

Thanks for you advices, but I've tried different solutions including the one you've just proposed (and tried them again just now) and nothing is working once the application is built.
Inside the IDE everything works perfectly.

I've tried to set the columns names first but after the app is built it hangs when setting the dgText.

I've tried every combination of syntax with no success.

The datagrid template stack is not encrypted or password protected, neither is it a substack of an encrypted or password protected stack.

Before setting the dgText I did put an "answer itemListWithTitle" and itemListWithTitle contained the right data.

adding an answer "dgindexes..." shows that indexes are empty, but only in the built application.

What's strange is that it is working in the IDE and only there.

And the same thing happens with version 4.0.0 and 4.5.1.

I don't understand what's happening.

Thanks once again, best regards,

ÉrIC

> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

-- My NeXT computer will Be a Mac too! --




More information about the use-livecode mailing list