Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 4 Jahren, 3 Monaten
Letzter Beitrag:
vor 4 Jahren, 3 Monaten
Beteiligte Autoren:
Andre Labuschagne, Fabrice Harari

WB - Navigating In A Looper

Startbeitrag von Andre Labuschagne am 09.10.2013 09:28

Hi All

I have a looper with two editable controls. So these two controls are effectively next to one another as in cells in a row in a spreadsheet. I want the user to navigate down the one column only. The default navigation is between columns and across. Does anyone know how to send the focus vertically down the row as the tab key is entered?

Cheers
Andre

Antworten:

Hi André

this is what I would try:
- intercept the TAB key by using either a button with the tab key as a shortcut, or a small JS snippet called from the field itself
- in the button code (or from...), do a listselectplus of the NEXT line of the looper
- and of course set the focus in the appropriate field

Best regards

von Fabrice Harari - am 09.10.2013 13:03
Hi Fabrice

Thanks for the suggestion. I am however confused.

I do not know how to intercept a tab key with a button nor with the tab key as a shortcut nor calling a JS snippet called from the field itself. I am making some investigation into javascript and trapping for keystrokes.

The listselectplus plus and setfocus I follow.

This is what I have tried. ExecuteProcess(Button,click) when the field is exited. I use LooperSelect to pick up the row and increment it. When it gets back to the browser code I listselectplus with the new value and then setfocus. But it goes to the first control on the page. The cursor does not go to the field in question. It does not even move to the next line. If I place the LooperSelect in an AjaxExecute argument the selected row is the last one in the looper. And the cursor stays on the same row, in the second field.

Any more help or suggestions would be welcome.

Cheers
Andre

von Andre Labuschagne - am 09.10.2013 15:22
Hi André

Quote
Andre Labuschagne
I do not know how to intercept a tab key with a button nor with the tab key as a shortcut nor calling a JS snippet called from the field itself. I am making some investigation into javascript and trapping for keystrokes.


A simple button with TAB as shortcut will do the trick

Quote
Andre Labuschagne
This is what I have tried. ExecuteProcess(Button,click) when the field is exited. I use LooperSelect to pick up the row and increment it. When it gets back to the browser code I listselectplus with the new value and then setfocus. But it goes to the first control on the page. The cursor does not go to the field in question. It does not even move to the next line. If I place the LooperSelect in an AjaxExecute argument the selected row is the last one in the looper. And the cursor stays on the same row, in the second field.

I'm afraid that is more complex than that... Is your button code in ajax? Doing a pageRefresh? How do you "GET BACK" to the browser code (I suspect that you don't)...
I'm not sure I can explain better without really delving into your page (awp or not, ajax looper or not, etc, etc)

Best regards

von Fabrice Harari - am 09.10.2013 15:54
Hi Fabrice

Thank you for your continued interest.

I do not have Tab as a choice for shortcut in the drop down list. I have checked the list of properties for the button and shortcut is not listed. So I do not know how to do it.

I have tried with an Ajax Looper and a Classic Looper. I have Ajax enabled the button which means that the page is not refreshed. I suspect that I am not *going back* to the browser and am clueless as to how to do that. The next line is calculated in the button code but that is where the exercise ends. I somehow need to use the AjaxExecute function so that the page does not refresh but when I use a procedure for that it returns the last record as selected instead of the selected record. I suspect that the code after the executeprocess is being run without waiting for the execute process to complete. And the Ajax procedure routine returns the incorrect selection. Pretty snookered.

Cheers
Andre

von Andre Labuschagne - am 09.10.2013 18:54
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.