Jump to content


Photo
- - - - -

List Boxes


4 replies to this topic

#1 Burnley106

Burnley106

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 02 April 2008 - 02:34 PM

Can any one tell me whether in a list box a record can be selected to appear at the top of the screen like @SPSEQ can do in a paging screen.

Many Thanks

#2 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 02 April 2008 - 04:21 PM

Can any one tell me whether in a list box a record can be selected to appear at the top of the screen like @SPSEQ can do in a paging screen.

Many Thanks



Yes, well sort of anyway. If you set the list box variable e.g. $MYCURRENT_SELECTION, to contain the value that you wish to have focus on in the listbox before focus is placed on the listbox control (field) e.g. in before focus logic, then you should get the desired result. It may not necessarily be at the top but should be on the page. Rember the first field in the cycle that services the listbox is hidden, and it is this value that is returned to the listbox data field
Things should be made as simple as possible, but not simpler

#3 Donald Miller

Donald Miller

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 205 posts
  • Gender:Male
  • Location:Cupar, Fife, Scotland
  • Interests:Motorcycling, Running, Cooking

Posted 14 January 2010 - 09:34 PM

Hi Darren

Found this old post with a search. Doesn't really give me what I'm looking for I don't think...

Using a listbox where a record is highlighted and on the button action is removed from the file, if the listbox is refreshed then the cursor is relocated to the first record.

Is there any way of maintaining the position/line number so that on the refresh the next record in the listbox is highlighted i.e. using the virtual "last seq/line no"?

For example: changing a record in the list box - the data can be changed and the listbox refreshed to show the changes but the same record remains highlighted after the refresh. That is the operation I'd like to achieve with the deletion.

Display of the next record at the top of the screen isn't really what is required but it'll do if the next record cannot be highlighted.

Any help greatefully received

Donald
Half of what he said meant something else, and the other half didn't mean anytthing at all

#4 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 14 January 2010 - 09:58 PM

For example: changing a record in the list box - the data can be changed and the listbox refreshed to show the changes but the same record remains highlighted after the refresh. That is the operation I'd like to achieve with the deletion.


Donald

If I am understanding your issue correctly you would like to delete a row from a list box and have the focus (highlight/select) placed on the next logic row in the list sequence. You will have to do a little leg work to achieve this and it will be a lot easier if you have a SQL database. After you have performed the delete action but BEFORE you refresh the list box, you will have to in effect 'get currency'. The simplest way is to call a global update and pass in the key that has just been deleted. The update will contain the file driving the list box as the primary and will be many time. Set the key(s) to the primary file as passed in from the parameters i.e. the row that has just been deleted. Then perform a sel-range on the file setting the end of range string to a value that would always be the last row (I always use 'zzzzzz' etc.). The first row that is read is the next concurrent record. Perform an LSEXIT. Pass this back and then set the $CURRENT_KEY list box variable (or what ever you have used on the list box object) and refresh the list box. As mentioned, if the file (table) is SQL then you can employ a SQL statement to more efficiently find the closest matching row to the one that has been deleted.
Things should be made as simple as possible, but not simpler

#5 Donald Miller

Donald Miller

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 205 posts
  • Gender:Male
  • Location:Cupar, Fife, Scotland
  • Interests:Motorcycling, Running, Cooking

Posted 14 January 2010 - 10:25 PM

Hi Darren

Thanks for the fast response. You understood the requirements perfectly. And if that is what is required it IS a lot of leg work. Shame there's not a Pro IV system variable for it. That'd be too easy...

I'm hurtling toward an installation for my customers (who didn't think I could meet their requirements). Fortunately this feature was not part of them - but I'd like to incorporate it at some point anyway. So if I don't get back to you in the next few weeks it'll be after that (when I'll be working in Hawaii). Yeah I know - some poor sod's gotta do it.....

Glad it's me tho.

Thanks again - I'll letcha know how I get on.

Donald
Half of what he said meant something else, and the other half didn't mean anytthing at all



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users