Datagrid Form crushes
Posted: Thu May 21, 2020 3:52 pm
Hello everyone!
I'm having trouble with my datagrid form:
/The application only contains a stack with 8 cards, gets data from MySql databse. The datagrid form in row template contains 2 fields and a button/
- First problem is, when user starts to run the application and opens the card which has the datagrid form on it, then the datagrid does not builds as suppose to, looks different from the created one. After the card closes and reopens, the datagrid looks perfect.
- Second problem is: if the user select a row then the button in it gets visible, after clicking on the button, it opens an other card, - user can input data - and when it is closed then the card - with the datagrid form on it - opens back again. Now the user selects a row again /it does not matter which one /, clicks on button, other card opens , closing other card and reopening the one has datagrid form on it,then datagrid crushes, giving the "no such an object", and highlighting the line i had underlined in the code below comes from the revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript.
/So the first approach of the user is succesfull, the datagrid form crushes after that.../
--------pControls is "all list controls" for a form or column row controls for a table
private function _GenerateReorderedControlList pControls, pIndexes
local theControl,theControlIndexesA,theControlsWithoutAHome,theIndex,theList
set the wholeMatches to true
## Separate controls based on whether or not they have an index
repeat for each line theControl in pControls
put the dgIndex of theControl into theIndex
if theIndex is among the items of pIndexes then
put theControl into theControlIndexesA[theIndex]
else
put theControl & cr after theControlsWithoutAHome
end if
end repeat
delete the last char of theControlsWithoutAHome
## Now order everything
repeat for each item theIndex in pIndexes
if theControlIndexesA[theIndex] is not empty then
put theControlIndexesA[theIndex] & cr after theList
else
put line 1 of theControlsWithoutAHome & cr after theList
delete line 1 of theControlsWithoutAHome
end if
end repeat
put theControlsWithoutAHome after theList
if the last char of theList is cr then delete the last char of theList
return theList
end _GenerateReorderedControlList
-------------------------------------------end code snippet-------------------------
would someone tell me what is going on please?
/ that is my second approach building the same kind of card with different name and datagridform on it from scratch, the first one gave the same error.../
I'm having trouble with my datagrid form:
/The application only contains a stack with 8 cards, gets data from MySql databse. The datagrid form in row template contains 2 fields and a button/
- First problem is, when user starts to run the application and opens the card which has the datagrid form on it, then the datagrid does not builds as suppose to, looks different from the created one. After the card closes and reopens, the datagrid looks perfect.
- Second problem is: if the user select a row then the button in it gets visible, after clicking on the button, it opens an other card, - user can input data - and when it is closed then the card - with the datagrid form on it - opens back again. Now the user selects a row again /it does not matter which one /, clicks on button, other card opens , closing other card and reopening the one has datagrid form on it,then datagrid crushes, giving the "no such an object", and highlighting the line i had underlined in the code below comes from the revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript.
/So the first approach of the user is succesfull, the datagrid form crushes after that.../
--------pControls is "all list controls" for a form or column row controls for a table
private function _GenerateReorderedControlList pControls, pIndexes
local theControl,theControlIndexesA,theControlsWithoutAHome,theIndex,theList
set the wholeMatches to true
## Separate controls based on whether or not they have an index
repeat for each line theControl in pControls
put the dgIndex of theControl into theIndex
if theIndex is among the items of pIndexes then
put theControl into theControlIndexesA[theIndex]
else
put theControl & cr after theControlsWithoutAHome
end if
end repeat
delete the last char of theControlsWithoutAHome
## Now order everything
repeat for each item theIndex in pIndexes
if theControlIndexesA[theIndex] is not empty then
put theControlIndexesA[theIndex] & cr after theList
else
put line 1 of theControlsWithoutAHome & cr after theList
delete line 1 of theControlsWithoutAHome
end if
end repeat
put theControlsWithoutAHome after theList
if the last char of theList is cr then delete the last char of theList
return theList
end _GenerateReorderedControlList
-------------------------------------------end code snippet-------------------------
would someone tell me what is going on please?
/ that is my second approach building the same kind of card with different name and datagridform on it from scratch, the first one gave the same error.../