I am completely new to webprogramming, I never made anything that goes in that direction. But for some reason I now want to know how it works. Since I am familar with scala i tried the lift framework.
I want to create a Button that does nothing more than notifying the server that the button was pressed.
At the moment my button is:
<input type="submit" value="chat"/>
开发者_高级运维and the notification of the server works with
SHtml.hidden( makeRequest _ )
But somhow this feels very stupid. It works, and it looks like how I want it to look like. But creating a hidden form element, just because i cant bind a function to a button element feels so ... yea I can't find a better word than stupid.
SHtml.submitButton(makeRequest _)
Is also very strange. I can't give a name to it (why?) and the function is not called when pressed (why?)
Have you wrapped the XML/HTML template with a form attribute? Apart from that, SHtml.submit("button name", makeRequest)
should usually work.
Have a look at Exploring Lift.
精彩评论