wood burning stoves 2.0*
The moose likes Product and Other Certifications and the fly likes MS 70-528 Johnsson Northrup Chpt 3 page 102 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "MS 70-528 Johnsson Northrup Chpt 3 page 102" Watch "MS 70-528 Johnsson Northrup Chpt 3 page 102" New topic
Author

MS 70-528 Johnsson Northrup Chpt 3 page 102

Marc Wentink
Ranch Hand

Joined: May 18, 2007
Posts: 142
Could someone help me to understand the following alinea in the self paced training kit


Chapter 3 Exploring Specialized Server Controls

If you need to programmatically add rows and cells to a table at run time, the Table control may be the right choice, but TableRow and TableCell objects that are added to the Table control need to be programmatically re-created when PostBack occurs.


Why do they have to be recreated?

If you need the rows and cells to survive PostBacks, you may want to consider using the DataList or GridView control.


And why here they do not?
The alinea concludes with:

As a result, the Table control is usually considered to be best suited for control developers who use the table as part of a custom control that they build.


Mmmm. Ok if you say it. But it does not yet make much sence to me.


SCJP5
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Why do they have to be recreated?
When the Table component gets saved to ViewState, apparently the programatically added rows and cells don't get saved with it. When a PostBack request comes through, the page gets rerendered based on what is saved in ViewState. Since your dynamic stuff isn't in ViewState, you'd have to add it again.

And why here they do not?
I guess these components save to the ViewState better.

Mmmm. Ok if you say it. But it does not yet make much sence to me.
Table would be a good base starting point for creating your own component. I don't know how you'd make your component save off like the DataList or GridView but the book implies that it's possible.


A good workman is known by his tools.
Marc Wentink
Ranch Hand

Joined: May 18, 2007
Posts: 142
Thanks Marc
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MS 70-528 Johnsson Northrup Chpt 3 page 102
 
Similar Threads
Performance hit using "where" clause in the query
Can I set up a JTable columns?
Table in DIV not Displaying Vertical Scroll Bar
Testing With JFCUnit
Table Question