This week's book giveaway is in the Python forum.
We're giving away four copies of Hello World and have Warren & Carter Sande on-line!
See this thread for details.
Win a copy of Hello World this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

MS 70-528 Johnsson Northrup Chpt 3 page 102

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marc Wentink
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc
 
today's feeble attempt to support the empire
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!