0

I use JSF 2.0 and Primefaces 3.5

I have a dialog and in case if data not passed my validation rules not closed dialog

    <p:commandButton id="seasonSave" actionListener="#{adminSeasonController.add()}"
                             action="#{adminManageTournamentController.generateTournamentNames()}"
                             value="#{msg.save}" ajax="true"  
                             onmousedown="return validateSubmit('createSeasonForm', ['name_season'], 'lang')"                                                
                             oncomplete="if (#{not adminSeasonController.validationFailed}) addSeasonDialog.hide()"
                             update=":manageTournament:name_season, :manageTournament:title ,:menuForm:growl, @form">

I see in controller validationField = true, but dialog closed.

how I can resolve my problem?

BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
Ray
  • 1,798
  • 7
  • 52
  • 88
  • You try:`oncomplete="if(#adminSeasonController.validationFailed})addSeasonDialog.show()`. – Rong Nguyen Jun 10 '13 at 12:50
  • 1
    @Rong: EL in `on***` attributes of PF components are not evaluated on postback request, they are evaluated on initial request. They namely represent JavaScript code. – BalusC Jun 18 '13 at 13:08
  • @BalusC hi, i didn't see `action` and the question, thank for your attention :-) – Rong Nguyen Jun 18 '13 at 16:49

2 Answers2

2

You can look primefaces showcase for this problem.

http://www.primefaces.org/showcase/ui/dialogLogin.jsf

Update of the link: https://www.primefaces.org/showcase/ui/overlay/dialog/loginDemo.xhtml

mikereem
  • 225
  • 1
  • 13
Zapateus
  • 506
  • 3
  • 7
  • 20
0
 <p:commandButton id="seasonSave" actionListener="#{adminSeasonController.add()}"
                             action="#{adminManageTournamentController.generateTournamentNames()}"
                             value="#{msg.save}" ajax="true"  
                             onmousedown="return validateSubmit('createSeasonForm', ['name_season'], 'lang')"                                                
                             oncomplete="if (!args.validationFailed) addSeasonDialog.hide()"
                             update=":manageTournament:name_season, :manageTournament:title ,:menuForm:growl, @form"/>
zargarf
  • 613
  • 5
  • 18