Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep. 02, 2010, 07:45:30 PM
53844 Posts in 11998 Topics by 11375 Members
Latest Member: elizablackmore7
News:
 
The PRADO Community » Prado v3.x » General Discussion » creating a dynamic list of views « previous next »
Pages: [1] Print
Author Topic: creating a dynamic list of views  (Read 1030 times)
Ben
Senior Member
***

Karma: 3
Offline Offline

Posts: 69


View Profile
« on: Mar. 17, 2008, 02:39:25 AM »

I tried to generate a TMultiView containing a dynamic number of views. My first aproach was to open the multiView, place a repeater in it, and then place a TView in the repeaters itemTemplate property. This doesn't work, because TMultiView accepts only TViews as children, no TRepeaters...
My second aproach was a bit more... imaginative. Wink I tried to create a TRepeater which opens the TMultiView in HeaderTemplate property, closes it in FooterTemplate property and generates the TViews in its ItemTemplate property. Of course, that didn't work either.

Now I know two ways how not to do it. Could anyone give me one hint how to accomplish the task?

I also tried to generate all the objects I need in code, but I'm not too sure about when they start their life-cycle (seems to me it happens when they're beeing attached to TMultiView's Views collection?!) how far this lifecycle will catch up to the page's lifecycle (I mean e.g. if I create them in Init stage, will they go past their own Init stage, or will they stop there and will their other lifecycle stages be called when the containing page reaches this state?) and how page state and postback data handling will work under these circumstances... What would happen when I deleted one of those views during a postback?

Hopefully there's somebody who's able to enlighten the dark... Smiley
Logged
donkee
Junior Member
**

Karma: 1
Offline Offline

Posts: 40


Gentoo rock's


View Profile
« Reply #1 on: Mar. 17, 2008, 05:15:40 AM »

For permit us to find your torch, please tell us what does your page is done for. (example: view news, ...)
Logged

Gentoo rock's
C is a real male language
C++ is for Lazy
Java is for women
Ben
Senior Member
***

Karma: 3
Offline Offline

Posts: 69


View Profile
« Reply #2 on: Mar. 17, 2008, 05:33:03 AM »

I'm trying to extend the component composer so that it can be used to generate activeRecord classes. I've converted it into a template control and wrote a page with a text box in which you can paste the SQL dump of a database. Then, I'm parsing the input to find all the different create table statements. Now I liked to create a TMultiView with n Views (one for each table). Each of these views are thought to hold one component composer object, which will be initialized with the data of its table (class name and properties for the beginning).
Logged
Ben
Senior Member
***

Karma: 3
Offline Offline

Posts: 69


View Profile
« Reply #3 on: Mar. 18, 2008, 02:11:28 PM »

Nobody with an idea how to solve this?

I even have problems creating the controls on my own... I can create all the views and component composers when the user submits the database dump, but as soon as I try to switch between the views (I simply use a dropDownList), I get an error, telling me that my TMultiView has an invalid TViewIndex (== 0, the view I've seen before postback).
This error occures before onLoad, where I intended to recreate the views on each postback. And I cand recreate them in onInit, because the ViewState hasn't been loaded at this stage (I hold the names of the tables in viewstate, so I know woh many views I have to create).
Logged
Pages: [1] Print 
« previous next »
Jump to: