ComboBox Menu Script in Datagrids
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
ComboBox Menu Script in Datagrids
Hello,
I have some ComboBox Menu-style Option Menu buttons in a DataGrid form. They are supposed to do some things on MenuPick, but no message is ever being sent to the object script when the objects are being clicked. It appears that there is some kind of internal exception or something related to the message path, because when I place a Breakpoint in the object script, it never runs, whether on MenuPick or even just on MouseUp/MouseDown.
Looking for possible reasons why this object does not function normally inside a DataGrid. I have posted this question before, and have conducted multiple detailed tests to ensure that my script operates correctly OUTSIDE a DataGrid. It appears to simply be due to the fact that the object is located in the DG.
Any suggestions/ special loopholes I need to be aware of with DGs to make this function right?
Thanks!
Phil E.
I have some ComboBox Menu-style Option Menu buttons in a DataGrid form. They are supposed to do some things on MenuPick, but no message is ever being sent to the object script when the objects are being clicked. It appears that there is some kind of internal exception or something related to the message path, because when I place a Breakpoint in the object script, it never runs, whether on MenuPick or even just on MouseUp/MouseDown.
Looking for possible reasons why this object does not function normally inside a DataGrid. I have posted this question before, and have conducted multiple detailed tests to ensure that my script operates correctly OUTSIDE a DataGrid. It appears to simply be due to the fact that the object is located in the DG.
Any suggestions/ special loopholes I need to be aware of with DGs to make this function right?
Thanks!
Phil E.
Re: ComboBox Menu Script in Datagrids
Hi.
So if, in the combo box script, you have simply:
on menuPick
answer the target
end menuPick
You get nothing?
Craig Newman
So if, in the combo box script, you have simply:
on menuPick
answer the target
end menuPick
You get nothing?
Craig Newman
Re: ComboBox Menu Script in Datagrids
On my current project stack, that is correct.
I opened a brand new stack, and created a very bare-bones DataGrid form, containing only a ComboBox Menu button in the Row Template, and tried the same procedure. It did not work, either. Neither MouseUp nor MenuPick is being received by the object. I will attach the new test stack I used.
Thanks!
Phil E.
I opened a brand new stack, and created a very bare-bones DataGrid form, containing only a ComboBox Menu button in the Row Template, and tried the same procedure. It did not work, either. Neither MouseUp nor MenuPick is being received by the object. I will attach the new test stack I used.
Thanks!
Phil E.
- Attachments
-
- DG ComboBox Test.livecode.zip
- (4.82 KiB) Downloaded 281 times
Re: ComboBox Menu Script in Datagrids
This works:
This doesn't:

Code: Select all
on menuPick pItemName
answer the target
end menuPick
Code: Select all
on menuPick pItemName
switch pItemName
answer the target
end switch
end menuPick

Re: ComboBox Menu Script in Datagrids
Klaus.
What I said.
The OP stated that the combo worked fine alone, but not embedded in the DG template. The menuPick handler he used therefore must either have declared "pItemName" as a case in its structure, or gone the way we both suggested, using the message bare bones. What changed when it was stuck into the form is the question.
Craig
What I said.
The OP stated that the combo worked fine alone, but not embedded in the DG template. The menuPick handler he used therefore must either have declared "pItemName" as a case in its structure, or gone the way we both suggested, using the message bare bones. What changed when it was stuck into the form is the question.
Craig
Re: ComboBox Menu Script in Datagrids
Klaus,
I see what you mean, but it actually did NOT work on my test stack when I did it that way.
On my actual stack, however, I had a different effect. BOTH methods popped up the answer box, assuming that I provided the word "default" before the "answer the target" command within the switch statement.
HOWEVER, when I use a breakpoint in the code where this is written, nothing happens. Meaning that the answer box pops up, but somehow does not execute the script to do so, if that makes any sense at all. The script just never runs, and the breakpoint is never activated, even though the answer dialog pops up as it should.
I made a few small tweaks to the test stack and will include it. I give my assurances that, at the moment, the actual stack is running the same test method for its own ComboBox Menu objects.
Best,
Phil E.
I see what you mean, but it actually did NOT work on my test stack when I did it that way.
On my actual stack, however, I had a different effect. BOTH methods popped up the answer box, assuming that I provided the word "default" before the "answer the target" command within the switch statement.
HOWEVER, when I use a breakpoint in the code where this is written, nothing happens. Meaning that the answer box pops up, but somehow does not execute the script to do so, if that makes any sense at all. The script just never runs, and the breakpoint is never activated, even though the answer dialog pops up as it should.
I made a few small tweaks to the test stack and will include it. I give my assurances that, at the moment, the actual stack is running the same test method for its own ComboBox Menu objects.
Best,
Phil E.
- Attachments
-
- DG ComboBox Test.livecode.zip
- (4.84 KiB) Downloaded 257 times
Re: ComboBox Menu Script in Datagrids
Ok Phil,
I'm getting somewhere with this.
For your breakpoint issue actually write the word "breakpoint" into the menuPick. Do not use the little red dot.
I still have nothing coming from the mouseUp but you don't need that.
In your menuPick you want pItemName not target. The switch/case is working.
Remember to always hit your Refresh DG after any script change
I am working with your first posted stack.
Simon
I'm getting somewhere with this.
For your breakpoint issue actually write the word "breakpoint" into the menuPick. Do not use the little red dot.
I still have nothing coming from the mouseUp but you don't need that.
In your menuPick you want pItemName not target. The switch/case is working.
Remember to always hit your Refresh DG after any script change
I am working with your first posted stack.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: ComboBox Menu Script in Datagrids
Simon,
You are totally right about inserting the "Breakpoint" via text rather than by using the red dot. This is strange to me, but I'm going with it!
As for the pItemName part, you are totally right, there, too. I see now that it is indeed running, and I was finally able to view the script as it runs, so I can actually debug it!
I am now realizing that the switch I am using in the application I am solving all of these problems for has an unrelated problem to solve, namely, how to get the dgIndex of the ComboBox Menu to store into a variable for use.
Sorry for the lack of feedback at first, I took your advice and ran with it, forgot to look back and appreciate! So, thank you!
Best,
Phil E.
You are totally right about inserting the "Breakpoint" via text rather than by using the red dot. This is strange to me, but I'm going with it!
As for the pItemName part, you are totally right, there, too. I see now that it is indeed running, and I was finally able to view the script as it runs, so I can actually debug it!
I am now realizing that the switch I am using in the application I am solving all of these problems for has an unrelated problem to solve, namely, how to get the dgIndex of the ComboBox Menu to store into a variable for use.
Sorry for the lack of feedback at first, I took your advice and ran with it, forgot to look back and appreciate! So, thank you!
Best,
Phil E.