Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:47:58+00:00 2026-06-14T07:47:58+00:00

I have two question as below; I have a Menu and submenus in left

  • 0

I have two question as below;

I have a Menu and submenus in left side of my page and a Tabview on center of my page. when click to menuItem, I add tab to tabview with javascript dynamically
but I can’t get tabs of tabview from backing bean. I can read only first tabs before I added with javascript.
so I want to match tabview at server side and client side synchronously.

how can i do this ?

and second;
When I closed to tab, I use TabCloseEvent in onTabClose method but event is always null. May be it will be solved with matching tabview with server and client side
i don’t know.

codes are as below.

Please advise me.

thanks..

xhtml code :

<p:menuitem value="#{itemMenu.menuAck}" 
            action="#{MenuBean.OpenPage(itemMenu.pageName)}" 
            ajax="true"
            oncomplete="handleTabViewEvent(args);" />

<script type="text/javascript">
   function handleTabViewEvent(args) {
       alert('Add tab here..');
    }
</script>

bean code :

public void OpenPage(String pageName) {
     String s = "Divert to handleTabViewEvent function";
}

public void onTabClose(TabCloseEvent event) {  
     FacesContext context = FacesContext.getCurrentInstance();
     TabView tw = (TabView)context.getViewRoot().findComponent("centerForm:tw");
     String s = "I must delete tab here from tw which closed. 
                 But event does not give me tab information. It is always null. And tw has old values";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:47:59+00:00Added an answer on June 14, 2026 at 7:47 am

    I add tab to tabview with javascript dynamically

    This was completely wrong approached in first place.

    You need to add the tab using JSF instead of using JS. Right now JSF is completely unaware about the changed client side state and will never know about the new tab. Any workaround would only end up to be uglier and harder to maintain than when just doing it by JSF instead of JS.

    See also:

    • How to add button for adding new tabs near last tab?
    • What is the need of JSF, when UI can be achieved from CSS, HTML, JavaScript, jQuery?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question, here are two classes below: class Base{ public: virtual void
I have a simple but subtle question. Below you see two different declaration variants
I have two classes and two pages found below: My question is how do
I have the below model which represents a two level menu hierarchy and what
I have two files with the following contents below.My question is ,in the below
I have two questions. How can I get the spinner in the figure below
I have two question to put forward: I was very interested, even intrigued by
guys I have two question to ask, they're easy, but bothering me for a
This is two part question: I have two stored procedures: sp1 & sp2. If
I have a question: I have two MSSQL tables, items and states, that are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.