Well, in the latest release (at least) you can find the extended selectOneListbox. Have you declared the taglib in the beginning of your jsp? Like this:
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%> But, if you want to keep with the standard selectOneListbox and although I don't understand which is the objective of what you are trying to do, here we go! - Step1: Create a backing bean with this code, where there are two selectOneListbox components declared (the ones we need): [CODE] import javax.faces.component.html.HtmlSelectOneListbox; import javax.faces.context.FacesContext; public class ConfigurationTest extends BioexedraBeanBase{ private HtmlSelectOneListbox list1; private HtmlSelectOneListbox list2; public ListTestBacking() { list1 = new HtmlSelectOneListbox(); list2 = new HtmlSelectOneListbox(); // I assign an id to each list list1.setId("leftList"); list2.setId("rightList"); // here I assign the title for the list1, using the clientId of the list2 list1.setTitle(list2.getClientId(FacesContext.getCurrentInstance())); } public HtmlSelectOneListbox getList1() { return list1; } public void setList1(HtmlSelectOneListbox list1) { this.list1 = list1; } public HtmlSelectOneListbox getList2() { return list2; } public void setList2(HtmlSelectOneListbox list2) { this.list2 = list2; } [/CODE] - Step 2: now your jsp page must have the two selectOneListbox components binded to the backing bean (using the 'binding' attribute that every component has and which allows to bind the jsp component with its instance declared in the backing bean): [CODE] <h:selectOneListbox binding="#{configurationTest.list1}"> <f:selectItem itemValue="1" itemLabel="LeftItem1"/> <f:selectItem itemValue="2" itemLabel="LeftItem2"/> </h:selectOneListbox> <h:selectOneListbox binding="#{configurationTest.list2}"> <f:selectItem itemValue="3" itemLabel="LeftItem1"/> <f:selectItem itemValue="4" itemLabel="LeftItem2"/> </h:selectOneListbox> [/CODE] Then only remains to test it ;-) If you have more doubts, don't hesitate to ask, Regards, Bruno 2005/6/10, Mariano Petrakovsky <[EMAIL PROTECTED]>: > hi Bruno, > > SelectOneListBox don't exist in my extended implementation of myfaces > :(... > i can't use forceId. > > I'm newby in jsf... and... generate my own HTMLSelectOneListBox... > :P... > mmnn... is not a good idea. > > But... based on this... me ask... > > <h:selectOneListbox id="leftList" size="15" > title="#{bean.rightListId} " > ... > > then... I need a bean to get the rendered id. How make this with the > FacesContext? > > (with code example will be happy :D) > > > -- > Mariano G. Petrakovsky > Programmer � Software Factory > AXG Tecnonexo - www.tecnonexo.com > > Development facilities:Av. Maip� 1252 8� (C1006ACT) � Buenos Aires � > Argentina. > Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065. > > Headquarters: 1604 Spring Hill Road, Suite 160 Vienna � VA 22182 � USA. > Tel.: (202) 986-7541 - Fax: (202) 787-3891. > > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � > � � � � > > -----Mensaje original----- > De: Bruno Aranda [mailto:[EMAIL PROTECTED] > Enviado el: Viernes, 10 de Junio de 2005 14:01 > Para: MyFaces Discussion > Asunto: Re: How to reference a component? > > > The easiest way to do this is to use the extended selectOneLisbox > components and use the attribute forceId, something like this: > > <h:selectOneListbox id="leftList" size="15" title="rightList" ... > <h:selectOneListbox id="rightList" forceId="true" size="15" title=""... > > The forceId attribute provokes that the clientId is the same that the > id you use with the id attribute. > > If you want to keep to standard components, you must have to use a > backing bean where you dynamically generate the HtmlSelectOneListbox > components, then you could get the final id (client id) of the other > component using list1.setTitle(list2.getClientId(facesContext)); > > Hope this helps, > > Bruno > > 2005/6/10, Mariano Petrakovsky <[EMAIL PROTECTED]>: > > > > How to reference an component inside the .jsp...??? > > > > if I have an .jsp like this: > > > > <h:selectOneListbox id="leftList" size="15" title="" ... > > ... > > <h:selectOneListbox id="rightList" size="15" title=""... > > > > I need for instance... make title of first SelectOneListbox with the > > rightList id > > > > some like... <h:selectOneListbox id="leftList" size="15" > > title="rightList.id" > > > > (I need this because id rendered is different of id static, it's > add > > form:subview:... then i need the id rendered :)) > > > > -- > > Mariano G. Petrakovsky > > Programmer � Software Factory > > AXG Tecnonexo - www.tecnonexo.com > > > > Development facilities:Av. Maip� 1252 8� (C1006ACT) � Buenos Aires � > > Argentina. > > Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065. > > > > Headquarters: 1604 Spring Hill Road, Suite 160 Vienna � VA 22182 � USA. > > Tel.: (202) 986-7541 - Fax: (202) 787-3891. > > > > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � > � > > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � > � > > � � � � > > > > > >

