Hello friends,
I have a problem i don't understand:
I have a list view of columns (inside a list view of rows). When i add an
ajaxEventBehaviour("onckick") to each col item - it works.
When i add another ajaxEventBehaviour("onmouseover") - the mouse over works
but the onclick stops working (it does not enter the onEvent()).
What am i doing wrong?
here's my code:
timeSlotsListView = new ListView<List<MeetingTimeSlot>>(
"timeSlotsLists", new PropertyModel(this,
"timeSlotsLists")) {
@Override
public void populateItem(final
ListItem<List<MeetingTimeSlot>>
row) {
List<MeetingTimeSlot> timeSlotsPerDate =
row.getModelObject();
row.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel<String>() {
@Override
public String
getObject() {
return
(row.getIndex() % 2 == 1) ? "even" : "odd";
}
}));
row.add(new
ListView<MeetingTimeSlot>("timeSlotsPerDate",
timeSlotsPerDate) {
@Override
protected void populateItem(final
ListItem<MeetingTimeSlot> col) {
final MeetingTimeSlot
meetingTimeSlot = (MeetingTimeSlot)
col.getModelObject();
final WebMarkupContainer
timeSlotContainer = new
WebMarkupContainer("timeSlotContainer");
Label timeRangeLabel = new
Label("timeRangeLabel",
meetingTimeSlot.getTimeRange());
timeSlotContainer.add(timeRangeLabel);
timeSlotContainer.setOutputMarkupId(true);
timeSlotContainer.add(new
AjaxEventBehavior("onclick") {
protected void
onEvent(AjaxRequestTarget target) {
System.out.println("in timeSlotContainer onclick");
prevTimeSlotContainer.add(new SimpleAttributeModifier("style",
"color: #6A6A6A"));
target.addComponent(prevTimeSlotContainer);
getPanelModelObject().setMeetingTimeSlot(
(MeetingTimeSlot) col.getModelObject());
getPanelModelObject().setMeetingBranchLogin(branchAvailabilityData.getBranchLogIn());
selectedMeetingDateContainer.setVisibilityAllowed(true);
target.addComponent(selectedMeetingDateContainer);
timeSlotContainer.add(new SimpleAttributeModifier("style", "color:
red;"));
target.addComponent(timeSlotContainer);
prevTimeSlotContainer = timeSlotContainer;
};
});
timeSlotContainer.add(new
AjaxEventBehavior("onmouseover") {
protected void
onEvent(AjaxRequestTarget target) {
System.out.println("in timeSlotContainer onmouseover");
timeSlotContainer.add(new AttributeModifier("class", true, new
Model("even")));
target.addComponent(timeSlotContainer);
};
});
timeSlotContainer.add(new
AjaxEventBehavior("onmouseout") {
protected void
onEvent(AjaxRequestTarget target) {
System.out.println("in timeSlotContainer onmouseout");
String bgStyle
= (row.getIndex() % 2 == 1) ? "even" : "odd";
timeSlotContainer.add(new AttributeModifier("class", true, new
Model(bgStyle)));
target.addComponent(timeSlotContainer);
};
});
col.add(timeSlotContainer);
}
});
}
};
timeTableContainer.add(timeSlotsListView);
}
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/onclick-ajax-event-stops-working-when-adding-onmouseover-tp3674638p3674638.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]