Package org.auraframework.instance

Examples of org.auraframework.instance.Component.reinitializeModel()


        Map<String, Object> newAttributes = Maps.newHashMap();
        newAttributes.put("attributeFromChildToGrandChild", "new attributeFromChildToGrandChild");
        newAttributes.put("attributeInChild", "new attribute in Child");
        childCmp.getAttributes().set(newAttributes);
        childCmp.reinitializeModel();

        if (testModelWithCount) {
            assertEquals(2, TestReinitializeModelWithCount.getCount());
            TestReinitializeModelWithCount.clearCount();
        } else {
View Full Code Here


        Map<String, Object> newAttributes = Maps.newHashMap();
        newAttributes.put("attributeInMain1", "new attribute In Main1");
        newAttributes.put("attributeInMain2", "new attribute In Main2");
        newAttributes.put("attributeInMain3", "new attribute In Main3");
        mainCMP.getAttributes().set(newAttributes);
        mainCMP.reinitializeModel();

        if (testModelWithCount) {
            assertEquals(3, TestReinitializeModelWithCount.getCount());
            TestReinitializeModelWithCount.clearCount();
        } else {
View Full Code Here

        }
        Map<String, Object> newAttributes = Maps.newHashMap();
        newAttributes.put("attributeInMain", "new attribute In Main");
        newAttributes.put("attributeInMain1", "new attribute In Main1");
        mainCMP.getAttributes().set(newAttributes);
        mainCMP.reinitializeModel();

        if (testModelWithCount) {
            assertEquals(2, TestReinitializeModelWithCount.getCount());
            TestReinitializeModelWithCount.clearCount();
        } else {
View Full Code Here

        attributes.clear();
        attributes.put("attrInParent", "new attributeinParent1");
        attributes.put("attMainToParentContainer", "new attribute1to2");
        attributes.put("attMainToParent", "new attribute1to3");
        mainCMP.getAttributes().set(attributes);
        mainCMP.reinitializeModel();
        if (testModelWithCount) {
            assertEquals(3, TestReinitializeModelWithCount.getCount());
            TestReinitializeModelWithCount.clearCount();
        } else {
            assertEquals(result.replaceAll("default", "new"), getRenderedBaseComponent(mainCMP).replaceAll("\\s+", ""));
View Full Code Here

        // now what we really have is test_Model_Parent, not test_Provider_Concrete
        // trying to change what we provide like this won't work :
        // attributes.put("whatToDo", "provideTestModelParentCmpWithNewAttr");
        attributes.put("attrInParent", "provideTestModelParentCmpWithNewAttr");
        mainCMP.getAttributes().set(attributes);
        mainCMP.reinitializeModel();
        String newresult = "<br/>ParentCMP<br/>m.valueParent=provideTestModelParentCmpWithNewAttr";
        assertEquals(newresult, getRenderedBaseComponent(mainCMP).replaceAll("\\s+", ""));
    }

    /*
 
View Full Code Here

        attributes.clear();
        // now what we really have is test_Model_Parent, not test_Provider_Concrete
        // trying to change what we provide like this won't work :
        attributes.put("whatToDo", "provideTestModelParentCmpWithNewAttr");
        mainCMP.getAttributes().set(attributes);
        mainCMP.reinitializeModel();
        String newresult = "<br/>ParentCMP<br/>m.valueParent=provideTestModelParentCmpWithNewAttr";
        assertEquals(newresult, getRenderedBaseComponent(mainCMP).replaceAll("\\s+", ""));
    }

    /*
 
View Full Code Here

        Component ifcmp = Aura.getInstanceService().getInstance(def, attributes);
        assertEquals("value from attr:defaultValue,value from model:defaultValue", getRenderedBaseComponent(ifcmp));
        Map<String, Object> attributes2 = Maps.newHashMap();
        attributes2.put("attr", "new value from component");
        ifcmp.getAttributes().set(attributes2);
        ifcmp.reinitializeModel();
        assertEquals("value from attr:new value from component,value from model:new value from component",
                getRenderedBaseComponent(ifcmp));
    }

    /*
 
View Full Code Here

        assertTrue(getRenderedBaseComponent(ifcmp).contains(
                "INNER CMP -- value of attr: defaultValue , value from module: defaultValue"));
        Map<String, Object> attributes2 = Maps.newHashMap();
        attributes2.put("attr_out", "newValue");
        ifcmp.getAttributes().set(attributes2);
        ifcmp.reinitializeModel();
        assertTrue(getRenderedBaseComponent(ifcmp).contains(
                "INNER CMP -- value of attr: newValue , value from module: newValue"));
    }

    /*
 
View Full Code Here

                        "<aura:component model=\"java://test.model.TestReinitializeModel\"><aura:attribute name='listToShow' type='List'/>%s</aura:component>",
                        source));
        Component iteration = Aura.getInstanceService().getInstance(def, attributes);
        assertEquals("qrs", getRenderedBaseComponent(iteration));
        // listToShow is qrs
        iteration.reinitializeModel();
        Map<String, Object> attributes2 = Maps.newHashMap();
        attributes2.put("listToShow", Lists.newArrayList("a", "b", "c"));
        iteration.getAttributes().set(attributes2);
        iteration.reinitializeModel();
        // listToShow is abc now
View Full Code Here

        // listToShow is qrs
        iteration.reinitializeModel();
        Map<String, Object> attributes2 = Maps.newHashMap();
        attributes2.put("listToShow", Lists.newArrayList("a", "b", "c"));
        iteration.getAttributes().set(attributes2);
        iteration.reinitializeModel();
        // listToShow is abc now
        assertEquals("abc", getRenderedBaseComponent(iteration));
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.