|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
setDisplayValueOnly does not work on HtmlSelectOneMenuHi, 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 |
|
|
Re: setDisplayValueOnly does not work on HtmlSelectOneMenuYaron,
What does your jsp file look like? -R Yaron wrote: > > 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 > |
|
|
RE: setDisplayValueOnly does not work on HtmlSelectOneMenuRichard,
My jsp has a binding to a grid. The code I sent is added to the grid and the grid is rendered. In any case I am attaching the grid's code if that helps. <td valign="top"> <!-- BEGIN panelGrid --> <h:panelGrid styleClass="panelGrid" id="grid1" width="100%"></h:panelGrid> <!-- END panelGrid --> </td> Thanks, Yaron -----Original Message----- From: Richard Yee [mailto:ryee@...] Sent: Sunday, May 11, 2008 11:26 PM To: MyFaces Discussion Subject: Re: setDisplayValueOnly does not work on HtmlSelectOneMenu Yaron, What does your jsp file look like? -R Yaron wrote: > > 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 > |
|
|
Re: setDisplayValueOnly does not work on HtmlSelectOneMenuI don't see any binding between the grid that you are building and the one in the JSP page. Did you send the correct code?
-R On Mon, May 12, 2008 at 12:06 AM, Yaron Spektor <yaron.spektor@...> wrote: Richard, |
|
|
RE: setDisplayValueOnly does not work on HtmlSelectOneMenuHi Richard and All, I think my question is a bit broader then
the binding issue. I was wondering whether any of you know why
dispalyValueOnly would not work in a MyFaces HtmlSelectOneMenu component (not a
tag). I am reattaching the example code I used: 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); menu.setDisplayValueOnly(true); menu.setDisplayValueOnlyStyleClass("myStyleClass"); return menu; } Thanks Yaron From: Richard Yee
[mailto:richard.k.yee@...] I don't see any binding
between the grid that you are building and the one in the JSP page. Did you
send the correct code? On Mon, May 12, 2008 at 12:06 AM, Yaron Spektor <yaron.spektor@...>
wrote: Richard,
|
| Free Forum Powered by Nabble | Forum Help |