-
1. Re: popuppanel and validation problem
healeyb May 28, 2012 10:10 AM (in response to ugossi)Hi, without seeing the code there's a lot of guess work and this is a stab in the dark...
How does the row click work that opens the popupPanel? are you using extendedDataTable with the selectionchange event
or is there a commandLink/commandButton in the row? Either way you need to render the contents of the popupPanel. So
you would need something like this:
<rich:popupPanel ...>
<h:panelGroup id="panelContents">
...
</h:panelGroup>
</rich:popupPanel>
& render="panelContents" on row click.
Regards,
Brendan.
-
2. Re: popuppanel and validation problem
ugossi May 28, 2012 10:49 AM (in response to healeyb)Hi, thaks a lot.
There is commandLink in the row of the table.
<a4j:commandLink oncomplete="#{rich:component(contrQualBB.pop)}.show();"
render="popup" onclick="show(#{cq.id},'dup')"
style="text-align:center;font-size:medium">
/>>OPEN
In the command link i render the popuppanel
<
h:form id="formPanel">
<rich:popupPanel id="popup" modal="true" autosized="true" resizeable="false" height="560" width="500" domElementAttachment="form">
Suppose that this is my table:
(row 1)--Name1--Order1---data1
(row 2)--Name2--Order2---data2
(row 3)--Name3--Order3---data3
If i visualizze (for exaple row 1), modify Order1 in Order11, save the data and close the popup (no validation error).
Now, if i open (row 2) in the popup i see the correct information Name2--Order2---data2.
If visualizze (for exaple row 1, again), modify Order1 in "", save the data (validation error, Order is a required value), close the popup.
Now, if i open the (row 2) in the popup i find the old value, relative to the (row 1) Name1--Order1---data1.
-
3. Re: popuppanel and validation problem
healeyb May 28, 2012 12:34 PM (in response to ugossi)Ok, as you are using domElementAttachment="form" I don't think you need the h:form that encloses the popupPanel.
If you weren't using domElementAttachment="form" you would put the form inside the popupPanel, not outside it. I
think that's right, I've got to admit I use jQuery dialogs rather than popupPanel.
You are rendering the popupPanel itself, you need to render the contents of the popupPanel as per my reply, so add
a panelGroup and render that from the commandLink and render that instead of render="popup".
- remove the enclosing h:form from the popupPanel
- add a panelGroup inside the popupPanel
- render the panelGroup from the commandLink render=, not the popupPanel itself
I think that's right!
Regards,
Brendan.
-
4. Re: popuppanel and validation problem
ivan_ra May 29, 2012 2:27 AM (in response to ugossi)You have to clear local values in panel:
https://community.jboss.org/thread/200279?tstart=0
https://community.jboss.org/thread/200207?tstart=0
this way you can clear all childs in panel:
{code}
public void refresh(String componentId) {
FacesContext context = FacesContext.getCurrentInstance();
UIComponent component = context.getViewRoot().findComponent(componentId);
if (component != null)
clearChilds(component);
}
private void clearChilds(UIComponent c) {
if (UIInput.class.isAssignableFrom(c.getClass())) {
UIInput input = (UIInput)c;
input.setSubmittedValue(null);
input.setValue(null);
input.setLocalValueSet(false);
} else {
Iterator<UIComponent> kids = c.getFacetsAndChildren();
while (kids.hasNext()) {
clearChilds(kids.next());
}
}
}
{code}
-
5. Re: popuppanel and validation problem
ugossi May 29, 2012 5:30 AM (in response to healeyb)Hi Brendan, thanks a lot.
I try to follow your indication but i have the same problem in the same condition.
I try to clear all childs in panel, as suggested by Ivan, and probably is the correct solution for me.
Regards.
-
6. Re: popuppanel and validation problem
khosro_question Jun 1, 2012 4:14 AM (in response to ugossi)ugo rossi ,it is a known issue https://issues.jboss.org/browse/RF-11413 and also look at https://community.jboss.org/message/735198#735198 .
Khosro.
-
7. Re: popuppanel and validation problem
ruenagel_frank Oct 6, 2013 7:33 AM (in response to ugossi)Dirty solution: the Problem is somewhat hidden, if you implement client side validation. But it is still there, and dangerous....
What I do:
A workaround on client side is to prevent closing the panel, if server sided validation errors occour:
<rich:popupPanel id="produktPopup" modal="true" onmaskclick="windowcloseproduktPopup();"
autosized="true">
<h:form id="xxxx">
[...]
<a4j:outputPanel ajaxRendered="true">
<script type="text/javascript">
function windowcloseproduktPopup() {
if(#{not facesContext.validationFailed}) {
#{rich:component('produktPopup')}.hide();
}
return false;
}
</script>
</a4j:outputPanel>
</h:form> </rich:popupPanel>
As Khosro writes in his helpful reply, this is a bug. And it is still open....