Im having issues reguarding the touchscreen mode on vision in a web component.
On most of text inputs inside the web component, it seem to work fine, but on certain text inputs inside a popup from the website it sometimes doesnt seem to work.
Could someone check this out? This links to a common used ui framework where the bug appears in its popup modal component.
This frameworks basic input fields work, but the one from the popups sometimes do not... If it fails once it seems to fail for the whole session untill the client has restarted, but even than it isnt guarenteed to work again.
Any ideas on how to test this further or zone in on a solution?
I can modify the website we are trying to display in vision, So if someone knows a javascript way to trigger the keyboard to popup by force if nothign else works...
I tried turning on jxbrowsers debuging tools through jvm but was unsuccesful...
Any ideas are welcome
What version of the web browser module are you using? If it's older than (I think) 8.1.34, it's got a super old version of Chromium embedded, so this might just be a fixed bug.
Possibly something fruitful in the JxBrowser API docs:
Though I have no idea if the Javascript-calling-Java convention will work from Jython: JavaScript | JxBrowser
Edit:
meh...
quite some work and not really ideal as it requires some changes on the website... so this only works since i can add it on the js...
Also weird that the window.getSelection() is the parent div and not the input...
But it seems to be that way even on the inputs that do work with native keyboard
i gonna test this some more tmw
from com.teamdev.jxbrowser.browser.callback import InjectJsCallback, BrowserCallback
from com.teamdev.jxbrowser.js import JsAccessibleTypes
from java.lang import Class, Object
from jarray import array
browser = system.gui.getParentWindow(event).getComponentForPath('Root Container.Web Browser').browser
class obs(InjectJsCallback):
def __init__(self,fn):
self.on=fn
class JavaToJsObject:
def openIgnitionKeyboard(self):
if system.gui.isTouchscreenModeEnabled():
test = system.gui.showTouchscreenKeyboard("")
frame = browser.focusedFrame()
if frame.isPresent():
frame.get().executeJavaScript("window.ignitionValue = '"+test+"'")
frame.get().executeJavaScript("window.getSelection().baseNode.querySelector('input').value = window.ignitionValue")
JsAccessibleTypes.makeAccessible(array([Class(JavaToJsObject()),Class(JavaToJsObject)], Class))
def addJavaCallToBrowser(params):
window = params.frame().executeJavaScript("window");
window.putProperty("java", JavaToJsObject());
return InjectJsCallback.Response.proceed();
browser.set(InjectJsCallback,obs(lambda event: addJavaCallToBrowser(event)))
and called it like this in on onclick in the textfield in javascript: