You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John <jo...@quivinco.com> on 2013/11/03 22:21:37 UTC
incorrect ids for links after switching jquery tabs
I'm finding that component ids are being corrupted as I switch between jquery tabs which means that these links fail when clicked. They are in loops and should have the correct loop count at the end, but garbage appears to be injected in the middle of the ids when rerendering.
source:
<t:jquery.dialogajaxlink t:id="book" t:dialog="reservationDialogCal" t:context="[currentEvent.event.monthIndex,currentEvent.event.dayNumber,eventNumber]" t:zone="reservationZone" class="availablece" title="${currentEvent.text}">${currentEvent.event.from.time}<br/>${currentEvent.event.to.time}</t:jquery.dialogajaxlink>
original correct rendering
<a title="available" class="availablece" id="book_11" href="#">21:00<br>23:00</a>
incorrect rendering after switching back within a tab
<a title="available" class="availablece" id="book_1421fd014ff_11" href="#">21:00<br>23:00</a>
How to fix this, has anyone seen this before and figured it out?
John
Re: incorrect ids for links after switching jquery tabs
Posted by John <jo...@quivinco.com>.
Yes, the results look much the same with random stuff injected.
It is looking like the jquery.dialogajaxlink doesn't work properly in loops within zones because of this id issue. The first time the zone is rendering the ids are fine though.
At present the user has to refresh the page to restore function.
<span style="height:149px;" class="calday">
14
<br>Thu
<br><a title="available" class="availablece" id="book_14223540913_9" href="#">09:00<br>12:00</a>
<br><a class="reservedce" id="edit_14223540913" href="#">13:00<br>14:30</a>
<br><a class="reservedce" id="edit_14223540913_0" href="#">14:50<br>16:20</a>
<br><a title="available" class="availablece" id="book_14223540913_10" href="#">16:40<br>18:00</a>
<br><a title="available" class="availablece" id="book_14223540913_11" href="#">21:00<br>23:00</a>
<br></span>
----- Original Message -----
From: Thiago H de Paula Figueiredo
To: Tapestry users
Sent: Monday, November 04, 2013 1:29 PM
Subject: Re: incorrect ids for links after switching jquery tabs
On Mon, 04 Nov 2013 10:52:30 -0200, John <jo...@quivinco.com> wrote:
> I have also added an id="value" attribute to the component but it is
> ignore, I just get a similar result. (see below)
Have you checked whether the zone-rendered link ids are now non-random,
which was your original problem? I haven't used the DialogAjaxLink from
tapestry5-jquery, so I don't know whether it actually supports receiving
the id.
You didn't seem to have included the results in the e-mail.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: incorrect ids for links after switching jquery tabs
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 04 Nov 2013 10:52:30 -0200, John <jo...@quivinco.com> wrote:
> I have also added an id="value" attribute to the component but it is
> ignore, I just get a similar result. (see below)
Have you checked whether the zone-rendered link ids are now non-random,
which was your original problem? I haven't used the DialogAjaxLink from
tapestry5-jquery, so I don't know whether it actually supports receiving
the id.
You didn't seem to have included the results in the e-mail.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: incorrect ids for links after switching jquery tabs
Posted by John <jo...@quivinco.com>.
Thanks for that Thiago, I have had a look at the Tesestry docs and not seen anything helpful.
I have also added an id="value" attribute to the component but it is ignore, I just get a similar result. (see below)
Is there an example somewhere?
John
<t:zone t:id="calendarZone" id="calendarZone">
<div style="height:516px;overflow:auto;">
<div style="float:right;border-left: 2px solid #fff;background-color: buttonface;"><t:linkcals/></div>
<form t:type="form" t:id="selectform" style="width: 65em;padding: 1px;margin: 1px;border: 1px solid #DFEFDF">
Criteria:
<t:select t:id="selectedVenueName" value="selectedVenueId" model="venues" t:blankOption="NEVER" t:zone="calendarZone"/>
<t:select t:id="selectedWorkName" value="selectedWorkId" model="works" t:blankOption="ALWAYS" t:zone="calendarZone"/>
</form>
<t:loop t:source="months" t:value="currentMonth">
<span class="calmon">
<strong>${currentMonthName}</strong><br/>
<t:loop t:source="monthDays" t:value="currentDay">
<span class="calday" style="height:${monthHeight}px;">
${currentDay}<br/>${currentDayName}<br/>
<t:loop t:source="monthEvents" t:value="currentEvent" t:index="eventNumber">
<t:if test="currentEvent.event.free">
<t:jquery.dialogajaxlink t:id="book" id="${eventNumberId}" t:dialog="reservationDialogCal" t:context="[currentEvent.event.monthIndex,currentEvent.event.dayNumber,eventNumber]" t:zone="reservationZone" class="availablece" title="${currentEvent.text}">${currentEvent.event.from.time}<br/>${currentEvent.event.to.time}</t:jquery.dialogajaxlink>
<p:else>
<t:jquery.dialogajaxlink t:id="edit" id="${eventNumberId}" t:dialog="reservationDialogCal" t:context="currentEvent.id" t:zone="reservationZone" class="${bookingClass}"
----- Original Message -----
From: Thiago H de Paula Figueiredo
To: Tapestry users
Sent: Monday, November 04, 2013 1:40 AM
Subject: Re: incorrect ids for links after switching jquery tabs
On Sun, 03 Nov 2013 19:21:37 -0200, John <jo...@quivinco.com> wrote:
> I'm finding that component ids are being corrupted as I switch between
> jquery tabs which means that these links fail when clicked. They are in
> loops and should have the correct loop count at the end, but garbage
> appears to be injected in the middle of the ids when rerendering.
>
> source:
> <t:jquery.dialogajaxlink t:id="book" t:dialog="reservationDialogCal"
> t:context="[currentEvent.event.monthIndex,currentEvent.event.dayNumber,eventNumber]"
> t:zone="reservationZone" class="availablece"
> title="${currentEvent.text}">${currentEvent.event.from.time}<br/>${currentEvent.event.to.time}</t:jquery.dialogajaxlink>
>
> original correct rendering
> <a title="available" class="availablece" id="book_11"
> href="#">21:00<br>23:00</a>
>
> incorrect rendering after switching back within a tab
> <a title="available" class="availablece" id="book_1421fd014ff_11"
> href="#">21:00<br>23:00</a>
>
> How to fix this, has anyone seen this before and figured it out?
For every element inside a zone you want to refer to it through its id,
like that's the case above, provide an id yourself instead of letting
Tapestry do it.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: incorrect ids for links after switching jquery tabs
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sun, 03 Nov 2013 19:21:37 -0200, John <jo...@quivinco.com> wrote:
> I'm finding that component ids are being corrupted as I switch between
> jquery tabs which means that these links fail when clicked. They are in
> loops and should have the correct loop count at the end, but garbage
> appears to be injected in the middle of the ids when rerendering.
>
> source:
> <t:jquery.dialogajaxlink t:id="book" t:dialog="reservationDialogCal"
> t:context="[currentEvent.event.monthIndex,currentEvent.event.dayNumber,eventNumber]"
> t:zone="reservationZone" class="availablece"
> title="${currentEvent.text}">${currentEvent.event.from.time}<br/>${currentEvent.event.to.time}</t:jquery.dialogajaxlink>
>
> original correct rendering
> <a title="available" class="availablece" id="book_11"
> href="#">21:00<br>23:00</a>
>
> incorrect rendering after switching back within a tab
> <a title="available" class="availablece" id="book_1421fd014ff_11"
> href="#">21:00<br>23:00</a>
>
> How to fix this, has anyone seen this before and figured it out?
For every element inside a zone you want to refer to it through its id,
like that's the case above, provide an id yourself instead of letting
Tapestry do it.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: incorrect ids for links after switching jquery tabs
Posted by Barry Books <tr...@gmail.com>.
I think this will happen after a zone update
On Sunday, November 3, 2013, John wrote:
> I'm finding that component ids are being corrupted as I switch between
> jquery tabs which means that these links fail when clicked. They are in
> loops and should have the correct loop count at the end, but garbage
> appears to be injected in the middle of the ids when rerendering.
>
> source:
> <t:jquery.dialogajaxlink t:id="book" t:dialog="reservationDialogCal"
> t:context="[currentEvent.event.monthIndex,currentEvent.event.dayNumber,eventNumber]"
> t:zone="reservationZone" class="availablece"
> title="${currentEvent.text}">${currentEvent.event.from.time}<br/>${currentEvent.event.to.time}</t:jquery.dialogajaxlink>
>
> original correct rendering
> <a title="available" class="availablece" id="book_11"
> href="#">21:00<br>23:00</a>
>
> incorrect rendering after switching back within a tab
> <a title="available" class="availablece" id="book_1421fd014ff_11"
> href="#">21:00<br>23:00</a>
>
> How to fix this, has anyone seen this before and figured it out?
>
> John
>