08-07-2023 11:31 AM
I am looking for suggestions and feedback regarding methods for setting the tabbing order of controls on a *.gviweb page. From my brief research it appears I will need to modify the html file generated by G Web post build to achieve the desired result.
NOTE: I am a long time LabVIEW developer, where this task is simple, but new to G Web.
NOTE: I am also not an experienced webpage designer. 😲 Yet! 😂
Are there other/better options to address tabbing order of controls in G Web?
Next, I am considering the addition (insertion) of a form to specify the tabindex of controls on the page.
<form>
Field 1 (first tab selection):
<input type="text" name="field1" tabindex=1 /><br />
Field 2 (third tab selection):
<input type="text" name="field2" tabindex=3 /><br />
Field 3 (second tab selection):
<input type="text" name="field3" tabindex=2 /><br />
</form>
example html from here.
However, I have read concerns about this using this method and creating a mismatch between this defined order and that inferred from the DOM. So, would it be better to just sort the generated html code to correct the tabbing order?
I am hoping to create a solution that can be implemented for pages with a handful of control or ones with nested tabs and hundreds of controls.
Thanks in advance for your feedback.
James
Solved! Go to Solution.
08-09-2023 03:19 PM
An update on a method to solve updating tabbing order.
I decided to try sorting the existing lines instead of adding a new form with tabindex values.
The HTML generated creates a couple of lines for each control and they are not in any recognizable order. The order might be based upon the order they were created, but I’m uncertain as I was not the original creator of the code. The attached file illustrates the Initial and Sorted versions of a small section that illustrates the changes to the HTML file for a desired tab order.
For this editing the html file is converted to an array of Lines at the start and back to a string when completed and rewriting the file.
The details of this solution are not universal but provide an outline for one solution.
The control names follow a standard convention with a text description, an underscore and a number.
For examples: ao-alias_1, ao-unit_1, ao-raw-min_1, ao-raw-max_1
After testing this process by FTPing modified html files to the CRIO, a prebuild VI was modified to locate these file paths and perform the sorting of the html files.
Note: These files are in a completely different hierarchy with the G Web development than the RT project and are only linked as part of a web service in the build specification.
08-10-2023 02:33 PM - edited 08-10-2023 02:36 PM
Follow-up as it is somewhat related...
I have my new tabbing order working but ran into a new issue related to the appearance of controls when they get focus. My .css file already had specifications to modify the appearance with hover: and I wanted similar visual effects when tabbing focus: between the controls. This works great for Type: String, Numeric Text & Button, however, not with LED.
Even though I can tab to and past the column of LED controls, I cannot get any styles to apply to the LED. I can verify the focus is on the LED by pressing the space bar to toggle its value.
Does anyone know if the LED Type is excluded by design from accepting focus?
I have also tried focus-visible: with the same results.
Thanks for any suggestions.
James
PS. I'd hate to restart by setting up a tabindex for all controls because of an issue with LED Type.
08-10-2023 04:27 PM
Even though I can tab to and past the column of LED controls, I cannot get any styles to apply to the LED. [...] I have also tried focus-visible: with the same results.
Maybe :focus-within would help?
08-11-2023 08:27 AM - edited 08-11-2023 08:41 AM
Thank you Milan for prompting me to try this!!
I had read about :focus-within and mistakenly discarded the idea based upon a description I read here!
It was the solution I needed for this stubborn control.
Thanks again!!
James
08-11-2023 05:00 PM
Awesome, that's good to hear. Sounds like you have an approach for the current application you are working on. Some thoughts for others who may have similar questions around configuring tab order in G Web:
08-17-2023 10:59 AM
Milan,
Thank you for the additional feedback and suggestions.
For the current G Web capabilities, sorting the HTML provided a better solution than letting the editor control tabbing order. In addition, this solution allowed me to setup a section of related controls to tab by rows and another section to tab by columns.
Thanks again!!
James