List<String> scriptList = _getScriptList(context, false);
boolean hasScript = ((scriptList != null) && !scriptList.isEmpty());
if (hasDialog || hasScript)
{
RenderingContext arc = RenderingContext.getCurrentInstance();
if (hasDialog)
DialogRequest.addDependencies(context, arc);
// =-=AEW How to pick a proper ID?
// Write out a script; let PPR know to use it
String scriptId = "::launchScript";
PartialPageContext ppContext = arc.getPartialPageContext();
// TODO: Create the span with a bogus component where
// getClientId() returns the scriptId; this avoids
// the need to downcast - you just need to
// call addPartialTarget(). Or, come up with a better
// PPR api to make it simpler