Android Question Webview

tariqyounis

Member
Licensed User
Longtime User
Hello All;
I wonder if there is away to track a button press in php file throw the webview. So if some one pressed a button in the php file I can open another b4xpage.
 

JohnC

Expert
Licensed User
Longtime User
Any link that the user clicks on will trigger the webview_OverrideUrl (URL As String) As Boolean event.

You can then check the passed URL to figure out how you want to handle it - for example, open another B4xpage.

But remember that if you do handle the event, then "Return True" in this event so that webview will not try to do anything for the event.
 
Upvote 0

tariqyounis

Member
Licensed User
Longtime User
Any link that the user clicks on will trigger the webview_OverrideUrl (URL As String) As Boolean event.

You can then check the passed URL to figure out how you want to handle it - for example, open another B4xpage.

But remember that if you do handle the event, then "Return True" in this event so that webview will not try to do anything for the event.

thank you JohnC for your reply but I did not get any feed back from the php file. my php file is as follows:
I am trying to know if the user pressed button id="para4".
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<label name="div0" id="div0" data="test2">test</label>
<!-- <p id="para">Some text here</p> -->
<!-- <input type="checkbox" name="div0" id="div0"> -->
</div>
<input type="text" id="para1" value = 1>
<input type="text" id="para2" value = 2 >
<input type="text" id="para3" value = 3 >
<br/>
<input type="button" id="para4" value = 5 >
</body>
</html>
 
Upvote 0

FrostCodes

Active Member
Licensed User
Longtime User
Take a look at my premade example, it should be able to help you
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
thank you JohnC for your reply but I did not get any feed back from the php file. my php file is as follows:
I am trying to know if the user pressed button id="para4".
Only HTTP links are handled by the OverrideURL event. You'll have to use javascript to catch those other button ID clicks.
 
Upvote 0

Similar Threads

Top