participate


Sun Java Studio Creator - table help
<<   Back to Forum  |   Give us Feedback
10 Duke Stars available
This topic has 10 replies on 1 page.
@18@
Posts:30
Registered: 12/5/06
table help   
Dec 14, 2006 5:26 PM

 
hi, i have a table with 5 columns, (week_no, objective, date1, date2 and add report).
how do i get the date for date1( example, today date). and how do i set the week no as auto increment by 1( example, row 1, the week_no is 1, row 2, the week_no is 2 and so on). and lastly, how to i set the add report button to link to another jsp file? i reali need help here. thanks
 
mbohm
Posts:98
Registered: 11/7/06
Re: table help   
Dec 15, 2006 9:42 AM (reply 1 of 10)  (In reply to original post )

 
The data in the table is determined by the contents of the dataprovider you attach to the table. If you are using a relational database, the autoincrementing is typically done in the database. Look at the Access Database tutorials at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp. To make the button go to another JSP file, you double-click it in the designer, and make it return an outcome string you have configured in the Page Navigation editor. See the Control Page Navigation tutorials at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp.
 
  jetsons
Posts:993
Registered: 3/13/04
Re: table help   
Dec 17, 2006 7:27 PM (reply 2 of 10)  (In reply to original post )

 
Hopefully, this will get you going in the right direction: http://blogs.sun.com/divas/entry/using_the_object_array_data
 
@18@
Posts:30
Registered: 12/5/06
Re: table help   
Dec 18, 2006 12:54 AM (reply 3 of 10)  (In reply to #2 )

 
hi, i wen to the website u gave me... i tried it out... but there are some error....
wen i come to this step:
(Here is where it starts getting kludgy. You should be able to
choose weeks from the array drop-down list, but
it propably is not appearing at this point. If weeks is
not in the drop-down list, choose Clean and
Build Main Project from the main menu. After the build
completes, close and reopen the project.), i cant see the drop-down list to choose weeks. no weeks from the drop down list... what is the error? i follow exactly the same as what it said.... thanks
 
@18@
Posts:30
Registered: 12/5/06
Re: table help   
Dec 18, 2006 1:36 AM (reply 4 of 10)  (In reply to #3 )

 
hi, sorry for the trouble but i manage to solve the problem le. thanks
 
@18@
Posts:30
Registered: 12/5/06
Re: table help   
Dec 18, 2006 1:47 AM (reply 5 of 10)  (In reply to #4 )

 
hi, sorry for all the trouble. jsut wana ask, how do i connect the code to the database tat i have, if my database is called student_report, where there is a column to count the weeks called week_no. and i suppose to get the startDate and endDate from a database called path, with two column naming Start_date and End_date.

another question is that my start_date and end_date, there are different path for different students, which mean i have 6 path with different start and end date, how do i specify which start and end date to use?
thanks alots
 
  jetsons
Posts:993
Registered: 3/13/04
Re: table help   
Dec 18, 2006 9:08 AM (reply 6 of 10)  (In reply to #5 )

 
It doesn't sound like this sample code is for you. My apologies for not understanding what you were looking for.

First you have to build your query that joins the two tables. You can learn about how to do that at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/databoundcomponents.html.

Then you can bind the table to that query's dataprovider.

I cannot answer the following question because I do not understand it:

another question is that my start_date and end_date, there are different path for different students, which mean i have 6 path with different start and end date, how do i specify which start and end date to use?
thanks alots
 
@18@
Posts:30
Registered: 12/5/06
Re: table help   
Dec 18, 2006 4:53 PM (reply 7 of 10)  (In reply to #6 )

 
ok thanks, do u hav an idea how to count the weeks between the start date and end date? thanks
 
  jetsons
Posts:993
Registered: 3/13/04
Re: table help   
Dec 18, 2006 6:03 PM (reply 8 of 10)  (In reply to #7 )

 
Check out the API for the Calendar class: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html

One way might be to get the WEEK_OF_YEAR for the start date and for the end date and calculate the difference.
 
@18@
Posts:30
Registered: 12/5/06
Re: table help   
Dec 18, 2006 11:28 PM (reply 9 of 10)  (In reply to #8 )

 
hi, thanks for helping me. i have antoher question, i hav a drop down list. how can i set the drop down list that it contain 1 to 15? thanks alots
 
  jetsons
Posts:993
Registered: 3/13/04
Re: table help   
Dec 19, 2006 8:09 AM (reply 10 of 10)  (In reply to #9 )

 
Hello,

You can find the answer here http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/about_components.html#input, and here http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/listbox_components.html

I would like to suggest a learning path for you. These are all small tutorials that won't take up much of your time (except for the first one and you can do that one in bits and pieces. That is you don't have to do the tutorial from start to finish, you can do any section at any time).

http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/jscintro.html

http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html

http://blogs.sun.com/divas/entry/about_a_page_s_lifecycle

http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/databoundcomponents.html

Also, when you change the subject, I highly recommend that you create a new post. Many of the people who answer questions on the forum don't even open a post that already has replies so it is good to have a new 0-reply post for a different subject.
 
This topic has 10 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 63
  • Guests : 118

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums