How do you get a LoadableDetachableModel to load again

2008-08-26 Thread Warren Bell
I have a page that displays a list of items backed by a 
LoadableDetachableModel. The page allows you to delete one item from the 
list and then shows the list less the item you just deleted. How do I 
get the LoadableDetachableModel to load the list of items again after 
the one item has been deleted? I want the page to go back to itself 
after the item is deleted. I do not want to create a new page.


--
Thanks,

Warren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to handle null pointer exception while submit button

2014-10-05 Thread Warren Bell
OK, a little confused, AWT, Applet ? Is Wicket up to something I haven’t heard 
about ?

Warren

On Oct 5, 2014, at 7:57 PM, Taught by S&M  wrote:

> This code will help to handle exceptions when there is a single TextField:
> 
> import java.awt.*;
> import java.awt.event.*;
> import java.applet.*;
> 
> /*
> 
> 
> */
> 
> class FieldZeroException extends Exception
> {
>   FieldZeroException()
>   {
>   }
>   
>   public String toString()
>   {
>   return "Text field is empty.";
>   }
> }
> 
> public class throwsDemo extends Applet implements ActionListener
> {
> Button b1;
> TextField tf1,tf2;
> Label l1,l2;
> 
>   public void init()
>   {
>   setLayout(new FlowLayout(FlowLayout.LEFT));
>   l1=new Label("NULL");
>   l1.setForeground(Color.RED);
>   l2=new Label();
>   l2.setForeground(Color.GREEN);
>   tf1=new TextField(10);
>   b1=new Button("Check");
>   add(tf1);
>   add(b1);
>   add(l1);
>   add(l2);
>   b1.addActionListener(this);
>   }
>   
>   public void actionPerformed(ActionEvent ae)
>   {
>   if(ae.getSource()==b1)
>   {
>   String str1=tf1.getText();
>   int i=str1.length();
>   try
>   {
>   if(i==0)
>   {
>   throw new FieldZeroException();
>   }
>   else
>   {
>   l1.setText("Success");
>   }
>   }
>   catch(FieldZeroException fze)
>   {
>   l1.setText(fze.toString());
>   }
>   }
>   }
> }
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/how-to-handle-null-pointer-exception-while-submit-button-tp4666392p4667826.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
> 
> 
> -- 
> This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.


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



Re: Integrating Wicket with an Angular app

2014-10-30 Thread Warren Bell
I have an Angular app with a Wicket back end. I am using Wicket rest 
annotations located at https://github.com/bitstorm/Wicket-rest-annotations . 
Seems to be working pretty good.

Warren

On Oct 30, 2014, at 2:04 PM, BenjaminV 
mailto:bvellac...@yahoo.com>> wrote:

Hi guys

Is this thread still alive? I have reasons to consider using wicket and
angular together and I was wondering how you got on?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Integrating-Wicket-with-an-Angular-app-tp4656794p4668180.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




What is the proper way to start a secondary process in Wicket 6

2014-11-19 Thread Warren Bell
I am using Wicket 6 REST annotations and want to asynchronously start a process 
that writes some logging data to a db. I don’t need the response to wait for 
this process. I have tried using threads, but I get the “App not attached to 
this thread” exception when I try to use an injected service. This logging 
process is a little more complicated than what log4j or loopback can do. The 
bottom line is that I do not want the request/response process to have to wait 
for the logging process to complete. What is the proper way of doing this in 
Wicket 6 using an injected service.

1) Get request
2) Log some data (Do not wait for this to complete)
3) Process request
4) Return response

Thanks,

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



Re: What is the proper way to start a secondary process in Wicket 6

2014-11-20 Thread Warren Bell
Ernesto, great job putting all that code together so quickly. I cloned your 
project and cherry picked out the code that I needed, I don’t need all the 
process progress code you have. I don’t really care what the process progress 
is or even if it completes ok, just don’t want it holding up my response.

I ended up using your ExecutionBridge, TasksRunnable, and ITask classes and 
interfaces. But I still don’t know where and how to inject my service into this 
new task/thread or ExecutionBridge without getting this exception:

Exception in thread "pool-1-thread-1" org.apache.wicket.WicketRuntimeException: 
There is no application attached to current thread pool-1-thread-1

Do I need to get the application attached to my new threads somehow so I can 
use my injected service, and if so, how do I do that ?

Warren

On Nov 20, 2014, at 5:47 AM, Ernesto Reinaldo Barreiro 
mailto:reier...@gmail.com>> wrote:

Martin,

I have created

https://github.com/reiern70/antilia-bits/tree/master/bgprocess

My only caveats are

https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L50

and

https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L70

I had to re-add Timer behavior: I do not see yet why? It is as if the timer
is not re-rendered: they are not isTemporar :-( I will check when I have
more time.

I would appreciate if you can review the code... before I write anything on
my fork  of Wicket in Action. This probably could be done in a leaner way
mounting a resource to serve JSON for task states and building the UI at
client side... But example illustrates how to do it with "plain Wicket".


On Thu, Nov 20, 2014 at 8:40 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com<mailto:reier...@gmail.com>> wrote:

Ok. Let me see what I can do this weekend while I wait for my son to
finish he's shower after he's football match  ;-)

On Thu, Nov 20, 2014 at 8:30 AM, Martin Grigorov 
mailto:mgrigo...@apache.org>>
wrote:

Sure! Thanks!
It could be as fancy as you wish.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Nov 20, 2014 at 10:17 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Can I give it a try? Something event showing some progress at client
side?

On Thu, Nov 20, 2014 at 7:54 AM, Martin Grigorov 
wrote:

Hi,

Someday I'll write a blog (with a demo) about this at
http://wicketinaction.com.
The question is being asked regularly.

Actually anyone can send a Pull Request at
https://github.com/dashorst/wicketinaction.com with such article.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Nov 20, 2014 at 7:26 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Hi Warren,


On Thu, Nov 20, 2014 at 12:46 AM, Warren Bell <
warrenbe...@gmail.com>
wrote:

I am using Wicket 6 REST annotations and want to asynchronously
start a
process that writes some logging data to a db. I don’t need the
response
to
wait for this process. I have tried using threads, but I get the
“App
not
attached to this thread” exception when I try to use an injected
service.
This logging process is a little more complicated than what log4j
or
loopback can do. The bottom line is that I do not want the
request/response
process to have to wait for the logging process to complete. What
is
the
proper way of doing this in Wicket 6 using an injected service.

Sometimes  what I do is I create a context class ServiceHolder,
inject
what I need on this class (e.g. services) and pass this to the non
web
thread (e.g as an argument to the runnable). Injector.inject will
have
WicketApp in context.


1) Get request
2) Log some data (Do not wait for this to complete)
3) Process request
4) Return response


You could use the same ServiceHolder as a bridge to pass info to the
WEB
layer. 1) keep a reference to it 2) in another (polling) request
use it
to
see how back-ground job is progressing. Sometimes I also use it to
control
the Job: e.g. stop/pause it, cancel it. Once Job finishes just let
service
holder "go".


Thanks,

Warren Bell

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




--
Regards - Ernesto Reinaldo Barreiro





--
Regards - Ernesto Reinaldo Barreiro





--
Regards - Ernesto Reinaldo Barreiro




--
Regards - Ernesto Reinaldo Barreiro

--
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.



Re: What is the proper way to start a secondary process in Wicket 6

2014-11-20 Thread Warren Bell
I have seen this from a 2010 post:

final Application app = Application.get();
  final ExecutorService service = new ScheduledThreadPoolExecutor(1) {
@Override
protected void beforeExecute(final Thread t, final Runnable r) {
  Application.set(app);
};
@Override
protected void afterExecute(final Runnable r, final Throwable t) {
  Application.unset();
}
  };

But there is no more Application#set(app) and Application#unset() in Wicket 6. 
Does Wicket 6 have some built in way of creating secondary processes, maybe an 
internal thread pool that can be set-up ?

Warren Bell

On Nov 20, 2014, at 10:03 AM, Warren Bell 
mailto:warr...@clarksnutrition.com>> wrote:

Ernesto, great job putting all that code together so quickly. I cloned your 
project and cherry picked out the code that I needed, I don’t need all the 
process progress code you have. I don’t really care what the process progress 
is or even if it completes ok, just don’t want it holding up my response.

I ended up using your ExecutionBridge, TasksRunnable, and ITask classes and 
interfaces. But I still don’t know where and how to inject my service into this 
new task/thread or ExecutionBridge without getting this exception:

Exception in thread "pool-1-thread-1" org.apache.wicket.WicketRuntimeException: 
There is no application attached to current thread pool-1-thread-1

Do I need to get the application attached to my new threads somehow so I can 
use my injected service, and if so, how do I do that ?

Warren

On Nov 20, 2014, at 5:47 AM, Ernesto Reinaldo Barreiro 
mailto:reier...@gmail.com><mailto:reier...@gmail.com>> 
wrote:

Martin,

I have created

https://github.com/reiern70/antilia-bits/tree/master/bgprocess

My only caveats are

https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L50

and

https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L70

I had to re-add Timer behavior: I do not see yet why? It is as if the timer
is not re-rendered: they are not isTemporar :-( I will check when I have
more time.

I would appreciate if you can review the code... before I write anything on
my fork  of Wicket in Action. This probably could be done in a leaner way
mounting a resource to serve JSON for task states and building the UI at
client side... But example illustrates how to do it with "plain Wicket".


On Thu, Nov 20, 2014 at 8:40 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com<mailto:reier...@gmail.com><mailto:reier...@gmail.com>> wrote:

Ok. Let me see what I can do this weekend while I wait for my son to
finish he's shower after he's football match  ;-)

On Thu, Nov 20, 2014 at 8:30 AM, Martin Grigorov 
mailto:mgrigo...@apache.org><mailto:mgrigo...@apache.org>>
wrote:

Sure! Thanks!
It could be as fancy as you wish.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Nov 20, 2014 at 10:17 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Can I give it a try? Something event showing some progress at client
side?

On Thu, Nov 20, 2014 at 7:54 AM, Martin Grigorov 
wrote:

Hi,

Someday I'll write a blog (with a demo) about this at
http://wicketinaction.com.
The question is being asked regularly.

Actually anyone can send a Pull Request at
https://github.com/dashorst/wicketinaction.com with such article.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Nov 20, 2014 at 7:26 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

Hi Warren,


On Thu, Nov 20, 2014 at 12:46 AM, Warren Bell <
warrenbe...@gmail.com>
wrote:

I am using Wicket 6 REST annotations and want to asynchronously
start a
process that writes some logging data to a db. I don’t need the
response
to
wait for this process. I have tried using threads, but I get the
“App
not
attached to this thread” exception when I try to use an injected
service.
This logging process is a little more complicated than what log4j
or
loopback can do. The bottom line is that I do not want the
request/response
process to have to wait for the logging process to complete. What
is
the
proper way of doing this in Wicket 6 using an injected service.

Sometimes  what I do is I create a context class ServiceHolder,
inject
what I need on this class (e.g. services) and pass this to the non
web
thread (e.g as an argument to the runnable). Injector.inject will
have
WicketApp in context.


1) Get request
2) Log some data (Do not wait for this to complete)
3) Process request
4) Return response


You could use the same ServiceHolder as a bridge to pass info to the
WEB
layer. 1) keep a reference to it 2) in another (polling) request
use it
to
see how back-ground job is progressing. Sometimes I also us

Re: What is the proper way to start a secondary process in Wicket 6

2014-11-20 Thread Warren Bell
After doing a little digging, I found the ThreadContext class.

ExecutorService executorService = new ScheduledThreadPoolExecutor(20)
{
@Override
protected void beforeExecute(Thread t, Runnable r) {
ThreadContext.setApplication(app);
}

@Override
protected void afterExecute(Runnable r, Throwable t) {
ThreadContext.detach();
}
};

That got rid of the initial "no application attached to current thread …” 
exception. 

Is this the correct way of creating a new process when you need to use an 
injected service in it ?

Warren Bell

On Nov 20, 2014, at 11:33 AM, Warren Bell  wrote:

> I have seen this from a 2010 post:
> 
> final Application app = Application.get();
>  final ExecutorService service = new ScheduledThreadPoolExecutor(1) {
>@Override
>protected void beforeExecute(final Thread t, final Runnable r) {
>  Application.set(app);
>};
>@Override
>protected void afterExecute(final Runnable r, final Throwable t) {
>  Application.unset();
>}
>  };
> 
> But there is no more Application#set(app) and Application#unset() in Wicket 
> 6. Does Wicket 6 have some built in way of creating secondary processes, 
> maybe an internal thread pool that can be set-up ?
> 
> Warren Bell
> 
> On Nov 20, 2014, at 10:03 AM, Warren Bell 
> mailto:warr...@clarksnutrition.com>> wrote:
> 
> Ernesto, great job putting all that code together so quickly. I cloned your 
> project and cherry picked out the code that I needed, I don’t need all the 
> process progress code you have. I don’t really care what the process progress 
> is or even if it completes ok, just don’t want it holding up my response.
> 
> I ended up using your ExecutionBridge, TasksRunnable, and ITask classes and 
> interfaces. But I still don’t know where and how to inject my service into 
> this new task/thread or ExecutionBridge without getting this exception:
> 
> Exception in thread "pool-1-thread-1" 
> org.apache.wicket.WicketRuntimeException: There is no application attached to 
> current thread pool-1-thread-1
> 
> Do I need to get the application attached to my new threads somehow so I can 
> use my injected service, and if so, how do I do that ?
> 
> Warren
> 
> On Nov 20, 2014, at 5:47 AM, Ernesto Reinaldo Barreiro 
> mailto:reier...@gmail.com><mailto:reier...@gmail.com>> 
> wrote:
> 
> Martin,
> 
> I have created
> 
> https://github.com/reiern70/antilia-bits/tree/master/bgprocess
> 
> My only caveats are
> 
> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L50
> 
> and
> 
> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L70
> 
> I had to re-add Timer behavior: I do not see yet why? It is as if the timer
> is not re-rendered: they are not isTemporar :-( I will check when I have
> more time.
> 
> I would appreciate if you can review the code... before I write anything on
> my fork  of Wicket in Action. This probably could be done in a leaner way
> mounting a resource to serve JSON for task states and building the UI at
> client side... But example illustrates how to do it with "plain Wicket".
> 
> 
> On Thu, Nov 20, 2014 at 8:40 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com<mailto:reier...@gmail.com><mailto:reier...@gmail.com>> 
> wrote:
> 
> Ok. Let me see what I can do this weekend while I wait for my son to
> finish he's shower after he's football match  ;-)
> 
> On Thu, Nov 20, 2014 at 8:30 AM, Martin Grigorov 
> mailto:mgrigo...@apache.org><mailto:mgrigo...@apache.org>>
> wrote:
> 
> Sure! Thanks!
> It could be as fancy as you wish.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Nov 20, 2014 at 10:17 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
> 
> Can I give it a try? Something event showing some progress at client
> side?
> 
> On Thu, Nov 20, 2014 at 7:54 AM, Martin Grigorov 
> wrote:
> 
> Hi,
> 
> Someday I'll write a blog (with a demo) about this at
> http://wicketinaction.com.
> The question is being asked regularly.
> 
> Actually anyone can send a Pull Request at
> https://github.com/dashorst/wicketinaction.com with such article.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Nov 20, 2014 at 7:26 AM, Ernesto Reinaldo Barreiro <
> r

Is there a hook where I can run code after response and connection is closed

2014-11-20 Thread Warren Bell
Just a follow up on a previous post where I was trying to log some data to a db 
and not have the response wait.

Is there a hook somewhere that is called after the response has left to the 
client and the connection is closed.

onAfterConnectionClosed(…)?

This would need to be accessible somehow in my “REST Annotations” 
implementation of IResource.

Thanks,

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



Re: What is the proper way to start a secondary process in Wicket 6

2014-11-21 Thread Warren Bell
Ernesto,

I am not sure that creating a service holder will do the trick without still 
attaching the app to the new thread. I am currently injecting a service into 
your ExecutionBridge class that is instantiated in the request thread. All is 
good until that ExecutionBridge gets passed to the new thread. Injecting the 
service in a Service holder is the same thing, isn’t it ?

I haven’t tried attaching the app to the new thread and injecting the service 
straight into the new task/thread itself. I think that would be cleaner. I will 
try that out.

Warren Bell

On Nov 21, 2014, at 8:19 AM, Ernesto Reinaldo Barreiro  
wrote:

> @Warren,
> 
> Apologies for the extra t on your name: texting on a mobile phone is a
> pain... I will update de demo to include a service. Just one question: the
> app not in context is when you try to inject that service? Or because you
> are using something else from WEB layer?
> 
> On Fri, Nov 21, 2014 at 11:05 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
> 
>> Thanks for your answer!  There is no hurry.
>> 
>> I will add a service to the mix to cover Warrent use case. Eg using Guice
>> integration.
>> 
>> On 21 Nov 2014 09:34, "Martin Grigorov"  wrote:
>>> 
>>> Hi Ernesto,
>>> 
>>> I'm traveling now. I'll be able to take a look at Sunday.
>>> On Nov 20, 2014 3:48 PM, "Ernesto Reinaldo Barreiro" >> 
>>> wrote:
>>> 
>>>> Martin,
>>>> 
>>>> I have created
>>>> 
>>>> https://github.com/reiern70/antilia-bits/tree/master/bgprocess
>>>> 
>>>> My only caveats are
>>>> 
>>>> 
>>>> 
>> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L50
>>>> 
>>>> and
>>>> 
>>>> 
>>>> 
>> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L70
>>>> 
>>>> I had to re-add Timer behavior: I do not see yet why? It is as if the
>> timer
>>>> is not re-rendered: they are not isTemporar :-( I will check when I
>> have
>>>> more time.
>>>> 
>>>> I would appreciate if you can review the code... before I write
>> anything on
>>>> my fork  of Wicket in Action. This probably could be done in a leaner
>> way
>>>> mounting a resource to serve JSON for task states and building the UI
>> at
>>>> client side... But example illustrates how to do it with "plain
>> Wicket".
>>>> 
>>>> 
>>>> On Thu, Nov 20, 2014 at 8:40 AM, Ernesto Reinaldo Barreiro <
>>>> reier...@gmail.com> wrote:
>>>> 
>>>>> Ok. Let me see what I can do this weekend while I wait for my son to
>>>>> finish he's shower after he's football match  ;-)
>>>>> 
>>>>> On Thu, Nov 20, 2014 at 8:30 AM, Martin Grigorov <
>> mgrigo...@apache.org>
>>>>> wrote:
>>>>> 
>>>>>> Sure! Thanks!
>>>>>> It could be as fancy as you wish.
>>>>>> 
>>>>>> Martin Grigorov
>>>>>> Wicket Training and Consulting
>>>>>> https://twitter.com/mtgrigorov
>>>>>> 
>>>>>> On Thu, Nov 20, 2014 at 10:17 AM, Ernesto Reinaldo Barreiro <
>>>>>> reier...@gmail.com> wrote:
>>>>>> 
>>>>>>> Can I give it a try? Something event showing some progress at
>> client
>>>>>> side?
>>>>>>> 
>>>>>>> On Thu, Nov 20, 2014 at 7:54 AM, Martin Grigorov <
>>>> mgrigo...@apache.org>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> Someday I'll write a blog (with a demo) about this at
>>>>>>>> http://wicketinaction.com.
>>>>>>>> The question is being asked regularly.
>>>>>>>> 
>>>>>>>> Actually anyone can send a Pull Request at
>>>>>>>> https://github.com/dashorst/wicketinaction.com with such
>> article.
>>>>>>>> 
>>>>>>>> Martin Grigorov
>>>>>>>> Wicket Training and Consulting
>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>>> 
>>&

Re: What is the proper way to start a secondary process in Wicket 6

2014-11-22 Thread Warren Bell
Ernesto,

That’s kind of what I ended up doing except with a different ThreadPoolExecutor 
implementation.

ExecutorService executorService = new ScheduledThreadPoolExecutor(20)
{
@Override
protected void beforeExecute(Thread t, Runnable r) {
ThreadContext.setApplication(MyApplication.this);
}

@Override
protected void afterExecute(Runnable r, Throwable t) {
ThreadContext.detach();
}
};

No particular reason why I picked ScheduledThreadPoolExecutor other than it 
looked a little easier to use. I need to look more into the different types of 
Thread pools and such.

I used:

ThreadContext.detach();

instead of:

ThreadContext.setApplication(null);

Warren Bell


On Nov 22, 2014, at 11:18 AM, Ernesto Reinaldo Barreiro  
wrote:

> pushed a new version including injecting a Guice managed service class
> 
> On Sat, Nov 22, 2014 at 8:08 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
> 
>> Warren,
>> 
>> Something like:
>> 
>> ExecutorService executorService =  new ThreadPoolExecutor(10, 10,
>>0L, TimeUnit.MILLISECONDS,
>>new LinkedBlockingQueue()) {
>>   @Override
>>   protected void beforeExecute(final Thread t, final Runnable r) {
>>   ThreadContext.setApplication(BgProcessApplication.this);
>>   };
>>   @Override
>>   protected void afterExecute(final Runnable r, final Throwable
>> t) {
>>   ThreadContext.setApplication(null);
>>   }
>> };
>> 
>> seems to work.
>> 
>> On Thu, Nov 20, 2014 at 8:33 PM, Warren Bell 
>> wrote:
>> 
>>> I have seen this from a 2010 post:
>>> 
>>> final Application app = Application.get();
>>>  final ExecutorService service = new
>>> ScheduledThreadPoolExecutor(1) {
>>>@Override
>>>protected void beforeExecute(final Thread t, final Runnable
>>> r) {
>>>  Application.set(app);
>>>};
>>>@Override
>>>protected void afterExecute(final Runnable r, final Throwable
>>> t) {
>>>  Application.unset();
>>>}
>>>  };
>>> 
>>> But there is no more Application#set(app) and Application#unset() in
>>> Wicket 6. Does Wicket 6 have some built in way of creating secondary
>>> processes, maybe an internal thread pool that can be set-up ?
>>> 
>>> Warren Bell
>>> 
>>> On Nov 20, 2014, at 10:03 AM, Warren Bell >> <mailto:warr...@clarksnutrition.com>> wrote:
>>> 
>>> Ernesto, great job putting all that code together so quickly. I cloned
>>> your project and cherry picked out the code that I needed, I don’t need all
>>> the process progress code you have. I don’t really care what the process
>>> progress is or even if it completes ok, just don’t want it holding up my
>>> response.
>>> 
>>> I ended up using your ExecutionBridge, TasksRunnable, and ITask classes
>>> and interfaces. But I still don’t know where and how to inject my service
>>> into this new task/thread or ExecutionBridge without getting this exception:
>>> 
>>> Exception in thread "pool-1-thread-1"
>>> org.apache.wicket.WicketRuntimeException: There is no application attached
>>> to current thread pool-1-thread-1
>>> 
>>> Do I need to get the application attached to my new threads somehow so I
>>> can use my injected service, and if so, how do I do that ?
>>> 
>>> Warren
>>> 
>>> On Nov 20, 2014, at 5:47 AM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com<mailto:reier...@gmail.com><mailto:reier...@gmail.com>>
>>> wrote:
>>> 
>>> Martin,
>>> 
>>> I have created
>>> 
>>> https://github.com/reiern70/antilia-bits/tree/master/bgprocess
>>> 
>>> My only caveats are
>>> 
>>> 
>>> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L50
>>> 
>>> and
>>> 
>>> 
>>> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TasksListPanel.java#L70
>>> 
>>> I had to re-add Timer behavior: I do not see yet why? It is as if the
>>> timer
>>> is not re-rendered: they are not isTemporar :-( I will check when I have
>>> more time.
>>>

Re: Wicketstuff Restannotations AbortWithHttpErrorCodeException always results in 500 Internal Server Error

2015-01-28 Thread Warren Bell
Hans,

I handle all exceptions and set status codes in my mapped method with 
AbstractRestResource#setResponseStatusCode(…). I don’t ever throw any 
exceptions from there. Setting a status code is the only thing that is really 
happening in AbstractRestResource#invokeMappedMethod(…) when an exception is 
caught anyway. Just spare the throwing of an exception and set the status code 
in your mapped method.

throw new AbortWithHttpErrorCodeException(“500”, “Ouch”);

versus

setResponseStatusCode(“500”); 

Also, I believe AbortWithHttpErrorCodeException is part of Wicket core, not 
something meant to be used in rest-annotations.

Hope this helps,

Warren Bell

> On Jan 28, 2015, at 7:58 AM, Hans Lesmeister 
>  wrote:
> 
> Hi,
> 
> We use the great rest-annotation from wicketstuff.
> One thing that bothers is if the AbortWithHttpErrorCodeException with a
> specific code (404, 402, etc) is thrown by the mapped method, those error
> codes do not make it to the calling client. The client always seems to get a
> 500.
> 
> I debugged through the request/response and found this in
> AbstractRestResource:
> http://pastebin.com/NKNmNHv6
> 
> Is there any way of getting the correct error codes to the client? If not,
> how are other people handling this?
> I would be glad to invest some time and apply a patch if necessary
> 
> -- Thanks and Cheers, Hans
> 
> 
> 
> 
> -
> 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: Clicking a button should fire a 'CSS event'

2015-02-03 Thread Warren Bell
Chris,

Seems like a lot of work just to get a div to blink. Write a behavior with some 
javascript for the blinking and do that on the client only separate from your 
form submission or whatever else your button is doing.

Warren

> On Feb 3, 2015, at 1:30 PM, Chris  wrote:
> 
> Hi guys,
> 
> I would like to control a DIV element when clicking on a button, so that it 
> sort of reacts to this event by „blinking“ for a short time.
> Currently, when clicking the button, a CSS attribute is added to the DIV’s 
> class and the page is reloaded so that this event is triggered.
> However, the event should fire only once so I would therefore need to delete 
> the attribute after that.
> 
> Is there a more elegant solution so that the „CSS event“ is fired once when 
> clicking the button?
> 
> Thanks,
> Chris
> 
> 
> 
> -
> 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: How can I injecting a Springbean into a custom session.

2009-03-06 Thread Warren Bell
Do you still have to use addComponentInstantiationListener(new 
SpringComponentInjector(this)) in your WebApplication#init() in order to 
use @SpringBean in sub classes of Component or is that done 
automatically now?


Warren


Igor Vaynberg wrote:


all subclasses of Component are injected automatically, you only need to do
this in classes outside the Component hierarchy.

-igor

On Fri, Mar 6, 2009 at 9:32 AM, CrocodileShoes   

wrote:



  

By the way is this safe to use in any Wicket component, for example, a
Panel?

I can't think of any reason why not, but this is my first foray into web
development.
--
View this message in context:
http://www.nabble.com/How-can-I-inject-a-Springbean-into-a-custom-session.-tp22340379p22377028.html
Sent from the Wicket - User 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





  



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



Passing a PageParameters to a RedirectRequestTarget

2009-03-07 Thread Warren Bell
Is there a way of passing a PageParameters to a RedirectRequestTarget 
without pulling apart PageParameters and adding them to the url?


Thanks,

Warren

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



Wicket-Security security check on component on a panel

2009-03-11 Thread Warren Bell
I am trying to do a security check on a component that is on a panel 
like this:


if(SecureComponentHelper.isAuthenticated(myComponent) && 
SecureComponentHelper.isActionAuthorized(myComponent, "enable"))

{
 // Do Something
}

I have also tried this:

if(myComponent.isAuthenticated() && 
!myComponent.isActionAuthorized("enable"))

{
 // Do Something
}

Basically the same thing. myComponent implements ISecureComponent. 
setSecurityCheck(new ComponentSecurityCheck(this)) is called in the 
constructors of myComponent.


This works fine if myComponent is on a page, but does not work if 
myComponent is on a panel. I get the following exception:


Caused by: org.apache.wicket.security.strategies.SecurityException: 
Unable to create alias for component: [MarkupContainer [Component id = 
myComponent]]
   at 
org.apache.wicket.security.components.SecureComponentHelper.alias(SecureComponentHelper.java:263)
   at 
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission.(ComponentPermission.java:54)
   at 
org.apache.wicket.security.swarm.strategies.SwarmStrategy.isComponentAuthorized(SwarmStrategy.java:228)
   at 
org.apache.wicket.security.checks.ComponentSecurityCheck.isActionAuthorized(ComponentSecurityCheck.java:127)
   at 
org.apache.wicket.security.components.SecureComponentHelper.isActionAuthorized(SecureComponentHelper.java:177)
   at 
com.scanman.panels.menus.MainMenuHandHeldPanel.(MainMenuHandHeldPanel.java:123)

   at com.scanman.pages.menus.MainMenu$2.(MainMenu.java:157)
   at com.scanman.pages.menus.MainMenu.(MainMenu.java:157)
   ... 28 more
Caused by: java.lang.IllegalStateException: No Page found for component 
[MarkupContainer [Component id = resetButtonContainer]]

   at org.apache.wicket.Component.getPage(Component.java:1729)
   at 
org.apache.wicket.security.components.SecureComponentHelper.alias(SecureComponentHelper.java:259)

   ... 35 more

How do you do a security check on a component that is on a panel?

Thanks,

Warren

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



Re: Wicket-Security security check on component on a panel

2009-03-12 Thread Warren Bell
Doing the security check in onBeforeRender() in the Panel fixed it. I 
did not have a Page yet.


Warren

   I am trying to do a security check on a component that is on a panel
   like this:

   if(SecureComponentHelper.isAuthenticated(myComponent) &&
   SecureComponentHelper.isActionAuthorized(myComponent, "enable")) {
   // Do Something }

   I have also tried this:

   if(myComponent.isAuthenticated() &&
   !myComponent.isActionAuthorized("enable")) { // Do Something }

   Basically the same thing. myComponent implements ISecureComponent.
   setSecurityCheck(new ComponentSecurityCheck(this)) is called in the
   constructors of myComponent.

   This works fine if myComponent is on a page, but does not work if
   myComponent is on a panel. I get the following exception:

   Caused by: org.apache.wicket.security.strategies.SecurityException:
   Unable to create alias for component: [MarkupContainer [Component id
   = myComponent]] at
   
org.apache.wicket.security.components.SecureComponentHelper.alias(SecureComponentHelper.java:263)
   at
   
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission.(ComponentPermission.java:54)
   at
   
org.apache.wicket.security.swarm.strategies.SwarmStrategy.isComponentAuthorized(SwarmStrategy.java:228)
   at
   
org.apache.wicket.security.checks.ComponentSecurityCheck.isActionAuthorized(ComponentSecurityCheck.java:127)
   at
   
org.apache.wicket.security.components.SecureComponentHelper.isActionAuthorized(SecureComponentHelper.java:177)
   at
   
com.scanman.panels.menus.MainMenuHandHeldPanel.(MainMenuHandHeldPanel.java:123)
   at com.scanman.pages.menus.MainMenu$2.(MainMenu.java:157) at
   com.scanman.pages.menus.MainMenu.(MainMenu.java:157) ... 28
   more Caused by: java.lang.IllegalStateException: No Page found for
   component [MarkupContainer [Component id = resetButtonContainer]] at
   org.apache.wicket.Component.getPage(Component.java:1729) at
   
org.apache.wicket.security.components.SecureComponentHelper.alias(SecureComponentHelper.java:259)
   ... 35 more

   How do you do a security check on a component that is on a panel?

   Thanks,

   Warren



Correct use of RangeValidator

2009-03-16 Thread Warren Bell

I am getting a ClassCastException when using RangeValidator like this:

RequiredTextField intField = new 
RequiredTextField("intField");

intField.add(new RangeValidator(0, 100));

or like this:

RequiredTextField intField = new 
RequiredTextField("intField");

intField.add(new RangeValidator(0, 100));


WicketMessage: Exception 'java.lang.ClassCastException: 
java.lang.Integer' occurred during validation 
org.apache.wicket.validation.validator.RangeValidator on component 
2:body:recvAnalisysForm:intField Root 
cause:java.lang.ClassCastException: java.lang.Integer at 
java.lang.String.compareTo(String.java:90)


The example app shows it coded this way, but NumberValidator has been 
deprecated.


add(new 
RequiredTextField("integerInRangeProperty").add(NumberValidator.range(0, 
100)));


What is the correct way of using RangeValidator and how do you type it?

Warren

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



Re: Correct use of RangeValidator

2009-03-17 Thread Warren Bell
I thought that I was telling the TextField, by the type , that 
it's model object is an integer. And I thought that it would retrieve 
its value from the model I set on it's form.


super(name, new CompoundPropertyModel(valueMap)

valueMap is an existing ValueMap with a value with key "intField" and 
that ValueMap#getAsInteger("intField") would be called. I guess 
ValueMap#getString("intField") is being called. Is it the ValueMap that 
is messing me up? What am I missing?


Igor Vaynberg wrote:

to construct a textfield that works with integer you either have to
pass Integer.class as a constructor arg, or call
setType(Integer.class);

-igor

On Tue, Mar 17, 2009 at 8:21 AM, Wilhelmsen Tor Iver  wrote:
  

WicketMessage: Exception 'java.lang.ClassCastException:
java.lang.Integer' occurred during validation
org.apache.wicket.validation.validator.RangeValidator on component
2:body:recvAnalisysForm:intField Root
cause:java.lang.ClassCastException: java.lang.Integer at
java.lang.String.compareTo(String.java:90)
  

According to the error message, the validator gets a String value here;
have you checked the actual IModel used by the field? The default Model
for *TextField uses String IIRC...

IModel model = new PropertyModel(theBean, "intField");
RequiredTextField intField = new
RequiredTextField("intField", model);
intField.add(new RangeValidator(0, 100));

-
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

  



--
Thanks,

Warren Bell
909-645-8864
warrenbe...@gmail.com


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



Closeing 1st Modal Window from 2nd Modal Window

2009-04-02 Thread Warren Bell
I have a situation that is like the Wicket example that opens two modal 
windows one from another. Everything is working correctly, but I need to 
close the 1st window when the 2nd window is closed. How would you do this?


Thanks,

Warren

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



Button markup id is missing on Modal Window

2009-04-06 Thread Warren Bell
I have a Modal Window that acts like a progress indicator. It has an 
AbstractAjaxTimerBehavior that checks to see if a condition is met. When 
it is met an image on the Modal Window is removed and a form with an 
AjaxButton is added. The image starts with isVisible() = true and the 
form and button start with it set false. The image comes off fine, but 
the form and button never get added. The Ajax debugger error is:


ERROR: Component with id [[processingForm]] a was not found while trying 
to perform markup update. Make sure you called 
component.setOutputMarkupId(true) on the component whose markup you are 
trying to update.
ERROR: Component with id [[okButton]] a was not found while trying to 
perform markup update. Make sure you called 
component.setOutputMarkupId(true) on the component whose markup you are 
trying to update.


I am calling Component#setOutputMarkupId(true), 
Component#setMarkupId(String id) and 
Component#setOutputMarkupPlaceholderTag(true). If I start with 
everything visible and then remove all of them, it works fine. It looks 
like Component#setOutputMarkupPlaceholderTag(true) is not working.


What do I need to do to make this work?

Thanks,

Warren

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



setOutputMarkupPlaceholderTag(true) not working on modal window

2009-04-08 Thread Warren Bell
I have a button on a modal window. The button starts with isVisible set
to false. I get the following ajax error when I set it to true:
 
ERROR: Component with id [[okButton]] a was not found while trying to
perform markup update. Make sure you called
component.setOutputMarkupId(true) on the component whose markup you are
trying to update.
 
I am calling Component#setOutputMarkupId(true),
Component#setMarkupId(String id) and
Component#setOutputMarkupPlaceholderTag(true).
 
What do I need to do to make this work?
 
Thanks,
 
Warren


Redirect to a static pdf in popup/new tab

2009-04-28 Thread Warren Bell
I have a situation where a user needs to click on many links on one page 
and display many static pdfs each in a new tab or popup. The problem is 
that I need to do some processing on the original page in the 
Link#onClick before I open up the pdf in a new tab or popup.  I do not 
want the pdfs added to any existing or new pageMaps either. Something 
like this:


new AjaxLink(...)
{

public void onClick(AjaxRequestTarget target)
{
// do some processing
// add component to target
// open up new window or tab with static pdf 
}


I have tried different combinations of ExternalLink with 
setPopupSettings(popupSettings). A modal window that uses an 
AbstractAjaxTimerBehavior while processing is being done and then allows 
user to click on an ExternalLink that displays pdf in popup. And other 
combinations. Each has little quirks or added steps required by the user.


Is there a better way of getting this to work?

Thanks,

Warren

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



Re: Redirect to a static pdf in popup/new tab

2009-04-28 Thread Warren Bell
As far as I can tell, there are no Ajax related links that can use 
PopupSettings. I need to refresh a component as part of the processing.



Steve Swinsburg wrote:
Could you use PopupSettings to specify it should be a new window and 
just process whatever you need in the onClick() of the link?



cheers,
Steve



On 28 Apr 2009, at 17:11, Warren Bell wrote:

I have a situation where a user needs to click on many links on one 
page and display many static pdfs each in a new tab or popup. The 
problem is that I need to do some processing on the original page in 
the Link#onClick before I open up the pdf in a new tab or popup.  I 
do not want the pdfs added to any existing or new pageMaps either. 
Something like this:


new AjaxLink(...)
{

public void onClick(AjaxRequestTarget target)
{
// do some processing
// add component to target
// open up new window or tab with static pdf }

I have tried different combinations of ExternalLink with 
setPopupSettings(popupSettings). A modal window that uses an 
AbstractAjaxTimerBehavior while processing is being done and then 
allows user to click on an ExternalLink that displays pdf in popup. 
And other combinations. Each has little quirks or added steps 
required by the user.


Is there a better way of getting this to work?

Thanks,

Warren

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






--
Thanks,

Warren Bell
909-645-8864
warrenbe...@gmail.com


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



Re: ModalWindows...

2009-04-29 Thread Warren Bell
I am not sure this is what you are looking for. Check 
setWindowClosedCallback


   yourModalWindow.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback()

   {

   public void onClose(AjaxRequestTarget target)
   {
   // do what you need to do
   }
   });

Warren

Vidhya Kailash wrote:

3. Can somebody please tell how to communicate between the page and the modal 
window?
thanks
  



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



Re: Ajax Buttons and Form

2009-06-08 Thread Warren Bell
Add the Model to the form and override IModel#getObject() return updated 
new "Post" object. I read on this mailing list not to set Models.


An example with a LoadableDetachableModel.

   Form blogPostForm = new Form(id, new 
CompoundPropertyModel(new LoadableDetachableModel()

   {

   @Override
   protected Post load()
   {
   return postService.save(post); 
   }
  
   }));


Warren

Luther Baker wrote:

I'm saving a 'Post', like a blog post, and JPA's merge function doesn't
update the object in place but rather, returns an object reflecting the new
database fields (like "id" if it were set).

In my application, I'd like to manage insert / update by setting this new
'Post' as the model for my form. In this case, Updates have ids ... but the
following gives me grief since the Form is not typed. I can't cast to
IModel - so not sure of the right thing to do here. Thoughts?


Here is the form field:

final TextField *postId* = new TextField("id");
postId.setOutputMarkupId(true);
add(postId);


Here is my save handler:

@Override
protected void onSubmit(final AjaxRequestTarget target,
final Form form)
{
...
// works fine
post = (Post) form.getModelObject();
final Post postWithId = postService.save(post);
// works fine
final IModel newModel = new
CompoundPropertyModel(postWithId);

*// 1. I want to use this new 'Post' object but neither of these compile*
form.setModel(newModel);
form.setModelObject(postWithId);

ERROR: The method setModelObject(capture#6-of ?) in the type
Form is not applicable for the arguments (Post)



*2. This compiles fine but doesn't actually update the id field on screen:*

form.setDefaultModelObject(postWithId);
target.addComponent(*postId*);



*3. Or, instead resetting the model, I can manually set the id field on the
existing model - which is all I really want to accomplish in this case:
*
post = (Post) form.getModelObject();
final Post postWithId = postService.save(post);
post.setId(postWithId.getId());

feedbackPanel.add(new SimpleAttributeModifier("class",
"info"));
info(getString("m-successfully-saved"));

target.addComponent(feedbackPanel);
target.addComponent(postId);

This seems to work, updates the id on screen and causes subsequent JPA
'merge' invocations to update instead of insert. As you can see, being an
AJAX button, I did have to explicitly render the new id field .

So, is there a well-defined approach for this sort of thing?

1 - is there a way I can actually reset the model?
2 - when I reset the DefaultModelObject - the the id isn't rendering to
screen - which implies I don't know what the DefaultModelObject actually is.
3 - Is it appropriate to use the Form fields to help discern between updates
and inserts - or is there a more appropriate way to manage this within
Wicket that I'm missing. My next step is to HIDE the id on the screen - but
wanted to make sure that it was indeed a well-received way to even manage
this type of update.

Thanks,

-Luther




--
Thanks,

Warren Bell
909-645-8864
warrenbe...@gmail.com


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



Re: getting started with swarm/wasp - rendering links to secure pages

2009-06-10 Thread Warren Bell
Try securing the link on your HomePage and do not secure the HomePage 
itself. The link has to implement ISecureComponent.


Add the permission for the link to your "basic" principal.

org.apache.wicket.security.hive.authorization.SimplePrincipal "basic"
{

//Permission for link on HomePage

  permission
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission
"com.webperformance.portal.web.HomePage:securelinktopage2", "inherit, render", 
"enable";

  permission
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission
"com.webperformance.portal.web.Page2", "inherit, render";

  permission
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission
"com.webperformance.portal.web.Page2", "enable";
};


Warren


Luca Provenzani wrote:

i don't think it is possible to do... because HomePage isn't a secure page
and then it's not under swarm control when it's rendered.
i'm afraid that you have to do by your hand...

but i'm not an expert! ;-)

Luca

2009/6/9 Christopher L Merrill 

  

I have a question about rendering of links to secure pages when the user
has not
been authenticated.

Based on this line from the tutorial:
 "In addition we granted links to our homepage the right to be clicked
(enable)."
I expected the link to either be non-visible or non-clickable - since I did
not grant the
enable permission for this page until login.  The link is enabled (though
the user is
redirected to the login page when clicked).



I've made my way through the getting-started guide
 (
http://wicketstuff.org/confluence/display/STUFFWIKI/Getting+started+with+Swarm
)
and have a simple example working in my prototype.  I have 3 pages:
 - HomePage (non-secure)
 - LoginPage (non-secure...obviously)
 - Page2 (secure)

My authorization file looks like this:

grant principal
org.apache.wicket.security.hive.authorization.SimplePrincipal "basic"
{
   permission
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission
"com.webperformance.portal.web.Page2", "inherit, render";
   permission
org.apache.wicket.security.hive.authorization.permissions.ComponentPermission
"com.webperformance.portal.web.Page2", "enable";
};

When the user logs in, they get the "basic" principal via a
UsernamePasswordContext.

I have a link from the HomePage to Page2 (secure page).  When the HomePage
renders and the
user had not logged in, the link is enabled.  Clicking the link does not
take the user to
the page - it takes them to the login page.  I was expecting the link to be
disabled - so
you don't even get the clickable cursor for it.  Am I simply mistaken in my
understanding
of what "right to be clicked" means?  Or have I missed some crucial bit
somewhere to allow
it to function as I expected?

If user is not authorized for an action, we will either want links to be
disabled (i.e. non-
clickable) or be not rendered at all...depending on the context.  Is this
something that
should be done via wasp/swarm or should I be doing this manually during
page construction?


TIA!
Chris


--
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Website Load Testing and Stress Testing Software & Services
 -


-
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: wicketstuff mini veil

2009-06-17 Thread Warren Bell

I don't know about the mini veil, but shouldn't your label and button be set up 
something like this:

In the class add a member that is your model string and then modify it in in 
the AjaxButton#onSubmit(...)

String modelString = ""

...

final Label label = new Label("testLabel", new Model("")
{

@Override
protected String getObject()
{
return modelString;
}

});

...

AjaxButton button = new AjaxButton("testVeil")

{
@Override
protected void onSubmit(AjaxRequestTarget arg0, Form arg1)
{

modelString = "" + new Random().nextLong();
arg0.addComponent(label);

}
}

I have not used setDefaultModelObject(...) before. I read that you shouldn't 
set a model object this way. Maybe that is causing a problem?


Warren


Jing Ge (Besitec IT DEHAM) wrote:
Hello, 


After doing this change, the project can be compiled and run. But I get
another problem.

Here is my test code:

final Label label = new Label("testLabel", new
Model(""));
  add(label);
  Form form = new Form("testForm");
AjaxButton button = new AjaxButton("testVeil") {

@Override
protected void onSubmit(AjaxRequestTarget arg0, Form
arg1) {
try {
Thread.sleep(5000);
label.setDefaultModelObject("" + new
Random().nextLong());
arg0.addComponent(label);
} catch (InterruptedException ex) {
 
Logger.getLogger(HomePage.class.getName()).log(Level.SEVERE, null, ex);

}
}
};
button.add(new Veil());
form.add(button);
add(form);

After the application is deployed and running, the ajax button is
disabled. Did I do something wrong? 


Best regards!
Jing Ge

-Original Message-
From: Jing Ge (Besitec IT DEHAM) [mailto:j...@besitec.com] 
Sent: Mittwoch, 17. Juni 2009 10:18

To: users@wicket.apache.org
Subject: RE: wicketstuff mini veil

Hello,

 


Should it be:

 


   super.bind(component);

   if (this.component != null) {

  .

   }

 


regards!

Jing Ge

 


-Original Message-
From: Jing Ge (Besitec IT DEHAM) [mailto:j...@besitec.com] 
Sent: Mittwoch, 17. Juni 2009 10:15

To: users@wicket.apache.org
Subject: wicketstuff mini veil

 


Hallo,

 

 

 


I have checked out the source code and taken a look at the class Veil. I

found the following code:

 

 

 


   public void bind(Component component)

 


   {

 


  super.bind(component);

 


  if (component != null)

 


  {

 


 throw new IllegalStateException(

 


  "This behavior is

already bound to component. An instance of this behavior cannot be

reused between components. Bound component: "

 

 


+ this.component.toString());

 


  }

 


  this.component = component;

 


   }

 

 

 


From the code we can see, the component will be checked after binding.

If it is null, an exception will be thrown. 

 

 

 


Well, actually, I don't get it. Since the component can not be null

after binding, the exception will be always thrown. Show me if I am

wrong.

 

 

 


Has anyone ever used the mini veil? Could anyone give me hand? Thanks.

 

 

 


Best regards!

 


Jing Ge

 

 

 

 

 

 

 




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

  



--
Thanks,

Warren Bell
909-645-8864
warrenbe...@gmail.com


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



Re: How to Hidden/Disabled Wicket tree with implementation wicket security

2009-07-16 Thread Warren Bell

Try this:

Warren

public class SecureWebMarkupContainer extends WebMarkupContainer implements 
ISecureComponent {

   public SecureWebMarkupContainer(String id)
   {
super(id);

   setSecurityCheck(new ComponentSecurityCheck(this));
   }
  
   public SecureWebMarkupContainer(String id, IModel model)

   {
   super(id, model);
   setSecurityCheck(new ComponentSecurityCheck(this));
   }
  
   public final void setSecurityCheck(ISecurityCheck check)

   {
   SecureComponentHelper.setSecurityCheck(this, check);
   }

   public final ISecurityCheck getSecurityCheck()
   {
   return SecureComponentHelper.getSecurityCheck(this);
   }

   public boolean isActionAuthorized(String action)
   {
   return SecureComponentHelper.isActionAuthorized(this, action);
   }

   public boolean isActionAuthorized(WaspAction action)
   {
   return SecureComponentHelper.isActionAuthorized(this, action);
   }

   public boolean isAuthenticated()
   {
   return SecureComponentHelper.isAuthenticated(this);
   }
  
   public boolean isAuthenticatedAndAuthorized(String action)

   {
   return isAuthenticated() && isActionAuthorized(action);
   }

{


Rizal Indra wrote:

Hi,
I have created my welcome page with menu tree 
(http://wicketstuff.org/wicket13/nested/ ). I want to hide/disabled some item 
menu depend on user right principal.

I have try put some tricks but not work :-)
MyTree.java
public class MyTree extends Tree {
@Override
protected void populateTreeItem(WebMarkupContainer item, int level) {
System.out.println(" getting populateTreeItem...");
super.populateTreeItem(item, level);
final TreeNode node = (TreeNode)item.getModelObject();
MarkupContainer nodeLink =  newNodeLink(item, "nodeLink", node);
SecureWebMarkupContainer swmc = new 
SecureWebMarkupContainer("hiddenMenu");
swmc.add(nodeLink);
//item.add(nodeLink);
item.add(swmc);
}
}

SecureWebMarkupContainer.java
public class SecureWebMarkupContainer extends WebMarkupContainer implements 
ISecureComponent {
...
}

can anyone give some example/advice how to make it work. 
thanks 




  Pemanasan global? Apa sih itu? Temukan jawabannya di Yahoo! Answers! 
http://id.answers.yahoo.com

-
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: How to Hidden/Disabled Wicket tree with implementation wicket security

2009-07-17 Thread Warren Bell

Your hive should have something like this with whatever actions you want:

permission ${ComponentPermission} 
"${MyPage}:myPanel:myForm:myWebMarkupContainer", "inherit, render, enable";


And also secure anything in the container like buttons:

permission ${ComponentPermission} 
"${MyPage}:myPanel:myForm:myWebMarkupContainer:myButton", "inherit, 
render, enable";


I seem to remember a similar problem that I had. It involved the way I 
used a WebMarkupContainer, a form and a panel. I messed around with how 
I nested the different components and I got it to work. Go figure?


Warren

Rizal Indra wrote:

Thanks for quick reply Warren,
exactly my code SecureWebMarkupContainer.java is same as with your code.
But its still not working. 
I am newbie in java wicket, so i need more example/hint for understanding its. I am sure that missing something but i dont know how to solve it.


Can anyone help me? thanks 




--- Pada Kam, 16/7/09, Warren Bell  menulis:

  

Dari: Warren Bell 
Judul: Re: How to Hidden/Disabled Wicket tree with implementation wicket 
security
Kepada: users@wicket.apache.org, bujang_kuan...@yahoo.com
Tanggal: Kamis, 16 Juli, 2009, 11:09 AM
Try this:

Warren

public class SecureWebMarkupContainer extends
WebMarkupContainer implements ISecureComponent {

   public SecureWebMarkupContainer(String
id)
   {
super(id);

   setSecurityCheck(new
ComponentSecurityCheck(this));
   }
 public
SecureWebMarkupContainer(String id, IModel model)
   {
   super(id, model);
   setSecurityCheck(new
ComponentSecurityCheck(this));
   }
 public final void
setSecurityCheck(ISecurityCheck check)
   {
   
   SecureComponentHelper.setSecurityCheck(this,

check);
   }

   public final ISecurityCheck
getSecurityCheck()
   {
   return
SecureComponentHelper.getSecurityCheck(this);
   }

   public boolean isActionAuthorized(String
action)
   {
   return
SecureComponentHelper.isActionAuthorized(this, action);
   }

   public boolean
isActionAuthorized(WaspAction action)
   {
   return
SecureComponentHelper.isActionAuthorized(this, action);
   }

   public boolean isAuthenticated()
   {
   return
SecureComponentHelper.isAuthenticated(this);
   }
 public boolean
isAuthenticatedAndAuthorized(String action)
   {
   return isAuthenticated()
&& isActionAuthorized(action);
   }

{


Rizal Indra wrote:


Hi,
I have created my welcome page with menu tree 
(http://wicketstuff.org/wicket13/nested/ ). I want to
  

hide/disabled some item menu depend on user right
principal.


I have try put some tricks but not work :-)
MyTree.java
public class MyTree extends Tree {
@Override
 protected void
  

populateTreeItem(WebMarkupContainer item, int level) {

 
  

   System.out.println(" getting
populateTreeItem...");

 
  

   super.populateTreeItem(item, level);


 final TreeNode
  

node = (TreeNode)item.getModelObject();


 MarkupContainer
  

nodeLink =  newNodeLink(item, "nodeLink", node);

 
  

   SecureWebMarkupContainer swmc = new
SecureWebMarkupContainer("hiddenMenu");

 
  

   swmc.add(nodeLink);

 
  

   //item.add(nodeLink);


 item.add(swmc);
 }
}

SecureWebMarkupContainer.java
public class SecureWebMarkupContainer extends
  

WebMarkupContainer implements ISecureComponent {


...
}

can anyone give some example/advice how to make it
  
work. thanks 


   Pemanasan global? Apa
  

sih itu? Temukan jawabannya di Yahoo! Answers! http://id.answers.yahoo.com

  

-


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






  Berbagi foto Flickr dengan teman di dalam Messenger. Jelajahi Yahoo! 
Messenger yang serba baru sekarang! http://id.messenger.yahoo.com
  



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



AbstractAjaxTimerBehavior on Modal Window causes PageExpiredException

2009-08-04 Thread Warren Bell
I am getting a PageExpiredException when I close a modal window with an
AbstractAjaxTimerBehavior on it. It does not seem to cause a problem,
but I would rather it not happen. I use the AbstractAjaxTimerBehavior to
auto close a modal window after a certain period of time if it is not
closed manually. I think the two ajax requests are conflicting with each
other, one to close the window and the other from the timer. Is there a
way to prevent this PageExpiredException from happening or is there a
better way to auto close a modal window?
 
Thanks,
 
Warren


Model question ?

2009-08-14 Thread Warren Bell
How should I set up my model for the following situation. I have a form
with a ListChoice and a TextField. The TextField needs to access a
property of the object selected of the ListChoice. I have it all working
using a ValueMap, but that seems like overkill to use a ValueMap for one
object. Here is how I have it:
 
super(new CompoundPropertyModel(new ValueMap()));

ListChoice vendorListChoice = new ListChoice("vendor",
new LoadableDetachableModel>(){...}, new
IChoiceRenderer(){...});

TextField accountNumberField = new
TextField("vendor.accountNumber");

I thought I could do something like this:

super(new CompoundPropertyModel(new Vendor()));

The ListChoice is the same as above and the TextField like this:

TextField accountNumberField = new
TextField("accountNumber");

The problem with this is that the ListChoice is trying to set a property
on the model named vendor when I realy want the selected ListChoice
vendor object be the model object and have the TextField access the
accountNumber property of the ListChoice vendor.

How should I set up my model to deal with this type of situation or is a
ValueMap the best way?

Thanks,

Warren




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



RE: Model question ?

2009-08-14 Thread Warren Bell
In your second example the Vendor in the vendorModel becomes the
selected Vendor from the ListChoice and that Vendor name property
becomes the value of the TextField? 

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com] 
Sent: Friday, August 14, 2009 3:47 PM
To: users@wicket.apache.org
Subject: Re: Model question ?


Warren,

... and if you prefer using a CPM for your "vendorEditForm"s:

public class HomePage extends WebPage {
private List vendors = Arrays.asList(new Vendor("v1"), 
 new
Vendor("v2"));
private Vendor vendor = new Vendor("default vendor");
public HomePage(final PageParameters parameters) {
IModel vendorModel = new PropertyModel(this, "vendor");
Form form = new Form("form");
add(form);
// use your existing LDM instead of this hard-wired 
// List of vendors but 
// make sure you merge your edits properly!
form.add(new ListChoice("vendors", 
 vendorModel, vendors));
// using a PropertyModel per field
Form editForm1 = new Form("vendorEditForm1");
add(editForm1);
editForm1.add(new TextField("name", 
new PropertyModel(this, "vendor.name")));   
// using a CompoundPropertyModel   
Form editForm2 = new Form("vendorEditForm2", 
new CompoundPropertyModel(vendorModel));
add(editForm2);
editForm2.add(new TextField("name")); 
}

private class Vendor implements Serializable{
private String name;
protected Vendor(String name) {this.name = name;}
public String toString(){return name;}
// safer to have accessors & mutators
}
// safer to have accessors & mutators }

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com



Warren Bell-3 wrote:
> 
> How should I set up my model for the following situation. I have a 
> form with a ListChoice and a TextField. The TextField needs to access 
> a property of the object selected of the ListChoice. I have it all 
> working using a ValueMap, but that seems like overkill to use a 
> ValueMap for one object. Here is how I have it:
>  
> super(new CompoundPropertyModel(new ValueMap()));
> 
> ListChoice vendorListChoice = new ListChoice("vendor",

> new LoadableDetachableModel>(){...}, new 
> IChoiceRenderer(){...});
> 
> TextField accountNumberField = new 
> TextField("vendor.accountNumber");
> 
> I thought I could do something like this:
> 
> super(new CompoundPropertyModel(new Vendor()));
> 
> The ListChoice is the same as above and the TextField like this:
> 
> TextField accountNumberField = new 
> TextField("accountNumber");
> 
> The problem with this is that the ListChoice is trying to set a 
> property on the model named vendor when I realy want the selected 
> ListChoice vendor object be the model object and have the TextField 
> access the accountNumber property of the ListChoice vendor.
> 
> How should I set up my model to deal with this type of situation or is

> a ValueMap the best way?
> 
> Thanks,
> 
> Warren
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Model-question---tp24978225p24979787.html
Sent from the Wicket - User 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



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



RE: Model question ?

2009-08-15 Thread Warren Bell
Is there any issues you need to be concerned with when using the page
itself as the model object?

Warren 

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com] 
Sent: Friday, August 14, 2009 5:43 PM
To: users@wicket.apache.org
Subject: RE: Model question ?


Warren,

If you don't mind your "wicket:id"s becoming rather misleading and
arguably slightly harder to follow (magical) Java, you can even do ...

public class HomePage extends WebPage {
private List vendors = Arrays.asList(new Vendor("v1"), 
new Vendor("v2"));
private Vendor vendor = new Vendor("default vendor");
public HomePage(final PageParameters parameters) {
setDefaultModel(new CompoundPropertyModel(this));
Form form = new Form("form"); 
add(form); 
form.add(new ListChoice("vendor", vendors)); 
Form editForm = new Form("vendorEditForm");
add(editForm);
editForm.add(new TextField("vendor.name"));
}
private class Vendor {
private String name;
Vendor(String name) {this.name = name;}
@Override public String toString() {return name;}
}
}

I haven't worked out how to properly paste html into nabble, so drop me
a line at the jWeekend site if you want the template code to go with
this, or a QuickStart. 

Any comments on the type-parameters used above anybody?!

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com


Warren Bell-3 wrote:
> 
> In your second example the Vendor in the vendorModel becomes the 
> selected Vendor from the ListChoice and that Vendor name property 
> becomes the value of the TextField?
> 
> -Original Message-
> From: jWeekend [mailto:jweekend_for...@cabouge.com]
> Sent: Friday, August 14, 2009 3:47 PM
> To: users@wicket.apache.org
> Subject: Re: Model question ?
> 
> 
> Warren,
> 
> ... and if you prefer using a CPM for your "vendorEditForm"s:
> 
> public class HomePage extends WebPage {
> private List vendors = Arrays.asList(new Vendor("v1"), 
>  new 
> Vendor("v2"));
> private Vendor vendor = new Vendor("default vendor");
> public HomePage(final PageParameters parameters) {
> IModel vendorModel = new PropertyModel(this,
"vendor");
> Form form = new Form("form");
> add(form);
> // use your existing LDM instead of this hard-wired 
> // List of vendors but 
> // make sure you merge your edits properly!
> form.add(new ListChoice("vendors", 
>  vendorModel, vendors));
> // using a PropertyModel per field
> Form editForm1 = new Form("vendorEditForm1");
> add(editForm1);
> editForm1.add(new TextField("name", 
> new PropertyModel(this, "vendor.name")));   
> // using a CompoundPropertyModel   
> Form editForm2 = new Form("vendorEditForm2", 
> new CompoundPropertyModel(vendorModel));
> add(editForm2);
> editForm2.add(new TextField("name")); 
> }
> 
> private class Vendor implements Serializable{
> private String name;
> protected Vendor(String name) {this.name = name;}
> public String toString(){return name;}
> // safer to have accessors & mutators
> }
> // safer to have accessors & mutators }
> 
> Regards - Cemal
> jWeekend
> OO & Java Technologies, Wicket Training and Development 
> http://jWeekend.com
> 
> 
> 
> Warren Bell-3 wrote:
>> 
>> How should I set up my model for the following situation. I have a 
>> form with a ListChoice and a TextField. The TextField needs to access

>> a property of the object selected of the ListChoice. I have it all 
>> working using a ValueMap, but that seems like overkill to use a 
>> ValueMap for one object. Here is how I have it:
>>  
>> super(new CompoundPropertyModel(new ValueMap()));
>> 
>> ListChoice vendorListChoice = new 
>> ListChoice("vendor",
> 
>> new LoadableDetachableModel>(){...}, new 
>> IChoiceRenderer(){...});
>> 
>> TextField accountNumberField = new 
>> TextField("vendor.accountNumber");
>> 
>> I thought I could do something like this:
>> 
>> super(new CompoundPropertyModel(new Vendor()));
>> 
>> The ListChoice is the same as above and the TextField like this:
>> 
>> TextField accountNumberField = new 
&

LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
I have a ListChoice that I add a choice to. I do this in an
AjaxButton#onSubmit(...). The problem is that load() has been called
before onSubmit() and I have to call LoadableDetachableMode#detach()
and have load() called again. This seems like a waste to have load()
called twice in order to get the new choice added to the ListChoice. Is
there a better way of doing this?
 
Warren


RE: LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
Ok, I see what is happening. I am using one of the selected choice
objects in the onSubmit and then adding a new choice object to the list.
In order for me to use that selected object, LDM#load() has to be called
first to get it. But how does it know I am going to use that chosen
object if I am not calling getObject()? Now if the selected object is a
member of the page and I don't use the selected object anywhere or add
the ListChoice to the tagret, does the ListChoice choices LDM#load get
called everytime any AjaxButton is pressed regardless of what form it is
on? Or to put it another way, in the situation below what are the
conditions that cause the LDM#load() to be called? 

class MyPage extends WebPage
{
  private MyObject myListChoiceSelectedObject;

  public MyPage()
  {
setDefaultModel(new CompoundPropertyModel(this));
...
someForm.add(new ListChoice("myListChoiceSelectedObject",
new LoadableDetachableModel>(){...}, new
IChoiceRenderer(){...}));
...
  }
}

Thanks for your help

Warren

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com] 
Sent: Friday, August 21, 2009 11:37 AM
To: users@wicket.apache.org
Subject: Re: LoadableDetachableModel#load() called twice


Warren,

Unless you are indirectly calling load() yourself, eg by calling
getObject(), on your LDM) during form processing it's Wicket converting
the selected item (by choice id) to the actual "choice" object, by
matching the id against the list of choices, calling load() on your LDM
in the process.

This implies that you may be submitting the selected value from the list
which is probably unnecessary if that particular submit is designed to
just add a value to the choices' backing model (eg the List or table
etc... you are deriving your list of choices from). 

One way to get around your issue would be to have your "Add an item to
my list" button and, the associated component where you add that new
list object, both on a separate form. Then, after that new form's
submit, your LDM's load() should only be called during any rendering,
which is probably what you want.

Does that do it?

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com



Warren Bell-3 wrote:
> 
> I have a ListChoice that I add a choice to. I do this in an 
> AjaxButton#onSubmit(...). The problem is that load() has been called 
> before onSubmit() and I have to call LoadableDetachableMode#detach() 
> and have load() called again. This seems like a waste to have load() 
> called twice in order to get the new choice added to the ListChoice. 
> Is there a better way of doing this?
>  
> Warren
> 
> 

--
View this message in context:
http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp
25082195p25085222.html
Sent from the Wicket - User 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



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



RE: LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
I need to read you response a little better. The choice id is being
submitted with the form the button is on. Now if I have the button on a
different form, can I update the ListChoice by simply adding the
ListChoice to the target?

Warren

-Original Message-
From: Warren Bell [mailto:warr...@clarksnutrition.com] 
Sent: Friday, August 21, 2009 12:43 PM
To: users@wicket.apache.org
Subject: RE: LoadableDetachableModel#load() called twice

Ok, I see what is happening. I am using one of the selected choice
objects in the onSubmit and then adding a new choice object to the list.
In order for me to use that selected object, LDM#load() has to be called
first to get it. But how does it know I am going to use that chosen
object if I am not calling getObject()? Now if the selected object is a
member of the page and I don't use the selected object anywhere or add
the ListChoice to the tagret, does the ListChoice choices LDM#load get
called everytime any AjaxButton is pressed regardless of what form it is
on? Or to put it another way, in the situation below what are the
conditions that cause the LDM#load() to be called? 

class MyPage extends WebPage
{
  private MyObject myListChoiceSelectedObject;

  public MyPage()
  {
setDefaultModel(new CompoundPropertyModel(this));
...
someForm.add(new ListChoice("myListChoiceSelectedObject",
new LoadableDetachableModel>(){...}, new
IChoiceRenderer(){...}));
...
  }
}

Thanks for your help

Warren

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com]
Sent: Friday, August 21, 2009 11:37 AM
To: users@wicket.apache.org
Subject: Re: LoadableDetachableModel#load() called twice


Warren,

Unless you are indirectly calling load() yourself, eg by calling
getObject(), on your LDM) during form processing it's Wicket converting
the selected item (by choice id) to the actual "choice" object, by
matching the id against the list of choices, calling load() on your LDM
in the process.

This implies that you may be submitting the selected value from the list
which is probably unnecessary if that particular submit is designed to
just add a value to the choices' backing model (eg the List or table
etc... you are deriving your list of choices from). 

One way to get around your issue would be to have your "Add an item to
my list" button and, the associated component where you add that new
list object, both on a separate form. Then, after that new form's
submit, your LDM's load() should only be called during any rendering,
which is probably what you want.

Does that do it?

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com



Warren Bell-3 wrote:
> 
> I have a ListChoice that I add a choice to. I do this in an 
> AjaxButton#onSubmit(...). The problem is that load() has been called 
> before onSubmit() and I have to call LoadableDetachableMode#detach() 
> and have load() called again. This seems like a waste to have load() 
> called twice in order to get the new choice added to the ListChoice. 
> Is there a better way of doing this?
>  
> Warren
> 
> 

--
View this message in context:
http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp
25082195p25085222.html
Sent from the Wicket - User 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



-
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



AbstractAjaxTimerBehavior on Modal Window causes PageExpiredException

2009-08-26 Thread Warren Bell
I am getting a PageExpiredException when I close a modal window that has
an AbstractAjaxTimerBehavior on it. What do I need to do to fix this?
 
Thanks


RE: Choose one

2009-08-27 Thread Warren Bell
I needed to do the same thing. I saw this on another post and it works
fine. Override getDefaultChoice:

protected CharSequence getDefaultChoice(Object selected)
{
  return "Choose One";

}

You can use
getLocalizer().getString("yourpage.dropdownchoice.defaultvalue", this)
for your different languages.

Warren


-Original Message-
From: Gatos [mailto:ega...@gmail.com] 
Sent: Thursday, August 27, 2009 5:46 AM
To: users@wicket.apache.org
Subject: Choose one

After I choose something in DropDownChoice then 'Choose one' item is
removed from the list.

If I will try to use "setNullValid(true)" then 'Choose one' string is
replaced with '' (emptry string).

How is it possible to display 'Choose one' if another item has been
selected?

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



RE: AbstractAjaxTimerBehavior on Modal Window causes PageExpiredException

2009-08-27 Thread Warren Bell
Yes all my objects that need to be serialized are being serialized.

I put together a workaround. In the onClick() that closes the Modal
Window. I called AbstractAjaxTimerBehavior#stop() then waited for a
period longer than the Duration of the AbstractAjaxTimerBehavior and
then closed the Modal Window. This worked, but it is kinda clunky and I
could see cases where it wouldn't. I think what is happening is that the
AbstractAjaxTimerBehavior requests are conflicting with the closeing of
the Modal Window. I was looking for a way that would close the Modal
Window only after the last request/response was made from the
AbstractAjaxTimerBehavior.

Is there a way of finding out when the last AbstractAjaxTimerBehavior
response comes back from the server before closeing the Modal Window or
am I going down the wrong path here?

Warren

-Original Message-
From: Mathias Nilsson [mailto:wicket.program...@gmail.com] 
Sent: Thursday, August 27, 2009 12:18 PM
To: users@wicket.apache.org
Subject: Re: AbstractAjaxTimerBehavior on Modal Window causes
PageExpiredException


Does all your models and objects that you use in the wicket page
implement Serializable?
--
View this message in context:
http://www.nabble.com/AbstractAjaxTimerBehavior-on-Modal-Window-causes-P
ageExpiredException-tp25159539p25178263.html
Sent from the Wicket - User 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



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



Model object properties go null after RestartResponseAtInterceptPageException.

2009-12-11 Thread Warren Bell
I have a page with about 10 text fields. The model for the page is a 
ValueMap. All of the values in the ValueMap get set to null when a user 
gets redirected back to the original page after a 
RestartResponseAtInterceptPageException. All of the keys in the ValueMap 
are still there.


What do I need to do to fix this?

Warren

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



RE: Model object properties go null after RestartResponseAtInterceptPageException.

2009-12-14 Thread Warren Bell
Does Any body have any ideas, I am stuck and can't figure this out.

I have a page with about 10 text fields. The model for the page is a
ValueMap. All of the values in the ValueMap get set to null when a user
gets redirected back to the original page after a
RestartResponseAtInterceptPageException. All of the keys in the ValueMap
are still there.

What do I need to do to fix this?

Warren

-
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: Model object properties go null after RestartResponseAtInterceptPageException.

2009-12-15 Thread Warren Bell
No it looks like it is the same instance, Its constructor is only being 
called once. I can watch the model object and see when it gets set to 
null, though I am not sure what I am looking for as far as what is 
setting it to null. It gets set to null on the way back to the page from 
the login. The model object is a ValueMap that I store in the 
Application object. I am also using wicket-security. Here is how my 
model is being created.


   super(name, new 
CompoundPropertyModel(getScanManApp().getAppProperties())

   {

   @Override
   public ValueMap getObject()
   {
   return getScanManApp().getAppProperties();
   }

   });


Johan Compagner wrote:

isnt your page not just a brand new shiny new instance?
place a breakpoint in your constructor

On 14/12/2009, Warren Bell  wrote:
  

Does Any body have any ideas, I am stuck and can't figure this out.

I have a page with about 10 text fields. The model for the page is a
ValueMap. All of the values in the ValueMap get set to null when a user
gets redirected back to the original page after a
RestartResponseAtInterceptPageException. All of the keys in the ValueMap
are still there.

What do I need to do to fix this?

Warren

-
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

  



--
Thanks,

Warren Bell


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



Maven problem with wicketstuff

2010-01-26 Thread Warren Bell
I am trying to retrieve wicketstuff-core from repository and am getting 
the following "Missing artifact".


Missing artifact org.wicketstuff:wicketstuff-core:jar:1.4.2-SNAPSHOT:compile

my pom

...
   
   wicket-snaps
   http://wicketstuff.org/maven/repository
   
   true
   
   
   true
   
   
...

   
   org.wicketstuff
   wicketstuff-core
   1.4.2-SNAPSHOT
   
...


What am I doing wrong?

Thanks,

Warren

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



Re: Maven problem with wicketstuff

2010-01-26 Thread Warren Bell

wicketstuff-minis

I found it:

   
   org.wicketstuff
   minis
   1.4.1
   

Thanks

mbrictson wrote:

What part of wicketstuff do you want to use in your project? The
"wicketstuff-core" artifact is not a JAR artifact. You have to specify the
actual JAR you need, like "annotation", for example:


  org.wicketstuff
  annotation
  1.4.2-SNAPSHOT



Warren Bell-2 wrote:
  
I am trying to retrieve wicketstuff-core from repository and am getting 
the following "Missing artifact".


Missing artifact
org.wicketstuff:wicketstuff-core:jar:1.4.2-SNAPSHOT:compile

my pom

...

wicket-snaps
http://wicketstuff.org/maven/repository

true


true


...


org.wicketstuff
wicketstuff-core
1.4.2-SNAPSHOT

...


What am I doing wrong?

Thanks,

Warren

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



    


  



--
Thanks,

Warren Bell


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



InMethod grid AbstractColumn#getHeaderCssClass() problem.

2010-02-01 Thread Warren Bell
I am having a problem with AbstractColumn#getHeaderCssClass() in an 
inmethod datagrid. It is writing my css class to the th tag but my css 
class is not working. I think it is something to do with IE8. 
Unfortunately the company that uses this app uses IE8 and the app is 
written for IE8. Digging threw the code, I can see were the css class 
name is added, but there does not seem to be any way to modify it or 
implementing my own ColumnHeader panel without copying a whole lot of 
classes. I think it would probably be better if the users css class was 
added to its own div tag.


Anyway, does anyone know of a simple way of getting my css class to work 
in an InMethod grid header? All I want to do is center the header text. 
Customers can get real nit picky.


The same class works for an individual cell:

   @Override
   public String getCellCssClass(IModel rowModel, int rowNum)
   {
   return "centerAlign";
   }
  
but, this does not work for the header:


   @Override
   public String getHeaderCssClass()
   {
   return "centerAlign";
   }

The th tag that is getting created is:

class="imxt-a">class="imxt-sort-header imxt-sort-header-none" onclick="var 
wcall=wicketAjaxGet('?wicket:interface=:4:body:grid:header:header:getOrderCostFromItems::IBehaviorListener:0:',null,null, 
function() {return Wicket.$('id20') != null;}.bind(this));return !wcall;">

Total



My css class:

.centerAlign {
   text-align: center;
}

--
Thanks,

Warren


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



Re: InMethod grid AbstractColumn#getHeaderCssClass() problem.

2010-02-01 Thread Warren Bell

Your first suggestion worked:

th.centerAlign *  {
 text-align: center !important;
}

Sorry about that, I just don't know my css very well. Just a suggestion, but 
maybe the JavaDocs should mention something about that?

Also, what is the future of InMethod?

Warren 




Matej Knopp wrote:

But the css class is in the output. Can't it be a styling problem?
I.e. the css being by more specific rule?

Can you try something like

th.centerAlign *  {
  text-align: center !important;
}

Or even more specific clas

th.centerAlign div.imxt-a {
text-align:center !important;
}

If that doesn't work, this should

div.imxt-vista table.imxt-head th.centerAlign div.imxt-a {
text-align:center !important;
}

You should use firebug (or something similar) to inspect the elements
to see which CSS ruels get applied and how to override them.

-Matej

On Mon, Feb 1, 2010 at 4:45 PM, Warren Bell  wrote:
  

I am having a problem with AbstractColumn#getHeaderCssClass() in an inmethod
datagrid. It is writing my css class to the th tag but my css class is not
working. I think it is something to do with IE8. Unfortunately the company
that uses this app uses IE8 and the app is written for IE8. Digging threw
the code, I can see were the css class name is added, but there does not
seem to be any way to modify it or implementing my own ColumnHeader panel
without copying a whole lot of classes. I think it would probably be better
if the users css class was added to its own div tag.

Anyway, does anyone know of a simple way of getting my css class to work in
an InMethod grid header? All I want to do is center the header text.
Customers can get real nit picky.

The same class works for an individual cell:

  @Override
  public String getCellCssClass(IModel rowModel, int rowNum)
  {
  return "centerAlign";
  }
 but, this does not work for the header:

  @Override
  public String getHeaderCssClass()
  {
  return "centerAlign";
  }

The th tag that is getting created is:


Total


My css class:

.centerAlign {
  text-align: center;
}

--
Thanks,

Warren


-
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

  



--
Thanks,

Warren Bell


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



Behavior does not work when visibility is changed from false to true

2010-02-18 Thread Warren Bell
I have a TextField with an AjaxFormSubmitBehavior attached to it. The 
behavior works fine when the page is loaded with the TextField visible 
but does not work if the page is loaded with it not visible and then 
made visible with an ajax call. I can see everything in the ajax 
response including the head js. The head js has a function that gets 
called by the TextFields onkeypress event before the wicket ajax is 
called. Firebug says it can't find the function, but it is in the ajax 
response. There is no js in this behavior that is associated with the 
page loading.


What do I need to do to make this behavior work after visibility is 
changed from false to true?


--
Thanks,

Warren Bell


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



Adding attributes to child components in a behavior.

2010-04-15 Thread Warren Bell
Is there a way to add attributes to child components in a behavior that
is added to a page? I want to create a behavior that is added to a page
that adds some js to the header and then adds some js in an onfocus
attribute of each child form component on the page. I have the list of
child form components, but can't figure out how to add the attribute to
the components.
 
Warren


Re: Adding attributes to child components in a behavior.

2010-04-15 Thread Warren Bell
I have that figured out, I just don't know how to add the attribute to 
each component. I can't add a behavior, since "Cannot modify component 
hierarchy after render phase has started (page version cant change then 
anymore)" Can I even do this in a behavior?


Cemal Bayramoglu wrote:

Warren,

See MarkupContainer#visitChildren

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket
Consulting, Development, Training
http://jWeekend.com

On 15 April 2010 18:44, Warren Bell  wrote:
  

Is there a way to add attributes to child components in a behavior that
is added to a page? I want to create a behavior that is added to a page
that adds some js to the header and then adds some js in an onfocus
attribute of each child form component on the page. I have the list of
child form components, but can't figure out how to add the attribute to
the components.

Warren




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

  



--
Thanks,

Warren Bell


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



RE: Adding attributes to child components in a behavior.

2010-04-15 Thread Warren Bell
Sorry if this got double posted, I didn't see it up there.

I have that figured out, I just don't know how to add the attribute to
each component. I can't add a behavior, since "Cannot modify component
hierarchy after render phase has started (page version cant change then
anymore)" Can I even do this in a behavior?
 
Cemal Bayramoglu wrote:
> Warren,
>
> See MarkupContainer#visitChildren
>
> Regards - Cemal
> jWeekend
> OO & Java Technologies, Wicket
> Consulting, Development, Training
> http://jWeekend.com
>
> On 15 April 2010 18:44, Warren Bell 
wrote:
>  
>> Is there a way to add attributes to child components in a behavior
that
>> is added to a page? I want to create a behavior that is added to a
page
>> that adds some js to the header and then adds some js in an onfocus
>> attribute of each child form component on the page. I have the list
of
>> child form components, but can't figure out how to add the attribute
to
>> the components.
>>
>> Warren
>>
>> 
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>   
 

-- 
Thanks,
 
Warren Bell


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



Re: Adding attributes to child components in a behavior.

2010-04-15 Thread Warren Bell
I ended up doing it in bind of the behavior and it works fine. I just have to 
remember to add the behavior to the page after all the other components. Thanks
 
 
 
I assume you were trying this in beforeRender of your behaviour, which
as you say is too late.
If you really need to use a behaviour encapsulate all this, try
something like the following, but some may feel its a little
politically incorrect to do this in bind.
 class MyBehaviour extends AbstractBehavior{
  @Override
  public void bind(Component component) {  
   if(!(component instanceof MarkupContainer)){
throw new RuntimeException("contaıners only please");
   }
   visitChildren(new IVisitor(){
@Override
public Object component(Component component) {
 component.add(new SimpleAttributeModifier("class","goodChild"));
 return IVisitor.CONTINUE_TRAVERSAL;
}
   });
  }
 }
 
Regards - Cemal
jWeekend
OO & Java Technologies, Wicket
Consulting, Development, Training
http://jWeekend.com
 

On 15 April 2010 20:17, Warren Bell  wrote:
> > I have that figured out, I just don't know how to add the attribute to each
> > component. I can't add a behavior, since "Cannot modify component hierarchy
> > after render phase has started (page version cant change then anymore)" Can
> > I even do this in a behavior?
> >
> > Cemal Bayramoglu wrote:
>> >>
>> >> Warren,
>> >>
>> >> See MarkupContainer#visitChildren
>> >>
>> >> Regards - Cemal
>> >> jWeekend
>> >> OO & Java Technologies, Wicket
>> >> Consulting, Development, Training
>> >> http://jWeekend.com
>> >>
>> >> On 15 April 2010 18:44, Warren Bell  wrote:
>> >>
>>> >>>
>>> >>> Is there a way to add attributes to child components in a behavior that
>>> >>> is added to a page? I want to create a behavior that is added to a page
>>> >>> that adds some js to the header and then adds some js in an onfocus
>>> >>> attribute of each child form component on the page. I have the list of
>>> >>> child form components, but can't figure out how to add the attribute to
>>> >>> the components.
>>> >>>
>>> >>> Warren
>>> >>>
>>> >>>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
> >
> >
> > --
> > Thanks,
> >
> > Warren Bell
> >
> >
> > -
> > 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
 
 


Which form componnent had focus when form was submitted?

2010-04-21 Thread Warren Bell
Is there a way to figure out in a forms onSubmit which text field or
button had focus when the form is submitted. I have done something in js
to achieve this, but wanted to see if there was something already built
in Wicket. I am limited to using form submit only no Ajax. Windows CE is
having problems with some of the Ajax I tried to use.
 
Thanks,
 
Warren


Re: Which form componnent had focus when form was submitted?

2010-04-21 Thread Warren Bell
Thats what I am currently doing. It just felt to much like something I
used to do in Struts. I don't know if there is much call for this, but
it would be nice to have an onSubmit for a text field or other form
components that would get fired off if that component was in focus when
the form was submited, or maybe a Form onSubmit(Component
componentInFocus). Just a thought, I end up doing a lot of this.
 
Warren
 
Igor Vaynberg wrote:
> you have to keep a HiddenField component and populate its value using
> javascript.
>
> -igor
>
> On Wed, Apr 21, 2010 at 9:41 AM, Warren Bell
>  wrote:
>> Is there a way to figure out in a forms onSubmit which text field or
>> button had focus when the form is submitted. I have done something in
js
>> to achieve this, but wanted to see if there was something already
built
>> in Wicket. I am limited to using form submit only no Ajax. Windows CE
is
>> having problems with some of the Ajax I tried to use.
>>
>> Thanks,
>>
>> Warren
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
 

-- 
Thanks,
 
Warren Bell
 
 


Where has InMethod.com gone?

2008-11-25 Thread Warren Bell
I am looking for an advance datagrid component. I see that inMethod is 
mentioned as having one. When I go to their sight, it talks about WiFi 
Video for iPhone. Where do I go to find info on their datagrid? And if 
they are gone, Does anyone else have some sort of advance datagrid?


--
Thanks,

Warren


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Redirecting to external URL

2009-01-01 Thread Warren Bell
I need to redirect to an external page. I saw this solution, but was not 
sure how to use it. Where does this exception get thrown? I do not want 
to instantiate some kind of dummy page.


public class RedirectToExternalException extends
AbstractRestartResponseException
{
  private static final long serialVersionUID = 1L;

  public RedirectToExternalException(String url)
  {

  RequestCycle rc = RequestCycle.get();
  if (rc == null)
  {
  throw new IllegalStateException(
  "This exception can only be
thrown from within request processing cycle");
  }
  else
  {
  Response r = rc.getResponse();
  if (!(r instanceof WebResponse))
  {
  throw new IllegalStateException(
  "This exception can
only be thrown when wicket is processing an
http request");
  }

  // abort any further response processing
  rc.setRequestTarget(new RedirectRequestTarget(url));
  }
  }
}

Thanks,

Warren

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



Re: Redirecting to external URL

2009-01-01 Thread Warren Bell
I need to explain myself a little better. This is the situation, I have 
several locations that are on different subnets. They are all connected 
with a VPN. Each subnet has its own server running this wicket app. The 
app clients are running on mobile scanning PDAs. These PDAs get moved 
between each subnet. The PDAs need to know what server to access the app 
at. One of the subnets has a Headquarters server. How I see this working 
is that each PDA would access the HQ server and then be redirected to 
its subnet server. For instance the PDA client would have its browsers 
home page set to the HQs url:


http://HQserverIP/redirectPDA

The HQ server would then redirect to the PDAs local server based on the 
ip address the response came from:


http://LocalserverIP/login

I did not want to create a page on the HQ server just so that it could 
be redirected thinking there could be some issues doing that. I was 
going to do this redirecting in a separate servlet, but I wanted to keep 
it all in one app. I saw the RedirectToExternalException solution 
thinking that this could be used.


Jonathan Locke wrote:

try:

RequestCycle.get().setRequestTarget(new RedirectRequestTarget(url));


Warren Bell wrote:

I need to redirect to an external page. I saw this solution, but was not
sure how to use it. Where does this exception get thrown? I do not want
to instantiate some kind of dummy page.

public class RedirectToExternalException extends
AbstractRestartResponseException
{
private static final long serialVersionUID = 1L;

public RedirectToExternalException(String url)
{

RequestCycle rc = RequestCycle.get();
if (rc == null)
{
throw new IllegalStateException(
"This exception can only be
thrown from within request processing cycle");
}
else
{
Response r = rc.getResponse();
if (!(r instanceof WebResponse))
{
throw new IllegalStateException(
"This exception can
only be thrown when wicket is processing an
http request");
}

// abort any further response processing
rc.setRequestTarget(new
RedirectRequestTarget(url));
}
}
}

Thanks,

Warren

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








--
Thanks,

Warren Bell
909-645-8864
war...@clarksnutrition.com

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



Re: Redirecting to external URL

2009-01-01 Thread Warren Bell
I don't always have access to those resources. I will try the 
setRequestTarget code. I would still have to set-up a dummy page to do 
this, since I am coming in from an external source, correct? Where else 
could I place this code?


public class DummyPage extends ...
{
   public DummyPage()
   {
  super ...
  RequestCycle.get().setRequestTarget(new RedirectRequestTarget(url));
   }
}


http://HQserverIP/appname/DummyPage
 



Jonathan Locke wrote:


isn't this outside the scope of wicket? it sounds like it might be 
solvable

with some kind of load balancer, router or DNS resolver...


Warren Bell wrote:

I need to explain myself a little better. This is the situation, I have
several locations that are on different subnets. They are all connected
with a VPN. Each subnet has its own server running this wicket app. The
app clients are running on mobile scanning PDAs. These PDAs get moved
between each subnet. The PDAs need to know what server to access the app
at. One of the subnets has a Headquarters server. How I see this working
is that each PDA would access the HQ server and then be redirected to
its subnet server. For instance the PDA client would have its browsers
home page set to the HQs url:

http://HQserverIP/redirectPDA

The HQ server would then redirect to the PDAs local server based on the
ip address the response came from:

http://LocalserverIP/login

I did not want to create a page on the HQ server just so that it could
be redirected thinking there could be some issues doing that. I was
going to do this redirecting in a separate servlet, but I wanted to keep
it all in one app. I saw the RedirectToExternalException solution
thinking that this could be used.

Jonathan Locke wrote:

try:

RequestCycle.get().setRequestTarget(new RedirectRequestTarget(url));


Warren Bell wrote:
I need to redirect to an external page. I saw this solution, but 
was not

sure how to use it. Where does this exception get thrown? I do not want
to instantiate some kind of dummy page.

public class RedirectToExternalException extends
AbstractRestartResponseException
{
private static final long serialVersionUID = 1L;

public RedirectToExternalException(String url)
{

RequestCycle rc = RequestCycle.get();
if (rc == null)
{
throw new IllegalStateException(
"This exception can only be
thrown from within request processing cycle");
}
else
{
Response r = rc.getResponse();
if (!(r instanceof WebResponse))
{
throw new IllegalStateException(
"This exception can
only be thrown when wicket is processing an
http request");
}

// abort any further response processing
rc.setRequestTarget(new
RedirectRequestTarget(url));
}
}
}

Thanks,

Warren

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





--
Thanks,

Warren Bell
909-645-8864
war...@clarksnutrition.com

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









--
Thanks,

Warren Bell
909-645-8864
war...@clarksnutrition.com

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



Re: inmethod grid and add/delete examples

2009-02-12 Thread Warren Bell
The books "Wicket in Action" and "Enjoying Web Development with Wicket" 
helped me a lot when I first started using Wicket.


Warren

On Wed, Feb 11, 2009 at 9:58 AM, Will Jaynes  wrote:

  

I have just started to look at the inmethod datagrid in wicketstuff. The
one thing that the examples don't show are how to add and delete items. Are
there such examples somewhere?

Will




I'm really missing a lot with regard to the datagrid examples. Perhaps it's
because I'm still relatively new to Wicket and very new to the Ajax stuff in
Wicket. As I've said, I don't see how to add or delete rows to the
datagrid.  But also I don't see in the examples how to actually update the
database with any edited values. Nor do I see, once a row is selected, how
to get that selected row and do something with it.

So, I'm pretty clueless, which makes it hard to help me, but I'd appreciate
any info or pointers.

Will

  



--
Thanks,

Warren Bell
909-645-8864
warrenbe...@gmail.com


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



Re: What's your take on handling markup in properties, html, wicket

2009-02-13 Thread Warren Bell
Create a panel with just the markup you need and switch them out with 
the isvisible based on the current language needed? Similar to the post 
for "Re: Adding/Replacing links in Panels" by Michael Sparer below. I 
use WebMarkupContainer, but I only have two states. 14 may get a little 
messy


Warren

Mathias P.W Nilsson wrote:

Hi,

Just wondering how this should be handled without DRY.

In many scenarios we have multiple languages that should have the same
markup but different text. This could be handled by using variation and put
every language in an own html file like myWicketPage_style_en.html.

However, this is not the optimal way and I don't think variation is made for
this either. It would be very annoing having 14 different html files if we
have 14 different languages that we should support. 


Sometimes the languages should look different ( not the same look. Different
positioning of elements ) and here we could use variation. As far as I'm
concerned this is not the right way of handling look and feel. Different css
should be used instead and then place position, coloring of the markup in a
css. The html file should be the same and the css should handle the layout. 
Take a look at  http://www.csszengarden.com/ http://www.csszengarden.com/ 


Every time I'm dealing with multiple languages the user wants bold, italic,
color in the text. Many times a list will appear just containing text. (
Nothing to do with extracting data from database and let wicket handle it )
This could be added in a properties file but then we would have bold tags,
italic and style tags in the properties file. If something should change we
need to go thru 14 properties files to change the markup in the properties.

Let's say we have the following text in many different languages. Some
markup is changed so you know what I mean.

Welcome to our companyHere is some long
text.some [BOLD]text[/BOLD]other text

Now imaging this text to be very long.

Now, my question is this. How do you handle tagged markup for different
languages without repeating markup tags.

* Variation and the text in the html file.
* different properties file with markup in it
* Other technique?


  



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



Re: How to get a reference to the holding page from a panel

2009-02-13 Thread Warren Bell
I have a simmilar situation where I want to put a panel nested in a 
panel nested in a page. The panel that is nested in the page stays the 
same for many different pages, but the panel nested into the panel 
changes. Would you do an anonymous panel class within an anonymous panel 
class within the page so that you can do the same type of referencing 
MyPage.this? Or is there a better way of doing this?
Actually I also find that using getPage() on beforeRender() to get the 
page
is ok as long as do deal with any problems in case you cannot get the 
page.


Pieter

On Fri, Feb 13, 2009 at 6:34 PM, Igor Vaynberg 
wrote:


make the panel an anonymous or inner class of the page and use 
MyPage.this.


-igor

On Fri, Feb 13, 2009 at 6:14 AM, pieter claassen 
wrote:

Is there a simple answer for how to get a reference from a panel to the
holding page that is available at compile time (something other than
getPage() on beforeRender())?

Thanks,
Pieter


-
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



Maurice Marrink will be greatly missed.

2009-03-03 Thread Warren Bell
I just recently found out, via this list, that Maurice Marrink had 
passed away. I wanted to let everyone know how much I appreciated 
Maurice. He helped me better understand Wicket and helped me customize 
wicket-security to meet my needs. He was very generous with his time and 
he will be greatly missed.


Thanks,

Warren Bell


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



InMethod grid, Hidden Field in column does not get updated

2011-11-16 Thread Warren Bell
I have an Inmethod grid with a HiddenField in a panel in a column. This 
HiddenField does not get updated after a SubmitCancelColumn is clicked. All the 
other fields get updated correctly except for the HiddenField. There is also a 
TextField in the same panel as the HiddenField, the TextField gets updated 
correctly. Here is the column code, newPriceTextField gets updated correctly 
and oldNewPriceHiddenField does not get updated:

WicketColumnAdapter newPriceColumn = new 
WicketColumnAdapter("newPriceColumnAdapter", new 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn(new
 Model("New Price"), "newPrice"))
{


 @Override
 public Component newCell(WebMarkupContainer parent, String componentId, IModel 
rowModel)
 {
  final PriceChange priceChange = (PriceChange)rowModel.getObject();

  final TextField newPriceTextField = new TextField("newPrice", 
new PropertyModel(priceChange, "newPrice"), Double.class)
  final HiddenField oldNewPriceHiddenField = new 
HiddenField("oldNewPrice", new PropertyModel(priceChange, 
"oldNewPrice"), Double.class);

  CostNewPricePanel panel = new CostNewPricePanel(newPriceTextField, 
oldNewPriceHiddenField);
  return panel;
 }

};



Also, the "oldNewPrice" property of the oldNewPriceHiddenField does change 
after SubmitCancelColumn gets clicked.

What do I need to do to get the HiddenField to update correctly?

Thanks,

Warren Bell


-- 
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway. 

The information contained in this e-mail is intended only for use of
the individual or entity named above. This e-mail, and any documents,
files, previous e-mails or other information attached to it, may contain
confidential information that is legally privileged. If you are not the
intended recipient of this e-mail, or the employee or agent responsible
for delivering it to the intended recipient, you are hereby notified
that any disclosure, dissemination, distribution, copying or other use
of this e-mail or any of the information contained in or attached to it
is strictly prohibited. If you have received this e-mail in error,
please immediately notify us by return e-mail or by telephone at
(951)321-1960, and destroy the original e-mail and its attachments
without reading or saving it in any manner. Thank you.



RE: InMethod grid, Hidden Field in column does not get updated

2011-11-18 Thread Warren Bell
Any takers, this one has me stumped. Is there anything special with how a 
HiddenField gets updated after an Ajax call. The HiddenField is in the same 
panel as a TextField. The TextField gets updated but the HiddenField does not. 
I have checked and the values have changed on the model object for both fields. 
I thought that when you add a component to the target that the component and 
all its children would get updated. I see the HiddenField coming back in the 
Ajax response, it just has the old value.

Thanks,

Warren

-Original Message-
From: Warren Bell 
Sent: Wednesday, November 16, 2011 11:04 AM
To: 'users@wicket.apache.org'
Subject: InMethod grid, Hidden Field in column does not get updated

I have an Inmethod grid with a HiddenField in a panel in a column. This 
HiddenField does not get updated after a SubmitCancelColumn is clicked. All the 
other fields get updated correctly except for the HiddenField. There is also a 
TextField in the same panel as the HiddenField, the TextField gets updated 
correctly. Here is the column code, newPriceTextField gets updated correctly 
and oldNewPriceHiddenField does not get updated:

WicketColumnAdapter newPriceColumn = new 
WicketColumnAdapter("newPriceColumnAdapter", new 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn(new
 Model("New Price"), "newPrice")) {


 @Override
 public Component newCell(WebMarkupContainer parent, String componentId, IModel 
rowModel)  {
  final PriceChange priceChange = (PriceChange)rowModel.getObject();

  final TextField newPriceTextField = new TextField("newPrice", 
new PropertyModel(priceChange, "newPrice"), Double.class)
  final HiddenField oldNewPriceHiddenField = new 
HiddenField("oldNewPrice", new PropertyModel(priceChange, 
"oldNewPrice"), Double.class);

  CostNewPricePanel panel = new CostNewPricePanel(newPriceTextField, 
oldNewPriceHiddenField);
  return panel;
 }

};



Also, the "oldNewPrice" property of the oldNewPriceHiddenField does change 
after SubmitCancelColumn gets clicked.

What do I need to do to get the HiddenField to update correctly?

Thanks,

Warren Bell



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



Re: WiQuery vs JQWicket

2011-11-23 Thread Warren Bell
Have you tried the InMethod grid, and if you have is there a reason you
are looking for something different? I am just curious.

Thanks,

Warren

On 11/23/11 8:26 AM, Brian Mulholland wrote:
> As I am looking at them, I am not noticing either implementing the
> jQuery grid, much less the paging scrollbar.  Am I overlooking it?
> 
> Brian Mulholland
> 
> 
> On Wed, Nov 23, 2011 at 10:56 AM, Pointbreak
>  wrote:
>> I've never used either framework, but your question made me curious
>> again. (Years ago I evaluated the existing wicket-jquery integrations
>> and wasn't happy with how they were designed. Since than I've always
>> just used jquery inside wicket, it's not that hard for simple designs,
>> and for complex designs these frameworks may be just to rigid). That
>> being said I just had a quick glance at the projects again and it seems
>> that WiQuery does the integration via Components (i.e. you create an
>> Accordion Component), while JqWicket does the integration via Bahaviors
>> (i.e. you add an AccordionBehavior to an existing Component, e.g. a
>> ListView). The latter (thus using Behaviors) is how I have always done
>> it, feels more natural to me, and is a lot more flexible.
>>
>> On Wednesday, November 23, 2011 10:16 AM, "Brian Mulholland"
>>  wrote:
>>> We are considering WiQuery and JQWicket.
>>>
>>> 1) Which is better and why?
>>> 2) Is one more established or better supported than the other?
>>> 3) Is one more full featured?
>>>
>>> What differentiates the two?
>>>
>>> Brian Mulholland
>>>
>>> -
>>> 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
> 

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



Re: Refreshing repeating view

2011-11-29 Thread Warren Bell
I just got done with a problem similar to this. It may be because your
RepeatingView is useing ReuseIfModelsEqualStrategy. In my situation the
component never thought the value changed so it reused the old value. It
sounds like that is what is happening to you. My fix was to call
Component#modelChanged() on the component. This forces it to use the new
value.

I finally figured this out with some help from Cemal Bayramoglu.
Hopefully you won't spend as much time as I did.

Thanks,

Warren Bell

On 11/29/11 6:38 AM, mohan mohan wrote:
> Hi
> 
>  I am using RepeatingView to add dynamic text fields on a plus button
> click in a panel. When I add new text field to the repeating view on a plus
> button click and refresh it, the user input for the other text fields gone.
> Does repeating view reconstructs the components on refresh?
> How can I preserve user input?
> 

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



Localizer in a new Thread

2010-07-29 Thread Warren Bell
I want to take advantage of Wicket's message localization in a new
thread I have created. I am trying to pass the localizer to a thread
that runs background tasks. I am geting an
"org.apache.wicket.WicketRuntimeException: There is no application
attached to current thread...". I am sure I am going about this the
wrong way.
 
What's the best way to get message localization in a new thread ?
 
Thanks,
 
Warren  


RE: Localizer in a new Thread

2010-07-29 Thread Warren Bell
To clarify, I want to use Localizer#getString(...) in a thraed I create.
I have seen other posts on this issue, but haven't been able to figure
out the solution.

Warren 

-Original Message-
From: Warren Bell [mailto:warr...@clarksnutrition.com] 
Sent: Thursday, July 29, 2010 3:31 PM
To: users@wicket.apache.org
Subject: Localizer in a new Thread

I want to take advantage of Wicket's message localization in a new
thread I have created. I am trying to pass the localizer to a thread
that runs background tasks. I am geting an
"org.apache.wicket.WicketRuntimeException: There is no application
attached to current thread...". I am sure I am going about this the
wrong way.
 
What's the best way to get message localization in a new thread ?
 
Thanks,
 
Warren

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



RE: Localizer in a new Thread

2010-07-30 Thread Warren Bell
I am not sure how to preload the the values. I am trying this, but am
not getting anywhere.

myApp.getResourceSettings().getPropertiesFactory().load(ScanManTask.clas
s, "com.scanman.cron.task")

I have a properties file named ScanManTask.properties and have added it
to my app like this:

getResourceSettings().addStringResourceLoader(new
ClassStringResourceLoader(ScanManTask.class));

ScanManTask is not a commponent. The load method has a clazz and path
argument. I am assummeing the class is the class associated with the
property file and the path is the package it is in?

I guess I could just load them manually, but I would like to take
advantage of localization. How do I get a localized version of a
Properties object with my messages in it?

-Original Message-
From: Wilhelmsen Tor Iver [mailto:toriv...@arrive.no] 
Sent: Thursday, July 29, 2010 11:19 PM
To: users@wicket.apache.org
Subject: SV: Localizer in a new Thread

> To clarify, I want to use Localizer#getString(...) in a thraed I 
> create.
> I have seen other posts on this issue, but haven't been able to figure

> out the solution.

The Localizer.getString() looks for its messages in Wicket's property
file structure, which depends on Application, the resource-oriented
classes, hierarchies and so forth. Your best bet is to "pre-read" the
values you need into a Properties object that you pass to the thread
code.

- Tor Iver

-
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



dynamically adding validators to TextFields in a ListView

2010-08-18 Thread Warren Bell
I have a ListView that adds one TextField to each ListItem. These
TextFields need to have different types of validators added to them
depending on a condition. One TextField in the first ListItem may need
an email validator while the TextField in the next ListItem may need a
number range validator and so on.
 
What is the best way to do this type of validation?
 
Warren
 


RE: dynamically adding validators to TextFields in a ListView

2010-08-19 Thread Warren Bell
I have that working ok, but I am trying to add an atribute to the
TextField when it is invalid. The problem is that a new TextField is
created when the page is rerendered. I have a workaround, but it is
ugly. Any sugestions?

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Wednesday, August 18, 2010 10:40 PM
To: users@wicket.apache.org
Subject: Re: dynamically adding validators to TextFields in a ListView

whatever is creating the textfield should add the appropriate validator

-igor

On Wed, Aug 18, 2010 at 10:01 PM, Warren Bell
 wrote:
> I have a ListView that adds one TextField to each ListItem. These 
> TextFields need to have different types of validators added to them 
> depending on a condition. One TextField in the first ListItem may need

> an email validator while the TextField in the next ListItem may need a

> number range validator and so on.
>
> What is the best way to do this type of validation?
>
> Warren
>
>

-
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



How do I access Wicket's string resources in a non component class ?

2013-12-11 Thread Warren Bell
I want to access Wicket's string resources in a non component class. I am aware 
of getLocalizer().getString(...) for a component, but how do you do this in a 
non Component based class and how do you make Wicket aware of the message 
bundle ? All of the Localizer#getString(...) methods require a Component. I am 
using Wicket version 6.10.0. I have a REST resource named UserResource.java and 
messages in UserResource.properties.

Thanks

Warren
-- 
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.

The information contained in this e-mail is intended only for use of the individual or entity named above. This e-mail, and any documents, files, previous e-mails or other information attached to it, may contain confidential information that is legally privileged. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, dissemination, distribution, copying or other use of this e-mail or any of the information contained in or attached to it is strictly prohibited. If you have received this e-mail in error, please immediately notify us by return e-mail or by telephone at (951)321-1960, and destroy the original e-mail and its attachments without reading or saving it in any manner. Thank you.
Clark’s Nutrition is a registered trademark of Clarks Nutritional Centers, Inc.
- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org

Re: How do I access Wicket's string resources in a non component class ?

2013-12-11 Thread Warren Bell
I think this is exactly what I am looking for. I had an older version of Wicket 
REST Annotations that did not have this class.

I do have a question about its usage. I did the following in my resource class 
and it does work.

DefaultBundleResolver  defaultBundleResolver = new 
DefaultBundleResolver(MyRestResource.class);
String message = defaultBundleResolver.getMessage("test", null);

Is this the correct way to use this class or is their a way for it to plug into 
Wicket via Application#Init() method and then get the Localizer and use it?

Thanks,

Warren


On Dec 11, 2013, at 1:30 PM, Andrea Del Bene wrote:

> Hi,
> 
> maybe you can have a look here: 
> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent/restannotations/src/main/java/org/wicketstuff/rest/utils/wicket/bundle/DefaultBundleResolver.java
> 
> That's a resource bundle resolver that works with the stringResourceLoaders 
> of the Application.
>> I want to access Wicket's string resources in a non component class. I am 
>> aware of getLocalizer().getString(...) for a component, but how do you do 
>> this in a non Component based class and how do you make Wicket aware of the 
>> message bundle ? All of the Localizer#getString(...) methods require a 
>> Component. I am using Wicket version 6.10.0. I have a REST resource named 
>> UserResource.java and messages in UserResource.properties.
>> 
>> Thanks
>> 
>> Warren
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> -- 
> This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.


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



Re: How do I access Wicket's string resources in a non component class ?

2013-12-11 Thread Warren Bell
Answered my own question. Found this in Wicket REST Annotation tests. 

DefaultBundleResolver resolver = new 
DefaultBundleResolver(RestResourceFullAnnotated.class); 
assertEquals(resolver.getMessage("CustomValidator", 
Collections.EMPTY_MAP), response);


On Dec 11, 2013, at 2:26 PM, Warren Bell wrote:

> I think this is exactly what I am looking for. I had an older version of 
> Wicket REST Annotations that did not have this class.
> 
> I do have a question about its usage. I did the following in my resource 
> class and it does work.
> 
> DefaultBundleResolver  defaultBundleResolver = new 
> DefaultBundleResolver(MyRestResource.class);
> String message = defaultBundleResolver.getMessage("test", null);
> 
> Is this the correct way to use this class or is their a way for it to plug 
> into Wicket via Application#Init() method and then get the Localizer and use 
> it?
> 
> Thanks,
> 
> Warren
> 
> 
> On Dec 11, 2013, at 1:30 PM, Andrea Del Bene wrote:
> 
>> Hi,
>> 
>> maybe you can have a look here: 
>> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/wicketstuff-restannotations-parent/restannotations/src/main/java/org/wicketstuff/rest/utils/wicket/bundle/DefaultBundleResolver.java
>> 
>> That's a resource bundle resolver that works with the stringResourceLoaders 
>> of the Application.
>>> I want to access Wicket's string resources in a non component class. I am 
>>> aware of getLocalizer().getString(...) for a component, but how do you do 
>>> this in a non Component based class and how do you make Wicket aware of the 
>>> message bundle ? All of the Localizer#getString(...) methods require a 
>>> Component. I am using Wicket version 6.10.0. I have a REST resource named 
>>> UserResource.java and messages in UserResource.properties.
>>> 
>>> Thanks
>>> 
>>> Warren
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> -- 
>> This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.
> 
> 
> -
> 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



Wicket serving AngularJS app

2013-12-23 Thread Warren Bell
I am using Wicket 6 to manage an AngularJS app. Currently I am just letting 
Tomcat serve the AngularJS client i.e. index.html and using Wicket for 
authentication, authorization and REST. But I would like to use Wicket to serve 
up the client so that I can manage css and js resources and set an initial 
cookie. What would be the best way to do this ? 

I was thinking of just making the index.html file a wicket page with no 
components or should I use a WebExternalResourceRequestHandler or something 
similar ?

Thanks,

Warren  
-- 
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway.

The information contained in this e-mail is intended only for use of the individual or entity named above. This e-mail, and any documents, files, previous e-mails or other information attached to it, may contain confidential information that is legally privileged. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, dissemination, distribution, copying or other use of this e-mail or any of the information contained in or attached to it is strictly prohibited. If you have received this e-mail in error, please immediately notify us by return e-mail or by telephone at (951)321-1960, and destroy the original e-mail and its attachments without reading or saving it in any manner. Thank you.
Clark’s Nutrition is a registered trademark of Clarks Nutritional Centers, Inc.
- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org