I have a form with <p:inputText> and <p:selectOneMenu> components next to each other. When the focus is on the input text and I press the tab key in order to navigate to select one menu by keyboard, then the focus is lost. I don't see which component is focused.
How can I get the focus on the select one menu when I tab into it?
You need to use the tabindex property of <p:inputText> and <p:selectOneMenu>, as explained in the documentation.
Using the tabindex property makes it possible to navigate between <p:inputText> and <p:selectOneMenu>. What worked for me was to see set the tabindex in <p:inputText> to n and n+1 in <p:selectOneMenu>. I used n = 90.
Related
Is there any way we can set the combo box not focusable? Because every time I select an item from combo box (drop down list), the keyboard shows up and the text from drop down list can be edited. I can't find any property from property inspector to disable this up. Or maybe we can disable this one programmatically in which I don't know.
Consider using an Option Menu (unlike a Combo Box an Option Menu has no field which a user can type into - and therefore no unwanted appearance of the keyboard)
Dave
The default script for a combo box is a menuPick handler. Whether or not you use the functionality of that handler or not, you would add this line at the end of that handler:
I want to disable focus for button in composite component.
I have a component that looks like this:
When I'm pressing the "Tab" key, first the inputText component is focused, then the commandButton component is focused.
What I want is to have focused only the inputText.
How can I achieve this?
<h:commandButton ... tabindex="-1">
The
attribute tabindex defines in which order the component will be selected in the tab cycle. Documentation for h:commandButton states for attribute tabindex:
Position of this element in the tabbing order for the current
document. This value must be an integer between 0 and 32767
But i guess above can be ignored, as on the other hand w3c states (for html5):
If the value is a negative integer
The user agent must set the
element's tabindex focus flag, but should not allow the element to be
reached using sequential focus navigation
I have a Delphi 6 application that has a TJvListView control. I have a popup menu tied to that control via the control's PopupMenu property. What I would like to do is show a different popup menu based on which column the user had the mouse over when they right clicked, with the additional option to not show a popup menu at all if the current column does not need one. How can I do this?
Thanks to this detailed sample by Remy Lebeau on in-place editing in a TListView I know what row and column the mouse is over except for one wrinkle. The mouse down event where I determine the current row and column occurs after the popup menu is exited.
I now need to know two things. First, how can I get some event to fire before the popup menu shows after a right mouse click so I can record the current list view row and column and suppress the popup menu if I want to, and second, how I can show a different popup based on the current column. I am hoping to avoid having to write a bunch of mini-forms instead of using the TListView PopupMenu property and supporting code. Is there a simple solution, perhaps some fancy footwork in a sub-class I should create around TJvListView?
You could perform the detection in mousemove instead of mousedown/Click and change the popupmenu depending.
You also could remove any popupmenu and call the wished via p.pupup in mousedown as you desire.
When you select multiple nodes of a JvTreeView, and then try to drag these nodes, the JvTreeView selects the node you clicked to drag, rather than initiating dragging all the selected nodes. You end up dragging only this single node.
Is it possible to drag multiple nodes in a JvTreeView? I am using Delphi 2007.
UPDATE: Oddly enough, if I hold down CTRL+SHIFT when dragging the items, I can successfully drag them all. Any ideas?
Suppose MultiSelectStyle is the default [msControlSelect], then the answer to your question is 'you don't release the control key when you're selecting the last item and beginning dragging'.
The culprit is in TJvTreeView.WMLButtonDown in JvComCtrls.pas. Code there tests if 'Ctrl' is pressed when the TreeView is MultiSelect, and clears all items and selects the clicked item if 'Ctrl' is not pressed. It should instead test if the clicked item is already selected and do nothing if it is.
You can see the broken behavior without dragging. Multi select a few items and then click a selected item with the mouse. The VCL TreeView do not select or de-select anything, while the JVTreeView, instead, de-selects all items and selects the clicked one.
Yes absolutely, I do it all the time.
Of course Multi-Select needs to be True and you may need to have a look at the TTreeView's MultiSelectStyle. That controls what type of nodes can be selected at the same time. For example if msSiblingOnly is set to true, you can only select sibblings.
Are you using dmAutomatic or dmManual. If the latter, it could be that you are doing something in the OnMouse* events that is negating the multi-selection you made earlier.
How can I force the Tab to focus the element I want, is it possible to give my software a list of elements to cycle focus ?
I remember once using a property called tabindex, but I can't find it anymore.
Maybe, preventing Tab to focus an element could also work ?
Yes, you can set the order of focusing for each widget in a container, using the function container.set_focus_chain().