• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

popup problem

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A popup page is displayed when the button is clicked, but it's title is "about:blank". I'm not sure why this is being displayed. My mangagedBean.print method is never called.

JSF PAGE snippet
BUTTON THAT STARTS THE PROCESS
<hx:commandExButton type="submit" value="Print" styleClass="commandExButton"
id="printButton"
onclick="doPopup(this); return false;">
</hx:commandExButton>

JSF PAGE JAVASCRIPT THAT GETS CALLED BY BUTTON
function doPopup(source) {
popup = window.open("","printPopup", "height=900, width=900, toolbar=yes, menubar=yes, scrollbars=yes");
popup.openerFormId = source.form.id;
popup.focus();
document.getElementById("subview1:viewFragment1:hidden:go").onclick(null);
}

JSF PAGE HIDDEN FORM THAT GETS SUBMITTED
<h:form id="hidden" target="printPopup">
<h:commandLink id="go" action="print">
</h:commandLink>
</h:form>

POPUP PAGE SNIPPET
<h:outputText styleClass="nms_outputText" style="height: 400px; width: 388px; overflow: visible" escape="false"
value="#{commonJSFCode.print}">
</h:outputText>

FACES-CONFIG.XML SNIPPET
<managed-bean>
<managed-bean-name>commonJSFCode</managed-bean-name>
<managed-bean-class>pagecode.CommonJSFCode</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>

MANAGED BEAN SNIPPET
public String getPrint() {

do stuff...
return "";
}
 
Dan MacLeod
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the problem, somehow my IDE imbedded another <hx:viewFragment tag in my code, so my form ID was not correct.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic