[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.6

display tag - problems using table decorator to create a dynamic link

Asked by courtenayt in Java Standard Tag Library (JSTL) & Server Tags, Java Programming Language, Java Server Pages (JSP)

Tags: displaytag

Hi,
 
I'm having some problems implementing the examples on the display tag website for creating dynamic links using a table decorator.  
 
I have the following setup:
 
I have a jsp page that displays my table (data is pulled from a database and put into a RowSetDynaClass):
 
<%
RowSetDynaClass new_ncs = ActionViewTables.newNCTableSC(sdid_string);
%>  
<% request.setAttribute("new_ncs_sc", new_ncs); %>
<display:table name="requestScope.new_ncs_sc.rows" id="row" decorator="teska.displaytag.Wrapper">
<display:column property="sfdid" title="ID" sortable="true"/>
<display:column property="level" title="Level" sortable="true"/>
<display:column property="form_name" title="Form Name" sortable="true"/>
<display:column property="last_name" title="System Coordinator" sortable="true"/>
<display:column property="date_submitted" title="Date Submitted" sortable="true" decorator="teska.displaytag.LongDateWrapper"/>  
<display:column property="scncviewlink" title="Take Action" />  
</display:table>
 
I have created my own wrapper class as follows:
 
package teska.displaytag;
 
/**
* Licensed under the Artistic License; you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://displaytag.sourceforge.net/license.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*Originally from: package org.displaytag.sample;
*
*
*/
 
 
import java.text.DecimalFormat;
import java.util.*;
 
import org.apache.commons.lang.time.FastDateFormat;
import org.displaytag.decorator.TableDecorator;
 
 
/**
* This class is a decorator of the TestObjects that we keep in our List. This class provides a number of methods for
* formatting data, creating dynamic links, and exercising some aspects of the display:table API functionality.
* @author epesh
* @author Fabrizio Giustina
* @version $Revision: 1.12 $ ($Author: fgiust $)
* modified by C Teska Race
*
*/
 
public class Wrapper extends TableDecorator{
 
/**
* FastDateFormat used to format dates in getDate().
*/
private FastDateFormat dateFormat;
 
/**
* DecimalFormat used to format money in getMoney().
*/
private DecimalFormat moneyFormat;
 
 
/**
* Creates a new Wrapper decorator who's job is to reformat some of the data located in our TestObject's.
*/
 
public Wrapper(){
super();
 
this.dateFormat = FastDateFormat.getInstance("MM/dd/yy"); //$NON-NLS-1$
this.moneyFormat = new DecimalFormat("$ #,###,###.00"); //$NON-NLS-1$
}
 
 
public String getScncviewlink(){
ListObject currRowObject = (ListObject)getCurrentRowObject();
String sfdid = (currRowObject.getSfdid());
return "\<a href=\"/displayView.jsp?sfdid=" + sfdid + "\"\>View\</a>";
}
 
 
/**
* Test method which always returns a null value.
* @return <code>null</code>
*/
public String getNullValue(){
return null;
}
 
 
/**
* Returns the date as a String in MM/dd/yy format.
* @return formatted date
*/
/*
public String getDate(){
return this.dateFormat.format(this.getCurrentRowObject().getDate());
}
 
*/
 
/**
* Returns the money as a String in $ #,###,###.00 format.
* @return String
*/
/*
public String getMoney(){
return this.moneyFormat.format(this.getCurrentRowObject().getMoney());
}
*/
 
}//close class
 
 
When I run this code I get the following error message:
 
500 Servlet Exception
 
Note: sun.tools.javac.Main has been deprecated.
/home/teska/public_html/sandbox1/WEB-INF/classes/teska/displaytag/Wrapper.java:64:
Class teska.displaytag.ListObject not found.
ListObject currRowObject = (ListObject)getCurrentRowObject();
^
/home/teska/public_html/sandbox1/WEB-INF/classes/teska/displaytag/Wrapper.java:64:
Class teska.displaytag.ListObject not found.
ListObject currRowObject = (ListObject)getCurrentRowObject();
^
2 errors, 1 warning
 
 
Resin 2.1.16 (built Tue Feb 15 11:12:27 PST 2005)
 
 
My questions are:
 
1: Where do I get the ListObject class and where do I put it to have ot work - does it need additional classes to work?
 
2. I'm not clear how I access the value of sfdid (the first value in each row of my RowSetDynaClass). The examples talk about getId() and getListIndex(), but it is not at all clear which one is the value of a specific object - if either one of them actually are that.  
 
Please let me know if I can provide any additional info
 
Thanks,
Courtenay
[+][-]01/30/07 01:39 PM, ID: 18431504Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Java Standard Tag Library (JSTL) & Server Tags, Java Programming Language, Java Server Pages (JSP)
Tags: displaytag
Sign Up Now!
Solution Provided By: mrcoffee365
Participating Experts: 1
Solution Grade: A
 
[+][-]01/24/07 10:55 AM, ID: 18388696Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/25/07 09:05 AM, ID: 18397175Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/25/07 09:43 AM, ID: 18397541Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/25/07 11:13 AM, ID: 18398401Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/25/07 12:09 PM, ID: 18398896Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/25/07 01:44 PM, ID: 18399638Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/25/07 02:27 PM, ID: 18399982Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/27/07 10:32 AM, ID: 18411227Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/27/07 11:37 AM, ID: 18411457Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/07 11:01 AM, ID: 18421870Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/07 11:56 AM, ID: 18422303Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/07 12:44 PM, ID: 18422769Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/07 06:44 PM, ID: 18424785Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 06:14 AM, ID: 18427691Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 06:23 AM, ID: 18427749Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 08:25 AM, ID: 18428798Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 09:19 AM, ID: 18429229Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 09:38 AM, ID: 18429415Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 09:55 AM, ID: 18429556Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 09:57 AM, ID: 18429577Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 10:18 AM, ID: 18429731Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 10:18 AM, ID: 18429736Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 10:45 AM, ID: 18429997Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 11:25 AM, ID: 18430347Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 11:44 AM, ID: 18430511Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 11:52 AM, ID: 18430590Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/30/07 12:47 PM, ID: 18431066Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 12:51 PM, ID: 18431097Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/30/07 02:18 PM, ID: 18431810Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92