Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to render <hx:dataIterator> before <h:selectBooleanCheckbox>

Posted on 2008-10-02
1
2,225 Views
Last Modified: 2013-11-24
Hi!

As you can see below I'm making use of "selectBooleanCheckbox" whose value is derived from the "dataIterator". But in real time scenario, the component "selectBooleanCheckbox" gets rendered before "dataIterator" because of which a NullPointerException gets thrown. But instead of a "selectBooleanCheckbox", if I use "outputText" inside the "dataIterator" I get the data displayed correctly.  Can anyone please let me know how to render "dataIterator" before rendering the "selectBooleanCheckbox".



One more thing, I don't want to use "dataTable" instead of "dataIterator". My presentation logic doesn't allow me to do that.

Thanks in advance guys,
Kartheek.
<hx:dataIterator value="#{row.subscriptions}" var="dataCol"
								id="subscriptionsTable1" >
								<h:selectBooleanCheckbox id="checkbox1"
									value="#{dataCol.emailSubscribed}">
								</h:selectBooleanCheckbox>
							</hx:dataIterator>

Open in new window

0
Comment
Question by:kkkrao
1 Comment
 

Accepted Solution

by:
kkkrao earned 0 total points
ID: 22648228
Ok...... I guess no one has a solution/hack for it.

Well, I made my stuff work by removing "<h:selectBooleanCheckbox>" and replacing it with "<h:outputText>" whose value is HTML code of checkbox"". U can have a look at the code snippet below....

Cheers,
K.

							<hx:dataIterator value="#{row.subscriptions}" var="dataCol"
								rendered="#{row.rowData}" id="subscriptionsTable1" >
								<h:outputText value="<td>" escape="false"></h:outputText>
								<h:outputText escape="false" value="<input type='checkbox' name='option' checked>" rendered="#{dataCol.emailSubscribed}"/>
								<h:outputText escape="false" value="<input type='checkbox' name='option' >" rendered="#{!dataCol.emailSubscribed}"/>
								<h:outputText value="</td>" escape="false"></h:outputText>
							</hx:dataIterator>

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 51
hibernate insert example 13 34
ejb on wildfly 5 30
Java 8 to Java 6 8 20
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question