0

I have this piece of code for render a popup, using f:ajax:

                        <h:commandButton id ="botonAcceso"
                                    value="#{msg['login.enter']}"
                                    styleClass="botonPeque"
                                    action="#{usuarioAuditoriaLogBean.entraAplicacion}">

                        <f:ajax disabled="true"
                                render=":login:errorAcceso"/>
                    </h:commandButton>

                    <h:panelGroup rendered="#{usuarioAuditoriaLogBean.popup}" id="errorAcceso">
                        <ui:fragment>
                            <script>window.open('#{usuarioAuditoriaLogBean.url}');</script>
                        </ui:fragment>
                    </h:panelGroup>

I want the person, who is trying to log, must first close the popup if the logging process fails, to try to log again. How can I do that?

Many thanks.

AdSsa
  • 268
  • 1
  • 6
  • 21

1 Answers1

0

INMO you should not use widnow.open in this scenario... cause you have no control over it after its being opened , instead

1) You can use a third party JSF Components Library like Primefaces , they got Modal Dialog

2)You can use jQuery Modal Dialog , here an example

Community
  • 1
  • 1
Daniel
  • 36,833
  • 10
  • 119
  • 200
  • Hi Daniel, thanks for the answer. I have chosen your first option, and I have updated the question. – AdSsa Apr 09 '12 at 11:05
  • Actually its a completely different question.. you should have to accept the answer and post a new question... (I dont think you need to use the render on the dialog , it wont be displayed until .show() anyway ) , Take a look at this primefaces example http://www.primefaces.org/showcase/ui/dialogForm.jsf , And change the onclick="dlg1.show()" into oncomplete="dlg1.show()" so the dialog will be displayed after usuarioAuditoriaLogBean.entraAplicacion will be executed on the server – Daniel Apr 09 '12 at 11:27
  • Ok. I'll post a new question. Thanks again! – AdSsa Apr 09 '12 at 11:30