• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data confusion in dialog after validation

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic