Re: get localized string from Model class?

2010-10-30 Thread vineet semwal
afaik you should only have property files corresponding to your components
,pages or application.
however if you just want to do your own way you can always use get your
resourcebundle.

On Sun, Oct 31, 2010 at 11:51 AM, 7zark7 <7za...@gmail.com> wrote:

> Hmm, that didn't seem to find a property if I have the property file
> specific to the model class, e.g.:
> NiceDateModel.properties
>
> However, I see now there's some classes such as:
>
> IComponentAssignedModel
>
> or perhaps I should subclass StringResourceModel, etc.
>
> Will look into it further,
>
> Thanks
>
>
>
> On 10/30/10 4:53 AM, 7zark7 wrote:
>
>> Thank you, I'll give that try!
>>
>> On Oct 30, 2010, at 1:51 AM, "Bas Gooren"  wrote:
>>
>>  The component parameter can be null.
>>>
>>> e.g. if you look at getObject() in the ResourceModel class:
>>>
>>> return
>>> Application.get().getResourceSettings().getLocalizer().getString(resourceKey,(Component)null,
>>> defaultValue);
>>>
>>> It calls Localizer#getString with the resource key and optionally a
>>> component.
>>>
>>> Sebastian
>>>
>>> - Original Message - From: "7zark7"<7za...@gmail.com>
>>> To: "Wicket"
>>> Sent: Saturday, October 30, 2010 8:47 AM
>>> Subject: get localized string from Model class?
>>>
>>>
>>>  Hi,

 I am writing a IModel  implementation which formats Dates in a
 particular way.

 I would like the text to be in localized properties files, however I
 can't seem to leverage anything in Wicket for this.  Localizer expects a
 component to be passed to its getString methods, which I do not have a
 reference to.

 Anyone have ideas or done similar?


 Thanks

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


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


-- 
regards,
Vineet Semwal


Re: get localized string from Model class?

2010-10-30 Thread 7zark7
Hmm, that didn't seem to find a property if I have the property file 
specific to the model class, e.g.:

NiceDateModel.properties

However, I see now there's some classes such as:

IComponentAssignedModel

or perhaps I should subclass StringResourceModel, etc.

Will look into it further,

Thanks


On 10/30/10 4:53 AM, 7zark7 wrote:

Thank you, I'll give that try!

On Oct 30, 2010, at 1:51 AM, "Bas Gooren"  wrote:


The component parameter can be null.

e.g. if you look at getObject() in the ResourceModel class:

return 
Application.get().getResourceSettings().getLocalizer().getString(resourceKey,(Component)null,
 defaultValue);

It calls Localizer#getString with the resource key and optionally a component.

Sebastian

- Original Message - From: "7zark7"<7za...@gmail.com>
To: "Wicket"
Sent: Saturday, October 30, 2010 8:47 AM
Subject: get localized string from Model class?



Hi,

I am writing a IModel  implementation which formats Dates in a 
particular way.

I would like the text to be in localized properties files, however I can't seem 
to leverage anything in Wicket for this.  Localizer expects a component to be 
passed to its getString methods, which I do not have a reference to.

Anyone have ideas or done similar?


Thanks

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




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




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



Re: Force DownloadLink

2010-10-30 Thread Jeremy Thomerson
JavaScript: document.getElementById("markup-id-of-link").click();

On Sat, Oct 30, 2010 at 9:07 PM, d2marcelo  wrote:

>
> Hello,
>
> how to force the DownloadLink to start downloading a file without the user
> clicking on it?
>
> I'm trying to do dowload.onClick(); from a setWindowClosedCallback but it
> won't start.
>
> Any thoughts?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Force-DownloadLink-tp3020797p3020797.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Force DownloadLink

2010-10-30 Thread d2marcelo

Hello, 

how to force the DownloadLink to start downloading a file without the user
clicking on it?

I'm trying to do dowload.onClick(); from a setWindowClosedCallback but it
won't start. 

Any thoughts?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-DownloadLink-tp3020797p3020797.html
Sent from the Users forum mailing list archive at Nabble.com.

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



If-Modified-Since header

2010-10-30 Thread Mauro Ciancio
Hello everyone:

I've been trying to get properly working the caching in my site's
resources using the if-modified-since header. I've noticed that the
check for the header is only done if the resource is mounted under the
'/resources' url (wicket filter @ line 1130, Wicket 1.4).

My resources are mounted under another url ('/photos'). I was
wondering why the check is restricted to that url. Also, I've tried to
mount my resources under /resources/photos but I get an exception that
says 'cannot be mounted under /resources'.

Any advices?
Thanks in advance.
-- 
Mauro Ciancio

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



Re: On-demand component initialization

2010-10-30 Thread Martin Makundi
Hi!

> Yeah, but then I would create new panel for every single click on that
> link. I know it's a bit edge-case, but still... So I can't achieve this
> without some own initialization logic?

You don't need to create new panel, just use lazy initialization.

 modalWidnow.setContent(getContentPanel());

getContentPanel() {
  if (contentPanel == null) {
 contentpanel = new ...
   }

   return contentPanel;
}


**
Martin

>


> Thanks for your replies.
>
> Regards,
> Peter
>
> 2010-10-30 16:48 keltezéssel, Alexander Morozov írta:
>>
>> You can set content for modal within onClick method.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: On-demand component initialization

2010-10-30 Thread Major Péter
Yeah, but then I would create new panel for every single click on that
link. I know it's a bit edge-case, but still... So I can't achieve this
without some own initialization logic?

Thanks for your replies.

Regards,
Peter

2010-10-30 16:48 keltezéssel, Alexander Morozov írta:
> 
> You can set content for modal within onClick method.

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



Re: On-demand component initialization

2010-10-30 Thread Alexander Morozov

You can set content for modal within onClick method.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/On-demand-component-initialization-tp3020334p3020343.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: On-demand component initialization

2010-10-30 Thread Martin Makundi
> then when I construct the page containing this modalwindow, I also will
> construct the modalwindow content, but the user can just decide to not
> to click on this link, so skip the modal, and then I have an unnecessary
> constructed panel.

Yeah.. you can construct panel in onClick before .show();

Also make note that you can re-use same modal window with various
different content always using setContent or setTitle on-fly.

**
Martin
>
> Thanks,
> Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



On-demand component initialization

2010-10-30 Thread Major Péter
Hi,

I'm trying to create a ModalWindow, something similar to this example:
http://wicketstuff.org/wicket14/nested/?wicket:bookmarkablePage=:org.apache.wicket.examples.ajax.builtin.modal.ModalWindowPage

If I create the modalwindow like this:
final ModalWindow modal = new ModalWindow("modal");
modal.setContent(new RegisterPanel(modal));
modal.setTitle("Registration");
modal.setCookieName("register");
add(new AjaxLink("showModal") {

   @Override
   public void onClick(AjaxRequestTarget target) {
  modal.show(target);
   }
});
add(modal);

then when I construct the page containing this modalwindow, I also will
construct the modalwindow content, but the user can just decide to not
to click on this link, so skip the modal, and then I have an unnecessary
constructed panel.
So I've played a bit with my RegisterPanel, and moved all of my logic to
onInitialize (because it's called before onBeforeRender), to initialize
my stuff there, but it looks like onInitialize is still called without
user action. If I put everything into onBeforeRender, then I can
guarantee, that the constructing logic runs on-demand, but then I will
have problems when user wants to reopen the window. I could create a
field to check whether I already initialized the component in
oBeforeRender, but that sounds like a hack. How can I solve this issue
elegantly?

Thanks,
Peter

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



Re: get localized string from Model class?

2010-10-30 Thread 7zark7
Thank you, I'll give that try!

On Oct 30, 2010, at 1:51 AM, "Bas Gooren"  wrote:

> The component parameter can be null.
> 
> e.g. if you look at getObject() in the ResourceModel class:
> 
> return 
> Application.get().getResourceSettings().getLocalizer().getString(resourceKey,(Component)null,
>  defaultValue);
> 
> It calls Localizer#getString with the resource key and optionally a component.
> 
> Sebastian
> 
> - Original Message - From: "7zark7" <7za...@gmail.com>
> To: "Wicket" 
> Sent: Saturday, October 30, 2010 8:47 AM
> Subject: get localized string from Model class?
> 
> 
>> Hi,
>> 
>> I am writing a IModel implementation which formats Dates in a 
>> particular way.
>> 
>> I would like the text to be in localized properties files, however I can't 
>> seem to leverage anything in Wicket for this.  Localizer expects a component 
>> to be passed to its getString methods, which I do not have a reference to.
>> 
>> Anyone have ideas or done similar?
>> 
>> 
>> Thanks
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

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



Re: flot examples

2010-10-30 Thread Misha

Hi,

You could find an example   here
http://www.jarvana.com/jarvana/browse/org/wicketstuff/flot-examples/1.4.12/.

I did not find how to put more than one chart on a page. If you have such
task and you succeed,please  write down about your solution. Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/flot-examples-tp3013635p3020156.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: get localized string from Model class?

2010-10-30 Thread James Carman
On Sat, Oct 30, 2010 at 2:47 AM, 7zark7 <7za...@gmail.com> wrote:
> I am writing a IModel implementation which formats Dates in a
> particular way.
>
> I would like the text to be in localized properties files, however I can't
> seem to leverage anything in Wicket for this.  Localizer expects a component
> to be passed to its getString methods, which I do not have a reference to.
>
> Anyone have ideas or done similar?
>

Why not have your model implementation that takes an IModel
that returns the format string?

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



replace datatable row with a panel

2010-10-30 Thread fachhoch

I have a ajaxdefaultdatatable with sorting and pagination.
 last column from each row in the table has has an ajaxlink, on click this
link I want to replace the whole row with some panel can I do this ?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/replace-datatable-row-with-a-panel-tp3020127p3020127.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: get localized string from Model class?

2010-10-30 Thread Bas Gooren

The component parameter can be null.

e.g. if you look at getObject() in the ResourceModel class:

return 
Application.get().getResourceSettings().getLocalizer().getString(resourceKey,(Component)null, 
defaultValue);


It calls Localizer#getString with the resource key and optionally a 
component.


Sebastian

- Original Message - 
From: "7zark7" <7za...@gmail.com>

To: "Wicket" 
Sent: Saturday, October 30, 2010 8:47 AM
Subject: get localized string from Model class?



Hi,

I am writing a IModel implementation which formats Dates in a 
particular way.


I would like the text to be in localized properties files, however I can't 
seem to leverage anything in Wicket for this.  Localizer expects a 
component to be passed to its getString methods, which I do not have a 
reference to.


Anyone have ideas or done similar?


Thanks

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





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