p:commandButton only works after refresh

Components, Ajax Framework, Utilities and More.
Post Reply
Posts: 44
Joined: 18 Dec 2010, 23:10

18 Dec 2010, 23:17

Hello everybody,

I have the following commandButton which is presenting a wierd behavior. It only works after I completely refresh the page. This issue happens in any browser, and it happens ONLY in the first time I acess the page. I mean, after the refresh, I can even restart GlassFish v3, and the problem won't happen.

Does anyone one know what is happening here?

I am using JSF 2.0 and PrimeFaces 2.1 and the NewsletterBean is @ViewScoped

By the way... any p:commandButton in my application presents this behavior. I wonder if I am missunderstanding how pirmeFaces works.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"

	<link rel="SHORTCUT ICON" href="favicon.ico"/>
	<link type="text/css" rel="stylesheet" href="theme/start/skin.css" />
	<link href="style/template_style.css" type="text/css" rel="stylesheet" />
	<ui:insert name="load_style" />
	<!-- ANALYTICS -->
	<script type="text/javascript">
	  <!-- google analytics code -->


	<div id="top_global"> 
		<div id="top">
			<ui:include src="/includes/top.xhtml" />
	<div id="menu">
		<p:panel id="newsletter_form_panel">
			<p:outputPanel id="output_nl">
			<h:form id="newsletter_form" prependId="false">
				<p:growl id="grow1" showDetail="true" />
				<h:panelGrid columns="4" style="float:left;">
					<h:outputLabel for="nl_mail" value="E-mail:" styleClass="email_label" />
					<h:inputText id="nl_mail" value="#{newsLetterBean.email}" required="true" requiredMessage="Informe seu e-mail!" 
						 validator="emailValidator" />
					<h:selectOneMenu value="#{sessionsBean.currentCity}" converter="cityEntityConverter">
						<f:selectItems value="#{newsLetterBean.allCities}"/>
					<p:commandButton id="save_nl_button2" actionListener="#{newsLetterBean.createNewsLetter}" value="Cadastrar E-mail!" update="output_nl" />
				<span style="float:right; width:300px;">Cadastre-se agora para ficar por dentro das novidades!</span>
				<p:ajaxStatus style="float:right; margin:7px 40px 0 0;">  
				    <f:facet name="start">
					        <h:graphicImage value="/images/ajax-loader.gif" />  
				      <div id="widget"></div>
				    <f:facet name="complete">  
				        <h:outputText value="" />  
			<br style="clear: both;" />
	<div id="content">
		<ui:insert name="content" />
	<div id="footer_global">
		<div id="footer">
			<ui:include src="/includes/footer.xhtml" />

NetBeans 7.3, Glassfish 3.1.2, Java EE 7, PrimeFaces 3.5 , Mojarra 2.1.17

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot], trung.do and 18 guests