TheCoder4eu / BootsFaces

BootsFaces : the next gen JSF Framework
MIT License
71 stars 17 forks source link

Calling a modal #19

Closed fsantannadi closed 10 years ago

fsantannadi commented 10 years ago

Actually it's not a problem, but I'm not knowing which attribute to use within a button to call a modal. In the example on the site does not tell you that. could help me?

TheCoder4eu commented 10 years ago

Hi, perhaps you missed this page in the doc: http://www.bootsfaces.net/page/bootstrap/modal.xhtml

It's in the Bootsrap widgets section. Or you do not display the page correctly? In that case, what browser are you using?

fsantannadi commented 10 years ago

I'm using chrome.... Sorry for my ignorance, but I had seen this page modal.xhtml, but not found a way to call the modal in a button attribute ... I believe that I can only call a modal in a link attribute like <a href ="#nameofmodal" ??? is that right? Thanks and congratulations for the work.

TheCoder4eu commented 10 years ago

Hi, in the modal page you are right, there is some information missing. If your purpose is just triggering a modal, then actually you have to use an attribute href ="#nameofmodal" plus an additional data-toggle="modal" attribute. You can see it in the source of the page here: https://github.com/TheCoder4eu/BootsFacesWeb/blob/master/web/bootstrap/modal.xhtml On the other hand, if you need an action that submits form data for processing and then shows up a modal with some information/result, then you should have a look at the Ajax Modal button in the commandButton example: http://www.bootsfaces.net/page/forms/commandButton.xhtml source: https://github.com/TheCoder4eu/BootsFacesWeb/blob/master/web/forms/commandButton.xhtml where the button triggers the modal thanks to the attribute oncomplete="$('#amodal').modal('show');"

Hope this helps you understand better how things should work.

fsantannadi commented 10 years ago

It sure helped me a lot. Thank you for the clarification. And once again congratulations for the good work

TheCoder4eu commented 10 years ago

Thank you, nice to know you like this project!