You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alexandros Karypidis <ak...@yahoo.gr> on 2010/04/19 21:54:21 UTC

Another beginner localization question

Hi,

I'm using a <wicket:message> tags, property files and a ChoiceRenderer 
to allow users to switch the Locale. My ChoiceRenderer overrides 
wantOnSelectionChangedNotifications() to have the browser send a Locale 
change event to the server and when this call returns, all 
<wicket:message> content is updated to match the new locale's messages.

This all works fine. However, I also have a "DatePicker" JQueryUI 
component component on my page which needs to be adjusted. This is done 
by having the browser execute the JavaScript:

<script type='text/javascript'>
                     $(function() {
                         
$.datepicker.setDefaults($.datepicker.regional['_[LOCALE]_']);
                     });
</script>

Is it possible to have the browser to execute some dynamically-generated 
JavaScript using the ChoiceRenderer's onSelectionChanged() event?

Thanks in advance.


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


Re: Another beginner localization question

Posted by Alexandros Karypidis <ak...@yahoo.gr>.
Aha! ...the joys of learning Wicket! :-)

On 19/4/2010 10:58 μμ, Pedro Santos wrote:
> Your ChoiceRenderer can implement IHeaderContributor and add your javascript
> to IHeaderResponse object, since when the user change the value on the
> selection component, the page will to be re-rendered
>
> On Mon, Apr 19, 2010 at 4:54 PM, Alexandros Karypidis<ak...@yahoo.gr>wrote:
>
>    
>> Hi,
>>
>> I'm using a<wicket:message>  tags, property files and a ChoiceRenderer to
>> allow users to switch the Locale. My ChoiceRenderer overrides
>> wantOnSelectionChangedNotifications() to have the browser send a Locale
>> change event to the server and when this call returns, all<wicket:message>
>> content is updated to match the new locale's messages.
>>
>> This all works fine. However, I also have a "DatePicker" JQueryUI component
>> component on my page which needs to be adjusted. This is done by having the
>> browser execute the JavaScript:
>>
>> <script type='text/javascript'>
>>                     $(function() {
>>
>>   $.datepicker.setDefaults($.datepicker.regional['_[LOCALE]_']);
>>                     });
>> </script>
>>
>> Is it possible to have the browser to execute some dynamically-generated
>> JavaScript using the ChoiceRenderer's onSelectionChanged() event?
>>
>> Thanks in advance.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>      


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


Re: Another beginner localization question

Posted by Pedro Santos <pe...@gmail.com>.
Your ChoiceRenderer can implement IHeaderContributor and add your javascript
to IHeaderResponse object, since when the user change the value on the
selection component, the page will to be re-rendered

On Mon, Apr 19, 2010 at 4:54 PM, Alexandros Karypidis <ak...@yahoo.gr>wrote:

> Hi,
>
> I'm using a <wicket:message> tags, property files and a ChoiceRenderer to
> allow users to switch the Locale. My ChoiceRenderer overrides
> wantOnSelectionChangedNotifications() to have the browser send a Locale
> change event to the server and when this call returns, all <wicket:message>
> content is updated to match the new locale's messages.
>
> This all works fine. However, I also have a "DatePicker" JQueryUI component
> component on my page which needs to be adjusted. This is done by having the
> browser execute the JavaScript:
>
> <script type='text/javascript'>
>                    $(function() {
>
>  $.datepicker.setDefaults($.datepicker.regional['_[LOCALE]_']);
>                    });
> </script>
>
> Is it possible to have the browser to execute some dynamically-generated
> JavaScript using the ChoiceRenderer's onSelectionChanged() event?
>
> Thanks in advance.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos