OnChangeAjaxBehavior continually triggered

2013-11-28 Thread dlock
I have a DataTable with a single column.  The table has a toolbar assigned
which provides sorting and filtering.

The filtering is done via TextField that has the following
OnChangeAjaxBehavior assigned.


OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior()
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{
 FilteredLazyLoadingDataProviderT, S provider =
 (FilteredLazyLoadingDataProviderT, S)
dataTable.getDataProvider();
 provider.filter(FilterAjaxFallbackOrderByBorder.this);

 target.add(dataTable);
 target.appendJavaScript(moveCaretToEnd(document.getElementById('
+ m_filter.getMarkupId() + ')));
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
{
 super.updateAjaxAttributes(attributes);
 attributes.setThrottlingSettings(new ThrottlingSettings(id,
Duration.milliseconds(200), true));
 }
};

When I view a page in Chrome/Firefox everything works as expected.  When I
view the page in Internet Explorer 11 I observer the following issue.

If the filter textfield has focus and is empty, the
OnChangeAjaxBehavior.onUpdate method is continually called (ajax requests
spam the server).  As soon as I enter a value into the text field, the
filtering is performed and the ajax calls cease to spam the server.

What is interesting is if I create a simple form with just a textfield in
and assign the above OnChangeAjaxBehaviour, the textfield in the form does
not have the same issue as the one in the table header.

My app is deployed in Tomcat 7.0.30 (although the issue can also been seen
when testing via jetty) 
Wicket 6.12

I have created a quickstart that can be run to observe the issue if anyone
is interested (what is the best way to provide it?)

I would appreciate if anyone can give me some pointers as to what is going
on.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OnChangeAjaxBehavior-continually-triggered-tp4662704.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: OnChangeAjaxBehavior continually triggered

2013-11-28 Thread dlock
Hi Martin.

Thanks for the quick reply.  I have created the following ticket...

https://issues.apache.org/jira/browse/WICKET-5432





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OnChangeAjaxBehavior-continually-triggered-tp4662704p4662706.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: EventBus.push not pushing data to subscribe method

2013-07-11 Thread dlock
If you use the Google Guava library, make sure the import associated with the
@Subscribe annotation is

org.apache.wicket.atmosphere.Subscribe

and not

com.google.common.eventbus.Subscribe





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EventBus-push-not-pushing-data-to-subscribe-method-tp4660183p4660198.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket-atmosphere - How to unsubscribe?

2013-07-11 Thread dlock
A quick update...

After upgrading to the latest versions (wicket-6.9.0, wicket-atmosphere-0.11
 atmosphere-runtime-1.0.13) I was still experiencing the issue.  However I
noticed that some of the retained pages where being held by Jetty specific
classes (I was profiling the app locally via eclipse).  

I decided to carry out the same profiling on a deployed instance of the
application (runniing in Tomcat7) and the problem disappeared, pages are
cleared up as you would expect and nothing untoward is retained in memory. 

Therefore I can only assume that the issue is somehow related to the Jetty
implementation, but as I am not deploying to Jetty (I only use it to develop
with locally), I guess this is no longer a problem for me.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-atmosphere-How-to-unsubscribe-tp4660170p4660206.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-09 Thread dlock
Hi Sven.
I created a QuickStart as per your suggestion and in the process of writing
it I discovered what the issue was.

Basically the mark-up had an erroneous enclosure tag defined which was
causing the problem.  

body
wicket:panel
*div wicket:enclosure=table*

[table]

   * /div*
/wicket:panel
/body

Removing the enclosure tag rectified the problem.  

At least now I know how to create a QuickStart :)

Thanks for you help.
dl



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-cell-not-receiving-event-after-sorting-tp4659277p4659303.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-08 Thread dlock
Hi Sven.
Thanks for taking a look at my question.

I have been trying to debug the issue (Ajax is new to me so please be
patient).  It looks like the issue is more fundamental than what I first
thought.  I added a simple row listener like so...

@Override
protected ItemT newRowItem(String id, int index, IModelT
model)
{
ItemT item = super.newRowItem(id, index, model);
item.add(new RowBehaviorT(onclick, model)
{
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(IModelT model,
AjaxRequestTarget target)
{
m_logger.info(row clicked: {}, model.getObject());
}
});
return item;
}

Prior to sorting, the content of the row is printed when clicked.  After
sorting nothing is printed, sorting again to revert back to the original
state will print the contents on a row click.

Every other sort (the one that results in the failure scenario) results in
the following errors being logged in the Wicket Ajax Debug Window

ERROR: Cannot find element with id: iconc2
ERROR: Cannot find element with id: id21c3
ERROR: Cannot find element with id: iconc4
ERROR: Cannot find element with id: id22c5
ERROR: Cannot find element with id: orderByLinkc6
ERROR: Cannot find element with id: orderByLinkc7
ERROR: Cannot find element with id: orderByLinkc8

The ids obviously change with each sort.  From what I can tell the
orderByLink ones are the header links that result in a sort when clicked and
the icon and id ones relate to the label/icon described in the original
problem.

There is JavaScript created that links the above ids to their behaviours 
Something like this

Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.1-usersTable-table-body-rows-25-cells-3-cell-icon,e:click,c:iconc6});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.0-usersTable-table-body-rows-25,e:click,c:id25c7});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.1-usersTable-table-body-rows-26-cells-3-cell-icon,e:click,c:iconc8});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.0-usersTable-table-body-rows-26,e:click,c:id26c9});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.1-usersTable-table-topToolbars-toolbars-1-headers-49-header-orderByLink,e:click,c:orderByLinkca});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.1-usersTable-table-topToolbars-toolbars-1-headers-50-header-orderByLink,e:click,c:orderByLinkcb});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorListener.1-usersTable-table-topToolbars-toolbars-1-headers-52-header-orderByLink,e:click,c:orderByLinkcc});;
Wicket.Ajax.ajax({u:./users?2-5.IBehaviorLis


When everything is working the markup and javascript ids align.  When it
fails, it looks like the previous javascript remains (hence why the row
listener is failing)

So, the (new) question I have is, where/how does the JavaScript and markup
get associated and why can't the newly generated ids be found (yet on a
resort they can).

Some possibly (not) important points.  The table resides in an extension to
Panel which is added to a page.
I am using Wicket 6.8.0

Any help/pointers would be appreciated.

dl










--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-cell-not-receiving-event-after-sorting-tp4659277p4659294.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-07 Thread dlock
Hi.

I have a simple abstract panel that I display as a cell within an
AjaxFallbackDefaultDataTable.  The panel has a label and a WebComponent that
shows an icon (based on passed in css).  

The WebComponent has an AjaxEventBehaviour(click) added and whenever the
icon is clicked the handling is delegated to the concrete implementation
(think of the table cell having an action associated with it, such as edit
etc).  Below is the (simplified) code of the LabelIconPanel...

public abstract class LabelIconPanelT extends Panel
{
private static final long serialVersionUID = 1L;
public LabelIconPanel(String id, IModelT model, IModelString text,
String cssIcon)
{
super(id, model);

Label label = new Label(label, text);

Component icon = new WebComponent(icon);
icon.add(new AjaxEventBehavior(click)
{
private static final long serialVersionUID = 1L;

@Override
protected void onEvent(AjaxRequestTarget target)
{
LabelIconPanel.this.onClick(target);
}
});

icon.add(new AttributeAppender(class, new ModelString(cssIcon),
 ));
add(label);
add(icon);
}
public abstract void onClick(AjaxRequestTarget target);
}
_

The panel is added to the table via a PropertyColumn like so...

new PropertyColumnSomePojo, String(new ModelString(Some header),
someProperty)
{
private static final long serialVersionUID = 1L;

@Override
public void populateItem(ItemICellPopulatorlt;SomePojo
item, String componentId, final IModelSomePojo rowModel)
{

LabelIconPanelSomePojo labelIconPanel =
new LabelIconPanelSomePojo(componentId, rowModel,
new ModelString(
rowModel.getObject().getPropertyValue()),
icon-pencil)
{
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target)
{
  // handle the icon being clicked
here...show a dialog to edit property etc.
}
};

item.add(labelIconPanel);
}
}



The issue I am having is that when I sort the table via the header, the icon
in the above panel is no longer receiving the click event (for any rows). 
If I revert the sort, the icons in each row work as expected.  If I refresh
the page after sorting, the icons work as expected.

This is my first post on here as I am new to Wicket development, so any
pointers as to what might be going on or suggestions as to where I might
need to start looking would be appreciated.

dl





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-cell-not-receiving-event-after-sorting-tp4659277.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org