I am trying to build a Web Application using WebSockets and jquery with Kiffi's UI Classes.
I need to know, how I can accomplish the 'Back' functionality of the browser in use (ex. history.go(-1) ) from within the _Click Event of a UIButton.
Could it be implemented using a javascript string and execute the script with jScriptEngine as follows?
Private Sub myButton_Click(Params As Map)
Dim jse as jScriptEngine
jse.evalString("window.history.go(-1);")
End Sub
I have achieved to implement the Back functionality using the following code, but the dynamically
created HTML Button does not match (Visually) with the rest of UIButtons.
Code:
Sub Class_Globals
Private WS As WebSocket
Private myBut As UIHtmlElement
End Sub
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
WS = WebSocket1
myBut.Initialize(WS, "myBut", "button")
myBut.Resize(50,80,-1,-1)
myBut.SetCss("border","0px transparent")
myBut.SetCss("background-color","transparent")
myBut.AppendHtml("<button class='button' style='-webkit-border-radius:13px; height:60px; width:100px' onClick='history.go(-1);return true;' id='mybut'>Back</button>")
End Sub
Any suggestions are welcome.
Regards
Chris