1. John Murphy
  2. PowerBuilder
  3. Thursday, 8 March 2018 19:02 PM UTC

I am testing the conversion from 12.0 to 2017 R2 and when a user clicks on a column with tab order=0 the row focus does not change.

 

 

Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Friday, 9 March 2018 16:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi John,

 

In a read-only DataWindow, when you click on any column that is not in the current row, the RowFocusChanging and RowFocusChanged events fire, but the current column is not changed -- the current column remains at 0, since no column can have focus. DataWindows are read-only if updates are not allowed, all tab orders are set to 0, or all tab columns are protected.

If, however, focus is on an editable column in an updatable DataWindow (a DataWindow that has one or more editable columns), the row focus events do not fire when you click on a protected column or on a column whose tab order is 0. The focus remains on the current, editable column.

If focus moves off an editable column in an updatable DataWindow, the DataWindow switches to read-only mode. This can happen when the last row in the DataWindow does not have an editable column. In this case, tabbing off the last editable column causes the row focus to move to the row following the row with the last editable column. The DataWindow then remains in read-only mode until focus is given to an editable column.

When you use the ScrollToRow method to change focus, the RowFocusChanging event is triggered before the scroll occurs, and the RowFocusChanged event is triggered after the scroll occurs.

You may find out more about these on page 535 here: https://www.appeon.com/system/files/product-manual/datawindow_reference_0.pdf

As a workaround/solution, I would suggest you to use SetFocus(), SetColumn() and/or SetRow() as needed.

 

Regards,

Comment
  1. John Murphy
  2. Friday, 9 March 2018 18:27 PM UTC
The behavior of my programs changed when converting from 12.0 to 2017 R2 in a very bad way.  I seem to have fixed the problem by changing SetRow to ScrollToRow in the clicked event of the datawindow ancestor but there is no way to make this out as normal. In all the previous versions of PB using SetRow in the clicked event caused the row focus to change no matter what column was clicked and now it does not.

  1. Helpful
  1. Clarence Chamorro
  2. Sunday, 11 March 2018 21:36 PM UTC
I found myself with the same issue when user will delete a row in a dw read only. 



If you use PFC then there is a work arround:



//cch Variable declararion



LONG ll_rows, ll_rows_array[], ll_row, ll_i



STRING ls_userid



 



////CCH GET THE MARKED ROWS AND Because the RowSelect PFC Service is set to single row my ll_rows_array[] has only one row



ll_rows = dw_2.inv_RowSelect.of_SelectedCount( ll_rows_array )



 



//CCH IF NO ROWS SELECTED THEN DO NOTHING



IF ll_rows 1 THEN



MESSAGEBOX('Warning No Rows Selected...','No Rows were Selected.~rPls Select a Row and Clicked this Botton Again...')



RETURN 



END IF



 



ll_row = ll_rows_array[1]



IF gstr_gen.lenguage = 'S' THEN



     IF MESSAGEBOX('Aviso de Borrar Registro...','Desea Borrar este Registro:',QUESTION!,YESNO!) = 2 THEN



        RETURN



     END IF



ELSE



     IF MESSAGEBOX('Warning Deleting Record...','Do you Want to Delete Record:',QUESTION!,YESNO!) = 2 THEN



        RETURN



     END IF



END IF



 



//cch delete selected row



dw_2.DELETEROW(ll_row)



This way I solve my issue selecting rows of read only datawindow.



Clarence.

  1. Helpful
There are no comments made yet.
Tom Jiang @Appeon Accepted Answer Pending Moderation
  1. Friday, 9 March 2018 03:07 AM UTC
  2. PowerBuilder
  3. # 2

I verified it on 11.5, 12.6 and 2017 R2. They all behave the same. When the tab order is set to 0, clicking on the column doesn't change the currentrow of the datawindow. Do you have any expression or code for the datawindow?  

Comment
  1. John Murphy
  2. Friday, 9 March 2018 08:52 AM UTC
Yes.  In the ancestor datawindow (i wrote it 25 years ago in PB 3) in the clicked event it does a SetRow.  I saw other people reporting problems with setrow before I submitted this so I guess this is the same problem.

  1. Helpful
  1. John Murphy
  2. Friday, 9 March 2018 09:08 AM UTC
I changed the setrow to scrolltorow and it works like before.  I think that this will need a lot of testing before I can go live.

  1. Helpful
  1. John Murphy
  2. Friday, 9 March 2018 09:15 AM UTC
I see references to bug #744 in other bug reports about setrow. How can I see it as searching for 744 only finds other references to it.

  1. Helpful
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.