Change ADF tab color when selected (af:menutabs and af:gomenuitem)

I have the following code in my jsf page:
<af:menuTabs>
<af:goMenuItem text="tab1" destination="tab1.jsp"/>
<af:goMenuItem text="tab2" destination="tab2.jsp"/>
<af:goMenuItem text="tab3" destination="tab3.jsp"/>
<af:goMenuItem text="tab4" destination="tab4.jsp"/>
</af:menuTabs>
When I click on tab2 the color does not change, thus it is confusing to know which tab the user is currently on. There is a selected attribute that you can set to true (e.g. <af:goMenuItem text="tab1" destination="tab1.jsp" selected=true/>), but that always leaves tab1 as the selected tab. I tried using a backing bean but there is no attribute to fire off when the user actually clicks one of the tabs. I even saw some examples of using af:commandmenuitem instead of af:gomenuitem, but there is no selected attribute to set to true. Any help? I have seen this done in many ADF applications. TIA.

unfortunatelly you must control them in a javaBean
if you put selected=true always be selected, you must make a bean that return true o false to this selected parameter on all the items,
i makeo one bean to control the selected property in a commandmenuitems but it can be the same.
public class CapBean{
private boolean foro = false;
private boolean material = false;
private boolean evaluacio = false;
private boolean pec = false;
private boolean macros = false;
private boolean calendari = false;
private boolean normes = false;
private boolean mail = false;
public CapBean() {
public void controlCap(String actiu){
if (actiu=="foro"){
this.setForo(true);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="material"){
this.setForo(false);
this.setMaterial(true);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="evaluacio"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(true);
this.setPec(false);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="pec"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(true);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="macros"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(true);
this.setCalendari(false);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="calendari"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(false);
this.setCalendari(true);
this.setNormes(false);
this.setMail(false);
} else if (actiu=="normes"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(true);
this.setMail(false);
} else if (actiu=="mail"){
this.setForo(false);
this.setMaterial(false);
this.setEvaluacio(false);
this.setPec(false);
this.setMacros(false);
this.setCalendari(false);
this.setNormes(false);
this.setMail(true);
//JSFUtils.storeOnSession("capMenu", this);
public void setForo(boolean foro) {
this.foro = foro;
public boolean isForo() {
return foro;
public void setMaterial(boolean material) {
this.material = material;
public boolean isMaterial() {
return material;
public void setEvaluacio(boolean evaluacio) {
this.evaluacio = evaluacio;
public boolean isEvaluacio() {
return evaluacio;
public void setPec(boolean pec) {
this.pec = pec;
public boolean isPec() {
return pec;
public void setMacros(boolean macros) {
this.macros = macros;
public boolean isMacros() {
return macros;
public void setCalendari(boolean calendari) {
this.calendari = calendari;
public boolean isCalendari() {
return calendari;
public void setNormes(boolean normes) {
this.normes = normes;
public boolean isNormes() {
return normes;
public void setMail(boolean mail) {
this.mail = mail;
public boolean isMail() {
return mail;
in the selected property i put
<af:commandMenuItem text="#{res[\'benvingut.menu.foro\']}"
action="#{capBean.toForo}"
selected="#{capBean.foro}"
onclick="parent.topFrame.location.reload()"/>
i need to reload the page to see the item selected, it's not so pretty but funtional
i hope me help service you
abel

Similar Messages

  • Want to change the Background Color of Selected Tab

    Hi All,
    I want to change the Background Color of Selected Tab of the tabstrip visible in Content Admin Role (Browse, Overview etc.).
    I have changed the Background Color of Selected Tab - Tabstrips-Complex Elements through Theme Editor, but that did not take effect.
    Only the other webdynpro components tabstrips took effect.
    Regards,
    Vishal

    Hi Andre,
    I don't know if you have already figured out how to change the background color of the tabstrip, but I will explain how we have done it.
    You might have tried to change the background color in "Tabstrip" (under the menu "Complex Elements") in Theme Editor. When you change the property "Background color of selected/unselected tabs", this will not change the color of the images on the tabstrip (ex. the triangle on the side of the tab). These images are on the server. We copied these images and then made changes to them, before we uploaded them again through the Theme Editor.
    The path to find the images is /usr/sap/~/JC01/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/portalapps/com.sap.design.urdesigndata/themes/portal/the name of your theme/common/tablist
    If this didn't work for you, you might have to change the properties in "Pattern Containers" (under Complex Elements") in Theme Editor. The tablist properties are under the header "Tab Container".
    I think it should work for you then. We also found that there was some problems when we tried to view the changes in Firefox, but haven't figured out how to solve this.
    /Ellen

  • Change the tab color

    Hi,
    i'm unable to change the tab color of panelTabbed item, i've tried the following in a css sheet:
    af|panelTabbed::tab:selected {
    font-style:italic;
    background-image: url("../Images/section_label_body.jpg");
    border-bottom-color: red;
    border-color: Fuchsia ;
    border-top-color: Green;
    outline-color: Yellow;
    color: Aqua;
    font style and background image seems to work (which tells me that i have the right skin selector) but non of the rest is changing the color of the tab.
    does anyone knows how to do that???????
    Note that when i say tab i mean the tabs header, where you click on it and it opens the tab body.
    Thanks,
    Alain.

    Hi,
    best tip I can give is:
    Disable content compression for the generated HTML output of the ADF Faces page. This will change the style class names from being obfuscated, which we use to reduce the download size of pages. Astyle class that shows as .x3s at runtime might show as af_inputText_content after this. The af_inputText_content then is waht you need to discover and translate into a valid skin selector.
    <context-param>
    <param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>
    <param-value>true</param-value>
    </context-param>
    Run the ADF Faces application you want to discover the skin selector for in FF with Firebug and the WebDeveloper plugin installed.
    Select the tab and look at the skin selectors displayed as the style class properties. If you find someting like af_panelTabbed_tab then this translates to af|panelTabbed::tab. If you see something like .p_selected then this means its a pseudo class that needs to be appended to the selector like af|panelTabbed::tab:selected.
    Use Firebug in inspect mode and select the tab. This shows you all the selectors as style classes in the generated HTML output. Open the Web Developer plugin to edit CSS on the page. Then add the style class selector you found, e.g. .af_panelTabbed_tab (note the leading dot ".") or with a curly brace
    .af_panelTabbed_tab{ ... }
    Within the cury braces, type the CSS you want to set and see how it behaves. You may have to play a bit to exactly find the style class and css you want, but assuming that the follwing works
    .af_panelTabbed_tab .p_selected{background-color:red}
    then this translates to teh following skin selection to be copied to the CSS skin file
    af|panelTabbed::tab:selected{background-color:red}
    Note that this backward translation from style class to skin selector needs some patience. However, experience proves to be the best when cooking and so it does for skinning.
    Hope this helps
    Frank

  • Can I change the background color when I'm in a brochure layout?

    can I change the background color when I'm in a brochure layout? I've tried making a box in desired color but cannot push it to the back(not an option, it's greyed out)

    Then you are in a Layout template and the shape is already the back most object.
    Peter

  • Different Colors when printing from Photoshop and InDesign CS3

    Different Colors when printing from Photoshop and InDesign CS3
    I have the following problem:
    When printing from Photoshop or InDesign to a PostScript printer, Adobe recommends to let Photoshop handle the colors (I use the German version, so I don't know the exact term used, it changes slightly in all CS3 apps anyway).
    The manufacturer however told me to let the PostScript printer handle the colors.
    When I chose this option in Ps's print dialog and then choose ISO Coated as the printer pfofile, the results are fine.
    But when I place the exact same image in an InDesign file and print from InDesign or export to PDF and print via Acrobat, again using "Printer handles colors", the results are the exact same as if I had used Ps and chosen to let Ps handle the colors (way too saturated and a bit too red).
    ·Photoshop CS3
    ·InDesign CS3
    ·Test image is a TIFF in CMYK Fogra 27 Coated (which is also the working color space in Ps and ID.
    ·Printer: Xerox Docucolor 3535
    ·Printer profile: ISO Coated
    How can I make sure the printer handles the colors in other CS3 apps than Ps? I tried it with ID's print dialog (translated from the German version: Color Management > Options > Color Handling: PostScript-printer decides colors).
    Thanks a lot!

    RE: "You don't indicate what Xerox printers you have"
    In my first post I named it, is that the information you need?
    Docucolor 3535 using Splash 3535
    That's interesting, so I have to find a way to turn off the printer's Color Management function? I mailed them, hope they can tell me how to do it easily. They usually just tell me to not use any profiles and so on, but that's the general rule in this area, I'm really tired of hearing it. Everybody seems to think profiles and LAB mode are nuclear science and I should stay away from it.
    Anyway, the test image I'm using is a simple photograph (size A3, 300dpi), so no transparencies at all. I'm placing this image into an equally large ID file and print it from ID, then export it to PDF-X/3 and print it from Acrobat. Hope that helps.

  • HT201407 I have a new device. When selecting the language and country I am trying to connect to a wifi connection and getting the error 'Your Iphone could not be activated because the activation server cannot be reached. Try connecting to your Iphone to i

    I have a new device. When selecting the language and country I am trying to connect to a wifi connection and getting the error 'Your Iphone could not be activated because the activation server cannot be reached. Try connecting to your Iphone to iTunes to activate it, or try again in a few minutes.

    Where exactly did you get this phone?
    Do you have a SIM in the phone?
    There are 2 primary causes for this.
    Either you don't have a SIM in the phone, which is REQUIRED to activate it, or the phone was hacked to unlock it.

  • Change the background color of selected row in adf table

    Hi,
    Can somebody guide me in changing the background color of a row when its being selected. In my ADF table, one of the column is of type Command Link. So whenever i click this command link on any particular row that complete row color should change as an indication of that row being selected.
    Please guide me to do this. I referred to other forum posts, but they couldnt meet my need.
    Thanks
    ri

    Hi Frank,
    you're right. This should work. But the result is not perfect from my point of view.
    I use
    <af:table ...>
      <af:column ...>
        <af:outputText value="#{row.col1}" inlineStyle="#{row.mystyle}"/>
      </af:column>
    </af:table>and I get e.g. this in HTML:
    <table ...>
      <tr>
        <td class="af_column_cell-text OraTableBorder1111"><span style="font-weight:bold;">qqq</span></td>
      </tr>
    </table>while I would prefer to get somethig like this:
    <table ...>
      <tr>
        <td style="font-weight:bold;"><span>qqq</span></td>
      </tr>
    </table>, which looks much smarter. Is it possible?
    Thanks,
    Alexandre.

  • Changing the Check Box color when selected/deselected

    How do I do this using the Action tab in Check Box Properties within Acrobat 7.0 (NOT DESIGNER)?
    I added the check boxes to the .PDF using the check box tool (Box Only-No Text).
    I am trying to fill the box green when selected and yellow when not selected via ACTION>Mouse Up>Run a JavaScript>Add and enteringthe javasript below with no success:
    if (this.rawValue == "1") {this.fillColor="0,255,0";} else {this.fillColor="255,255,0";}
    PLEASE HELP!!!

    If you are in AcroForm and not LiveCycle Designer, you not use LiveCycle Designer FormCalc syntax or LiveCycle Designer references.
    With a single check box:
    if(event.target.isBoxChecked(0)) {
       event.target.fillColor  = color.green;
    } else {
    event.target.fillColor = color.yellow;

  • Cannot change JToggleButton background color when Windows XP theme is used

    I wanted to change the background of a JToggleButton when it's pressed. I tried a few things, such as
    UIManager.put("ToggleButton.select", Color.RED);
    setting button's background, button's UI.
    but nothing worked.
    so I tried changing desktop theme from Windows XP to Windows Classic, then i was able to set button's background.
    The following is a simple test program, by switching theme, the toggleButton looks differently.
    Does anyone know how I can change JToggle button's background color under Windows XP theme?
    Thank you in advance!
    import javax.swing.*;
    import java.awt.*;
    public class ToggleTest {
        public static void createGUI(){
            JToggleButton button = new JToggleButton("Test");
            button.setBackground(Color.BLUE);
            JFrame testFrame = new JFrame("Test Frame");
            testFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            testFrame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER));
            testFrame.getContentPane().add(button);
            testFrame.pack();
            testFrame.setVisible(true);
        public static void main(String[] args){
            try{
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                //UIManager.put("ToggleButton.select", Color.RED);
            catch(Exception ex){
                ex.printStackTrace();
            SwingUtilities.invokeLater(new Runnable(){
                public void run(){
                    createGUI();
    }

    class myToggleBtn extends JToggleButton {
      String s;
      public myToggleBtn(String str, Boolean sel) {
        super(str, sel);
        s = str;
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (this.isSelected()) {
             int w = getWidth();
             int h = getHeight();
             g.setColor(Color.green); //selected color
             g.fillRect(0, 0, w, h);
             g.setColor(Color.darkGray); //selected foreground color
             g.drawString(s, (w - g.getFontMetrics().stringWidth(s))/2 + 1, (h + g.getFontMetrics().getAscent())/2 - 1);
    }

  • Border color when selecting field

    Post Author: RicoDeJong
    CA Forum: General
    Hi,
    When selecting a field in CR11 it doesn't come with a changed border color.
    On a different PC it does. Don't know where this configuration parameter is set?
    Anyone?

    Thanks Bibhu;
    The suggestion did not work that well but it did give me an idea. I used the code below in the "exit" event and I was able to change the the border color.
    switch (this.rawValue)
    case "1":
        this.font.fill.color.value = "0,0,0";
        this.border.fill.color.value= "255,255,255";
    Thanks Again Bibhu

  • ROI color when selected

    I want to change the default gray color of the ROI to red or blue, when it is selected by the user for modifications. I have seen a similar post in NI forum, and the solution was given as 'change it at the image property node'...
    I am using IMAQ constructROI for my application..please give me a detailed suggestion for acheiving this color change. (I useIMAQ windROIcolor for changing the color of the ROI when it is not active)
    Thanx in advance,
    Mathew

    I don't know exactly what you want to do, but if i understood you correctly, you want to change the color of the pixels which masks the ROI area?!
    Therefore, look on the attached VI
    If you want to change the background color of the selected ROI tool, e.g. line or rectangle, i think it's not possible if you work with the WindTools setup or the WndWindows...
    Instead of this, you should use an image control, place it on the frontpanel and make a right click on it - scroll to Advanced - Customize, afterwards it's possible to change the background color of several selected tools. Save the customized control and work with it...
    regards,
    ThSa
    http://www.newgistics.com

  • In FCP it will not change the border color when attempted?

    I have tried to change the border color on a transition I am using with the Final Cut Pro Product and it still remains black.  Can some one assist me?

    1) What is the source material of the two clips you are applying the transition between?
    2) What are your sequence settings (click anywhere on your timeline and type Command + 0 {zero} to see your sequence settings - either report what they are or take a screen shot and post the screen shot here)?
    3) Have you tried creating a new sequence and see if you can get it to work correctly in a new sequence?
    4) Have you tried trashing you FCP preferences - usually recommended when FCP begins acting strangely -
    http://support.apple.com/kb/TS1846
    you can download (free) Preference Manager from Digital Rebellion that will do the work for you:
    http://www.digitalrebellion.com/prefman/
    it will also give you the choice of archiving your current preferences if you wish to return to them.
    MtD

  • Certain sentences change slightly in color when I save as JPEG, how can I fix this?

    Here is an sample of my resume, notice that certain bullets and sentences have changed in color when I save it as a PDF, when I save it as a JPEG its fine though
    Ignoe the blue highlight
    your help is greatly appreciated!!

    You have a lot more issues than bullets & text changing color.
    Are you really using light gray text against a darker gray background?
    This makes it hard to read on screen and even printing out (in B&W or Color) will make the gray text halftoned.
    Trust me, no one will be happy to receive a resume looking like this.
    Make it in a work processor like MS Word. Black text on a white page.
    Save it as a .DOC, DOCX, or PDF.
    WIth some many people looking for a job in this economy today, you do not want to an employer to struggle to read your resume.

  • Changing JCheckBox default color when disabled

    I am using JCheckBoxes to serve as a checklist providing feedback to the user on how far through a sequence of events the program has progressed. I do not want the user to be abel to check the boxes himself.
    I currently am using JCheckBox.setEnabled(false) to keep the user for ticking the boxes. Unfortunately this changes the foreground color from black (readable) to gray (unreadable). setForeground has no effect.
    So I have two questions:
    1. Is there a better way to secure JCheckBoxes from the user?
    2. If not is there a way to alter the default disabled color for specific CheckBoxes?

    hopefully there's a better way than this
    (the checkBoxIcon code is just to do with the tick)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.metal.*;
    class Testing extends JFrame
      public Testing()
        UIManager.put("CheckBox.disabledText",Color.BLACK);
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JCheckBox cbx = new JCheckBox("Disabled",new CheckBoxIcon(),true);
        getContentPane().add(cbx,BorderLayout.NORTH);
        getContentPane().add(new JCheckBox("Enabled",true),BorderLayout.SOUTH);
        pack();
        cbx.setEnabled(false);
      public static void main(String[] args){new Testing().setVisible(true);}
    class CheckBoxIcon implements Icon
      protected int getControlSize() { return 13; }
      private void paintOceanIcon(Component c, Graphics g, int x, int y)
        ButtonModel model = ((JCheckBox)c).getModel();
        g.translate(x, y);
        int w = getIconWidth();
        int h = getIconHeight();
        if (model.isPressed() && model.isArmed())
          g.setColor(MetalLookAndFeel.getControlShadow());
          g.fillRect(0, 0, w, h);
          g.setColor(MetalLookAndFeel.getControlDarkShadow());
          g.fillRect(0, 0, w, 2);
          g.fillRect(0, 2, 2, h - 2);
          g.fillRect(w - 1, 1, 1, h - 1);
          g.fillRect(1, h - 1, w - 2, 1);
        g.setColor( MetalLookAndFeel.getControlInfo() );
        g.translate(-x, -y);
        if (model.isSelected())
          drawCheck(c,g,x,y);
      public void paintIcon(Component c, Graphics g, int x, int y)
        ButtonModel model = ((JCheckBox)c).getModel();
        int controlSize = getControlSize();
        if (model.isPressed() && model.isArmed())
          g.setColor( MetalLookAndFeel.getControlShadow() );
          g.fillRect( x, y, controlSize-1, controlSize-1);
          drawPressed3DBorder(g, x, y, controlSize, controlSize);
        else
          drawFlush3DBorder(g, x, y, controlSize, controlSize);
        g.setColor( MetalLookAndFeel.getControlInfo() );
        if (model.isSelected())
          drawCheck(c,g,x,y);
      private void drawFlush3DBorder(Graphics g, int x, int y, int w, int h)
        g.translate(x, y);
        g.setColor(MetalLookAndFeel.getControlDarkShadow());
        g.drawRect(0, 0, w-2, h-2);
        g.setColor(MetalLookAndFeel.getControlHighlight());
        g.drawRect(1, 1, w-2, h-2);
        g.setColor(MetalLookAndFeel.getControl());
        g.drawLine(0, h-1, 1, h-2);
        g.drawLine(w-1, 0, w-2, 1);
        g.translate(-x, -y);
      private void drawPressed3DBorder(Graphics g, int x, int y, int w, int h)
        g.translate(x, y);
        drawFlush3DBorder(g, 0, 0, w, h);
        g.setColor(MetalLookAndFeel.getControlShadow());
        g.drawLine(1, 1, 1, h-2);
        g.drawLine(1, 1, w-2, 1);
        g.translate(-x, -y);
      protected void drawCheck(Component c, Graphics g, int x, int y)
        int controlSize = getControlSize();
        g.fillRect( x+3, y+5, 2, controlSize-8 );
        g.drawLine( x+(controlSize-4), y+3, x+5, y+(controlSize-6) );
        g.drawLine( x+(controlSize-4), y+4, x+5, y+(controlSize-5) );
      public int getIconWidth() {return getControlSize();}
      public int getIconHeight() {return getControlSize();}
    }

  • All songs synced when selected playlists, artists and genres is used

    For some reason when I check check "selected playlists, artists and genres" and uncheck the artists I do not want on the iphone they are not removed.
    Reading the forums it was indicated that songs that are part of a playlist will not be removed so I deleted all the playlists and the songs/artists are still on the iphone.
    I then removed all songs and added them back in but they are still there.
    I even disabled genius and the artists/songs are still there.
    I know I can manually manage the music but unchecking the artists would be very unwieldy.
    The main summary screen is set to open itunes when this iphone is connected and nothing else and the music tab does not have the automatically fill free space with songs checked.

    Just installed iTunes 10 in the hopes that this would resolve the issue but to no avail.
    Help please I just want to sync my phone and leave off artists I uncheck (multiple albums and compilations)

Maybe you are looking for

  • Queries related to iViews in EP.. :)

    Hello All, I have few queries related to iViews in EP: 1> How should I create an iView out of an EAR file thats deployed on server? 2> Do I always need a par file to create an iView? 3> Suppose I have a Web project (containing servlet). How will I cr

  • Yosemite Reinstall --- Failure --- Please Help!!

    Hello, please help me. Just don't know what to do now. Just had an Driver-Update-Crash due letting installing and auto-reboot two drivers (RME AudioDriver and Airdisplay2 Driver) and suddenly my MacBook Pro (Mid2012) didn't passed the grey startup sc

  • Business rule - cannot run

    Gurus, I cannot launch a business rule. When I try to launch it, it gives a message "the rule cannot be launched because it has hidden rtp variables without default value" What could be he problem with it. THANKS

  • When to expect a new version of the Data Modelling tool ?

    Hello, just a quick question - what's the time horizon for the new version ? and where ( if at all ) can i see the list of bugs/features to be addressed in it ? Thank you. Andrew Edited by: andrey on Jan 16, 2009 8:40 AM

  • RE: ole borders in msword

    hi all, does anybody know the property or method for borders to msword, i need to put borders for certificates created in msword, very urgent. thanks.