Now I have another error: *TypeError: Effect has no properties*

I have no idea what's wrong because everything worked some time ago. I want to highlight a table row when user clicks on a link in that row.

*My code:*

public class ColumnLinkPanel extends Panel
{
private static final Logger log = LoggerFactory.getLogger(ColumnLinkPanel.class);

public ColumnLinkPanel(String id, final IModel model)
{
super(id);

Image icon = new Image("detailsIcon",new ResourceReference(ColumnLinkPanel.class,"doc.png"));
AjaxLink ajaxLink = new AjaxLink("detailsLink")
{
@Override
public void onClick(AjaxRequestTarget target)
{
ResultDetailsPanel newPanel = new ResultDetailsPanel("resultDetailsPanel",model); findParent(MainPage.class).get("resultDetailsPanel").replaceWith(newPanel.setOutputMarkupId(true));
target.addComponent(newPanel);
target.appendJavascript(new Effect.Highlight(findParent(OddEvenItem.class)).toJavascript());
}
};

add(ajaxLink.add(icon));
}
}


*From Ajax debug:*

<tbody>
<tr id="id120" class="even">
<td class="timeColumn">
<span>2008.02.20 20:37:57</span>
</td><td class="testColumn">
<span>Tests 1</span>
</td><td class="detailsColumn">
<span>
<a id="detailsLink21" onclick="var wcall=wicketAjaxGet('?wicket:interface=:2:resultsPanel:datatable:rows:1:cells:3:cell:detailsLink::IBehaviorListener:0:-1',null,null, function() {return Wicket.$('detailsLink21') != null;}.bind(this));return !wcall;" href="#"><img src="resources/lv.lu.cdzfk.ctests.web.components.ColumnLinkPanel/doc.png" border="0"/></a>
</span>
</td>
</tr><tr id="*id222*" class="odd">
<td class="timeColumn">
<span>2008.02.21 04:36:18</span>
</td><td class="testColumn">
<span>Tests 1</span>
</td><td class="detailsColumn">
<span>
<a id="detailsLink23" onclick="var wcall=wicketAjaxGet('?wicket:interface=:2:resultsPanel:datatable:rows:2:cells:3:cell:detailsLink::IBehaviorListener:0:-1',null,null, function() {return Wicket.$('detailsLink23') != null;}.bind(this));return !wcall;" href="#"><img src="resources/lv.lu.cdzfk.ctests.web.components.ColumnLinkPanel/doc.png" border="0"/></a>
</span>
</td>
</tr>
</tbody>
<tfoot>



</tfoot>
</table>
</div>]]></component></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*INFO: *Response processed successfully.
*INFO: *Invoking post-call handler(s)...
*INFO: *Calling focus on searchButton7
*INFO: *focus set on detailsLink23
*INFO: *
*INFO: *Initiating Ajax GET request on ?wicket:interface=:2:resultsPanel:datatable:rows:2:cells:3:cell:detailsLink::IBehaviorListener:0:-1&random=0.5963552713915646
*INFO: *Invoking pre-call handler(s)...
*INFO: *Received ajax response (1081 characters)
*INFO: *
<?xml version="1.0" encoding="UTF-8"?><ajax-response><component id="resultDetailsPanel15" ><![CDATA[<div id="resultDetailsPanel15" class="contentDiv">
<h1>Detaļas</h1>
<table border="0" id="detailsTable">
<tr>
<td><span>Reakcijas laiks</span></td>
<td><span>78,109,125,156,187,234,250,281,313,344,375,406,437,469,500,516,547,579,609,641,672,703,734,766,797,828,860,875,906,938,969,1000,1031,1062,1094</span></td>
</tr>
<tr>
<td>Rezultāti</td>
<td>
<table border="0">
<tr>
<td><span>Vidējais reakcijas laiks</span></td>
<td><span>582.6 ms</span></td>
</tr>
</table>
</td>
</tr>
</table>
</div>]]></component><evaluate><![CDATA[new Effect.Highlight('*id222*',
{}
);
]]></evaluate></ajax-response>
*INFO: *Response parsed. Now invoking steps...
*ERROR: *Exception evaluating javascript: TypeError: Effect has no properties



Yep.  If your using the effects directly without any of the Ajax
components, you need to manually add the scriptaculous javascript
files to your page.

add this code to your page and you should be good to go:
add(ScriptaculousAjaxBehavior.newJavascriptBinding());

On Thu, Feb 21, 2008 at 12:56 AM, Maris Orbidans <[EMAIL PROTECTED]> wrote:
hi

 I am trying to use wicketstuff-scriptaculous-1.3 latest snapshot but
 it's not working.
 I have simply included the jar in my app.  Do I need to do anything else
 to install scriptaculous support ?

 Maris



 public class ColumnLinkPanel extends Panel
 {

    public ColumnLinkPanel(String id, final IModel model)
    {
        super(id);

        Image icon = new Image("detailsIcon",new
 ResourceReference(ColumnLinkPanel.class,"doc.png"));
        AjaxLink ajaxLink = new AjaxLink("detailsLink")
        {
            @Override
            public void onClick(AjaxRequestTarget target)
            {
                ResultDetailsPanel newPanel = new
 ResultDetailsPanel("resultDetailsPanel",model);

 
findParent(MainPage.class).get("resultDetailsPanel").replaceWith(newPanel.setOutputMarkupId(true));
                target.addComponent(newPanel);
                target.appendJavascript(new
 Effect.Highlight(this).toJavascript());
            }
        };

        add(ajaxLink.add(icon));
    }
 }




 *INFO: *
 <?xml
 ............................................
                </tr>
            </table>
    </div>]]></component><evaluate><![CDATA[new 
Effect.Highlight('detailsLink11',
 {}
 );
 ]]></evaluate></ajax-response>

 *ERROR:
 *Exception evaluating javascript: ReferenceError: Effect is not defined

 ---------------------------------------------------------------------
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to