Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic selectOneRadio items inside of a dataTable

843844Sep 9 2008 — edited Sep 11 2008
I am populating a dataTabe from a list of objects being passed to the datatable from the backing bean. that part work perfectly. now I want to add in a radio button at the end of each row which will have an ajax method tied to it. I am having a little trouble dynamically creating the radio buttons as the datatable loops through the list of objects. I know each radio button needs a unique ID but it won't accept a value from the current object. I get a facesException "Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains "#"". Any insight as to how I would be able to achieve this dynamic radio button list would be very much appreciated.
<h:form>
<h:selectOneRadio id="contactId">
<h:dataTable columnClasses="nameColumn,activeColumn,actionColumn" border="0" cellpadding="3" cellspacing="0" width="400" rendered="#                {accntCntrl.manageOtherUsers}" value="#{accntCntrl.contactList}" var="contactList">
	  
	   <h:column>
	    	
	    	<h:outputText value="#{contactList.firstName} #{contactList.lastName}"/>	    	
	    	
	    </h:column>
	    
	    <h:column>
	    	<h:outputText value="#{contactList.active}"></h:outputText>
	    </h:column>
	    <h:column>
	    	<h:graphicImage value="../resources/img/icon/process-stop.png"/><h:outputText value=" "/><h:graphicImage value="../resources/img/icon/edit-find-replace.png"/>
	    </h:column>
	    <h:column>
           
            <f:selectItem id="#{contactList.firstName}" itemLabel="Edit" value="#{contactList.id}" />
            
        </h:column>
	    
    </h:dataTable>
    </h:selectOneRadio>
    </h:form>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2008
Added on Sep 9 2008
2 comments
1,086 views