[SalesForce] Reusable components in Managed package (Problem with Namespace)

Lately I have been developing set of Visualforce components "VisualStrap" that can be used to implement Bootstrap inside VF pages easily. So to make the upgrade process easy I made a managed package and included VF components inside and marked all the components Global so that they can be accessed in the destination org. Everything seems working but lately VF dynamic bindings seem not to like the managed VF components.

ISSUE 1 : Problem with VF Dynamic component

VisualForce Page Code

<apex:page docType="html-5.0" standardcontroller="Account" extensions="TestPage_Con">
    <VisualStrap:importVisualStrap />
    <VisualStrap:visualStrapBlock >
        <apex:form >            
            <apex:pageBlock >
                <apex:pageBlockSection columns="2" collapsible="false">
                    <apex:inputField value="{!myAccount['Name']}" styleClass="form-control" />
                    <apex:commandButton value="Do Submit" styleClass="btn-success"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
        </apex:form>
    </VisualStrap:visualStrapBlock> 
</apex:page>

Controller Class

public class TestPage_Con {
    public Account myAccount{get;set;}

    public TestPage_Con(ApexPages.StandardController controller) {
        myAccount = new Account();
    }   
}

Observations

  • If the submit button is pressed the pages throughs error "Apex class 'VisualStrap.TestPage_Con' does not exist ". Seems like it is looking for the controller class inside my namespace i.e. "VisualStrap", any Idea how to point it to proper class ?
  • Pages Loads without any problem for the first time
  • If I change {!myAccount['Name']} to {!myAccount.Name} it starts working.(in actual code I am using fieldset for dynamic binding). EDIT : The issue seems to happen only and only with Dynamic Binding.
  • Problem seems to happen with full page refresh i.e. if rerender parameter is not provided.

ISSUE 2 : New Parameter "binding" in the managed components

(Well this is not exactly a issue)
After installing the managed component in a dev org I am seeing a new parameter called "binding" which was not declared in the component. I tried to search for more information but couldn't find much detail about it. Was wondering what is the use of this attribute/parameter ?

References

  • Managed Package : http://blogforce9dev-developer-edition.ap1.force.com/ProjectDetail?id=a0290000009MI61
  • <VisualStrap:importVisualStrap /> : This component just includes all the necessary static resources
  • </VisualStrap:visualStrapBlock> : This is just a wrapper component the source code for the same is

    <apex:component selfClosing="false" access="global">
    <apex:outputPanel styleClass="visualstrap">
    <apex:componentBody />
    </apex:outputPanel>
    </apex:component>

Update 3-Jan-2014
I have created a case with SF and they were able to replicate the same. The case was forwarded to engineering team and I am currently waiting for their response.

Update 21-Feb-2014
Salesforce finally marked this as a bug and the patch will probably come @ winter 15

Best Answer

I've been reading this question on and off for the last day or so, to see if I can help or arrive at a possible cause. I've done a few managed VF components as well and not seen these issues. You also seem to have made some pretty good observations on your own, as well as narrowed a reproduction down quite nicely, leading me to advise that you create similarly worded Salesforce support case together and see what they have to say, as the first issue sounds like you've found a corner case with VF components. Sorry I cannot be of much help on this occasion, other than to confirm you've got a solid support case.

Related Topic