PrimeFaces Extensions: Why is <pe:resetInput> rendered? - jsf

I have a small problem with PrimeFaces Extensions.
I use the Tag inside a CommandButton.
The functionality is OK, but the "pe-Tag" is rendered and makes a gap between two buttons, which is bigger than without the tag. (you can see it on the picture)
Any idea how I have to configure my button, so that the "pe-Tag" is not rendered?
Picture:
Button-Code:
<p:commandButton value="#{labels.abort}"
icon="ui-icon-cancel"
process="#this"
update=":workflowContentPanel"
immediate="true"
actionListener="#{workflowHandler.abort}"
rendered="#{myBean.entity}">
<pe:resetInput target="workflowPG"/>
</p:commandButton>

OK, found out.
Sometimes Eclipse does make funny things.
There was an "invisible" blank inside my code. Don't know why, haven't used auto format or something similar ;-(
The blank was between the closing bracket from and the opening bracket from

Related

PrimeFaces commandButton not work after submit

I have the following problem I have a CommandButton of primefaces that does well its function which is to save an accounting movement, but when you try to enter a second movement the button does not work to such an extent that it does not warn you if the required fields are empty.
Note that if I give the cancel button that only has a JS to hide and show some labels there is if the button works again.
I need that button to continue working without having to hit the cancel button.
I'm going to leave a partial code that includes the TAG of the form and the buttons warn if you need to also put the fields.
<h:form id="form_agregar_movimiento" prependId="false" >
...
<p:commandButton styleClass="Tamano-Texto-Datos Boton-Afirmativo"
value="Agregar"
action="#{movimientosController.agregarNuevoMovimiento()}"
update=":growl_mensaje_eventos :dataTable_listar_movimientos form_agregar_movimiento"
/>
<p:commandButton styleClass="Tamano-Texto-Boton Boton-Negativo"
value="Cancelar"
onclick="js_ocultar('agregar_movimiento_contenedor'); js_mostrar('movimiento_contenedor_botonAgregarMovimiento');"/>
</h:form>
594/5000
Hi guys, I have solved the problem, I noticed that other forms presented the same problem and testing by ending with #form as recommended and the "prependId = true" and additional add the attribute resetValues="true" and with And the buttons come back to work without problems.
Note: in the example that this function did not work for me but it was for something else, I had a RequestContext.getCurrentInstance().Execute() which calls a JavaScript and it was giving me an error in the browser, I corrected it and works correctly.
Thanks for the tips that have left me

bootsfaces b:commandButton in ui:repeat not updating h:graphicImage

I'm using the 0.7 version of bootsfaces to create a simple page, which has something like the following:
<h:form id="some_form">
<ui:repeat id="some_elements" var="property" value="#{someBean.properties}">
<b:commandButton value="ShowProp" ajax="true" actionListener="#{someBean.showProperty(property)}" update=":some_form:some_elements:graphic"/>
<!-- This property is true -->
<ui:fragment rendered="#{someOtherBean.showGraphic}">
<h:graphicImage url="gen_image?id=#{property.id}" id="graphic"/>
</ui:fragment>
</ui:repeat>
</h:form>
Now, the idea is that on clicking the button, a property is updated and the image should be re-generated (in this case a jfreechart graph - but this is besides the point.) I tested this with primefaces commandButton and it works fine (the graph is redrawn..) However with bootsfaces commandButton, nothing happens once the ajax call completes (I can see the call on the server side, but the graph is not reloaded.) I think it's down to how it must reference the image in the repeated block, but now sure what is wrong - has anyone come across this?
(NOTE: reason I don't want to use primefaces is that it does not integrate well with bootstrap)
I've opened a bug on the project's bugtracker (https://github.com/TheCoder4eu/BootsFaces-OSP/issues/135).
Actually, why did you expect the update=":some_form:some_elements:graphic" to work in the first place? This expression is an id that doesn't exist. The id is some_form:some_elements:0:graphic. In other words: it contains the row number. PrimeFaces (and Mojarra and MyFaces) recognizes that the command button is part of a UIRepeat group and guesses the correct row number. But that's just a guess. Obviously a reasonable guess, because most of the time you want to update something that's in the vicinity of the command button.
The next version of BootsFaces is going to guess the correct row number, too :).

All tabs of tabpanel refreshed, when event happens in any one of the tab (Richface 3.3.4)

We have a tabPanel which has multiple tabs. When any event is performed in any of the tabs (e.g. click 'ajaxSubmit' button in tab1) all tabs are refreshed which is causing performance issues (e.g. getter of 'table' value is always invoked from tab3).
We tried to wrap the content of each tab in <a4j:region>, but the getters of components in tab3 are still invoked.
Please find the sample code snippet below:
<r:tabPanel id="tabWorkingPanel" styleClass="otTMcontainer" selectedTab="#{tabHandlerBean.activeTab}">
<rich:tab id="tab1">
<h:commandButton value="ajaxSubmit"/>
</rich:tab>
<rich:tab id="tab2" />
<rich:tab id="tab3">
<rich:dataTable id="table" value="#{bean.someValue}">...</rich:dataTable>
</rich:tab>
</r:tabPanel>
I think you should be using reRender so that only relevant tabs are refreshed. I think you should also wrap the contents of each tab in a form so that not everything is submitted on each submit, though perhaps that's what you were trying to do with region. I would carefully read the documentation to make sure you're using these correctly.
I have not used RichFaces, so I'm not positive this will work, but a similar approach works for PrimeFaces.
BalusC's description of process and update may be useful. He's discussing PrimeFaces, but I think the same concepts apply.

PrimeFaces dialog isn't displayed properly after ajax call that update=#all

I have a single page application written in JSF - PrimeFaces.
There are a couple of dialogs that are displayed correctly at the begining.
But after clicking:
<p:menuitem value="Logout" update="#all" action="#{loginBean.logout}"/>
the dialogs don't open correctly.
Maybe is is possible for you to make an update elements list, for example like:
update=":a:b,:c,:d:e:f".
Many people complains when try to use "#all".
you can also use, its like to show dialog force fully
<p:dialog widgetVar="statusDialog" ....... />
and use onClick = "PF('statusDialog').show();"

Equivalent of RichFaces 4 <rich:popupPanel> for RichFaces 3

I am looking for something like <rich:popupPanel> in RichFaces 4, but then for RichFaces 3. I haven't found anything like in documenation. There is only <rich:modalPanel> which doesn't suit my needs, because it has problems displaying my datamodel in table. The selection doesn't work, it always returns no rows selected. If I put my table component in <rich:panel> or <rich:togglePanel>, then it works fine.
Is there any popup window excluding <rich:modalPanel> in RichFaces 3?
I dont have 50 reputation to ask you more details in a comment, so i will answer directly hoping this is what you're asking about.
I think you mean that your problem is that the content of the ModalPanel is not rerendered dynamically. but for this you can wrap your table (or the components you want to update) in an <a4j:outputPanel> with ajaxRendered="true"
Setting ajaxRendered="true" will cause the <a4j:outputPanel> to be updated with each Ajax response for the page, even when not listed explicitly by the requesting component. This can in turn be overridden by specific attributes on any requesting components.
http://docs.jboss.org/richfaces/latest_4_0_X/Component_Reference/en-US/html/chap-Component_Reference-Containers.html#sect-Component_Reference-Containers-a4joutputPanel
In my code I have something like :
<a4j:commandLink id="timelineBtn" action="#{timelineBean.doGenerateLog}"
oncomplete="Richfaces.showModalPanel('timelinePnl');return false;"
value="#{labels['timeline.button.lbl']}"/>
that opens the modalPanel :
<rich:modalPanel style="width:800;height:600;" id="timelinePnl">
<a4j:outputPanel id="dataPanel" ajaxRendered="true">
<!-- your components to be updated go here -->
</a4j:outputPanel>
</rich:modalPanel>
So my content is updated with the results of my timelineBean.doGenerateLog method each time i open the modalPanel .

Resources