Comments (9)
I'm not in favor of removing p:resetInput.
The following construction is used a lot in our projects :
<p:commandLink title="Title"
action="#{bean.doAction(data)}"
update=":mainform:tabContainer:container :mainform:containerA :mainform:containerB :mainform:containerC"
rendered="#{not empty data.id}"
process="@this">
<p:resetInput target=":mainform:tabContainer:container" />
</p:commandLink>
Only inputs in :mainform:tabContainer:container are reset.
Other containers like :mainform:containerA keep there input values, in our case often input search criteria with the search result as text. The search result can change though database transactions/bean.doAction.
The official JSF 2.2 definition of resetValues="true" is: "JSF resets all input components specified in the render attribute."
For example: <f:ajax render="field1" resetValues="true"/>
So:
<p:commandLink title="Title"
action="#{bean.doAction(data)}"
update=":mainform:tabContainer:container :mainform:containerA :mainform:containerB :mainform:containerC"
rendered="#{not empty data.id}"
process="@this"
resetValues="true">
</p:commandLink>
Means all inputs of containers mentioned in "update" (in JSF: the render tag) will reset.
What is not correct in this situation.
When the tag p:resetInput is removed the only solution is to add in method bean.doAction:
PrimeFaces.current().resetInputs(":mainform:tabContainer:container");
Which is correct, but is less semantic/visible then a p:resetInput tag.
from primefaces.
@tandraschko i will have to check but we do this a lot to reset a Dialog before opening it which lives in another form
.
<p:commandButton id="btnAdd" actionListener="#{pathDefinitionController.newEntity()}"
value="#{appmsg['action.admin.add']}" title="#{appmsg['action.admin.add.hint']}" icon="fa fa-plus"
styleClass="ui-admin-button" rendered="#{accessProvider.adminOwner}" immediate="true" update=":frmEntityDialog"
oncomplete="PF('editDialog').show();">
<p:resetInput target=":frmEntityDialog" />
</p:commandButton>
I wasn't sure resetValues="true"
handles this case so I guess we need to test it. cc @FlipWarthog
from primefaces.
in your case you can just remove p:resetInput and add resetValues=true, should work
from primefaces.
OK we will test it and report back.
from primefaces.
What about a programmatically reset like "PrimeFaces.current().resetInputs("form:panel")"?
Very unfortunate if that is not possible anymore.
from primefaces.
What about a programmatically reset like "PrimeFaces.current().resetInputs("form:panel")"? Very unfortunate if that is not possible anymore.
@DazzlingBob no i think its just removing the tag <p:resetInput>
all else would remain i believe.
from primefaces.
Yeah
Only the tag
from primefaces.
I think we also do that @DazzlingBob which is why now i remember using p:resetInout to control only what gets reset not what gets also Updated.
from primefaces.
sounds valid
lets close
from primefaces.
Related Issues (20)
- Bug fileDownload on Primefaces 14, Jakarta 10 EE HOT 2
- Google Maps: Warning popup in showcase HOT 3
- FileUpload: restricting file names (allowTypes ) of uploaded files not double-checked at server side HOT 10
- Menu Item: ui-state-hover and ui-state-active classes gained after click | v14.0.0+ HOT 9
- ConfirmPopup: MenuItem closes before confirmation HOT 30
- Calendar: Broken popup positioning HOT 2
- InputNumber: update `padControl` attribute to allow more flexibility HOT 5
- DataTable: Style for responsive view when `reflow=true` HOT 6
- Chart: Cannot Be Responsive HOT 3
- Hosting namespaces on https HOT 3
- SelectBooleanCheckbox, ToggleSwitch: NVDA (Screen reader) reads "empty" when focusing HOT 13
- SelectOneMenu: Not handling `readonly` property correctly
- DatePicker: width of input of navigator should not be 100% when inline in ui-fluid
- p:media cann't display pdf when use streamcontent features HOT 7
- Html5FacesContextResponseWriter: Reduce instantiation HOT 3
- DataTable: Border is removed on focus for all elements within a DataTable HOT 2
- Datatable CellEdit cannot get focus in EditMode after Tab. HOT 4
- ColumnToggler: not using column visibility from bean property HOT 2
- JPALazyDataModel: Case insentive with Numeric column error HOT 10
- PanelGrid: Wrong position of inner menuButton, when embedded in dialog HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from primefaces.