B4J Question SOLVED: Basic Buttons on RPi Server

lip

Active Member
Licensed User
Longtime User
I have a very basic text HTML page which I use to monitor and debug my nonUI Raspberry Pi app.

I can pass parameters to it in the url and handle them.

I can also create a Button that appears on my page.

How do I persuade the button to do something?

I started looking through the Server Example which I can see does this. I can see the Handler in Guess, but where is the button defined?

I have searched the forum for 'Button' but struggled to find anything.

Thanks
 

derez

Expert
Licensed User
Longtime User
The attached file, index.html, is in the www directory, each button's function has its handler in the server.
 

Attachments

  • index.zip
    716 bytes · Views: 148
Upvote 0

lip

Active Member
Licensed User
Longtime User
Thanks - I had not spotted index.html

Forgive me, I have spent years on B4A but only just started B4J and have absolutely no clue about servers or HTML or webpages yet!!!

I have not created any ***.html files in my project. I have just created Handler Classes and used resp.write to put information onto the pages.

So I cannot really create buttons directly in B4J. I need to create a ****.html file with the buttons?
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
SOLVED: This was what I was looking for:-
Resp.Write("<a href='http://" & Main.myLocalIP & ":8888/CommandLog'><button type=button>CommandLog</button></a>")
 
Upvote 0
Top