Tuesday, March 20, 2007

Basic design thoughts for first task

Ok, my first task was to create a custom type where you could enter a CAML query that would go to another sharepoint list and display the results of the query as an HTML table as part of the list item.

So I built a custom type and alterred it so that a CAML query (just a string really) could be enterred along with the column/type definition. I thought this was the appropriate place for the query to be attached. Later you should also be able to specify the list you want queried, but I think I will hardcode that initially.

So assuming I can access a query and a list you can obtain an SPView set up the way you want it. You can also grab HTML from a view. So theoretically you can display this view as html as the value for a column/type. Now I just need to figure out how? You can use the GetValueField function that is part of the Type (note that Type and TypeValue are different ideas - kind of like a Prototype and Instantiations of it). But this is set to not be read as HTML and tags get converted so they appear as text. It is probably better to try and alter the RenderPattern or create a custom control. I would like to create a custom control (would be simple, just pop in a placeholder type control and fill it in with the html generated by the view), but I don't see how this is done. I see how to create a control for the editting (a control descending from BaseFieldControl returned by Type)and for type creation (a control specified in the XML(CAML) file that defines the type instead of using PropertySchema). But I don't see how to replace the actual display... This is probably not set up to have a control used, so I will ahve to figure out what I can do with CAML rendering.

I am taking a different approach now. I am going to focus on getting HTML from a CAMLQuery to appear in the column. First it will be on a static list.

No comments: