Page 1 of 1

dcbrowse data aData insert/delete question

Posted: Mon Sep 08, 2014 6:09 am
by skiman
Hi Roger,

I'm browsing an array and using the INSERT and DELETE options.
INSERT xbeK_ALT_INS EXIT ...
DELETE xbeK_DEL ACTION ...

Now, I want to use also two pushbuttons for the INSERT and the DELETE action. What is the fastest way to accomplish this. Is there some method as oBrowse:insert() I can use as action of the button?

Re: dcbrowse data aData insert/delete question

Posted: Mon Sep 08, 2014 9:58 am
by reganc
skiman wrote:Hi Roger,

I'm browsing an array and using the INSERT and DELETE options.
INSERT xbeK_ALT_INS EXIT ...
DELETE xbeK_DEL ACTION ...

Now, I want to use also two pushbuttons for the INSERT and the DELETE action. What is the fastest way to accomplish this. Is there some method as oBrowse:insert() I can use as action of the button?
Can you not just do a PostAppEvent(xbeP_Keyboard,xbeK_ALT_INS,,,oBrowse) from a button?

Re: dcbrowse data aData insert/delete question

Posted: Mon Sep 08, 2014 11:18 am
by Cliff Wiernik
Or call the same function from the action codeblock. That is what we do, not for insert/delete but for itemmarked/itemselected.

Re: dcbrowse data aData insert/delete question

Posted: Mon Sep 08, 2014 11:48 pm
by skiman
Hi Regan,

Yes, that is maybe the best solution. I will try this.

Hi Cliff,

I expect that this wouldn't work. With the insert/delete in the browse the addition of an element to the array, or deletion of it, is performed inside the code of the browse. This should also be added to the action of the button.

Re: dcbrowse data aData insert/delete question

Posted: Tue Sep 09, 2014 1:01 am
by skiman
This is working the same way as the INSERT and DELETE key.

ACTION {|| PostAppEvent(xbeP_Keyboard,xbeK_INS,,oBrowseprod) }

ACTION {|| PostAppEvent(xbeP_Keyboard,xbeK_DEL,,oBrowseprod) , setAppfocus(oBrowseprod) }

Thanks for the tip Regan. I never use this PostAppEvent(...) function. I have to keep this in mind.