Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Access data in transformation from registered control View modes: 
User avatar
Member
Member
Boolean - 8/23/2012 5:30:41 PM
   
Access data in transformation from registered control
Hi guys

I have a bit of a strange setup and I can't seem to get it to work.

I have a datasource on my portal page which pulls in several records from a path in the cms tree. I then have a basic repeater (let’s call it RepeaterBlue) pointing to that datasource which uses a transformation to display the data (Title, Date etc.). Pretty standard stuff.

I then have a control I want to register in that transformation, a webpart that is a physical file, which is more or less a nested repeater. I register my control, but when I try to access CMSContext.CurrentDocument.GetValue("EventID"), I get the EventID of the page that *has* the datasource, not the page RepeaterBlue is looking at. RepeaterBlue's transformation gets all the data correctly (ie. I can access the Eval properties in the transformation just fine), but the registered control can't seem to see anything outside of the current document that contains the datasource and RepeaterBlue.

Any idea how to get the access to the document properties that the transformation can see through my registered control?

Thanks.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 8/24/2012 9:36:36 AM
   
RE:Access data in transformation from registered control
You will need to access the repeater's dataitem. I am not feeling well at the moment, so I lack the energy to go into detail. But I hope that helps point you in the right direction.

User avatar
Member
Member
Boolean - 8/24/2012 9:41:22 AM
   
RE:Access data in transformation from registered control
Thanks for the feedback while you are sick ;)

I was able to get around it by adding this to the top of my page:

<script language="CS" runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
rptRepeaterBlue.Title = "MyTitle";
rptRepeaterBlue.SubTitle = "MySubTitle";
}
</script>

That seemed to work pretty well.

Cheers!

User avatar
Member
Member
Boolean - 8/24/2012 9:46:26 AM
   
RE:Access data in transformation from registered control
Dang, no edit function.

What I meant was while the above sample works ok, I'm going to use that to try and get access to the repeaters dataitem. Hopefully that works.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 8/24/2012 10:28:56 AM
   
RE:Access data in transformation from registered control
If you want to learn how to do stuff in code for an ASCX transformation. Create a test user control in your project that inherits from CMSAbstractTransformation and you will have intellisense to help you out.

You can use Container.DataItem to access the dataitem on databind