templates

ASP.NET MVC 2 generation of the List/Index view

ASP.NET MVC 2 has powerful features for generating the model-dependent content of the Edit view (using EditorForModel) and Details view (using DisplayForModel) that automatically utilizes metadata and editor (or display) templates: <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend><%...

template typename question

Hi, I have a problem with template and wondering is there a possible way to achieve what I wanted to do. Here is my question. template <typename T> class A { public: typedef T* pointer; typedef const pointer const_pointer; A() {} template <typename D> A(const D& d) { // how can I st...

Unresolved externals with explicit template instantiations. What is the declaration syntax?

Here's some simplified code to demonstrate the problem I have. I have a template function for which I only wish to compile certain fixed instantiations. The function declarations are: // *** template.h *** int square (int x); double square (double x); The definitions are: // *** template.cpp *** #include "template.h" // (template ...

Using forloop.counter value as list index in a Django template

Hi, in my Django 1.1.1 application I've got a function in the view that returns to his template a range of numbers and a list of lists of items, for example: ... data=[[item1 , item2, item3], [item4, item5, item6], [item7, item8, item9]] return render_to_response('page.html', {'data':data, 'cycle':range(0,len(data)-1]) Inside the...

Word templates populated automatically from list fields from a SharePoint custom list?

Hi, Is it possible to automatically create Word documents which include list fields from a custom SharePoint list? here is the scenario: - custom list (over 100 columns) - Word templates (not sure where is best to store them yet) - Entry Form will provide data for the templates (or partial data, ie Client name, Sales Rep) - a form that...

Converting John Resig's JavaScript Templating Engine to work with PHP Templates

I'm trying to convert the John Resig's Templating Engine to work with PHP. Essentially what I would like to achieve is the ability to use certain Kohana Views via a JavaScript templating engine, that way I can use the same views for both a standard PHP request and a jQuery AJAX request. I'm starting with the basics and would like to be...

How do determine what is *really* causing your compiler error

Hi All, I am porting a very large code base and I am having more difficulty with old code. For example, this causes a compiler error: inline CP_M_ReferenceCounted * FrAssignRef(CP_M_ReferenceCounted * & to, CP_M_ReferenceCounted * from) { if (from) from->AddReference(); if (to) to->RemoveReference(); to = from; return ...

How to create a MVC 2 DisplayTemplate for a field whose display format is dependent on another field?

If I have a property whose display format is dependent on the value of another property in the view model how do I create a display template for it? The combination of field1's display being dependent on field2's value will be used throughout the app and I would like to encapsulate this in a MVC 2 display template. To be more specific...

Dojox grid having problem with Contentpane

the grid appears properly on template's first loading. But when you click the paging button to load flooders.php thru list_result1() only the paging buttons will appear. I already tested the flooders.php outside the template and it works properly. what seems to be the problem? and what are the tools that i can use to see if the javascr...

nVelocity - Template issue when attempting 'greater than' comparison on decimal property

I have a simple object that has as one of it's properties a decimal named Amount. When I attempt a comparison on this property as part of an nVelocity template, the comparison always fails. If I change the property to be of type int the comparison works fine. Is there anything extra I need to add to the template for the comparison to wor...

Register/Include javascript within RenderingTemplate.

Problem description Is it possible to register (include) javascript within RenderingTemplate? (RenderingTemplates are used to render list forms or fields) By using <SharePoint:RenderingTemplate ID="NewRelatedListItem" runat="server"> <Template> <span id="part1"> <SharePoint:ScriptLink Name="SPFormFieldAssistant.js" Localiz...

XSL How to copy identical + add copy with attributes changes

Hello I need to copy a node and its sub-nodes: first: one identical copy followed by a modified copy with some attributes values changed Here is the extract to change: <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet=...

POI dynamic templates

Hello, Can anyone tell me where do I find some useful documentation on handling copying rows, cells, columns from one excel file to another, using POI? I need to insert in one blank excel file, 2 or more templates from other files, dynamic. I also need to keep all the styles made for the group of cells that I copy. How can I do that? ...

Simplest way to mix sequences of types with iostreams?

I have a function void write<typename T>(const T&) which is implemented in terms of writing the T object to an ostream, and a matching function T read<typename T>() that reads a T from an istream. I am basically using iostreams as a plain text serialisation format, which obviously works fine for most built-in types, although I'm not sure...

PHP functions vs includes for site template

What is the best, easiest, and fastest way to use a template for a page. Right now I have been using a function to create my template for each page. $title = "Kick Me"; <?php pageHtmlHeadStart($title)> <!-- Were Javascript would go --> <?php pageHtmlHeadEnd(); guiHeader(); ?> Content went here. <?php guiFooter; ?> I uses to ...

Hide Joomla Template in Controller

Hey Guys, i have a big Joomla 1.5 Problem. I'll create my own Gallery Component/PlugIn and want to add an AJAX Sorting possibility. In the Backend i want to reorder the Images by Drag&Drop in an Gallery. It works, but for the Output i have the following Problem: I send the AJAX Request to index.php?option=com_cwgallery&controller=gal...

MOSS - Rendering template for document library

Hi, I have created: A custom content type that inherits from document 0x0101. A custom list that is based on my content type. I have also set so that the id for the rendering template is set to my own developed template. The problem is that when i click on "New" on my new list it will automatically go to the upload.aspx and then to ...

Calling the same xsl:template for different node names of the same complex type

Hi, I'm trying to keep my xsl DRY and as a result I wanted to call the same template for 2 sections of an XML document which happen to be the same complex type (ContactDetails and AltContactDetails). Given the following XML: <?xml version="1.0" encoding="UTF-8"?> <RootNode> <Name>Bob</Name> <ContactDetails> <Address> ...

Using HTML::Template within a value attribute

Hello, my question is how would I use an HTML::Template tag inside a value of form field to change that field. For example <table border="0" cellpadding="8" cellspacing="1"> <tr> <td align="right">File:</td> <td> <input type="file" name="upload" value= style="width:400px"> </td> <...

Symfony/Doctrine: Unserialize in action vs template

Hi, Can anyone tell me why calling "unserialize" works fine in an action but gives an offset error in a template? It's basically possible to unserialize a database text result into a variable in an action and pass it to template, in which case it displays fine: $this->clean = unserialize($this->raw); <?php echo $clean ?> But not if ...