How to pass template text to bean from the JSF page -


i have check box has long description. want pass description in email if user selected check box.

i don't want write same description in end bean , jsf page. instead want pass front end description bean.

how can in jsf

<h:selectbooleancheckbox value="#{contactusbean.subscribenewsletter}" /> receive news letters company abc.........  

and long lengthy description need pass bean.

put span around want grab id. on form submission grab content javascript , put in hidden input field , in bean. or, know, write in bean or bundle , grab there.

to grab bundle file:

create package named "strings" or whatever want call it. create file named "strings.properties".

in write content :

content=bla bla bla. 

then grab file such:

private final static string bundle_basename = "resources.strings.strings"; private resourcebundle bundle = resourcebundle.getbundle(bundle_basename,         facescontext.getcurrentinstance().getviewroot().getlocale()); string content = bundle.getstring("content"); 

to write on jsf page:

    <f:loadbundle basename="resources.strings.strings" var="pmsg" />      #{pmsg.content} 

for other method, javascript documented well:

mycontentelem = document.getelementbyid("id"); mycontent = mycontentelem.innerhtml; getelementbyid("hiddeninput").value = mycontent; 

srsly put in bean or bundle, retarded. if don't want write twice use el expression don't write in jsf page.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -