dev@woodstock.java.net

Re: Calendar do not work in a table

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Fri, 06 Jun 2008 20:31:05 -0400

What did you try, specifically? I provided a couple different
approaches. If you're working with a database only, the HashMap approach
is not for you.

I don't have a full database example for you, but you must pull values
from the DataProvider. (Not certain if you must commit the input values,
first?) If you're working with CachedRowSetDataProvider, you should be
able to obtain a value for a given RowKey and FieldKey. Assuming the
provider uses an int row index, the first row is "0" and my field key is
'DATE', I expect you can write something like this:

    Object obj = provider.getValue(getFieldKey("DATE"), getRowKey("0"))

Note that you can also call the getFieldKeys and getRowKeys methods to
get an array you can iterate over. The DataProviders APIs are documented
below.

    http://developers.sun.com/docs/jscreator/apis/dataprovider/index.html

That said, if calendar is not working for you, please try another
component like checkbox or text field. At least, that will tell you if
there is something wrong with your code or the calendar itself.

Dan

PS. There are a couple known issues with calendar which are related to
table -- see issues #1265
<https://woodstock.dev.java.net/issues/show_bug.cgi?id=1265> and #1024
<https://woodstock.dev.java.net/issues/show_bug.cgi?id=1024>.


Liviu Delureanu wrote:
>
> I've tried to use your suggestion but it do not work. I'll appreciate
> if you have a full example of a page which :
>
>
>
> 1. have a column in which all cells are a calendar component
>
> 2. the table component is updatable and is binded to a database table.
>
>
>
> Thanks!
>
>
>
> --- On *Mon, 6/2/08, Dan Labrecque /<Dan.Labrecque_at_Sun.COM>/* wrote:
>
> From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
> Subject: Re: Calendar do not work in a table
> To: dev_at_woodstock.dev.java.net
> Date: Monday, June 2, 2008, 10:20 PM
>
> This is not a Woodstock bug. The blog example simply does not show
> how to obtain values. I've added comments to the blog and will
> close this issue.
>
> Dan
>
> Liviu Delureanu wrote:
>> If you think the Issue #: 1239
>> <https://woodstock.dev.java.net/issues/show_bug.cgi?id=1239> is a
>> real bug please vote for this on
>> Votes for issue 1239
>> <https://woodstock.dev.java.net/scdocs/votehelp.html>:
>> Vote for this issue
>> <https://woodstock.dev.java.net/issues/showvotes.cgi?voteon=1239>
>>
>>
>> */Liviu Delureanu <liviudelureanu_at_yahoo.com>/* wrote:
>>
>> I've opened an issue for this problem:
>> Issue #: 1239
>> <https://woodstock.dev.java.net/issues/show_bug.cgi?id=1239>
>>
>>
>> */Liviu Delureanu <liviudelureanu_at_yahoo.com>/* wrote:
>>
>> Hi!
>> I'm new with Woodstock and web technology and I've tried
>> to get the calendar component placed in the table after
>> followed the
>>
>> steps:
>>
>> http://blogs.sun.com/winston/entry/adding_calendar_to_table
>>
>> 1 Create a Project
>> 2 Drag and drop Table Component on to the design surface
>> 3 Drag and drop the JDBC table Data Sources -> Travel -> Trip on to the Table
>> Component.
>> 4 Optional: Using table layout remove the TRIPID and TRIPTYPEID
>> 5 Using Table layout set the
>> Pagination of the table and page size 5.
>> 6 Drag and drop a Calendar component on to the design surface (not on the table
>> component)
>> 7 Edit the JSP page and
>> move the Calendar Tag to the Table Column Corresponding
>> to DEPDATE
>> 8 From the outline Panel remove the extra StaticText component in the DEPDATE
>> column.
>>
>> 9 Do not remove it in the JSP
>> 10 Remove the style attribute from the Calendar Tag
>> Now the DEPDATE tablecolumn tag in JSP should look like
>>
>> <ui:tableColumn binding="#{Page1.tableColumn3}" headerText="DEPDATE"
>> id="tableColumn3" >
>> <ui:calendar binding="#{Page1.calendar1}" id="calendar1"/>
>> </ui:tableColumn>
>>
>>
>> However, during runtime it always refer to ROW No 1 whenever I select a date
>> from the calendar component.
>> The calendar button show only on row 1 and if I choose from that a date all
>> rows of the table is changed.
>> Can tell me what I'm doing wrong?
>> Any Ideea ?
>>
>> I've used NetBeans 6.1 and 6.0.1 and Woodstock 4.3
>>
>>
>>
>>
>>
>>
>
>