When I remove, the console says:

Executing 0 inits
console.js:104 All inits executed

Thanks,
Steve

On 4 May 2015 at 12:04, Stephen Nutbrown <steves...@gmail.com> wrote:
> Hi,
>
> Just to add to that - when I press remove row, this function also is
> not called (at least, the alert doesn't show). Only when the page
> loads.
>
> Thanks,
> Steve
>
> On 4 May 2015 at 11:56, Stephen Nutbrown <steves...@gmail.com> wrote:
>> Hi,
>>
>> Thank you Akshay & Dimitris.
>>
>> Just a quick note on the things I have now tried, and the outcome.
>> I tried Ashkay's example but seemed to run into some problems, mainly
>> that I don't know exactly where to put this code as it is using a js
>> module, the function is also anonymous so I was a bit stuck/confused.
>>
>> I then put an alert inside the function passed to the scanner:
>>  dom.scanner("[data-component-type='DateTimeField']", function(container) {
>>         alert('running function');
>>   ....
>>    ....
>> }
>>
>> I see this runs once for each row on the form to begin with, but does
>> no run again when adding a new row. E.g, if I have 2 rows, it runs
>> twice, I press add row, it does not run again (but I now have 3 rows).
>> The new row is the one which contains the field which doesn't seem
>> show the picker on click.
>>
>> I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to work.
>>
>> This is what I get in the console of Google Chrome developer tools:
>>
>>
>> ===== When the page loads =====
>> Loading 0 libraries
>> console.js:104 Executing 7 inits
>> console.js:104 Invoking t5/core/pageinit:focus("price")
>> console.js:104 Loaded module t5/core/forms
>> console.js:104 Loaded module t5/core/form-fragment
>> console.js:104 Loaded module t5/core/validation
>> console.js:104 Loaded module t5/core/ajaxformloop
>> console.js:104 Loaded module bootstrap/alert
>> console.js:104 Loaded module datetimefield
>> console.js:104 All inits executed
>>
>> ==== When I then click "Add Row ======
>> console.js:104 Executing 3 inits
>> console.js:104 Loaded module datetimefield
>> console.js:104 Loaded module t5/core/validation
>> console.js:104 Loaded module t5/core/ajaxformloop
>> console.js:104 All inits executed
>> ================================
>>
>> Looking in the events listeners part of Google chrome developer tools,
>> I can see the original one has two additional event listeners which
>> the new one doesn't. These are called "dp" and "mousedown".
>>
>> Perhaps the order in which these are initialised matter here, should
>> the datetimefield be after the validation/ajaxformloop?
>>
>> Thanks,
>> Steve
>>
>> On 4 May 2015 at 11:08, Dimitris Zenios <dimitris.zen...@gmail.com> wrote:
>>> Also can you please update to latest tapestry 5.4-beta-31
>>>
>>> I think there was a bug that looks like that and got fixed.
>>>
>>> On Mon, May 4, 2015 at 1:04 PM, Dimitris Zenios <dimitris.zen...@gmail.com>
>>> wrote:
>>>
>>>> Javascript is using dom.scanner function which should execute on every
>>>> zone change.Just like the DateField
>>>>
>>>> Can you please check whether the function passed to dom.scanner is
>>>> executed when you add or remove rows?
>>>>
>>>> On Mon, May 4, 2015 at 2:42 AM, akshay <akshayestat...@gmail.com> wrote:
>>>>
>>>>> Hi Stephen,
>>>>>
>>>>> You can try something like this:-
>>>>>   @Inject
>>>>>   private AjaxResponseRenderer ajaxResponseRenderer;
>>>>>
>>>>>
>>>>>  ajaxResponseRenderer.addRender("YOUR ZONE");
>>>>>     ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
>>>>>
>>>>>       @Override
>>>>>       public void run(JavaScriptSupport javascriptSupport) {
>>>>>
>>>>>         javascriptSupport.require("YOUR JS FILE").invoke("function to be
>>>>> invoked");
>>>>>
>>>>>
>>>>>       }
>>>>>     });
>>>>>
>>>>> Best Regards
>>>>> Akshay
>>>>>
>>>>> On Mon, May 4, 2015 at 1:38 AM, Stephen Nutbrown <steves...@gmail.com>
>>>>> wrote:
>>>>>
>>>>> > I tried adding this to the DateTimeField without much luck:
>>>>> >
>>>>> > @AfterRender
>>>>> > void afterRender(){
>>>>> >     javascriptSupport.require("datetimefield");
>>>>> > }
>>>>> >
>>>>> > I don't think this has any effect since the js is already loaded once,
>>>>> > and i'm not 100% certain that this is the problem either.
>>>>> >
>>>>> > On 4 May 2015 at 00:35, Stephen Nutbrown <steves...@gmail.com> wrote:
>>>>> > > Hi,
>>>>> > >
>>>>> > > I have a quick question (and this isn't anything to do with your code,
>>>>> > > which is fantastic) - it's more to do with how Tapestry handles an
>>>>> > > AjaxFormLoop.
>>>>> > >
>>>>> > > I have this component inside an ajax form loop. When I add a new row,
>>>>> > > it will add in a new component (of type DateTimeField).
>>>>> > >
>>>>> > > However, although the DateTimeField from the previous rows works fine,
>>>>> > > the new one doesn't. I get the feeling this is because the javascript
>>>>> > > wants to be re-initialised - we want to run DateTimeField.js again?
>>>>> > >
>>>>> > > I'm struggling a little bit to find out exactly why this is. There are
>>>>> > > no console errors (either to the java output or JS console), so I
>>>>> > > assume the event handler isn't added to the newly added row.
>>>>> > >
>>>>> > > Any ideas on how I would go about doing that?
>>>>> > >
>>>>> > > I noticed something similar going on with Tapestry's DateField, so i'm
>>>>> > > sure this isn't to do with the component. If I refresh the page, the
>>>>> > > newly added row works fine.
>>>>> > >
>>>>> > > Thanks,
>>>>> > > Steve
>>>>> > >
>>>>> > > On 3 May 2015 at 15:59, Stephen Nutbrown <steves...@gmail.com> wrote:
>>>>> > >> Hi Dimitris,
>>>>> > >>
>>>>> > >> That's extremely kind and generous of you, thank you! I owe you a few
>>>>> > >> beers, if you happen to have a paypal address hooked up to your email
>>>>> > >> account I can send you a little something (Not much as I'm currently
>>>>> a
>>>>> > >> student myself, but just to buy yourself a few beers on me).
>>>>> > >>
>>>>> > >> Cheers,
>>>>> > >> Steve
>>>>> > >>
>>>>> > >> C
>>>>> > >>
>>>>> > >> On 3 May 2015 at 11:28, Dimitris Zenios <dimitris.zen...@gmail.com>
>>>>> > wrote:
>>>>> > >>> Sure I will put them here as an attachment so everybody can see it
>>>>> > >>>
>>>>> > >>> You will also need to
>>>>> > >>> 1.Put the datetimepicker library inside META-INF/modules/datetime/.
>>>>> > >>> 2.Put the datetimepicker css inside  META-INF/assets/other/css/.
>>>>> > >>>
>>>>> > >>> The example I have attached is using Java 8 LocalDateTime but it
>>>>> can be
>>>>> > >>> adopted in order to use java.util.Date
>>>>> > >>>
>>>>> > >>> Thanks
>>>>> > >>> Dimitris Zenios
>>>>> > >>>
>>>>> > >>> On Fri, May 1, 2015 at 9:41 PM, Stephen Nutbrown <
>>>>> steves...@gmail.com>
>>>>> > >>> wrote:
>>>>> > >>>>
>>>>> > >>>> Hi Dimitris,
>>>>> > >>>>
>>>>> > >>>> Wow, as it happens that's the exact same one I was having problems
>>>>> > >>>> implementing!
>>>>> > >>>>
>>>>> > >>>> It would be awesome to have some kind of tapestry5 component
>>>>> > >>>> marketplace. Perhaps another thing for another day.
>>>>> > >>>> I feel very cheeky asking, but would you be up for (able to) send
>>>>> me
>>>>> > >>>> the code, i'd be more than happy to pay for a few drinks for you?
>>>>> > >>>>
>>>>> > >>>> Thanks,
>>>>> > >>>> Steve
>>>>> > >>>>
>>>>> > >>>> On 1 May 2015 at 11:24, Dimitris Zenios <dimitris.zen...@gmail.com
>>>>> >
>>>>> > wrote:
>>>>> > >>>> > For tapestry 5.4 i have been using this javascript library
>>>>> > >>>> > https://eonasdan.github.io/bootstrap-datetimepicker/
>>>>> > >>>> >
>>>>> > >>>> > and a custom component extending AbstractField
>>>>> > >>>> >
>>>>> > >>>> >
>>>>> > >>>> >
>>>>> > >>>> >
>>>>> > >>>> > On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown <
>>>>> > steves...@gmail.com>
>>>>> > >>>> > wrote:
>>>>> > >>>> >
>>>>> > >>>> >> Hi,
>>>>> > >>>> >>
>>>>> > >>>> >> I have been looking for a date + time picker for Tapestry. I'd
>>>>> > like a
>>>>> > >>>> >> form component which will bind to a java.util.Date object, and
>>>>> asks
>>>>> > >>>> >> for a time as well as a date.
>>>>> > >>>> >>
>>>>> > >>>> >> I haven't had much luck, i've found bits of code here and there
>>>>> for
>>>>> > >>>> >> older versions of tapestry. I would have thought this component
>>>>> > would
>>>>> > >>>> >> be one which comes with Tapestry out of the box, as I would
>>>>> think
>>>>> > it's
>>>>> > >>>> >> a common requirement.
>>>>> > >>>> >>
>>>>> > >>>> >> I tried to create my own component which extends AbstractField,
>>>>> > based
>>>>> > >>>> >> on the source code I can see for the
>>>>> > >>>> >>
>>>>> > >>>> >>
>>>>> > >>>> >>
>>>>> >
>>>>> http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
>>>>> > >>>> >> but I ran in to some issues (I think perhaps I just didn't have
>>>>> > enough
>>>>> > >>>> >> patience, I will need to revisit it if I am to try again - it's
>>>>> a
>>>>> > bit
>>>>> > >>>> >> of a learning curve for me).
>>>>> > >>>> >>
>>>>> > >>>> >> Is there a simpler way to do this? Am I going in the right
>>>>> > direction
>>>>> > >>>> >> trying to create a new component which extends AbstractField? If
>>>>> > there
>>>>> > >>>> >> was one that is known to work on the latest versions of tapestry
>>>>> > and
>>>>> > >>>> >> with jQuery as the js provider (or not requiring
>>>>> > jQuery/Prototype), I
>>>>> > >>>> >> would really appreciate a link. If not, any guidance on if my
>>>>> > approach
>>>>> > >>>> >> is sensible, if it is.. i'll just try again this evening.
>>>>> > >>>> >>
>>>>> > >>>> >>
>>>>> > >>>> >> Any help is really appreciated.
>>>>> > >>>> >> Thanks,
>>>>> > >>>> >>
>>>>> > >>>> >>
>>>>> > ---------------------------------------------------------------------
>>>>> > >>>> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> > >>>> >> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> > >>>> >>
>>>>> > >>>> >>
>>>>> > >>>>
>>>>> > >>>>
>>>>> ---------------------------------------------------------------------
>>>>> > >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> > >>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> > >>>>
>>>>> > >>>
>>>>> > >>>
>>>>> > >>>
>>>>> > >>>
>>>>> ---------------------------------------------------------------------
>>>>> > >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> > >>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> >
>>>>> > ---------------------------------------------------------------------
>>>>> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> > For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> >
>>>>> >
>>>>>
>>>>>
>>>>> --
>>>>> Cheers!!
>>>>> Akshay
>>>>>
>>>>
>>>>

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

Reply via email to