Not sure if this will work with

<h:selectOneMenu 

  but you could try it this way. I have done this with a commandLink.

<h:commandLink id="manufacturer_x"
        action="go_Test" actionListener="#{testList.execute}">
        <f:param name="queryTableParam" value="ALL" />
</h:commandLink>

Inside bean.

public void execute(ActionEvent event) {
queryTable = (String) map.get("queryTableParam");
//then call  whatever you need to do
this.go();

}





Lisa wrote:
> I tried the following but could not get it to work:
>
>                   
>     <h:selectOneMenu id="areaCode" value="#{areaCodeBean.areaCode}">
>         <f:selectItems value="#{areaCodeBean.selectList}"/>
>         <f:param name="codeType" value="US.AREA_CODES" />
>     </h:selectOneMenu>
>
> And in the BB to retrieve the codeType I have the following method that is
> called:
>
>     private String getCodeType()
>     {
>         String codeType = (String)FacesContext.getCurrentInstance()
>                
> .getExternalContext().getRequestParameterMap().get("codeType");
>
>
>         return codeType;
>     }
>
> ---
> When I look at the value for "codeType" it is always null.  getCodeType is
> called by 
>
>    public List<SelectItem> getSelectList() {
>      // query from types table here and pass codeType (call to getCodeType()
> which uses faces context
>     // to get a param set in the XHTML.
>    } 
>
>
>
>
>
>
> sahil wrote:
>   
>> you can use the <f:param> tag to pass a parameter in jsf.
>>
>> although I havent tried it in jsf, but i use it in jboss-seam. I think it
>> will work.
>>
>>
>> Lisa wrote:
>>     
>>> I want to build a SelectItem list by calling a method in my backing bean,
>>> but I want to be able to pass the backing bean a String (from the XHTML).
>>>
>>>
>>> ---
>>> This is what I currently have:
>>>
>>>     <h:selectOneListbox
>>>             rendered="#{carBean.listMode}"
>>>             id="idSelectVehicleType"
>>>             value="#{carBean.vehicleType}"
>>>             size="1">
>>>
>>>         <f:selectItems id="idCarBeanTypeList"
>>> value="#{carBean.vehicleTypeList}"/>
>>>     </h:selectOneListbox>
>>>
>>> where vehicleTypeList is a method in CarBean.getVehicleTypeList()
>>>
>>> ---
>>> So I want to change the method signature to accept a String like so:
>>>
>>>   CarBean.getVehicleTypeList(String s)
>>>
>>> and in the XHTML pass String s to CarBean.getVehicleTypeList(String s).
>>>
>>> Is this possible?
>>>   value="#{carBean.vehicleTypeList("myString")}"
>>>
>>>
>>> thanks
>>>
>>>
>>> Lisa
>>>
>>>       
>>     
>
>   

Reply via email to