1. Sivaprakash BKR
  2. PowerBuilder
  3. Monday, 7 June 2021 08:34 AM UTC

Hello,

PB 2019 R3

2 windows - 1 view window and 1 edit window

view window list all required records from a table and when double clicked it opens the edit window with data for that row.  Both view window and edit window are open now [in a mdi window].  After saving the modifications in the edit window, this window closes and focus goes to view window. 

Now I want to refresh the view window

1.  Is it possible to modify [ refresh ] that particular row alone, instead of full retrieve, by fetching details from the database ? If yes, how ?
2.  Which event is the right place to write this code ?

In edit window, there is a possibility to delete that record also.  In that case the view should remove that particular record.

Happiness Always
BKR Sivaprakash

 

Sivaprakash BKR Accepted Answer Pending Moderation
  1. Tuesday, 8 June 2021 03:41 AM UTC
  2. PowerBuilder
  3. # 1

Thanks Arnd and Olan

I'll try those options.   My preference will be to update the concerned rows instead of complete retrieve.  As Arnd pointed out there may be more view window(s) and edit window(s) open at a point.  Need to find way(s) to rightly update the concerned view window, as there is a possibility of the same view window opened multiple times (as instances).  

 

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 7 June 2021 13:33 PM UTC
  2. PowerBuilder
  3. # 2

Another way to refresh a window COMPLETELY is to POST a call to the Retrieve event being used, or to the OPEN event if that calls more than one Retrieve event.

And of course you can always define a new event to specifically re-retrieve the DWs in your object, then POST your call to that event.


Good Luck,

Olan

Comment
There are no comments made yet.
Arnd Schmidt Accepted Answer Pending Moderation
  1. Monday, 7 June 2021 10:50 AM UTC
  2. PowerBuilder
  3. # 3

1. ) ReSelectRow() is your friend (https://docs.appeon.com/pb2019/datawindow_reference/ch09s121.html)

2.) Depends on your application framework.
Your edit windows needs to call a method so that the datawindow in the list knows which row has to be retrieved.

If the edit window is a response dialog, that should be easy.

If there can be multiple edit windows you have to setup some message logic to inform the list about changes. You have to find attributes (often the PrimaryKey) to identify the rows that have to be retrieved/refreshed.

To remove rows form the list window, you can use RowsDiscard (https://docs.appeon.com/pb2019/datawindow_reference/ch09s130.html).

hth

Arnd

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.