You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rebecca <ri...@gmail.com> on 2011/07/18 08:45:20 UTC

onclick ajax event stops working when adding onmouseover

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&lt;List&lt;MeetingTimeSlot&gt;>(
				"timeSlotsLists", new PropertyModel(this, "timeSlotsLists")) {

			@Override
			public void populateItem(final ListItem&lt;List&lt;MeetingTimeSlot&gt;>
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: onclick ajax event stops working when adding onmouseover

Posted by rebecca <ri...@gmail.com>.
Hello again

Do you have an idea why this 2 ajax events don't work together?

thanks
Rebecca

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/onclick-ajax-event-stops-working-when-adding-onmouseover-tp3674638p3680546.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: onclick ajax event stops working when adding onmouseover

Posted by Andrew Fielden <an...@power-oasis.com>.
I don't have a direct answer to your question, but I would start
investigating this by first establishing whether your web browser is
invoking the Javascript which calls your server's Ajax onclick event
handler.
You can install Firebug, which is an excellent debugging tool for Firefox,
and allows you to set breakpoints in the Javascript.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/onclick-ajax-event-stops-working-when-adding-onmouseover-tp3674638p3674895.html
Sent from the Users forum mailing list archive at Nabble.com.

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