ReturnInField listbox/group Messagepath problem [SOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

ReturnInField listbox/group Messagepath problem [SOLVED]

Post by Lagi Pittas » Fri May 15, 2015 1:39 pm

Hi

I created a lookup routine using a listbox and allowed for return or doubleclick as a selection - everything worked fine.

I then wanted to do other processing that the listbox by itself couldn't do (or maybe me?) so I selected the listbox and made it a group.


I transferred all the listbox code into the group script - and it all works EXCEPT the returninfield handler is not called withingeither the group or the listbox scripts.

If I add a returninfield handler in the main stack it gets called - I would have thought it would get passed up to the group first as the next closest container, or am I missing something.

Best Regard Lagi
Last edited by Lagi Pittas on Sat May 16, 2015 4:16 pm, edited 2 times in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10394
Joined: Wed May 06, 2009 2:28 pm

Re: ReturnInField listbox/group Messagepath problem

Post by dunbarx » Fri May 15, 2015 2:52 pm

Hi.

Not sure I have this right. If I make a new list field and place this into its script:

Code: Select all

on returninfield
   put the selectedText of me
end returninfield
I get what I expect.

If I then group that field, and move the handler into the group script (note the modification required):

Code: Select all

on returninfield
   put the selectedText of the target
end returninfield
All works fine. Is that small change helpful?

Craig Newman

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: ReturnInField listbox/group Messagepath problem

Post by Lagi Pittas » Fri May 15, 2015 4:10 pm

Hi Craig

Thats what I did - but the Handler is never called in the Group script but gets handled in the main stack.

That's what had me stumped

Lagi

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10394
Joined: Wed May 06, 2009 2:28 pm

Re: ReturnInField listbox/group Messagepath problem

Post by dunbarx » Fri May 15, 2015 5:29 pm

If you put a breakpoint in the group script handler, it does not detect the message? I assume you deleted the handler in the field script, right?

If it is firing in the stack script, something has made the message bypass several controls.

Craig

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: ReturnInField listbox/group Messagepath problem [SOLVED]

Post by Lagi Pittas » Sat May 16, 2015 4:16 pm

Hi Craig

As soon as I read your answer/question the answer flashed into my head - I am using rrpgrid from runrevplanet.com (a fantastic piece of coding btw every(commercial) livecode user should check it out you'll be glad you did - anybody who has wished the standard grid was orthogonal, consistent and obvious in the way it works - anyway I digress). I remembered that the main routine uses a rawkeydown and although the code is not in a front script, I was pretty sure rawkeydown is called before returninfield in the standard message hierarchy . I put a blank rawkeydown handler within the menu button and lo and behold the group script returninfield is called (taking precedence over the returninfield I placed within the list box).

It's all very logical after the problem has been solved.

Thanks again Craig

Regards lagi

Post Reply