Hi,

<a id="from2059--lt"href="#" onclick="changeDate('from2059'**, -1)"><<\/a>

ins't exactly "proper" JavaScript. What do you want to achieve? Apend that
HTML to component's HTML?

On Thu, Feb 14, 2013 at 2:41 PM, Artur <a_wron...@gazeta.pl> wrote:

> Hi Guys,
>
> We just migrated our code to W6.5 and are very happy about it.
> Unfortunately we don't know how to fix one of the errors.
>
> We did a research but cannot find a solution :(
>
> The code adds a link before a component with some javascript:
>
>             private class ChangeDateBehavior extends Behavior {
>   [...]
>                 @Override
>                 public void renderHead(Component component,
> IHeaderResponse response) {
>                     if (RequestCycle.get().find(**AjaxRequestTarget.class)
> != null) {
>                         String javascript = "var e = Wicket.$('" +
> getMarkupId()
>                                 + "'); if (e != null &&
> typeof(e.parentNode) != 'undefined') e.parentNode.removeChild(e);";
> response.render(**JavaScriptHeaderItem.**forScript(javascript, null));
>                     }
>                     String tag = "<a id=\"" + getMarkupId() +
> "\"href=\"#\" onclick=\"changeDate('" + component.getMarkupId()
>                         + "', " + Integer.toString(days) + ")\">" + txt +
> "";
> response.render(**JavaScriptHeaderItem.**forScript(tag, null));
>
>                 }
>
>                 @Override
>                 public void bind(Component component) {
>                     this.component = component;
>                 }
>
>                 public String getMarkupId() {
>                     return component.getMarkupId() + "--" + id;
>                 }
>
>             }
>
>
> And the error msg from the console:
> ERROR: Wicket.Head.Contributor.**processScript: SyntaxError: syntax
> error: eval -> <a id="from2059--lt"href="#" onclick="changeDate('from2059'
> **, -1)"><<\/a>
>
>
> Thanks for help in advance,
> Artur
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Reply via email to