• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Data confusion in dialog after validation  RSS feed

 
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
 
You can't expect to wield supreme executive power just because
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!