Thanks Geert, once again, this was very helpful. It solved quite a  
few issues that I was having that I had just worked around, now it is  
easier and cleaner.


Austin
On Oct 15, 2007, at 5:25 AM, Geert Bevin wrote:

>
> Hi Austin,
>
> the way you're injecting the template if perfectly fine.
>
> The error about the embedded element not being able to be found is
> related to the ID you're using. If you use a relative ID (like the
> one you're using: CategoryEntry), then it will look for that embedded
> element according to the element that's actually using the template.
> If you start with a dot, you use an absolute ID (for
> instance: .Pub.CategoryEntry). Those will always be found.
>
> It could be that by injecting the template in the site structure,
> you're applying it one or several elements. Maybe one of those is
> located somewhere that causes the relative lookup to fail.
>
> HTH,
>
> Geert
>
> On 14 Oct 2007, at 16:01, Austin Coose wrote:
>
>>
>> What is the best way to inject a template?
>>
>> I tried to use the method based on the wiki example of default
>> template associated with an element:
>>
>> private Template template
>>      public getTemplate() { return template }
>>      public void setTemplate(Template template) { this.template =
>> template }
>>
>> public void processElement () {
>>      . . .
>> }
>>
>> And the in the site.xml
>>
>> <element  . . .>
>> <property name="template">
>> <template type="html">common.navigation</template>
>> </property>
>> </element>
>>
>> When I explicitly declare the template with "Template template =
>> getHtmlTemplate("common.navigation")", then everything works and gets
>> printed out normally, but when I use the above method, I get an error
>> that says it can not find the embedded element, when I comment out "
>> processEmbeddedElement(template, "CategoryEntry"); " in the
>> implementation, then the template gets printed out with the static
>> html and so does  ${v ELEMENT:CategoryEntry /}.
>>
>> I also tried several other methods to inject a template buy viewing
>> the API for Template and ElementSupport, along with several others,
>> most of the time template ended up being null, or the same problem as
>> above. I tried so many things and I included one at least with a
>> frame of reference.  I played around with code implementation and the
>> template itself, just to see if I could get anything to work, but
>> alas, to no avail.
>>
>> What am I missing?
>>
>> Thanks for any help.
>>
>> Austin
>>
>>>
>
> --
> Geert Bevin
> Terracotta - http://www.terracotta.org
> Uwyn "Use what you need" - http://uwyn.com
> RIFE Java application framework - http://rifers.org
> Music and words - http://gbevin.com
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to