B4J Question Web and jServer

besoft

Active Member
Licensed User
Longtime User
Hello, I am making a simple web application using the jserver library (B4J).
I got to the point that I generate a page , populate a table with data, everything works ok.
I would like that when I click on a row in the table I get back the values in the table in LOG().
I have looked at several examples, but I can't seem to figure out the right way.
Can anyone help ?
click() function on a table row:
$("#table1").on("click", "tr", function() {
    var $name = $(this).children("td:eq(1)").text();
    document.getElementById("uco_serial").innerHTML = $name;

    var $opomba = $(this).children('td:eq(0)').text();
    document.getElementById("id_status").innerHTML = $opomba;

    });

I am interested in the values "uco_serial" and "id_status" . I can display the values on the page, but I can't "link" them back to the B4J application.
 
Solution
the solution to my problem :
row:
Dim id As Future = lstStudentsID.GetVal

The solution was "hidden" in the WebSocet example.
Thank you for your help.

BR

aeric

Expert
Licensed User
Longtime User
1740988137631.png

This is part of my Web API Server v3 tutorial.

If you are using jQuery, you don't need to use getElementById.
If you are using bootstrap, you can use data-xxx attributes.
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
It's certainly a very good solution, but still a bit challenging.
As the project is almost finished, I just need to know which line has been selected, so I would still like to find a solution to my question.
I have studied the example Guess my number, but I have not managed to get the information back yet.
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
Thank you for your reply and your efforts to help.
As an application everything works fine for me, even the JS script works. I can also display the data from the selected row on the page.
Since I am using jServer and WebSocket, I am just wondering how to properly get all the selected row data back as a response into the B4j application itself.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Since I am using jServer and WebSocket, I am just wondering how to properly get all the selected row data back as a response into the B4j application itself.
Have you checked the DBUtils example?
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
My application is based on this example. However, I will double-check if I may have missed a solution somewhere.
Thank you for your help.
🤝
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
the solution to my problem :
row:
Dim id As Future = lstStudentsID.GetVal

The solution was "hidden" in the WebSocet example.
Thank you for your help.

BR
 
Upvote 0
Solution
Top