With an array listbox, after you delete the record you can delete the row from the listbox.
NOTES about array listboxes: there is a boolean array associated with the array listbox which is the listbox lb_Display_Listbox <- name of the listbox also name of the boolean array. to locate selected row(s): Repeat $Loc:=find in array(lb_Display_Listbox;true) if ($Loc>0) do stuff //* see below for an example of Do stuff end if until ($Loc<0) So... for the record deletion issue you can do something like this: * - Do stuff example delete record Listbox Delete Rows(lb_Display_Listbox;$Row_Number;$How_Many) This should be much faster, as you do not have to recreate the listbox content through selection to array Chip On Wed, 19 Dec 2018 09:21:56 -0500, Sandor Szatmari wrote: > > Actually, I'm using an array based ListBox, but your comment led me > to understand how I should apply the underlying concept of what you > were getting at. > I added this code to the appropriate locations, to reestablish the > selection in the child table and then propagate that data into the > arrays being displayed in the ListBox. > > > QUERY([table];[table]ID=[LinkedTable]ID) > SELECTION TO > ARRAY([table];Numbers;[table]EndpointType;Names;[table]EndpointAddress;Addresses) > > > Now the ListBox updates as desired. > > Thanks so much for helping understand what I was missing. > > > Sandor > > > > From: Chip Scheide <4d_o...@pghrepository.org> > To: Sandor Szatmari <s...@infoplusonline.com> > Cc: 4D iNug Technical <4d_tech@lists.4d.com> > Sent: 12/18/2018 4:30 PM > Subject: Re: UI Form Updates > > > asumming the listbox is a selection listbox there is a set associated > with the listbox which represents the selected record(s). The listbox > property is called 'highlight set'. > > This set (i am going to call it "Selected_Set") holds all record(s) > selected by the user. > So your code is much easier done like this: > > > // the user has selected at least 1 record > if Records in set("Selected_Set")>0) > > Create set([AccountSOAPEndpoints];"$Temp") //holds all currently > displayed records > CONFIRM("Are you SURE you want to remove the selected Web Service > Endpoint?";"Remove";"Cancel") > > If (OK=1) > //places the selected record(s) into the current selection > use set("Selected_Set") > > // assuming the records are not locked by another user/process they > are deleted > delete selection([AccountSOAPEndpoints]) > > // this removes the deleted records from the originally displayed > records > // and places the resulting set into "$Temp" > difference("$Temp";"Listbox_Selection_Set";"$Temp") > > // this places the originally displayed records, minus the deleted > ones > // into the current selection of [AccountSOAPEndpoints] > // this should update the listbox > use set("$Temp") > > clear set("$Temp") // clear the set to avoid excess memory usage > end if > end if > > > > your code would: > // create a set with the originally displayed records >> CREATE SET([AccountSOAPEndpoints];"$TempSet") > > //retrieve all records into current selection >> ALL RECORDS([AccountSOAPEndpoints]) > > /replace the current selection (all records) with the originally > displayed records >> USE SET("$TempSet") >> CLEAR SET("$TempSet") > > > > On Tue, 18 Dec 2018 16:06:13 -0500, Sandor Szatmari wrote: >> >> Chip, >> >> >> Thanks for your help. Here is my adaptation of your suggestion. >> NOTE: It does not work. :) >> >> >> Can you please offer some advise on what I am missing here? Thanks. >> >> >> $TheEvent:=Form event >> Case of >> : ($TheEvent=On Load) >> // We should only be enabled for Accounts that are non themselves >> Secondaries >> OBJECT SET ENABLED(Self->;True) >> >> >> : ($TheEvent=On Clicked) >> // Delete the selected Secondary >> LISTBOX GET CELL POSITION(SOAPEndpointListBox;$col;$row) >> If ($row>0) >> >> >> CONFIRM("Are you SURE you want to remove the selected Web Service >> Endpoint?";"Remove";"Cancel") >> If (OK=1) >> $selectedSOAPEndpoint:=SOAPEndpointNumbers{$row} >> >> >> GOTO RECORD([AccountSOAPEndpoints];$selectedSOAPEndpoint) >> DELETE RECORD([AccountSOAPEndpoints]) >> >> >> CREATE SET([AccountSOAPEndpoints];"$TempSet") >> ALL RECORDS([AccountSOAPEndpoints]) >> USE SET("$TempSet") >> CLEAR SET("$TempSet") >> >> >> End if >> >> >> End if >> End case >> Sandor Szatmari >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Senior Software Developer >> Bristol Capital Inc. - InfoPlus >> 201 746 7215 >> www.infoplusonline.com >> >> >> >> From: Chip Scheide <4d_o...@pghrepository.org> >> To: 4D iNug Technical <4d_tech@lists.4d.com> >> Cc: Sandor Szatmari <s...@infoplusonline.com> >> Sent: 12/17/2018 5:19 PM >> Subject: Re: UI Form Updates >> >> you need to update the current selection of records in the selection >> from the table the listbox is displaying. >> ex: >> create set([table];"$Temp") >> use set("Listbox_Selection_Set") >> delete selection([table]) >> difference("$Temp";"Listbox_Selection_Set";"$Temp") >> use set("$Temp") >> clear set("$Temp") >> >> Chip >> >> On Mon, 17 Dec 2018 16:00:33 -0500, Sandor Szatmari via 4D_Tech wrote: >>> I added a page to an existing form. I can add and delete rows. I >>> have + button to show the data entry form and a '-' button to display >>> a 'confirm the deletion of the selected row' dialog. However, once >>> the entry form or the dialog are dismissed the ListBox in the table >>> does not update to show that the new data has been entered or >>> deleted. If I switch to one of the other tabs in form and then >>> switch back, the ListBox reflects the addition or deletion of the >>> data. Thanks for any help you can give. >>> >>> Sandor Szatmari >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Senior Software Developer >>> Bristol Capital Inc. - InfoPlus >>> 201 746 7215 >>> www.infoplusonline.com >>> >>> CONFIDENTIALITY NOTICE: This email (and any related attachments) >>> contains information from InfoPlus (a service of Bristol Capital, >>> Inc.). It is intended only for the addressee and may contain >>> information that is confidential and/or otherwise exempt from >>> disclosure under applicable law. If you are not the intended >>> recipient or are acting as agent for the intended recipient, any use >>> or disclosure of this communication is prohibited. If you have >>> received this communication in error, please notify us immediately to >>> arrange for the appropriate method of returning or disposing of the >>> communication. If our respective Companies have confidentiality >>> provisions in effect, this email and the materials contained herein >>> are deemed CONFIDENTIAL and should be treated accordingly unless >>> expressly provided otherwise. >>> ********************************************************************** >>> 4D Internet Users Group (4D iNUG) >>> Archive: http://lists.4d.com/archives.html >>> Options: https://lists.4d.com/mailman/options/4d_tech >>> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >>> ********************************************************************** >> --------------- >> Gas is for washing parts >> Alcohol is for drinkin' >> Nitromethane is for racing >> >> >> CONFIDENTIALITY NOTICE: This email (and any related attachments) >> contains information from InfoPlus (a service of Bristol Capital, >> Inc.). It is intended only for the addressee and may contain >> information that is confidential and/or otherwise exempt from >> disclosure under applicable law. If you are not the intended >> recipient or are acting as agent for the intended recipient, any use >> or disclosure of this communication is prohibited. If you have >> received this communication in error, please notify us immediately to >> arrange for the appropriate method of returning or disposing of the >> communication. If our respective Companies have confidentiality >> provisions in effect, this email and the materials contained herein >> are deemed CONFIDENTIAL and should be treated accordingly unless >> expressly provided otherwise. > --------------- > Gas is for washing parts > Alcohol is for drinkin' > Nitromethane is for racing > > > CONFIDENTIALITY NOTICE: This email (and any related attachments) > contains information from InfoPlus (a service of Bristol Capital, > Inc.). It is intended only for the addressee and may contain > information that is confidential and/or otherwise exempt from > disclosure under applicable law. If you are not the intended > recipient or are acting as agent for the intended recipient, any use > or disclosure of this communication is prohibited. If you have > received this communication in error, please notify us immediately to > arrange for the appropriate method of returning or disposing of the > communication. If our respective Companies have confidentiality > provisions in effect, this email and the materials contained herein > are deemed CONFIDENTIAL and should be treated accordingly unless > expressly provided otherwise. --------------- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************