Richard Pinaroc

Greenhorn
+ Follow
since Jun 03, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Richard Pinaroc

Hello All,

Running Primefaces v3.2 and have nested datatables which has the following configuration. Found this configuration to help get pagination and sorting working for each generated datatable. I did find that adding the widgetVar attribute to the inner datatable breaks sorting and pagination.




The following error message is generated on the initial sort for any field column in any datatable but subsequent sorts on a different field do not generate this error.




Any ideas or suggestions?

Thank you.
11 years ago
JSF
Hello All,

Is there a way to replace the multi-select checkbox with the view button in the column title in the following primfaces datatable "Checkbox Based Selection"example?

http://primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf

I can easily hide the multi-select checkbox using javascript. Attached is an example I am trying to figure out.

Thank you.
12 years ago
JSF
Hello All,

My code is based on the PrimeFaces "DataTable - Row Selection" example. I want to be able to change the color value using selectOneMenu for that selected record. The problem is when add a selectOneMenu



returns the following error:



12 years ago
JSF
Thanks Paul...That's what I thought.
Hello All,

I am trying to parameterize my sql statement but the following mysql statement will return no results.

mysql = "select ?,count(*) as count from mytable where ? is not null and ( ? like '%@abc.com' or ? like '%@def.com' ) and myfield = ? and validate_date > date_sub(NOW(), Interval ? ) group by ?";

pstmt = conn.prepareStatement(mysql);
pstmt.setString(1, "field1");
pstmt.setString(2, "field1");
pstmt.setString(3, "field1");
pstmt.setString(4, "field1");
pstmt.setString(5, "test");
pstmt.setString(6, "2 Month");
pstmt.setString(7, "field1");
rs = pstmt.executeQuery();

Boolean hasrows = rs.next();


After narrowing down the problem, here is what I am left with that works.

mysql = "select "+field1+",count(*) as count from mytable where ? is not null and ( "+field1+" like '%@abc.com' or ? like '%@def.com' ) and myfield = ? and validate_date > date_sub(NOW(), Interval "+dateRange+" ) group by "+field1;

pstmt = conn.prepareStatement(mysql);
pstmt.setString(1, "field1");
pstmt.setString(2, "field1");
pstmt.setString(3, "test");
rs = pstmt.executeQuery();

Boolean hasrows = rs.next();

Any ideas or suggestions?

Here is my environment that I am testing on.
JDK 1.6.0_22
MySQL 5.0.77
NetBeans 7.0

Thank you.
figured it out using the following code

<p:dataTable value="#{my2DBean.my2Dlist}" id="tbl" var="row" style="width: 40%">
<p:columns columnIndexVar="index" var="columnNames" value="#my2DBean.myColumnHeadings}">
<f:facet name="header">
<h:outputText style="text-align:left" value="#{columnNames}" />
</f:facet>
<h:outputText value="#{row[index]}"/>
</p:columns>
</p:dataTable>
12 years ago
JSF
Hello Sara et all,

I found this solution for the same issue I am having but I cannot get my 2D arraylist to show up properly in a nested datatable. The problem I am having is that the data is being displayed in one column instead of multiple columns. If I output the 2D arraylist to console using plain old java, it shows up properly.

Here is a simple example on what I am doing in my backing bean



Here is what my jsf looks like:



This is the result being displayed:

Item Name
Quantity
Price

Chocolate bar
10
1.50

Chips
5
1.00

Instead of the desired output:

Item Name Quantity Price
Chocolate Bar 10 1.50
Chips 5 1.00

Any ideas or suggestions?

Thanks in advance
12 years ago
JSF