1. Nathalie Meurant
  2. PowerBuilder
  3. Monday, 25 April 2022 14:01 PM UTC

Hi,

I have a trouble with event rowfocuchanging. 

I have a window with 4 tabpage. In the last tabpage, there are 3 datawindow.

the 3 datawindow contains a list and for each row of the list, it is a dropdowndatawindow.

When i open the window, the system past in rowfocuschanging

the value are : - newrow : 1 and currentrow = 0 (cfr image)

when i choose the last tabpage and i click on the first row of the first dw, the dddw doesn't show the list.

the system think that my focus are on the second row. 

so in the event of rowfocuschanging, the value are - newrow : 2 and currentrow = 1 (cfr image)

I don't understand why the system go in rowfocuschanging because i click on the first row and not on the second row!

I have this trouble when i click on the same row that have the focus.

 

 

 

 

 

Nathalie Meurant Accepted Answer Pending Moderation
  1. Thursday, 28 April 2022 08:42 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

I found the solution.

It was a setrow in the ancestor script 'cliked' that provocate the trouble. 

Thank you very much at all people that help me! ty ty

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 28 April 2022 17:07 PM UTC
Hi Nathalie .. that is great news! Thanks for the update. :-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 April 2022 15:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi Nathalie;

  My guess is that the AcceptText command is messing things up for you as it can cause many other events to fire during this event's processing. Food for thought.

Regards ... Chris

Comment
  1. Nathalie Meurant
  2. Wednesday, 27 April 2022 16:19 PM UTC
Hi Chris,



I removed it but I still have the problem.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 27 April 2022 16:47 PM UTC
In that case, I would look at other code that is changing the current row to #2 as the DC would have changed the rowfocus on instantiation to row #1 intially & thus the RowfocusChanging event from 0 to 1. This sounds like it could be possibly a mismatch in the PB runtime as another source of this behaviour. If you can repeat this issue in a simple test case, please open a Support Ticket & attach the test case.
  1. Helpful
There are no comments made yet.
Nathalie Meurant Accepted Answer Pending Moderation
  1. Wednesday, 27 April 2022 09:09 AM UTC
  2. PowerBuilder
  3. # 3

Andreas Mykonios

Comment
There are no comments made yet.
Nathalie Meurant Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 07:33 AM UTC
  2. PowerBuilder
  3. # 4

Hi John,

I haven't insertrow at all for this part. i do only a retrieve. Because all data are loaded before using application.

The problem comes from the value of Newrow. When I click on the first line, the Newrow should have the value 1. 

So I click on row 1 => RowFocuschanging triggers (normal) = Newrow = 2 and currentrow = 1

CLicked triggers after RowFocuschanging  => ROW = 1.

Did you see the problem?

Comment
  1. Nathalie Meurant
  2. Tuesday, 26 April 2022 09:34 AM UTC
the filter are on dddw and not for dw list

  1. Helpful
  1. Andreas Mykonios
  2. Wednesday, 27 April 2022 06:01 AM UTC
Ok. I'm not sure what you attempt to do in rowfocuschanging event. Normally this event should be used to do some checks and decide if the row focus can change or not. If you want to do some processing to the new row (after the focus has changed) the right place to do that is rowfocuschanged event.

Andreas.
  1. Helpful
  1. Nathalie Meurant
  2. Wednesday, 27 April 2022 09:09 AM UTC
Thank you for your answer.

In the event rowfocuschanging, i just want to setup a flag that manage the display for field.

So, the old flag (currentrow) is set to OFF and the new flag (newrow) is set to ON.

I do that because for each row, i have a DDDW and a statictext. The DDDW must be in front when the row have the focus and the text must be appear in the other case.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 25 April 2022 14:54 PM UTC
  2. PowerBuilder
  3. # 5

Hi, Nathalie -

Keep in mind that the DW's RowFocusChanging event fires BEFORE row focus changes. The RowFocusChanged event fires AFTER row focus has changed. When the DW is constructed, it contains zero rows, then at some point, code somewhere issue an InsertRow for the purpose of providing the user with a visible data row. This causes the RowFocusChanging event to fire with currentrow=0, newrow=1. 

Apparently, at some later point in time your action(s) cause another InsertRow to occur, and this causes another RowFocusChanging event to fire with currentrow=1, newrow=2. It does not sound like this is the behavior you are intending to have happen, so you probably want to track down why this subsequent InsertRow is being performed.

The call stack pane in the Debugger should help you determine where the InsertRow method is being called from within the window.

Regards, John

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.