[
http://issues.apache.org/jira/browse/TOMAHAWK-530?page=comments#action_12445521
]
Holger Schimanski commented on TOMAHAWK-530:
--------------------------------------------
I got a patch by private email from another MyFaces user. Maybe you can use
this code to solve this issue.
In HtmlCalendarRenderer method getLocalizedLanguageScript replace
StringBuffer script = new StringBuffer();
setStringVariable(script,popupCalendarVariable
+".initData.imgDir",(JavascriptUtils.encodeString(AddResourceFactory.getInstance
(facesContext).getResourceUri(facesContext,
HtmlCalendarRenderer.class, "DB/"))));
by
StringBuffer script = new StringBuffer();
String imageLocation = HtmlRendererUtils.getImageLocation(uiComponent);
if(imageLocation == null)
setStringVariable(script,popupCalendarVariable +".initData.imgDir",
(JavascriptUtils.encodeString(AddResourceFactory.getInstance(facesContext)
.getResourceUri(facesContext,
HtmlCalendarRenderer.class, "DB/"))));
else
setStringVariable(script, popupCalendarVariable
+".initData.imgDir",
(JavascriptUtils.encodeString(AddResourceFactory.getInstance(facesContext)
.getResourceUri(facesContext, imageLocation+"/")))
);
and in getScriptBtn replace
String imgUrl = (String)
uiComponent.getAttributes().get("popupButtonImageUrl");
if(imgUrl!=null)
{
writer.writeAttribute(HTML.SRC_ATTR,
addResource.getResourceUri(facesContext, imgUrl), null);
}
else
{
writer.writeAttribute(HTML.SRC_ATTR,
addResource.getResourceUri(facesContext, HtmlCalendarRenderer.class,
"images/calendar.gif"), null);
}
by this code
String imgUrl = (String)
uiComponent.getAttributes().get("popupButtonImageUrl");
String imageLocation =
HtmlRendererUtils.getImageLocation(uiComponent);
if(imgUrl!=null)
{
writer.writeAttribute(HTML.SRC_ATTR,
addResource.getResourceUri(facesContext, imgUrl), null);
}
else if (imageLocation != null)
{
writer.writeAttribute(HTML.SRC_ATTR,
addResource.getResourceUri(facesContext, imageLocation+"/calendar.gif"), null);
}
else
{
writer.writeAttribute(HTML.SRC_ATTR,
addResource.getResourceUri(facesContext, HtmlCalendarRenderer.class,
"images/calendar.gif"), null);
}
> imageLocation of inputCalendar does not work
> --------------------------------------------
>
> Key: TOMAHAWK-530
> URL: http://issues.apache.org/jira/browse/TOMAHAWK-530
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Calendar
> Affects Versions: 1.1.3
> Reporter: Holger Schimanski
>
> Setting e.g. imageLocation="images/calendar" has no effect. Images are still
> loaded from Extension Filter and not from the URL, which is set in
> imageLocation.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira