table help
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
[383 byte] By [
@18@a] at [2007-11-26 12:40:33]

# 1
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.
# 2
Hopefully, this will get you going in the right direction: http://blogs.sun.com/divas/entry/using_the_object_array_data
# 3
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@a at 2007-7-7 16:12:16 >

# 4
hi, sorry for the trouble but i manage to solve the problem le. thanks
@18@a at 2007-7-7 16:12:16 >

# 5
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
@18@a at 2007-7-7 16:12:16 >

# 6
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/dat aboundcomponents.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
# 7
ok thanks, do u hav an idea how to count the weeks between the start date and end date? thanks
@18@a at 2007-7-7 16:12:16 >

# 8
Check out the API for the Calendar class: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.htmlOne way might be to get the WEEK_OF_YEAR for the start date and for the end date and calculate the difference.
# 9
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
@18@a at 2007-7-7 16:12:16 >

# 10
Hello,
You can find the answer here http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/abo ut_components.html#input, and here http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/lis tbox_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/jsc intro.html
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/hel loweb.html
http://blogs.sun.com/divas/entry/about_a_page_s_lifecycle
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/dat aboundcomponents.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.
