/
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?
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've solved the problem with help from people on expert exchange. For all who would benefit, here is what I did:
Using a table wrapper I can create a dynamic link. In the method in the Wrapper that creates a dynamic link, I can access the database and get additional info to append to the dynamic URL. Note - table wrappers and column wrappers cannot exist on the same table - anything you want to have in a column wrapper will have to be put into the table wrapper or all sorts of ugly errors will appear.
Here is what works for the Wrapper class:
package teska.displaytag;
/**
Licensed under the Artistic License; you may not use this file
Modified: getLink2() changed by C. Teska January 11, 2005
*/
public class Wrapper extends TableDecorator{
/**
* Creates a new Wrapper decorator who's job is to reformat some of the data located in our TestObject's.
*/
public Wrapper(){
super();
}
public String getScNcViewLink(){
BasicDynaBean rowObject = (BasicDynaBean) getCurrentRowObject();
Integer sfdid = (Integer) rowObject.get("sfdid");
int sfdid_int = sfdid.intValue();
String sfdid_string = Integer.toString(sfdid_int);
// Here is where I could access the database and use the sfdid_string to
// obtain an additional value from the database and append that String
// to the url below instead of the sfdid_string.
return "<a href = \"/sandbox1/displayView.jsp?sfdid=" + sfdid_string + "\">View</a>";
}
Hi,
I'm having some problems implementing the examples used to create 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;
/**
*
*
*
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;
/**
*
*/
public class Wrapper extends TableDecorator{
/*
public String getDate(){
return this.dateFormat.format(this.getCurrentRowObject().getDate());
}
*/
/
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?
Please let me know if I can provide any additional info
Thanks,
Courtenay
Just a note for reference - the last column in my display tag table is the one that references the wrapper class to create the dynamic link.
please please please anybody with information on how to do this will be appreciated beyond imagination!!!!
Courtenay
I've solved the problem with help from people on expert exchange. For all who would benefit, here is what I did:
Using a table wrapper I can create a dynamic link. In the method in the Wrapper that creates a dynamic link, I can access the database and get additional info to append to the dynamic URL. Note - table wrappers and column wrappers cannot exist on the same table - anything you want to have in a column wrapper will have to be put into the table wrapper or all sorts of ugly errors will appear.
Here is what works for the Wrapper class:
package teska.displaytag;
/**
*
*
*
Originally from: package org.displaytag.sample;
*
*
/
import java.text.DecimalFormat;
import java.util.;
//import org.displaytag.sample.;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.beanutils.*;
import org.displaytag.decorator.TableDecorator;
/**
*
*
*/
public class Wrapper extends TableDecorator{
/**
}
Here is what works in my nc_lists.jsp:
<%
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"/>
<display:column property="scNcViewLink" title="View" />
</display:table>