Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Tabs with Templating or how to add action to tab #413

Closed
pavankd opened this issue Jun 15, 2016 · 9 comments
Closed

How to use Tabs with Templating or how to add action to tab #413

pavankd opened this issue Jun 15, 2016 · 9 comments

Comments

@pavankd
Copy link

pavankd commented Jun 15, 2016

Hi ,
Please help me in following scenario ,
i want to use tabs with template.
like when i click on tab it must load tab specific template. without javascript.
or
how to add action to tab

@pavankd pavankd changed the title How to use Tabs with Templating How to use Tabs with Templating or how to add action to tab Jun 15, 2016
@stephanrauh
Copy link
Collaborator

I don't understand the first question. What do you want to do precisely? Which templates do you want to load?

As for the second question: <b:tabView /> supports the BootsFaces AJAX API. It seems we've yet to implement the jQuery event, but even today it should be possible a bind an AJAX call to onClick.

@pavankd
Copy link
Author

pavankd commented Jun 15, 2016

In My project we used template for page layout with header,content,footer and maintemplate .so indeed to add tabs in the content part and load corresponding xhtml to specific tab using ui:define and ui:insert.
how to do this?

@zhedar
Copy link
Collaborator

zhedar commented Jun 15, 2016

@pavankd I'm going a bit StackOverflow on this and may ask: What have you tried so far?

@pavankd
Copy link
Author

pavankd commented Jun 16, 2016

@zhedar So fare i tried SPA but i am unable to load forms properly eg : onclick="ajax:navigationbean.setPage('/pages/registrationForm.xhtml')" to command button or navlink,its not loading properly, Form is activation only after the second click and my application has lot of inner pages with forms.

i followed this link to create my application : http://www.beyondjava.net/blog/single-page-applications-with-bootsfaces/

@stephanrauh
Copy link
Collaborator

That's a cool link indeed :).

Seriously, I suspect you try to do something that's a bit unorthodox. I understand you've got a page with a template. This page contains a tab. Is this correct?

Now comes the twist: by selecting another tag withing the page, you want to replace the template. Correct?

But that would mean to replace the entire page with another page. TabViews, in contrast, are usually used to replace the content area of the tab. They are not used to replace the surroundings of the tabView. Of course, it's perfectly possible your use case make sense - far be it from me to me to judge over this! - but I'd like to point out it's not the traditional use case of tabs.

So, I've got two questions:

  • Did I get you right?
  • Do you really want to replace the template when another tab is selected? Is there no other option to achieve your goal?

@zhedar
Copy link
Collaborator

zhedar commented Jun 17, 2016

That may even not related to tabs, but may even be a general problem, as it looks much like #399.

@pavankd Could you try, if it works with BootsFaces 0.8.1?

@TheCoder4eu
Copy link
Owner

@pavankd , does it work with last releases?

@primeO
Copy link

primeO commented May 29, 2018

How to close the tab in bootsfaces cant find any sources of it in demo link

@stephanrauh
Copy link
Collaborator

In general, you can't close tab. Things look a bit different if you're using dynamic tabs (these ones: https://showcase.bootsfaces.net/bootstrap/tab.jsf#dynamic_tabs). They are populated from an array, so closing a tab is simple a matter of deleting the corresponding array entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants