I am creating a page which has 2 different components A and B. A and B both have some associated HTML code which should be included at page Head level .I try to inject this associated code by using below code in Java Classes corresponding to component A and B.context.getPageScopeData().put(RuntimePage.PAGESCOPE_HEAD_INJECTION, string);The Problem is system only injects code associated with component B (because component B loads after A. if i get rid of component B, associated HTML code with component A starts injecting) at the Head section of the page. Is there a way through which i can inject HTML code of component A and B both at header Level ?
I don't know that much about this - but if you can do a put - can you also do a get? If so - both of your components should do the 'get' first, and then add their respective code to the return value before doing the 'put' - that way it doesn't matter which order they get loaded in (something that I don't believe you can guarantee), they should end up doing "the right thing".
Just a wild guess...context.getPageScopeData().put(RuntimePage.PAGESCO PE_HEAD_INJECTION, context.getPageScopeData().get(RuntimePage.PAGESCO PE_HEAD_INJECTION)+string);