setDisplayValueOnly does not work on HtmlSelectOneMenu

View: New views
2 Messages — Rating Filter:   Alert me  

setDisplayValueOnly does not work on HtmlSelectOneMenu

by Yaron Spektor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I appologize if this was sent twice, but I couldn’t see the first one on the list:

 

Hi,

I am running this simple example below trying to set the setDisplayValueOnly on HtmlSelectOneMenu to true

It does print out: “in buildComboBox !!!!menu.isDisplayValueOnly:true” but I still see the menu widget on the screen.

I am using MyFaces 1.1.6  

 

import org.apache.myfaces.component.html.ext.HtmlSelectOneMenu;

 

private static UIComponent buildComboBox(List values, String bindingValue, String idPrefix, int id, boolean immediate, String defaultElection) {

            HtmlSelectOneMenu menu = new HtmlSelectOneMenu(); // combo box

            ValueBinding binding = app.createValueBinding(bindingValue);

            menu.setValueBinding("value", binding);

            menu.setId(idPrefix + "_" + id);

             menu.setRequired(true);

            // populate the drop down list

            UISelectItems items = new UISelectItems();

            items.setValue(values); // add choices to list

            menu.getChildren().add(items);

            if(defaultElection!=null){

                  menu.setValue(defaultElection);

            }    

            menu.setDisplayValueOnly(true);

            System.out.println("in buildComboBox !!!!menu.isDisplayValueOnly:"+menu.isDisplayValueOnly());

            return menu;

      }

 

Any thoughts?

Thanks

Yaron


? autosort with t:commandSortHeader

by Dipl.-Ing. Torsten Liermann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I'm using tomahawk 1.1.6 with facelets and will, that
a simple Column of java.util.Long  will be autosorted

The the code is:

 <t:column defaultSorted="true" sortable="true" sortPropertyName="transactionid">
                <f:facet name="header">
                    <t:commandSortHeader columnName="transactionid" value="No." arrow="true"/>
                </f:facet>
                <t:outputText value="#{_transaction.transactionid}">
                    <f:convertNumber pattern="0000000" type="number"/>
                </t:outputText>
                </t:column>

The arrow toggles, up and down, but not the content. Must I implement
a comparator or what ever?

Thanks for a tip.
Torsten