This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Data confusion in dialog after validation

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Primefaces:3.3.1 or 3.2....
JSF:
<!-- jsf -->com.sun.faces 2.1.2


this is my index page.this page have the datatable. In this ,I deleted some code filed.Basically be to see p:commandButton.
add p:commandButton and edit commandButton show the same dialog.
you can see this image,and this code.chinese you can ignore.





===============================================
you can see this above code:<p:ajax event="close" oncomplete="myrefresh();"></p:ajax>.
myrefresh(); is jscode,it's :
function myrefresh()
{
if(document.getElementsByClassName("ui-messages-error-summary").length!=0){
alert("havae error CSS!");
window.location.reload();
}
}

if dialog have uesd "ui-messages-error-summary" css,index.xhtml will reload.
Now,we don't used this JScode <p:Ajax>.and you see this images.
1.First.
I click index.xhtml's addButton.
show I need dialog.Effect as shown in figure:


And I click this dialog's add button,this button is p:commandButton.
Because some textbox have ==> required="true" requiredMessage="account:not null!".
So..Validation and page show error ..Effect as shown in figure:



OK..now,we click this dialog cancel button.
And ,we return index.xhtml.and click index's editButton.


you can see this,page data is error.


The correct data should be like this


lase: If you click first "editButton", validation and page show error,To continue to open the dialog.Whether to add or edit,the data will error.





Bean code :




I hava no ideal.so i write some javaScript code for this problem,

function myrefresh()
{
/* alert("1:"+document.getElementsByClassName("ui-messages-error-summary")); */
if(document.getElementsByClassName("ui-messages-error-summary").length!=0){
alert("havae error CSS!");
window.location.reload();
}
}

But,I think is bad.........


thanks for you help.
 
Qian Zhao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this problem resolve. url:http://forum.primefaces.org/viewtopic.php?f=3&t=23682
Content minimized. Click to view
 
Qian Zhao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tandraschko
Expert Member
Posts: 1172
Joined: 03 Dec 2010, 21:11
30 Jul 2012, 17:08
Re: <I changed topic>Data confusion in dialog after validati
This isn't a bug and we have a more flexible component in primefaces-extensions: http://fractalsoft.net/primeext-showcase-mojarra/sections/resetInput/masterDetailScenario.jsf

if you try it,maybe
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic