partial page processing issue 3.0.M3/2011-08-26

UI Components for JSF
Post Reply
rkrenn
Posts: 33
Joined: 26 Jul 2011, 03:55
Location: Austria

26 Aug 2011, 08:48

hi,

since today 3.0.M3-SNAPSHOT has a problem with partial processing, if containers/elements to process are not specified with default values (like process=@this,@parent, ...):

this still works:

Code: Select all

<p:commandButton ajax="true" process="@this" actionListener=... />
but this fails since this morning:

Code: Select all

<p:commandButton ajax="true" process="some_named_element" actionListener=... />
(actionListener is not invoked any more). This does not happenswith the standard example cases, but e.g. if "some_named_element" is somewhere in a <ui:insert>ed xhtml.

i wonder if this is related with https://code.google.com/p/primefaces/so ... ail?r=5366 (Fix for partial state saving disabled.) / https://code.google.com/p/primefaces/is ... id=2437#c0?
Mojarra 2.1.28, PrimeFaces 3.3.1, Primefaces Extensions 0.7.0, libservlet3.1-java tomcat8, openjdk-8-jdk

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

26 Aug 2011, 09:30

Should be;

Code: Select all

<p:commandButton ajax="true" process="@this some_named_element" actionListener=... />
We were adding @this by default in the past, but it was breaking other things so we left it out and reverted back.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

26 Aug 2011, 09:53

Hello Cagatay,
We were adding @this by default in the past, but it was breaking other things so we left it out and reverted back.
What is default if you don't specify "process" attribute in PrimeFaces? JSF impl. has @this as default in f:ajax http://javaserverfaces.java.net/nonav/d ... /ajax.html I think, PrimeFaces has another default. Right? Were there problems here with @this? Can you remember the reason of that? Would it be not better to have @this as default? Otherwise we have to write in > 50% cases process="@this" instead of omit this attribute completely.
Last edited by Oleg on 26 Aug 2011, 09:54, edited 1 time in total.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

rkrenn
Posts: 33
Joined: 26 Jul 2011, 03:55
Location: Austria

26 Aug 2011, 09:54

thank you very much; applied and works!

edit / oleg's comment: obviously, if you don't specify any "process=" it will use @this as default. only appending @this is mandatory now.
Mojarra 2.1.28, PrimeFaces 3.3.1, Primefaces Extensions 0.7.0, libservlet3.1-java tomcat8, openjdk-8-jdk

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

26 Aug 2011, 10:05

Command components defaults to @all, p:ajax to @this.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

26 Aug 2011, 10:14

Oh, I meant command components of course. So, ajaxified p:commandButton has @all as default and h:commandButton with p:ajax / f:ajax @this as default? Any reason of @all? @all looks like not ajaxified command component, but ajax="true" is default for all PF command components. That means user expects rather @this than @all I think. I would never use implicity process="@all" for p:commandButton. What do you think?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

sfohart
Posts: 2
Joined: 26 Sep 2011, 13:26

05 Oct 2011, 02:21

Is there any problems using <p:commandButton> with components like <p:autocomplete>, or ajaxify events?

For me, this code do not work fine

Image

Uploaded with ImageShack.us

Code: Select all

<p:tab id="dadosItemEntrega" title="#{entregasMsg['entregas.tab.dadosDocumento.titulo']}">
				
	<h:panelGroup id="itemCirculacaoDocumentoForm">
		<fieldset>
			<ul>
				<li class="complex">
					<span class="left">
						<h:outputLabel value="#{condominioMsg['condominio.label']}:"  for="condominio" styleClass="left" />
						<p:autoComplete value="#{circulacaoDocumentoBean.itemCirculacaoDocumento.condominio}" completeMethod="#{condominioBean.completeNomeFantasiaCondominio}"
										label="#{condominioMsg['condominio.label']}" 
										required="true" forceSelection="true" 
										converter="condominioConverter"
										id="condominio" var="c" itemLabel="#{c.nomeFantasia}" itemValue="#{c}">						
																	
							<p:ajax event="itemSelect" 
									update="documento" 
									listener="#{circulacaoDocumentoBean.handleCondominioChange}" 
									process="@this,condominio" />												
						</p:autoComplete>
					</span>
					<span class="right">
						<h:outputLabel value="#{documentoMsg['documento.titulo']}" for="documento" />
						<h:selectOneMenu 	id="documento" value="#{circulacaoDocumentoBean.itemCirculacaoDocumento.documento}" 
											required="true" 
											converter="documentoConverter"
											label="#{documentoMsg['documento.titulo']}" >
							<f:selectItem itemValue="" itemLabel="#{generalMsg['select.empty.label']}" />
							<f:selectItems value="#{documentoBean.documentoList}" var="documento" itemLabel="#{documento.descricao}" itemValue="#{documento}" />
						</h:selectOneMenu>
					</span>
				</li>
				<li>
					<h:outputLabel value="#{entregasMsg['entregas.itemEntrega.observacao.label']}:" />
					<h:inputTextarea  	value="#{circulacaoDocumentoBean.itemCirculacaoDocumento.observacao}" 
										label="#{entregasMsg['entregas.itemEntrega.observacao.label']}" 
										id="observacao"  rows="5" >
						<f:validateLength  for="observacao" maximum="500" />
					</h:inputTextarea>
				</li>
				<li>
					<h:outputLabel value="#{responsavelRecebimentoMsg['responsavelrecebimento.titulo']}" for="responsavelRecebimento"/>
					<p:autoComplete  	id="responsavelRecebimento" value="#{circulacaoDocumentoBean.itemCirculacaoDocumento.responsavelRecebimento}" 
										completeMethod="#{responsavelRecebimentoBean.completeResponsavelRecebimento}"
										converter="responsavelRecebimentoConverter" 
										label="#{responsavelRecebimentoMsg['responsavelrecebimento.titulo']}"
										required="true" forceSelection="true" 
										var="responsavel" itemLabel="#{responsavel.nome}" itemValue="#{responsavel}" />
				</li>
			</ul>
			<div class="submit_link">
				<br />
				<p:commandButton 	value="#{generalMsg['action.reset.label']}" type="reset" process="@parent" />
				
				<p:commandButton 	value="#{generalMsg['action.add.label']}" id="addItemButton" async="false"
									process="@parent"
									actionListener="#{circulacaoDocumentoBean.adicionarItemCirculacaoDocumento}" 
									update="itemCirculacaoDocumentoGrid itemCirculacaoDocumentoForm"
									/>
			</div>
		</fieldset>
	</h:panelGroup>


	<p:dataTable 	value="#{circulacaoDocumentoBean.entity.itemCirculacaoDocumentoList}"
					emptyMessage="#{generalMsg['datatable.emptyMessage']}"
					rowKey="#{item.documento.descricao}"
					id="itemCirculacaoDocumentoGrid" var="item">
					
		<p:column headerText="#{condominioMsg['condominio.label']}">
			<h:outputText  value="#{item.condominio.nomeFantasia}"  />
		</p:column>
		<p:column headerText="#{documentoMsg['documento.titulo']}">
			<h:outputText  value="#{item.documento.descricao}"  />
		</p:column>
		<p:column headerText="#{responsavelRecebimentoMsg['responsavelrecebimento.titulo']}">
			<h:outputText  value="#{item.responsavelRecebimento.nome}"  />
		</p:column>
		<p:column headerText="#{entregasMsg['entregas.itemEntrega.status.label']}">
			<h:outputText  value="#{item.status.label}"  />
		</p:column>
		
		
		<p:column style="width:100px">
			<p:commandButton 	title="#{generalMsg['action.delete.label']}" id="deleteItemCirculacaoDocumentoButton"
								image="toolbar-delete-button"	    										 
								process="@this"
								action="#{circulacaoDocumentoBean.reinitItemCirculacaoDocumento}" 
								update="crudEditForm:entregaTabView:itemCirculacaoDocumentoGrid" 
								>
				<p:collector 	value="#{item}"											 
								removeFrom="#{circulacaoDocumentoBean.entity.itemCirculacaoDocumentoList}" />
			</p:commandButton>
			
			<p:commandButton 	title="#{generalMsg['action.edit.label']}" id="editItemCirculacaoDocumentoButton"
								image="toolbar-edit-button"		 
								process="@this" 
								update="crudEditForm:entregaTabView:itemCirculacaoDocumentoGrid">
				<f:setPropertyActionListener value="#{item}" target="#{circulacaoDocumentoBean.itemCirculacaoDocumento}" /> 
			</p:commandButton>						
		</p:column>
		
	</p:dataTable>

</p:tab>
If I use @all in addItemButton, this do not work too. Idem for @parent, @form and @none.

sfohart
Posts: 2
Joined: 26 Sep 2011, 13:26

05 Oct 2011, 04:27

I needed using <p:ajax> for all components into html fieldset, and @this in "Adicionar" commandButton...

Is there other solution?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests