Calendar inside table

Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Calendar inside table

janir
Hi!
Have trouble getting this to work; the "Calendar button" is only showing on the first row. And if i select a date in the control; the date is copied to all rows.

Here is part JSP:
<webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}" headerText="FinishDate" id="tableColumnFinish" width="217"> 
<webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2" selectedDate="#{currentRow.value['finishDate']}"/> 

Here is part of the mapped data.
private Date finishDate;

public Date getFinishDate() {
return finishDate;
}

public void setFinishDate(Date FinishDate) {
this.finishDate = new java.sql.Date(FinishDate.getTime());
}


Here is a couple of screenshots; illustrating the problem
1. Designtime, http://www.jirstart.net/test/designtime.png
2. Runtime; http://www.jirstart.net/test/runtime.png


Any ideas?
Thanks,janir
Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

Roman Mostyka
Hi Janir!

Try to read this:
http://blogs.sun.com/winston/entry/adding_calendar_to_table
I hope it will help You.

Thanks,
Roman.

> Hi!
> Have trouble getting this to work; the "Calendar button" is only showing on
> the first row. And if i select a date in the control; the date is copied to
> all rows.
>
> Here is part JSP:
> <webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}"
> headerText="FinishDate" id="tableColumnFinish" width="217">
> <webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2"
> selectedDate="#{currentRow.value['finishDate']}"/>
>
> Here is part of the mapped data.
> private Date finishDate;
>
> public Date getFinishDate() {
> return finishDate;
> }
>
> public void setFinishDate(Date FinishDate) {
> this.finishDate = new java.sql.Date(FinishDate.getTime());
> }
>
>
> Here is a couple of screenshots; illustrating the problem
> 1. Designtime, http://www.jirstart.net/test/designtime.png
> 2. Runtime; http://www.jirstart.net/test/runtime.png
>
>
> Any ideas?
> Thanks,janir
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

janir
Hi!

Have done so earlier; and followed the "recipy"; but problem remains the same.
Regards,
janir


Roman Mostyka wrote
Hi Janir!

Try to read this:
http://blogs.sun.com/winston/entry/adding_calendar_to_table
I hope it will help You.

Thanks,
Roman.
> Hi!
> Have trouble getting this to work; the "Calendar button" is only showing on
> the first row. And if i select a date in the control; the date is copied to
> all rows.
>
> Here is part JSP:
> <webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}"
> headerText="FinishDate" id="tableColumnFinish" width="217">
> <webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2"
> selectedDate="#{currentRow.value['finishDate']}"/>
>
> Here is part of the mapped data.
> private Date finishDate;
>
> public Date getFinishDate() {
> return finishDate;
> }
>
> public void setFinishDate(Date FinishDate) {
> this.finishDate = new java.sql.Date(FinishDate.getTime());
> }
>
>
> Here is a couple of screenshots; illustrating the problem
> 1. Designtime, http://www.jirstart.net/test/designtime.png
> 2. Runtime; http://www.jirstart.net/test/runtime.png
>
>
> Any ideas?
> Thanks,janir
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@visualweb.netbeans.org
For additional commands, e-mail: users-help@visualweb.netbeans.org
Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

ckutler2
Janir,

In each row, the calendar's selected date must be set to a separate object. In Winston's example, the calendar's selected date is bound to a column in the database row.  You are binding the calendar in each row to the one property finishDate.

Is there a column in the database table that holds the date for each row? Then bind the Calendar to that database column. If not, you need to create something to hold the data for each row. I do something similar to this in http://blogs.sun.com/divas/entry/table_component_sample_visual_web. Here I am holding serving sizes but you could do something similar to hold dates.



janir wrote:
Hi!

Have done so earlier; and followed the "recipy"; but problem remains the
same.
Regards,
janir



Roman Mostyka wrote:
  
Hi Janir!

Try to read this:
http://blogs.sun.com/winston/entry/adding_calendar_to_table
I hope it will help You.

Thanks,
Roman.
    
Hi! 
Have trouble getting this to work; the "Calendar button" is only showing
on
the first row. And if i select a date in the control; the date is copied
to
all rows. 

Here is part JSP: 
<webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}"
headerText="FinishDate" id="tableColumnFinish" width="217"> 
<webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2"
selectedDate="#{currentRow.value['finishDate']}"/> 

Here is part of the mapped data. 
private Date finishDate; 

public Date getFinishDate() { 
return finishDate; 
} 

public void setFinishDate(Date FinishDate) { 
this.finishDate = new java.sql.Date(FinishDate.getTime()); 
} 


Here is a couple of screenshots; illustrating the problem 
1. Designtime, http://www.jirstart.net/test/designtime.png
2. Runtime; http://www.jirstart.net/test/runtime.png


Any ideas? 
Thanks,janir
  
      
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



    

  

-- 
Chris Kutler, Technical Writer for Ruby Support in the NetBeans IDE
http://blogs.sun.com/divas
------------------------------------------------------------------
Did you know a cat has 32 muscles in each ear.
Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

janir
Hi!

The code shown was just a small extract of my code; all data for all fields in the table are mapped towards an array of objects, each row corresponding to an object in the array. I also have a TextField component; which is working.

Here is the header of the class Project
import java.util.Date;

/**
 *
 * @author Janir
 */
public class Project {
   
    private Date finishDate;    
   
    public Date getFinishDate() {
        return finishDate;
    }

    public void setFinishDate(Date FinishDate) {
        this.finishDate = new java.sql.Date(FinishDate.getTime());        
    }
.....

This is mapped in an array in a SessionBean
private Project[] projectArray;
    public Project[] getProjectArray() {
        return this.projectArray;
    }
......

And this is the source of the table row
 <webuijsf:tableRowGroup binding="#{DataEntry.tableRowGroup1}" id="tableRowGroup1" rows="14"
                                sourceData="#{SessionBean.ProjectArray}" sourceVar="currentRow">

And as mentioned; all other fields works "as expected"; but not the date field bound to the calender object

Any feedback most appreciated!

Thanks!
janir


Chris Kutler wrote
Janir,

In each row, the calendar's selected date must be set to a separate
object. In Winston's example, the calendar's selected date is bound to a
column in the database row.  You are binding the calendar in each row to
the one property finishDate.

Is there a column in the database table that holds the date for each
row? Then bind the Calendar to that database column. If not, you need to
create something to hold the data for each row. I do something similar
to this in
http://blogs.sun.com/divas/entry/table_component_sample_visual_web. Here
I am holding serving sizes but you could do something similar to hold dates.



janir wrote:
> Hi!
>
> Have done so earlier; and followed the "recipy"; but problem remains the
> same.
> Regards,
> janir
>
>
>
> Roman Mostyka wrote:
>  
>> Hi Janir!
>>
>> Try to read this:
>> http://blogs.sun.com/winston/entry/adding_calendar_to_table
>> I hope it will help You.
>>
>> Thanks,
>> Roman.
>>    
>>> Hi!
>>> Have trouble getting this to work; the "Calendar button" is only showing
>>> on
>>> the first row. And if i select a date in the control; the date is copied
>>> to
>>> all rows.
>>>
>>> Here is part JSP:
>>> <webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}"
>>> headerText="FinishDate" id="tableColumnFinish" width="217">
>>> <webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2"
>>> selectedDate="#{currentRow.value['finishDate']}"/>
>>>
>>> Here is part of the mapped data.
>>> private Date finishDate;
>>>
>>> public Date getFinishDate() {
>>> return finishDate;
>>> }
>>>
>>> public void setFinishDate(Date FinishDate) {
>>> this.finishDate = new java.sql.Date(FinishDate.getTime());
>>> }
>>>
>>>
>>> Here is a couple of screenshots; illustrating the problem
>>> 1. Designtime, http://www.jirstart.net/test/designtime.png
>>> 2. Runtime; http://www.jirstart.net/test/runtime.png
>>>
>>>
>>> Any ideas?
>>> Thanks,janir
>>>  
>>>      
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@visualweb.netbeans.org
>> For additional commands, e-mail: users-help@visualweb.netbeans.org
>>
>>
>>
>>    
>
>  

--
Chris Kutler, Technical Writer for Ruby Support in the NetBeans IDE
http://blogs.sun.com/divas
------------------------------------------------------------------
Did you know a cat has 32 muscles in each ear.
Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

ckutler2
Can you please show the JSP tags for the columns

janir wrote:
Hi!

The code shown was just a small extract of my code; all data for all fields
in the table are mapped towards an array of objects, each row corresponding
to an object in the array. I also have a TextField component; which is
working. 

Here is the header of the class Project
import java.util.Date;

/**
 *
 * @author Janir
 */
public class Project {
    
    private Date finishDate;    
    
    public Date getFinishDate() {
        return finishDate;
    }

    public void setFinishDate(Date FinishDate) {
        this.finishDate = new java.sql.Date(FinishDate.getTime());        
    }
.....

This is mapped in an array in a SessionBean
private Project[] projectArray;
    public Project[] getProjectArray() {
        return this.projectArray;
    }
......

And this is the source of the table row
 <webuijsf:tableRowGroup binding="#{DataEntry.tableRowGroup1}"
id="tableRowGroup1" rows="14"
                                sourceData="#{SessionBean.ProjectArray}"
sourceVar="currentRow">

And as mentioned; all other fields works "as expected"; but not the date
field bound to the calender object

Any feedback most appreciated!

Thanks!
janir



Chris Kutler wrote:
  
Janir,

In each row, the calendar's selected date must be set to a separate 
object. In Winston's example, the calendar's selected date is bound to a 
column in the database row.  You are binding the calendar in each row to 
the one property finishDate.

Is there a column in the database table that holds the date for each 
row? Then bind the Calendar to that database column. If not, you need to 
create something to hold the data for each row. I do something similar 
to this in 
http://blogs.sun.com/divas/entry/table_component_sample_visual_web. Here 
I am holding serving sizes but you could do something similar to hold
dates.



janir wrote:
    
Hi!

Have done so earlier; and followed the "recipy"; but problem remains the
same.
Regards,
janir



Roman Mostyka wrote:
  
      
Hi Janir!

Try to read this:
http://blogs.sun.com/winston/entry/adding_calendar_to_table
I hope it will help You.

Thanks,
Roman.
    
        
Hi! 
Have trouble getting this to work; the "Calendar button" is only
showing
on
the first row. And if i select a date in the control; the date is
copied
to
all rows. 

Here is part JSP: 
<webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}"
headerText="FinishDate" id="tableColumnFinish" width="217"> 
<webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2"
selectedDate="#{currentRow.value['finishDate']}"/> 

Here is part of the mapped data. 
private Date finishDate; 

public Date getFinishDate() { 
return finishDate; 
} 

public void setFinishDate(Date FinishDate) { 
this.finishDate = new java.sql.Date(FinishDate.getTime()); 
} 


Here is a couple of screenshots; illustrating the problem 
1. Designtime, http://www.jirstart.net/test/designtime.png
2. Runtime; http://www.jirstart.net/test/runtime.png


Any ideas? 
Thanks,janir
  
      
          
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



    
        
  
      
-- 
Chris Kutler, Technical Writer for Ruby Support in the NetBeans IDE
http://blogs.sun.com/divas
------------------------------------------------------------------
Did you know a cat has 32 muscles in each ear.



    

  

-- 
Chris Kutler, Technical Writer for Ruby Support in the NetBeans IDE
http://blogs.sun.com/divas
------------------------------------------------------------------
Did you know a cat has 32 muscles in each ear.
Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

janir
Here is ths JSP tags:

<webuijsf:table augmentTitle="false" binding="#{DataEntry.tableEnterData}" id="tableEnterData"
                            style="height: 120px; left: 11px; top: 142px; position: absolute" title="Table" width="829">
                            <webuijsf:tableRowGroup binding="#{DataEntry.tableRowGroup1}" id="tableRowGroup1" rows="14"
                                sourceData="#{MainSessionBean.Projects}" sourceVar="currentRow">
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnProjectID}" headerText="Project ID" id="tableColumnProjectID"
                                    sort="projectID" width="61">
                                    <webuijsf:staticText binding="#{DataEntry.staticText5}" id="staticText5" text="#{currentRow.value['projectID']}"/>
                                </webuijsf:tableColumn>
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnProjectName}" headerText="Project Name" id="tableColumnProjectName"
                                    sort="projectName" width="179">
                                    <webuijsf:staticText binding="#{DataEntry.staticText6}" id="staticText6" text="#{currentRow.value['projectName']}"/>
                                </webuijsf:tableColumn>
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnInvoicingTemplate}" headerText="Invoice Type"
                                    id="tableColumnInvoicingTemplate" sort="InvoicingTemplate" width="16">
                                    <webuijsf:staticText binding="#{DataEntry.staticText1}" id="staticText1" text="#{currentRow.value['invoicingTemplate']}"/>
                                </webuijsf:tableColumn>
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnLastInvoice}" headerText="Last Invoice" id="tableColumnLastInvoice"
                                    sort="startDate" width="83">
                                    <webuijsf:staticText binding="#{DataEntry.staticText1}" id="staticText1" text="#{currentRow.value['startDate']}"/>
                                </webuijsf:tableColumn>
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnFinish}" embeddedActions="true" headerText="Finish Date"
                                    id="tableColumnFinish" width="217">
                                    <webuijsf:calendar binding="#{DataEntry.calendar2}" id="calendar2" selectedDate="#{currentRow.value['finishDate']}"/>
                                </webuijsf:tableColumn>
                                <webuijsf:tableColumn binding="#{DataEntry.tableColumnNotes}" headerText="Notes" id="tableColumnNotes" sort="comment">
                                    <webuijsf:textField binding="#{DataEntry.textNotes}" id="textNotes" text="#{currentRow.value['comment']}"/>
                                </webuijsf:tableColumn>
                            </webuijsf:tableRowGroup>
                        </webuijsf:table>


<quote author="Chris Kutler">
Can you please show the JSP tags for the columns

Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

ckutler2
Janir,

My apologies. I really tried to figure out how to make the Calendar work
inside a table but I can't figure it out either. You have already posted
a comment to Winston's blog so I won't direct you there. It didn't work
for me either, even with the corrections to his code.

Here are some related bugs if you want to vote for any:

http://www.netbeans.org/issues/show_bug.cgi?id=94549
http://www.netbeans.org/issues/show_bug.cgi?id=89180
http://www.netbeans.org/issues/show_bug.cgi?id=121419

janir wrote:

> Here is ths JSP tags:
>
> <webuijsf:table augmentTitle="false" binding="#{DataEntry.tableEnterData}"
> id="tableEnterData"
>                             style="height: 120px; left: 11px; top: 142px;
> position: absolute" title="Table" width="829">
>                             <webuijsf:tableRowGroup
> binding="#{DataEntry.tableRowGroup1}" id="tableRowGroup1" rows="14"
>                                 sourceData="#{MainSessionBean.Projects}"
> sourceVar="currentRow">
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnProjectID}" headerText="Project ID"
> id="tableColumnProjectID"
>                                     sort="projectID" width="61">
>                                     <webuijsf:staticText
> binding="#{DataEntry.staticText5}" id="staticText5"
> text="#{currentRow.value['projectID']}"/>
>                                 </webuijsf:tableColumn>
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnProjectName}" headerText="Project Name"
> id="tableColumnProjectName"
>                                     sort="projectName" width="179">
>                                     <webuijsf:staticText
> binding="#{DataEntry.staticText6}" id="staticText6"
> text="#{currentRow.value['projectName']}"/>
>                                 </webuijsf:tableColumn>
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnInvoicingTemplate}" headerText="Invoice
> Type"
>                                     id="tableColumnInvoicingTemplate"
> sort="InvoicingTemplate" width="16">
>                                     <webuijsf:staticText
> binding="#{DataEntry.staticText1}" id="staticText1"
> text="#{currentRow.value['invoicingTemplate']}"/>
>                                 </webuijsf:tableColumn>
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnLastInvoice}" headerText="Last Invoice"
> id="tableColumnLastInvoice"
>                                     sort="startDate" width="83">
>                                     <webuijsf:staticText
> binding="#{DataEntry.staticText1}" id="staticText1"
> text="#{currentRow.value['startDate']}"/>
>                                 </webuijsf:tableColumn>
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnFinish}" embeddedActions="true"
> headerText="Finish Date"
>                                     id="tableColumnFinish" width="217">
>                                     <webuijsf:calendar
> binding="#{DataEntry.calendar2}" id="calendar2"
> selectedDate="#{currentRow.value['finishDate']}"/>
>                                 </webuijsf:tableColumn>
>                                 <webuijsf:tableColumn
> binding="#{DataEntry.tableColumnNotes}" headerText="Notes"
> id="tableColumnNotes" sort="comment">
>                                     <webuijsf:textField
> binding="#{DataEntry.textNotes}" id="textNotes"
> text="#{currentRow.value['comment']}"/>
>                                 </webuijsf:tableColumn>
>                             </webuijsf:tableRowGroup>
>                         </webuijsf:table>
>
>
>
> Can you please show the JSP tags for the columns
>
>
>  

--
Chris Kutler, Technical Writer for Ruby Support in the NetBeans IDE
http://blogs.sun.com/divas
------------------------------------------------------------------
Did you know a cat has 32 muscles in each ear.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Calendar inside table

ARUMUGAM
This post has NOT been accepted by the mailing list yet.
In reply to this post by janir

Dear Sir,

Please use property,

name="#{Page1.calendar1.id}"

  (ie).
<webuijsf:calendar binding="#{Page1.calendar1}" id="calendar1" name="#{Page1.calendar1.id}" selected="#{Page1.selected}"/>

Regards.

Arumugam A.V