I get the current HTML for the page using the JQuery.html () method like this.
<h:outputScript name="js/jquery-1.7.2.js" /> <h:outputScript> function getHtml(){ $('#next').click(function(){ htmlString=$('#wrapper').html(); alert(htmlString); command({param:htmlString}); }); } </h:outputScript>
My XHTML Page
<div id="wrapper"> <form prependId="false"> // My HTML form with some input fields <h:commandButton id="next" value="Submit" action=#{bean.formvalues} onCick="getHtml();"> <h:commandButton> <p:remoteCommand name="command" actionListener="#{bean.getjs}" /> </form> </div>
My bean
@ManagedBean @sessionScoped public class bean{ private String formvalues;
But I can not get the "htmlString" , which has the HTML source code of the page in the bean when I use this goodfaces mainfaces tag. How to get it in a bean.
source share