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,082,665
  • 372
  • 3,610
  • 3,555
Ray
  • 1,788
  • 7
  • 55
  • 92
  • 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
  • 235
  • 1
  • 14
Zapateus
  • 516
  • 3
  • 8
  • 21
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
  • 633
  • 6
  • 18