Solved

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

Posted on 2008-10-02
1
2,231 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running JavaFX on JDeveloper 12C 1 79
How to convert from xls to xlsx using java 7 97
What's wrong with this code? 4 36
Where to place postgres JDBC driver jar on tomcat 8 33
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

697 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