[tapestry5-jquery] CustomDatepicker mixin not working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[tapestry5-jquery] CustomDatepicker mixin not working

nquirynen
Hi,

I'm upgrading to tapestry:5.4.0 and tapestry-jquery:4.0.0.

I have the following .tml:

     <t:form>
         <t:datefield t:id="someDateField"
                 t:value="someDate"
                 t:mixins="jquery/CustomDatepicker"
                 t:customdatepicker.params="params" />
     </t:form>

and in my java code:

     @Property
     private LocalDate someDate;

     public JSONObject getParams() {
         JSONObject params = new JSONObject();
         params.put("dateFormat", "dd-mm-yy");
         params.put("changeMonth", true);
         params.put("changeYear", true);
         return params;
     }

In the browsers console I do see the following:

Invoking
tjq/customdatepicker({"selector":"#someDateField","params":{"dateFormat":"dd-mm-yy","changeMonth":true,"changeYear":true,"selector":"#someDateField"}})

But for some reason the parameters are not being applied to the component...


I have noticed that it does work when it is inside a Zone and when the
Zone is rerendered, but cannot find out why...
Hope you guys can find the problem!


Example code you can test yourself:


/CustomDatePickerTest.tml/

<!DOCTYPE html>
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd 
<http://tapestry.apache.org/schema/tapestry_5_4.xsd>"
     xmlns:p="tapestry:parameter">

<t:zone t:id="zone" id="zone">
     <t:form>
         <t:datefield t:id="someDateField" t:value="someDate"
             t:mixins="jquery/CustomDatepicker"
t:customdatepicker.params="params" />
     </t:form>
</t:zone>

<t:eventlink t:async="true" t:event="rerender">Rerender</t:eventlink>

</html>


/CustomDatePicker.java/

public class CustomDatePickerTest {

     @Property
     private LocalDate someDate;
     @Inject
     private AjaxResponseRenderer ajax;
     @InjectComponent
     private Zone zone;

     public JSONObject getParams() {
         JSONObject params = new JSONObject();
         params.put("dateFormat", "dd-mm-yy");
         params.put("changeMonth", true);
         params.put("changeYear", true);
         return params;
     }

     void onRerender() {
         ajax.addRender(zone);
     }
}
Reply | Threaded
Open this post in threaded view
|

Re: [tapestry5-jquery] CustomDatepicker mixin not working

françois facon
Hi Nathan,

Could you open an issue at https://github.com/got5/tapestry5-jquery/issues ?

François

2016-05-17 10:34 GMT+02:00 Nathan Quirynen <[hidden email]>:

> Hi,
>
> I'm upgrading to tapestry:5.4.0 and tapestry-jquery:4.0.0.
>
> I have the following .tml:
>
>     <t:form>
>         <t:datefield t:id="someDateField"
>                 t:value="someDate"
>                 t:mixins="jquery/CustomDatepicker"
>                 t:customdatepicker.params="params" />
>     </t:form>
>
> and in my java code:
>
>     @Property
>     private LocalDate someDate;
>
>     public JSONObject getParams() {
>         JSONObject params = new JSONObject();
>         params.put("dateFormat", "dd-mm-yy");
>         params.put("changeMonth", true);
>         params.put("changeYear", true);
>         return params;
>     }
>
> In the browsers console I do see the following:
>
> Invoking
> tjq/customdatepicker({"selector":"#someDateField","params":{"dateFormat":"dd-mm-yy","changeMonth":true,"changeYear":true,"selector":"#someDateField"}})
>
> But for some reason the parameters are not being applied to the
> component...
>
>
> I have noticed that it does work when it is inside a Zone and when the
> Zone is rerendered, but cannot find out why...
> Hope you guys can find the problem!
>
>
> Example code you can test yourself:
>
>
> /CustomDatePickerTest.tml/
>
> <!DOCTYPE html>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd <
> http://tapestry.apache.org/schema/tapestry_5_4.xsd>"
>     xmlns:p="tapestry:parameter">
>
> <t:zone t:id="zone" id="zone">
>     <t:form>
>         <t:datefield t:id="someDateField" t:value="someDate"
>             t:mixins="jquery/CustomDatepicker"
> t:customdatepicker.params="params" />
>     </t:form>
> </t:zone>
>
> <t:eventlink t:async="true" t:event="rerender">Rerender</t:eventlink>
>
> </html>
>
>
> /CustomDatePicker.java/
>
> public class CustomDatePickerTest {
>
>     @Property
>     private LocalDate someDate;
>     @Inject
>     private AjaxResponseRenderer ajax;
>     @InjectComponent
>     private Zone zone;
>
>     public JSONObject getParams() {
>         JSONObject params = new JSONObject();
>         params.put("dateFormat", "dd-mm-yy");
>         params.put("changeMonth", true);
>         params.put("changeYear", true);
>         return params;
>     }
>
>     void onRerender() {
>         ajax.addRender(zone);
>     }
> }
>
Reply | Threaded
Open this post in threaded view
|

Re: [tapestry5-jquery] CustomDatepicker mixin not working

nquirynen


On 17/05/16 21:43, françois facon wrote:

> Hi Nathan,
>
> Could you open an issue at
> https://github.com/got5/tapestry5-jquery/issues ?
>
> François
>
> 2016-05-17 10:34 GMT+02:00 Nathan Quirynen
> <[hidden email] <mailto:[hidden email]>>:
>
>     Hi,
>
>     I'm upgrading to tapestry:5.4.0 and tapestry-jquery:4.0.0.
>
>     I have the following .tml:
>
>         <t:form>
>             <t:datefield t:id="someDateField"
>                     t:value="someDate"
>                     t:mixins="jquery/CustomDatepicker"
>                     t:customdatepicker.params="params" />
>         </t:form>
>
>     and in my java code:
>
>         @Property
>         private LocalDate someDate;
>
>         public JSONObject getParams() {
>             JSONObject params = new JSONObject();
>             params.put("dateFormat", "dd-mm-yy");
>             params.put("changeMonth", true);
>             params.put("changeYear", true);
>             return params;
>         }
>
>     In the browsers console I do see the following:
>
>     Invoking
>     tjq/customdatepicker({"selector":"#someDateField","params":{"dateFormat":"dd-mm-yy","changeMonth":true,"changeYear":true,"selector":"#someDateField"}})
>
>     But for some reason the parameters are not being applied to the
>     component...
>
>
>     I have noticed that it does work when it is inside a Zone and when
>     the Zone is rerendered, but cannot find out why...
>     Hope you guys can find the problem!
>
>
>     Example code you can test yourself:
>
>
>     /CustomDatePickerTest.tml/
>
>     <!DOCTYPE html>
>     <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd
>     <http://tapestry.apache.org/schema/tapestry_5_4.xsd>"
>         xmlns:p="tapestry:parameter">
>
>     <t:zone t:id="zone" id="zone">
>         <t:form>
>             <t:datefield t:id="someDateField" t:value="someDate"
>                 t:mixins="jquery/CustomDatepicker"
>     t:customdatepicker.params="params" />
>         </t:form>
>     </t:zone>
>
>     <t:eventlink t:async="true" t:event="rerender">Rerender</t:eventlink>
>
>     </html>
>
>
>     /CustomDatePicker.java/
>
>     public class CustomDatePickerTest {
>
>         @Property
>         private LocalDate someDate;
>         @Inject
>         private AjaxResponseRenderer ajax;
>         @InjectComponent
>         private Zone zone;
>
>         public JSONObject getParams() {
>             JSONObject params = new JSONObject();
>             params.put("dateFormat", "dd-mm-yy");
>             params.put("changeMonth", true);
>             params.put("changeYear", true);
>             return params;
>         }
>
>         void onRerender() {
>             ajax.addRender(zone);
>         }
>     }
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [tapestry5-jquery] CustomDatepicker mixin not working

nquirynen
Sorry, mail was sent empty by mistake.

Just wanted to say I made the issue with some of my thoughts/testing info.
https://github.com/got5/tapestry5-jquery/issues/373

Have also tried with Tapestry 5.4.1 with no success.

On 18/05/16 09:19, Nathan Quirynen wrote:

>
>
> On 17/05/16 21:43, françois facon wrote:
>> Hi Nathan,
>>
>> Could you open an issue at
>> https://github.com/got5/tapestry5-jquery/issues ?
>>
>> François
>>
>> 2016-05-17 10:34 GMT+02:00 Nathan Quirynen
>> <[hidden email] <mailto:[hidden email]>>:
>>
>>     Hi,
>>
>>     I'm upgrading to tapestry:5.4.0 and tapestry-jquery:4.0.0.
>>
>>     I have the following .tml:
>>
>>         <t:form>
>>             <t:datefield t:id="someDateField"
>>                     t:value="someDate"
>>                     t:mixins="jquery/CustomDatepicker"
>>                     t:customdatepicker.params="params" />
>>         </t:form>
>>
>>     and in my java code:
>>
>>         @Property
>>         private LocalDate someDate;
>>
>>         public JSONObject getParams() {
>>             JSONObject params = new JSONObject();
>>             params.put("dateFormat", "dd-mm-yy");
>>             params.put("changeMonth", true);
>>             params.put("changeYear", true);
>>             return params;
>>         }
>>
>>     In the browsers console I do see the following:
>>
>>     Invoking
>> tjq/customdatepicker({"selector":"#someDateField","params":{"dateFormat":"dd-mm-yy","changeMonth":true,"changeYear":true,"selector":"#someDateField"}})
>>
>>     But for some reason the parameters are not being applied to the
>>     component...
>>
>>
>>     I have noticed that it does work when it is inside a Zone and when
>>     the Zone is rerendered, but cannot find out why...
>>     Hope you guys can find the problem!
>>
>>
>>     Example code you can test yourself:
>>
>>
>>     /CustomDatePickerTest.tml/
>>
>>     <!DOCTYPE html>
>>     <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd
>>     <http://tapestry.apache.org/schema/tapestry_5_4.xsd>"
>>         xmlns:p="tapestry:parameter">
>>
>>     <t:zone t:id="zone" id="zone">
>>         <t:form>
>>             <t:datefield t:id="someDateField" t:value="someDate"
>>                 t:mixins="jquery/CustomDatepicker"
>>     t:customdatepicker.params="params" />
>>         </t:form>
>>     </t:zone>
>>
>>     <t:eventlink t:async="true"
>> t:event="rerender">Rerender</t:eventlink>
>>
>>     </html>
>>
>>
>>     /CustomDatePicker.java/
>>
>>     public class CustomDatePickerTest {
>>
>>         @Property
>>         private LocalDate someDate;
>>         @Inject
>>         private AjaxResponseRenderer ajax;
>>         @InjectComponent
>>         private Zone zone;
>>
>>         public JSONObject getParams() {
>>             JSONObject params = new JSONObject();
>>             params.put("dateFormat", "dd-mm-yy");
>>             params.put("changeMonth", true);
>>             params.put("changeYear", true);
>>             return params;
>>         }
>>
>>         void onRerender() {
>>             ajax.addRender(zone);
>>         }
>>     }
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]