Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

popup problem  RSS feed

 
Dan MacLeod
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!