Dynamically injecting Visualforce markup into component

I have an issue where I am trying to render a component on a VF page where I don't know if the component exists in the org or not until run time (I am trying to use a dynamic component on the front end). Since I can't assume it exists by default, I can't reference the component like so:

Component.some_namespace.MyComponent myComp = new Component.some_namespace.MyComponent(); 

as that won't compile.

I can query the component using SOQL and even get its markup, but can I do anything with the VF markup I get? Could I create a wrapper component and inject the markup somehow? I guess like...

Component.c.WrapperComponent wrapComp = new Component.c.WrapperComponent(); wrapComp.vfMarkup = queriedComponent.Markup; 

it's frustrating because the queried component is of type ApexComponent (a metadata type) but the dynamic component requires an object of type ApexPages.Component. There's no way I can convert the ApexComponent to a ApexPages.Component, right?


Category: apex Time: 2016-07-29 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.167 (s). 12 q(s)