[
https://jira.jboss.org/jira/browse/RF-7247?page=com.atlassian.jira.plugin...
]
Nick Belaevski commented on RF-7247:
------------------------------------
Example of usage:
<c:scriptObject var="scriptOptions">
<c:scriptOption attributes="attribute1, attribute2, attributex"
variables="var1, var2, varx "/>
<c:scriptOption attributes="onclick, onsmth, onmousedown"
variables="onitemselect, onitemsmth"
wrapper="eventHandler" />
<c:scriptOption name="currentDate"
value="#{this:getCurrentDate(context, component, currentDate)}" />
<c:scriptOption attributes="direction" defaultValue="auto" />
<c:scriptOption name="jointPoint"
value="#{component.attributes['joinPoint']}"
defaultValue="left-top" />
</c:scriptObject>
<c:if test="#{not empty scriptOptions}">
, <f:writeAsScript value="#{scriptOptions}" />
</c:if>
Generated code:
java.util.HashMap scriptOptions = new java.util.HashMap();
getUtils().addToScriptHash(scriptOptions, "attribute1",
component.getAttributes().get("attribute1"), null ,
ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "attribute2",
component.getAttributes().get("attribute2"), null ,
ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "attributex",
component.getAttributes().get("attributex"), null ,
ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "var1",
variables.getVariable("var1"), null , ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "var2",
variables.getVariable("var2"), null , ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "varx",
variables.getVariable("varx"), null , ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "onclick",
component.getAttributes().get("onclick"), null ,
ScriptHashVariableWrapper.EVENT_HANDLER);
getUtils().addToScriptHash(scriptOptions, "onsmth",
component.getAttributes().get("onsmth"), null ,
ScriptHashVariableWrapper.EVENT_HANDLER);
getUtils().addToScriptHash(scriptOptions, "onmousedown",
component.getAttributes().get("onmousedown"), null ,
ScriptHashVariableWrapper.EVENT_HANDLER);
getUtils().addToScriptHash(scriptOptions, "onitemselect",
variables.getVariable("onitemselect"), null ,
ScriptHashVariableWrapper.EVENT_HANDLER);
getUtils().addToScriptHash(scriptOptions, "onitemsmth",
variables.getVariable("onitemsmth"), null ,
ScriptHashVariableWrapper.EVENT_HANDLER);
getUtils().addToScriptHash(scriptOptions, "currentDate",
getCurrentDate(context,component,currentDate), null ,
ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "direction",
component.getAttributes().get("direction"), "auto" ,
ScriptHashVariableWrapper.DEFAULT);
getUtils().addToScriptHash(scriptOptions, "jointPoint",
component.getAttributes().get("joinPoint"), "left-top" ,
ScriptHashVariableWrapper.DEFAULT);
if ( Boolean.valueOf( String.valueOf( ( ! getUtils().isEmpty( scriptOptions ) ) )
).booleanValue() ) {
writer.writeText(convertToString(","),null);
org.ajax4jsf.javascript.ScriptUtils.writeToStream(writer, scriptOptions);
}
Create optimization prototype
-----------------------------
Key: RF-7247
URL:
https://jira.jboss.org/jira/browse/RF-7247
Project: RichFaces
Issue Type: Sub-task
Components: planning_all
Affects Versions: 3.3.2.CR1
Reporter: Nick Belaevski
Assignee: Nick Belaevski
Fix For: 3.3.2.CR1
Original Estimate: 1 day
Remaining Estimate: 1 day
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira