Setting the cursor at the end of a text item Forms 10g
Is there a way in 10g forms to set the cursor at the end of the text item without highlighting the text.
I have a text item field when I query it and tab to the field, it highlights the whole text inside the block item. Users sometimes type without thinking so, we made it set the cursor at the end.
I know in 6i forms there was a client package (d2kwutil) that accomplished this and if I have too, I'll use it via the WebUtil. I just was not sure if there was anything in 10g forms that accomplished the same task.
Any help is appreciated.
Chris
Hello,
You can also use the good old win_api_shell.sendkeys() d2kwutil function, that works also fine with Web versions.
For instance, in a When-New-Item-Instance trigger:
win_api_shell.sendkeys(get_window_property('WINDOW1',window_handle),'{End}',TRUE); Francois
Similar Messages
-
How to position the cursor at the end of the text with EDIT_TEXT?
Hello, it wanted to ask to them if somebody could make work the module of function EDIT_TEXT so that it positions the cursor at the end of the text that is visualizing in the text editor. In the documentation it says that passing a ' X' to him in the field scrollend of the parameter Control is obtained that operation. Nevertheless, I did this and the cursor continues appearing at the beginning of the text that visualizes.
Somebody could help me please?
Regards,
Gabriel
PD: The code that I use is the following one:
FORM f_ingresar_comentarios.
DATA: l_action,
l_result LIKE itcer,
l_pedido LIKE thead-tdname,
li_coment_save LIKE i_comentarios OCCURS 0,
li_coment_aux LIKE i_comentarios OCCURS 0 WITH HEADER LINE,
l_lines TYPE i,
l_lines_save TYPE i,
l_lines_insert TYPE i,
l_index TYPE i,
l_index_aux TYPE i,
l_insert,
lwa_control LIKE itced.
CLEAR: l_action.
CLEAR i_comentarios.
REFRESH: i_comentarios,
li_coment_save,
li_coment_aux.
l_pedido = v_pedido.
Leemos el texto si es que existe
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = v_id_text
language = sy-langu
name = l_pedido
object = c_ekko
IMPORTING
header = wa_cabecera
TABLES
lines = i_comentarios "Lineas de texto leídas
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
Armamos la cabecera por primer comentario para el pedido
CLEAR wa_cabecera.
wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
wa_cabecera-tdname = v_pedido. "Nro de pedido
wa_cabecera-tdid = v_id_text. "ID en tabla TTXID
wa_cabecera-tdspras = sy-langu. "Lenguaje
wa_cabecera-tdlinesize = 70.
ENDIF.
Salva comentarios originales
li_coment_save[] = i_comentarios[].
lwa_control-scrollend = c_x. " c_x = 'X'
Abre el editor de texto
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
header = wa_cabecera
save = space
control = lwa_control
IMPORTING
newheader = wa_cabecera
function = l_action
RESULT = l_result
TABLES
lines = i_comentarios
EXCEPTIONS
object = 1
id = 2
language = 3
name = 4
linesize = 5.
Si cambio los comentarios, actualiza comentarios
CASE l_action.
WHEN c_unchanged.
WHEN c_delete.
WHEN c_update OR
c_insert.
Obtiene cantidad de lineas de comentarios originales y modificados
DESCRIBE TABLE li_coment_save LINES l_lines_save.
DESCRIBE TABLE i_comentarios LINES l_lines.
Si se insertaron lineas...
IF l_lines > l_lines_save.
Calcula cantidad de lineas a insertar para luego calcular valor de
indice a partir del cual insertar los nuevos comentarios
l_lines_insert = l_lines - l_lines_save.
l_index = ( l_lines - l_lines_insert ) + 1.
Controla que al menos una de las lineas insertadas sea diferente de
blanco
l_index_aux = l_lines.
l_insert = c_n.
DO l_lines_insert TIMES.
READ TABLE i_comentarios INDEX l_index_aux.
IF sy-subrc = 0 AND
i_comentarios-tdline <> space.
l_insert = c_s.
EXIT.
ENDIF.
l_index_aux = l_index_aux - 1.
ENDDO.
IF l_insert = c_s.
Carga comentarios originales y agrega lineas insertadas
li_coment_aux[] = li_coment_save[].
APPEND LINES OF i_comentarios
FROM l_index
TO l_lines
TO li_coment_aux.
Setea variable para indicar actualizacion de comentarios.
v_comentario = 'S'.
Agrega usuario y fecha del comentario
CONCATENATE sy-uname
sy-datum
INTO li_coment_aux-tdline
SEPARATED BY space.
li_coment_aux-tdformat = '*'.
APPEND li_coment_aux.
Grabamos el texto
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = wa_cabecera
savemode_direct = c_x
IMPORTING
newheader = wa_cabecera
TABLES
lines = li_coment_aux
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " f_ingresar_comentarios
In addition, I made another program simpler that it uses the same functions and also have the same problem:
*& Report Y_GVA_TEXT *
REPORT y_gva_text .
DATA: wa_cabecera LIKE thead,
i_comentarios LIKE tline OCCURS 0 WITH HEADER LINE.
DATA: l_action,
v_comentario,
l_result LIKE itcer,
v_pedido LIKE thead-tdname VALUE '3',
l_pedido LIKE thead-tdname,
c_a05 LIKE thead-tdid VALUE 'A05',
c_ekko LIKE stxh-tdobject VALUE 'EKKO',
l_lines LIKE sy-tabix,
lwa_control LIKE itced.
CONSTANTS: c_x VALUE 'X',
update VALUE 'U', "Langtext verändert
insert VALUE 'I', "Langtext eingefügt
delete VALUE 'D', "Langtext gelöscht
modify VALUE 'M', "Kein Langtext, Inlinezeile veränd.
unchanged VALUE ' '.
CLEAR: l_action.
CLEAR i_comentarios.
REFRESH i_comentarios.
Leemos el texto si es que existe
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = c_a05
language = sy-langu
name = v_pedido
object = c_ekko
IMPORTING
header = wa_cabecera
TABLES
lines = i_comentarios "Lineas de texto leídas
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Armamos las cabecera para mostrar los comentarios
CLEAR wa_cabecera.
wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
wa_cabecera-tdname = v_pedido. "Nro de pedido
wa_cabecera-tdid = c_a05. "ID en tabla TTXID
wa_cabecera-tdspras = sy-langu. "Lenguaje
wa_cabecera-tdlinesize = 70.
ENDIF.
lwa_control-noendlines = c_x.
lwa_control-scrollend = c_x.
Abre el editor de texto
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
header = wa_cabecera
save = space
control = lwa_control
IMPORTING
newheader = wa_cabecera
function = l_action
RESULT = l_result
TABLES
lines = i_comentarios
EXCEPTIONS
object = 1
id = 2
language = 3
name = 4
linesize = 5.
Si cambio los comentarios, actualiza comentarios
CASE l_action.
WHEN unchanged.
WHEN delete.
WHEN update OR
insert.
Agrega usuario y fecha del comentario
CONCATENATE sy-uname
sy-datum
INTO i_comentarios-tdline
SEPARATED BY space.
i_comentarios-tdformat = '*'.
APPEND i_comentarios.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = wa_cabecera
IMPORTING
newheader = wa_cabecera
TABLES
lines = i_comentarios.
ENDCASE.Murugesh,
I believe that you have mis-read Gabriel's problem.
Gabriel,
The cursor is not positioning at the base of the editor as you have cited.
In order to get this functionality to work, you must set the LINE_EDITOR import paramter to 'X'.
data: hdr like THEAD.
data: l_itced like itced.
hdr-tdobject = 'VBBP'.
hdr-tdname = '4000029521000030'.
hdr-tdid = 'Z005'.
hdr-tdspras = 'E'.
hdr-TDLINESIZE = '100'.
hdr-TDTXTLINES = '3'.
l_itced-SCROLLEND = 'X'.
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
DISPLAY = ' '
EDITOR_TITLE = ' '
HEADER = hdr
PAGE = ' '
WINDOW = ' '
SAVE = 'X'
LINE_EDITOR = 'X' " here !!!
CONTROL = l_itced
PROGRAM = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
RESULT =
TABLES
LINES = lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
LINESIZE = 3
NAME = 4
OBJECT = 5
TEXTFORMAT = 6
COMMUNICATION = 7
OTHERS = 8
Don't forget those points !! -
REGARDING position the cursor at the end of the field
i friends,
i have a field having length of 20 ,i need to place the cursor at the end of the filed means at the 20 th position the cursor must be there how will i acieve this...plz help me the value which i will pass to this field is may be of character 4 ,5 what ever but the cursor will be always at the 20th position or at the end of the filed plz help me.......parameters:pa_str(20) type c default '11111111111111111111' .
initialization. .
Set cursor field 'PA_STR' offset 20. -
How to highlight a line in a text stream and position the cursor at the end.
I would like to select a line in a text control data stream, highlight the text, and place the cursor at the end of the line so that the text control can be edited at that point.
Depends on what you mean by "highlight". If you mean highlight in the sense of when you use the mouse to select text, then you can't do that and then place the cursor at the end, since that would effectively "unhighlight" the text. You need to use a different kind of "highlight", like turning the text bold or something. This KB article talks about highlighting particular characters: How Do I Highlight Particular Characters in a String Control?
See attached for simple example. Modify as needed.
Attachments:
Text Select.vi 19 KB -
Set the cursor in the middle in XYGraph
hi how to set the cursor in the midde programmatically?
need help plz?
for labview 8.0Here's a simple example (LV 8.0) showing how you can center the cursor with a button press.
Message Edited by altenbach on 06-18-2008 11:35 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
CenterCursor.png 13 KB
CenterCursor.vi 22 KB -
Other ways to send the cursor to the end of the text
Hi everybody
Is there any other way to send the cursor to the end of the textfield except win_api_shell.sendkeys and keep cursor position.
Because when I use keep cursor position property.. it is not working properly when i programatically write go_block and return back to this block.
win_api_shell.sendkeys is working fine but, it is not giving me the desired results...
so can any1 please suggest other ways to do it.....
Thanks in advanceYou could use a global to deactivate this trigger before using ther sendkeys(), then reactivate it after
KEY-PRESSED trigger
If :global.fire = 'true' then
-- do the job
end if ;your code:
:global.fire := 'false';
win_api_shell.sendkeys()...
:global.fire := 'true';Francois -
How can I replace the cursor in the below query?
I have this below query which calls a stored procedure that takes only 1 item's attributes at a time. But because of performance problems we are
required to remove the cursor. How can I replace the below cursor logic with set operations or CTE? Please advice.
DECLARE db_cursor_ava CURSOR
FOR
SELECT t.[agent-id],
t.[start-date],
t.[end-date],
t.[monitor-days],
t.[monitor-start],
t.[monitor-end],
t.[timezone-offset]
FROM @tmpAgentPeriodTimeRange t
OPEN db_cursor_ava
FETCH NEXT FROM db_cursor_ava INTO @agentID_ava,
@stDateTime_ava,
@endDateTime_ava,
@monDays_ava,
@monSt_ava,
@monEnd_ava,
@offset_ava
WHILE @@FETCH_STATUS = 0
BEGIN
DELETE
FROM @tmpMonitorPeriod
DELETE
FROM @tmpFinalResult
SET @runID = 1
IF(@endDateTime_ava>DATEADD(MI,@offset_ava, GETUTCDATE()))
BEGIN
SET @endDateTime_ava=DATEADD(MI,@offset_ava, GETUTCDATE())
END
INSERT INTO @tmpMonitorPeriod
EXEC core.usp_GetMonitoringPeriod
@startDate = @stDateTime_ava,
@endDate = @endDateTime_ava,
@monitoringDays = @monDays_ava,
@monitoringStart = @monSt_ava,
@monitoringEnd = @monEnd_ava
SELECT @maxID = MAX(tm.id)
FROM @tmpMonitorPeriod tm
FETCH NEXT FROM db_cursor_ava INTO @agentID_ava,
@stDateTime_ava,
@endDateTime_ava,
@monDays_ava,
@monSt_ava,
@monEnd_ava,
@offset_ava
END
CLOSE db_cursor_ava
DEALLOCATE db_cursor_ava
mayooran99You've been down this path before - and the response is exactly the same.
how to replace cursor logic
And I'll suggest that you post the entire code - since you repeatedly delete 2 table variables but only populate one. The setting of @maxID also seems to have no purpose. And perhaps the issue here isn't the cursor but the general approach. Who knows
- but it appears you may have prematurely assumed that the cursor is the problem. -
Center the cursor on the Waveform Graph?
I have a waveform graph where the user can adjust the scale on both the X and Y axes. The "problem" that I am having is that if the scale's range is set too far from where the cursor is at, the cursor will be off screen and not selectable. So, I am trying to center the cursor to the scale when the scale is changed or via a button. Here is the code that I have written for one of the Cursor plots:
Select Case setBlueCursor
Case 1
blueCursorPt.Plot = plotInlineTorque
inlineTorqueMax = yAxisInlineTorque.Range.Maximum
inlineTorqueMin = yAxisInlineTorque.Range.Minimum
blueCursorStartY = (inlineTorqueMax + inlineTorqueMin) / 2
blueCursorStartX = (XAxis.Range.Maximum + XAxis.Range.Minimum) / 2
blueCursorPt.YPosition = blueCursorStartY
blueCursorPt.XPosition = blueCursorStartX
This code will center the cursor like I want but then I can't move the cursor after that as it is "stuck" at the position that I have coded it. The problem appears to be with the last two lines of code here. I do not know of any other way to do this though. I have tried the "moveCursor" method but the end result ends the same way, with the cursor stuck in the center and can't move. Any help on a solution? Is there a better, easier way to do this? I'm new to Measurement Studio and .NET.
Thank youThis code works. It appears that I was calling the subroutine that this code is located in over and over in another part of my program.
-
Place the cursor at the begin of the Input field [Parameter]
All,
I have a input field in a report, i need to place the cursor in the First position of the field, currently cursor stop always in the last.
PS : I have unchecked the Options> cursor> positions cursor at end of text
Is it any other setting i need to look ?
a®Thanks Naren,
This is documentation i found on the right justified checkbox in layout
Text
Right-justified display
Definition
When you activate this attribute, any output in the field is right-
justified. In the case of numeric formats, right-justified output is
also effective in input fields.
Its working in RF
a® -
I imported my i photo library into aperture.
I can see the i photo events in aperture library as events with the number of photos in each event.
When you click events in the aperture library no photos appear although if you roll the cursor over the event icon it show the photos. If you click on the event either on the event icon or in the library no photos appear.
HelpCheck, if you have any filters set. The search fields in the Insector panel and the browser should be showing "All items" or "Showing All".
The Browser search field could be set for each project and album individually, so you have to check it for each project.
Regards
Léonie
For example: The projects count shows "20 items", but the browser is empty, because the project's filter is set to show only rejected items. -
I can't see the cursor on the logon screen with my MBP when using it in bright sunlight.
I have a 15 inch MacBook Pro with an anti glare screen. I am running Lion 10.7.3.
It is being used in bright sunlight in southern greece very sucessfully apart from the fact I cant see the cursor on the logon screen to select the user I want to log in as. .
Setting the cursor to a larger size using the universal access options works really well once I have logged in but at the moment I have to dash for the nearest shade to be able to see the screen to log in.
Any suggestions? A key sequence to swap between users on the logon screen would do (there are only two)If you're using it in bright light, you may be getting sunlight through the back of the machine which can wash out the display. The Apple logo on the back of the lid is actually a cut-out that uses the systems back light to make it glow. Bright light (especially sunlight) can actually shine through the back. As the users in the login are typically in the middle of the display, this is the area most likely to be washed out as that is where the Apple logo is. You can try just putting your hand over the Apple logo on the back to block the sunlight when trying to log in.
-
Dear support,
dear LV users,
selecting "bring to center" for a free cursor in a XY graph does not
bring the cursor into the center of the graph, but instead the command brings it to the
mean/average value. This is not an issue for a linear mapping
of the axis [due to the fact that the center of the axis is equal to
the middle/average value of the end points on the axis]. But when
mapping of the axis is logarithmic, the cursor ends up on the top of
the screen. That is because the average value of the end points
(min(y_axis)+max(y_axis))/2) is not equal to the center of the axis.
Is that a wished behavior, please?
Example: For an y_axis = [1..100], the awaited center position would be at
10 and not at 50.5. The center position for the logarithmic mapping
should be calculated as (log(min(y_axis))+log(max(y_axis)))/2, IMHO.
Kind regards,
Solved!
Go to Solution.You are right, LabVIEW chooses this form (min(y_axis)+max(y_axis))/2).
You can go to "idea exchange".
Link:
http://forums.ni.com/t5/ideas/v2/ideaexchangepage/blog-id/labviewideas
here you can see how many people like your idea.
Perhaps it will be considered in the next version of LabVIEW. -
How to programmatically move the cursor to the "To" field of a new AppointmentItem?
I need to move the cursor to the "To" field of all new AppointmentItems which are created through my Outlook Addin. How I can achieve this?
Thanks in advance.
Thanks PrasadHello Prasad,
The Outlook object model doesn't provide anything for that. You need to use Windows API functions or use
Accessibility API to set the cursor programmatically. -
How can i change the Cursor for the hole frame?
I think this is quite a simple question:
I would like to change the cursor for the hole Frame, while the programme is reading data from database.
but with frame.setCousor(...) i get a compiler-error.
Thank youI think this is quite a simple question:
I would like to change the cursor for the hole Frame,
while the programme is reading data from database.
but with frame.setCousor(...) i get a compiler-error.
Thank youHello,
there shouldnt be any compiler-error.
Post some code and we will help.
docs:
/**Sets the cursor image to the specified cursor.
This cursor image is displayed when the contains method for this component returns true for the current cursor location,
and this Component is visible, displayable, and enabled.
Setting the cursor of a Container causes that cursor to be displayed
within all of the container's subcomponents, except for those that have a non-null cursor.*/
public void setCursor(Cursor cursor)regards
tim -
I was working on an email last night and must have set something on which I do not want. When I state firefox, it comes up full screen but without any menu or toolbars. Even when I move the cursor to the top of the scrren to reveal what is there, there still is no menu or toolbars showing.
If you run Firefox in full screen mode then press F11 or Fn + F11 to toggle (Mac: command+Shift+F).
Maybe you are looking for
-
Any transaction to see the content of IDOC field ??
HI Gurus, We have 1000's of Idocs of a particular type processed correctly in our system. However one of them had BAD data, which also got processed in SAP. So I am trying to find out which IDOC it was. Going through WE02, its proving very difficult
-
I have just moved out of a shared flat and into another shared flat as a temporary measure. In the old place I used to be the account holder. I was there for just over a year and had an 18month contract for infinity (I was not expecting to have to mo
-
Hi, I want to send the invoice to customer whenever it was released to accounting in VF02. i have maintained the customer e mail in master data. Where i have to do the configuration. Sateesh
-
Sorry for the lame subject, but it's the best I could do. :) Anyway, I 'want' something, but I could use some advice on how to accomplish it. Here's what I've been trying to realise: - A simple master-detail scenario - One of the detail records has b
-
Hana Paramter is static or dynamic
Hi Team, how we can justify whether have to take restart of hana db after changing or adding parameter value in .ini files(indexserver.ini,nameserver.ini, statisticsserver.ini or xengine.ini) or not in hana studio, to take changes effective on the