So I am trying to make a HS4 plugin from scratch(used to be HS3 plugin). It's been ok so far, but now I am starting with the feature pages. And I have little/no experience with HTML, Javascript etc. I tried to google it and found some usefull tips. But I still cant figure it out. So what have I done:
-Started with the "blank page" from the sample
-Added a button to it, with some javascript that I found by googling.
-Added the PostBackProc function in the HSPI class.
But, I can not get PostBackProc to trigger when pushing the button. I have no idea what I am doing wrong here. Please help
Code:
-Started with the "blank page" from the sample
-Added a button to it, with some javascript that I found by googling.
-Added the PostBackProc function in the HSPI class.
But, I can not get PostBackProc to trigger when pushing the button. I have no idea what I am doing wrong here. Please help

Code:
Code:
public override string PostBackProc(string page, string data, string user, int userRights) { HomeSeerSystem.WriteLog(HomeSeer.PluginSdk.Logging.ELogType. Error, "Postback: ", Name); return ""; }
HTML Code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!--This maintains the scale of the page based on the scale of the screen--> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="HomeSeer Technologies"> <!--This liquid tag loads all of the necessary css files for HomeSeer--> {{includefile '/bootstrap/css/page_common.css'}} <title>Sample Blank Feature Page</title> </head> <body class="body homeseer-skin"> <!--These liquid tags add the HomeSeer header and navbar to the top of the page when appropriate--> {{includefile 'header.html'}} {{includefile 'navbar.html'}} <!--Primary container for the page content The .container class ensures the page content is fit and centered to the screen--> <div class="container"> <!--This is an intentionally blank page that you can use as a blueprint to create feature pages from--> <button type="button" class="btn btn-default" action="button_press">Save</button> </div> <script> $(document).on('click','button', {} ,function(e){ var data; $(this.attributes).each(function() { var parts = this.nodeName+"="+this.nodeValue; if(data==null) { data = parts; } else { data = data+"&"+parts; } }); var fdata = $(this.form).serialize(); if(fdata != null) { data = data+"&"+fdata } AjaxPost(data,"teslaSeerTest/blankTest.html"); }); </script> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> {{includefile 'bootstrap/js/page_common.js'}} </body> </html>
Comment