How to set different numbers of visible items af:menu

Hi guys,
I have a request in setting different number of visible items for adf menu components(af:menu). I see that this option is available from the css skin file using " -tr-visible-items" attribute on af|menu selector:
af|menu
-tr-visible-items: 3;
The main issue is that I have 2 menu components and on menu1 I need 3 items visible and on menu2 4 items. I created a custom styleClass and called from one of the menu, but it doesn't seem to work.
JSFF snippet:
<af:menuBar id="mb1">
<af:menu text="Menu with 3 items" id="m1">
<af:commandMenuItem text="commandMenuItem 1" id="cmi1"/>
<af:commandMenuItem text="commandMenuItem 2" id="cmi2"/>
<af:commandMenuItem text="commandMenuItem 3" id="cmi3"/>
<af:commandMenuItem text="commandMenuItem 4" id="cmi4"/>
<af:commandMenuItem text="commandMenuItem 5" id="cmi5"/>
</af:menu>
<af:menu text="Menu with 4 items" id="m2" styleClass="myclass">
<af:commandMenuItem text="commandMenuItem 1" id="cmi6"/>
<af:commandMenuItem text="commandMenuItem 2" id="cmi7"/>
<af:commandMenuItem text="commandMenuItem 3" id="cmi8"/>
<af:commandMenuItem text="commandMenuItem 4" id="cmi9"/>
<af:commandMenuItem text="commandMenuItem 5" id="cmi10"/>
</af:menu>
And this is the CSS snippet:
af|menu
-tr-visible-items: 3;
.myclass
-tr-visible-items: 4;
I tried also adding the following to filter components but no luck...
.myclass af|menu
-tr-visible-items: 4;
So always only 3 items are displayed, looks like the cusom styleClass makes no difference.
Could you let me know if I'm missing something?
Thanks,
Mihai

Hi Frank,
Thanks for your qucik reply.
I've done this also and not working...
So if I add the following code
.men1 af|menu
-tr-visible-items: 3;
and
.men2 af|menu
-tr-visible-items: 10;
and add on both afmenu's styleClass me1 and men2, nothing changes, it keeps the default value of 14... It looks lile only this works
af|menu
-tr-visible-items: 3;
Thanks,
Mihai

Similar Messages

  • How to set different row - column visibility attribute

    Hi all:
       I have one table in webdynpro for java. For example it have 4 rows, I need to set one column as different visible for row 1st and row 2nd .
               column1   column2
    row1      x               -
    row2      -               x
    Can I set it ?
    Thanks a lot.

    ya sure, u can
    make a visibility element and assign it to the tablecelleditor of each column of ur table. Now in the code, u must have bound the table to a node,  make the visibility element in the same node. Whichever row u want to make invisible, write the following code:
    wdcontext.node<nodename>.get<node name>elementat(<the row which u wish to make invisible>).set<visibility context>(wdvisibility.NONE);
    it will work.
    Let me know if u need further help....
    All The Best!!!
    Regards
    Gita

  • How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?

    Hi All,
    How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?
    Assume Material is Pen.
    While creating Sales Order in VA01 how to bring different price for the same material for Platinum,Gold and Silver Customers.
    Kindly help me out.
    Thanks,
    Renjith Jose

    A good place to start is http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
    Also, do a search in this forum on HttpURLConnection. That class allows you to use POST method to send form data to a web server.
    "Hidden" variables are only hidden in HTML. The HTTP that gets POSTed to the web server doesn't distinguish between hidden and not hidden. That is, the content you would write to the HttpURLConnection.getOutputStream() would be something like:
    hidden=1&submit=ok(Of course, the variable names would depend on what the web server was expecting from the form.)
    Also, be sure to set the Content-Type request parameter to "application/x-www-form-urlencoded"

  • How to set page numbers in scripts

    Hi,
        i want page numbers at bottom of page,
      please tell me how to set page numbers in scripts?

    Hi,
    In footer
    use this
    &PAGE& / &SAPSCRIPT-FORMPAGES&
    &PAGE& of &SAPSCRIPT-FORMPAGES&
    reward if it helps..
    regards,
    Omkar.

  • How to set different renderers to different cells in same column of JTable?

    Hello Friends,
    I need your help again...
    Does any body knows, how to set different renderer's for different cells of same column in JTable..??
    For ex.
    Col1 Col2 Col3 Col4
    A       A       A      A
    A       A       A      B
    A       A       A      C
    A       A      A       D
    Where A B C D would be different Renderers.  I want set exactly same ,,, ie. one column with different renderer at different cell positions..
    Right now i m setting renderer using statement bellow :
    table.getColumnModel().getColumn(int).setCellRenderer(rederer_Instance);But with this, effect in the last renderer is applicable whole column....
    Can any body help me out ?????????
    please refer this thread for similar kind of discussion...
    http://forums.sun.com/thread.jspa?forumID=57&threadID=571445Thanks
    Suyog

    Please refer to the first reply of [this thread|http://forums.sun.com/thread.jspa?forumID=57&threadID=571445] for the answer. If you have a specific problem implementing it, post you code with a specific question.

  • How to set different font for a particular row in jtables?

    How to set different font size and font type for a particular row in jtable?

    More than enough sample code here:
    [http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
    db

  • How to set different nr of e.g dia wp for different op.modes when in instan

    I wander how to set different nr of e.g dia wp for different op.modes when in instance profile the nr of wp is fixed.
    thx in advance

    yes u can create the operation mode by using tcode rz04. the steps are:-
    1) run the tcode :- rz04
    2: select the operation mode then click on create instance (create ur instanace for eg :- day mode and night mode)
    3)click on operation mode select the timetable then select normal operation(24 hr)->assign the modes (means select the time by double click and then right click on that select assign and give the mode eg:- day mode ) same way give another modes.Incase if there is any problem then please let me know.
    4)go to back -> click on instance/operation mode ->select create new instance->give the host name & click on current setting and save it the diaglog window will appear give the operation mode name eg day mode then if you want to increase or decrease the work process by cliking on + and - tab u can change it after that save it the WP authorization some kind of this window will appear click on yes then new instance mode will appear give the instance name eg night mode then save it again dialog window will appear do changes in work process according to ur requriement and click on save again the same wp window will appear if u want to add more operation mode then click yes either no then save it . Now u will able to see ur all operation modes.
    operation mode setup
    http://help.sap.com/saphelp_nw70/helpdata/EN/c4/3a5e76505211d189550000e829fbbd/content.htm
    Operation Mode Switches
    http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a5f1f505211d189550000e829fbbd/content.htm
    Note 39412 - How many work processes to configure
    cheers
    dEE

  • A quick way to set different color for certain items in JList?

    is there a quick way of setting different color for certain items in JList?

    Either use HTML strings as the values in your JList (quickest, but may not be the most convenient, especially if your model isn't just text), or create your own ListCellRenderer (e.g. extend DefaultListCellRenderer).
    There is no such thing as "list.setItemForeground(int index, Color c)". You'll have to use one of the methods above.

  • How to set different header for different Standard report page

    How to set different header for different Standard report page

    Hi,
    A easy answer would be use the 'set report header text.vi' but maybe you are talking about something else ?

  • How to set different Icons for Jtreenode

    How to set different Icons for Jtreenode,i want to set icons for jtreenode,not only for leaf,open,closeicon,i hope that each node has a different icon.Thanks!

    you need to check for the node value within a renderer, then assign an icon based on what you expect to get back.
    check out this page. http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

  • How to set different icons for different windows which is seen in the top left corner?

    Hi
    How to set different icons for different windows which is seen in the top left corner? I know when building exe there is a option to edit icons or add icons and that icon is default for all the windows in the project. But i want different icons for different windows which is possible in VB.
    Is there any way to set icon by calling any dlls.
    Thanks & Regards
    Samuel J
    [email protected]

    Hi Sam,
    no problem. See the attachment.
    Mike
    Attachments:
    TestIcon_LV85.zip ‏44 KB

  • How do you set the number of visible items in the popup box of a JComboBox?

    Hi,
    Do you know how to set the number of items that shall be visible in the popup box of a JComboBox?
    I have produced an implementation of an autocomplete JComboBox such that following each character typed in the text field, the popup box is repopulated with items. Normally 8 items are visible when showing the popup box. Sometimes even though the list of items is > 8 the popup box shrinks in height so that 8 items are not visible.
    Thanks,
    Simon

    Below is my JComboBox autocomplete implementation.
    The problem seems to occur when the list of items is reduced in number, the button selected and then the list size increased, the popup box does not automatically increase in size. I have tried setMaximumRowCount � but does not resolve the problem.
    To see how it works:
    1)     click in text field.
    2)     Type 1 � the full list of items are shown.
    3)     Type 0 � the list has been narrowed down � the popup box is greyed out for remaining items.
    4)     Type Backspace � the full list of items is redisplayed.
    5)     Type 0 � to narrow down the list.
    6)     Select button � the popup box is invisible.
    7)     Select button � the popup box is displayed with 2 items.
    8)     Select Backspace � here is the problem � the combo box list contains all items but the popup box has been shrunk so that only 2 are visible.
    9)     Select button � popup box is invisible.
    10)     Select button � popup box is as expected.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.plaf.basic.*;
    class Test
    private JComboBox jCB = null;
    private JTextField jTF=null;
    private String typed="";
    private Vector vector=new Vector();
    public Test()
    JFrame fr=new JFrame("TEST ComboBox");
    JPanel p = new JPanel();
    p.setLayout( new BorderLayout() );
    ComboBoxEditor anEditor = new BasicComboBoxEditor();
    String[] s = new String[30];
    for (int i=0; i<30; i++) {
    s[i] = (new Integer(i+10)).toString();
    jTF=(JTextField)anEditor.getEditorComponent();
    jTF.addKeyListener(new KeyAdapter()
    public void keyReleased( KeyEvent ev )
    char key=ev.getKeyChar();
    if (! (Character.isLetterOrDigit(key)
    ||Character.isSpaceChar(key)
    || key == KeyEvent.VK_BACK_SPACE )) return;
    typed="";
    typed=jTF.getText();
    fillCB(vector);
    jCB.showPopup();
    jCB = new JComboBox();
    jCB.setEditor(anEditor);
    jCB.setEditable(true);
    boolean ins;
    for (int x=0; x<30; x++)
    ins = vector.add( new String(s[x]) );
    fillCB(vector);
    jCB.setSelectedIndex(-1);
    fr.getContentPane().add(p);
    p.add("South",jCB);
    p.add("Center",new JButton("test combo box"));
    fr.pack();
    fr.show();
    public void fillCB(Vector vector)
    typed = typed.trim();
    String typedUp = typed.toUpperCase();
    jCB.removeAllItems();
    jCB.addItem("Please select");
    for(Enumeration enu = vector.elements(); enu.hasMoreElements();) {
    String s = (String)enu.nextElement();
    if (s.toUpperCase().startsWith(typedUp)) {
    jCB.addItem(s);
    jTF.setText(typed);
    public static void main( String[] args )
    Test test=new Test();
    Many thanks,
    Simon

  • How to maintain different prices for same item in different organizations

    hi all,
    We have noticed that the list price of an item at Item Validation Org level is getting defaulted when creating requisitions. We want to maintain different prices for the item for different organizations, so that the prices will be properly defaulted to requsitions depending on supplier and receiving org.
    We found one way of doing this. Using contract purchase agreement and Advanced Pricing price lists. Can anyone please let us know if there is any other way of achieving this??
    Also, I have a question regarding Advanced pricing Price Lists. I performed following steps.
    1.Set the QP: Licensed for Product profile to Purchasing
    2.Create and approve a contract purchase agreement in Oracle Purchasing
    3.Define Price Lists and Price List Lines (optional)
    4.Define sourcing rules and ASLs to automatically default source information onto requisition lines. Associate Contract to ASL.
    5. This will enable Oracle Advanced Pricing integration in the following Oracle Purchasing functionality:
    Requisition pricing
    Purchase order pricing
    But when I create requisitions, the price from price list is not getting defaulted automatically. In requisitions form, if I go to source tab and select source as a Contract Purchase Agreement, then the price from price lists is getting defaulted. Is there any way where the source for the requisition can be automatically defaulted to Contract and the price can be picked from price lists??

    Can oyu not make it an organization level item and specify the proce there instead of keeping it a master level item?
    Regards,
    Utsav.

  • How to set css effect on choicebox items

    Hello,
    i've got two questions.
    1) How can i edit an "Item" of a choicebox with css? I've figured out that i can easily give my choicebox like a other background color with it's ID. But i dont know how i do it with the items in a choicebox.
    2) And how do i implement, that the choicebox items are shown when i only hover over the choicebox?
    Thanks in advance!

    Hy there,
    1.)
    best way to start styling is to have a look at the default styles defined in caspian.css located in jfxrt.jar
    This is the best doku about css styling in javaFX beyound the css reference guide: http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html
    2.) I think you could set the items with -fx-color: transparent as they should dissapear on hover if you manipulate the style
    .choice-box .menu-item .hover{
    -fx-text-color:transparent;
    also try effects on
    .choice-box:hover {
    -fx-text-color:transparent;
    }

  • How to set different renderers to same column

    I am trying to set different renderer to same column.
    table.getColumn("columnname").setCellRenderer(
                   FirstCellRenderer);
    table.getColumn("columnname").setCellRenderer(SecondCellRenderer);
    I want both to work at the same time.
    It is taking the second renderer but not first.
    Can anyone please help me, how can i achive it.

    In my situation i need first renderer for all the columns in the table.
    Second renderer only for one column.(which shows thw column value as tooltip)
    Can you please tell me how can i do it.
    when i tried to consolidate in one renderer , it is showing me the same value to all the columns.

Maybe you are looking for