Thttpserver::createitem

I need documentation about this method and also setItemField and getitemfield
What these methods do?
Can they be used to set an UI in a custom web app?
How can I send html code to the client?
Thank you


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi,

Maybe I overlooked at it, but I don’t see any createitem or setItemField in the THttpServer Reference or in the HttpServer Documentation. Maybe @linev has an idea of what you’re asking for…

Cheers, Bertrand.

Hi

Can they be used to set an UI in a custom web app?
How can I send html code to the client?

It is very much depends from that you want to do.
There is example tutorials/http/custom.C and tutorials/http/custom.htm,
which demonstrates usage of fully custom HTML for http server.

Another example is httptextlog.C and httptextlog.js shows how one can implement alternative draw function and how request to server can be improved for some custom applications.

I need documentation about this method and also setItemField and getitemfield
What these methods do?

These methods set properties for custom elements in objects hierarchy, which are “visible” from the client side with h.json request. For instance, they are used to supply custom properties for command, registered to the THttpServer.

JavaScript ROOT, which is used on client side, use some of these custom properties. There is no full documentation about them - only simple examples shown in httpcontrol.C and httpaccess.C tutorial macros. Like configure items which are drawn by default:

serv->SetItemField("/","_monitoring","5000");
serv->SetItemField("/","_layout","grid2x2");
serv->SetItemField("/","_drawitem","[hpxpy,hpx,Debug]");
serv->SetItemField("/","_drawopt","col");

Actually, these are most properties you can set.

Regards,
Sergey

ok, thank you.

About custom html code is there a way to link another html file from a link in a main html file?

I want to develop an UI in a main.htm and, from here, I want a link to start a calibration.htm file that draw another UI.

I tried by playing with tutorials/http/custom.C but with no success. I think that I need to set a folder for the http server to look for local html file (something of that should be possible with apache server for example)

If you are using custom.htm example - you can use any valid HTML syntax to organize your web page.

in custmo.C macro you can set full path to the html file, which will be shown in the browser when typing main page. Like:

serv->SetDefaultPage("/data/html/datacustom.htm");

If you want to reference other html pages from main page, you have to register file folder to the server:

serv->AddLocation("more", "/data/html/more");

In this case web pages from “/data/html/more” folder can be accessed with URL “http://localhost:8080/more/calibration.htm”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.