clustering and failover

2013-06-27 Thread Uwe Schäfer

hi

quick question about clustering: am i right to believe that putting 
session/pagemap data in a memcached-like storage has advantages over the 
tomcat session clustering in terms of latency and robust failover behaviour?
i mean, the latter obviously has the data nearby (when assuming sticky 
sessions) whereas the first needs to grab it from (and push it to) 
external storage every time even though it is far more selective about 
what it needs.


i was wondering if tomcat session clustering can effectivly update only 
the dirty parts of the session data?


i'd love any kind of feedback on that topic INCLUDING 'depends'-answers :)

cu uwe

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



Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Bas Gooren

Hi Andreas,

My guess is that the GuiceComponentInjector proxies are "detached" when 
the page is serialized.
The last page (or the last N pages) are kept in memory by wicket (I 
think, last I checked was some years ago).


Checking ...
Yes, see LazyInitProxyFactory and its nested class JdkJHandler (which is 
used for injected interfaces).

The proxy is replaced on serialization.

Somehow I always thought the proxies were also detached when the page is 
detach()-ed. Guess not :-)


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 23:37, schreef Andreas Lundblad:

On Thu, Jun 27, 2013 at 11:25 PM, Bas Gooren  wrote:

Hi Andreas,

When your validator fails, you remain on the FormPage. A quick debug session
shows me that the injected IService remains the same accross requests.

I've seen this too. I thought that this didn't matter since, as you
said: "The GuiceComponentInjector which is set-up in the wicket
application injects proxies".


The fix for your problem is simple, and a best practice anyway: inject
Provider in your service.

It's a best practice since the service does not know the "scope" of the
entitymanager, all it knows is that the entitymanager has a different
lifecycle; Your service may be instantiated and kept around for the time
your app is running, but could also be instantiated on the fly when needed.
That's one of the reasons why Provider<> was invented: if the scope is
different, a provider allows you to nicely deal with it.

In case you are not familiar with providers: it has no negative side-effects
in terms of performance.
The guice-persist module binds the EntityManager per request, so all calls
to Provider while in the same request will yield the exact
same EntityManager instance.



PS See https://code.google.com/p/google-guice/wiki/InjectingProviders (header 
"Providers for Mixing Scopes").

Thank you Bas for this excellent answer. Much appreciated.

-- Andreas Lundblad

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





Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Bas Gooren
PS See https://code.google.com/p/google-guice/wiki/InjectingProviders 
(header "Providers for Mixing Scopes").


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 22:03, schreef Andreas Lundblad:

On Thu, Jun 27, 2013 at 3:59 PM, Bas Gooren  wrote:

I'm not the one who posed the original question.

Andreas, like I said: please show us some code, and we can help you pinpoint
your issue.


Thanks for all the rapid help!

I've created a minimal page that shows the error. Basically no
difference from the original code (
http://github.com/javadev/wicket-guice-demo )

To reproduce:

1. Download and unzip http://aoeu.se/www/wicketguice-problem.zip
2. mvn jetty:run
3. Go to localhost:9090, then go to "Form page"
4. Try to submit "gavin"
5. Try to submit "gavin" again.

This results in the 'EntityManager is closed' exception. No idea how
to solve this. If it's unsolvable, I'll look into the Provider
approach, but it would be really nice to manage without it.

best regards,
Andreas Lundblad

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





Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Andreas Lundblad
On Thu, Jun 27, 2013 at 11:25 PM, Bas Gooren  wrote:
> Hi Andreas,
>
> When your validator fails, you remain on the FormPage. A quick debug session
> shows me that the injected IService remains the same accross requests.

I've seen this too. I thought that this didn't matter since, as you
said: "The GuiceComponentInjector which is set-up in the wicket
application injects proxies".

> The fix for your problem is simple, and a best practice anyway: inject
> Provider in your service.
>
> It's a best practice since the service does not know the "scope" of the
> entitymanager, all it knows is that the entitymanager has a different
> lifecycle; Your service may be instantiated and kept around for the time
> your app is running, but could also be instantiated on the fly when needed.
> That's one of the reasons why Provider<> was invented: if the scope is
> different, a provider allows you to nicely deal with it.
>
> In case you are not familiar with providers: it has no negative side-effects
> in terms of performance.
> The guice-persist module binds the EntityManager per request, so all calls
> to Provider while in the same request will yield the exact
> same EntityManager instance.
>
>
>
> PS See https://code.google.com/p/google-guice/wiki/InjectingProviders (header 
> "Providers for Mixing Scopes").

Thank you Bas for this excellent answer. Much appreciated.

-- Andreas Lundblad

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



Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Bas Gooren

Hi Andreas,

When your validator fails, you remain on the FormPage. A quick debug 
session shows me that the injected IService remains the same accross 
requests.
The fix for your problem is simple, and a best practice anyway: inject 
Provider in your service.


It's a best practice since the service does not know the "scope" of the 
entitymanager, all it knows is that the entitymanager has a different 
lifecycle; Your service may be instantiated and kept around for the time 
your app is running, but could also be instantiated on the fly when needed.
That's one of the reasons why Provider<> was invented: if the scope is 
different, a provider allows you to nicely deal with it.


In case you are not familiar with providers: it has no negative 
side-effects in terms of performance.
The guice-persist module binds the EntityManager per request, so all 
calls to Provider while in the same request will yield 
the exact same EntityManager instance.


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 22:03, schreef Andreas Lundblad:

On Thu, Jun 27, 2013 at 3:59 PM, Bas Gooren  wrote:

I'm not the one who posed the original question.

Andreas, like I said: please show us some code, and we can help you pinpoint
your issue.


Thanks for all the rapid help!

I've created a minimal page that shows the error. Basically no
difference from the original code (
http://github.com/javadev/wicket-guice-demo )

To reproduce:

1. Download and unzip http://aoeu.se/www/wicketguice-problem.zip
2. mvn jetty:run
3. Go to localhost:9090, then go to "Form page"
4. Try to submit "gavin"
5. Try to submit "gavin" again.

This results in the 'EntityManager is closed' exception. No idea how
to solve this. If it's unsolvable, I'll look into the Provider
approach, but it would be really nice to manage without it.

best regards,
Andreas Lundblad

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





Re: Chrome Calling Pages Twice Issue?

2013-06-27 Thread dhongyt
Yeah I have seen that post about that issue, but I don't use any img. Most of
my pictures are div and the image is called in the CSS.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Chrome-Calling-Pages-Twice-Issue-tp4659839p4659879.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: What is the purpose of Validatable.model?

2013-06-27 Thread Marios Skounakis
Thank you both for your answers.

I wonder what would be best if you want to use the same validation
framework in multiple scenarios. I have a domain object that can be updated
either by a wicket form or by uploading an excel file. I want to have the
same validation logic. Would it be best to use an external validation
component (e.g. beans validation or spring validation) or would it be best
to write some custom code to use wicket validators outside a wicket form?
Do you have any thoughts on this?



On Wed, Jun 26, 2013 at 10:34 AM, Martin Grigorov wrote:

> Hi,
>
> Additionally the validatable's model brings the form component model - this
> is the current value. The validatable's value is the next value. You can
> use them like in a state machine - you can move to a new state/value only
> from some of the other states/values, but not from all.
>
>
> On Wed, Jun 26, 2013 at 8:10 AM, Igor Vaynberg  >wrote:
>
> > this method is useful for validators that integrate with other
> > frameworks. take for example bean-validation framework.
> >
> > a bean validation validator can call getModel(), get the model, cast
> > it to IPropertyReflectionAwareModel, get the property, and retrieve
> > validation annotations associated with it.
> >
> > -igor
> >
> >
> > On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis 
> > wrote:
> > > Hi all,
> > >
> > > What is the purpose of Validatable.model?
> > >
> > > I don't seem to be able to find any usages of Validatable.getModel(),
> > > setModel() or model...
> > >
> > > Thanks
> > > Marios
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Andreas Lundblad
On Thu, Jun 27, 2013 at 3:59 PM, Bas Gooren  wrote:
> I'm not the one who posed the original question.
>
> Andreas, like I said: please show us some code, and we can help you pinpoint
> your issue.


Thanks for all the rapid help!

I've created a minimal page that shows the error. Basically no
difference from the original code (
http://github.com/javadev/wicket-guice-demo )

To reproduce:

1. Download and unzip http://aoeu.se/www/wicketguice-problem.zip
2. mvn jetty:run
3. Go to localhost:9090, then go to "Form page"
4. Try to submit "gavin"
5. Try to submit "gavin" again.

This results in the 'EntityManager is closed' exception. No idea how
to solve this. If it's unsolvable, I'll look into the Provider
approach, but it would be really nice to manage without it.

best regards,
Andreas Lundblad

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



Re: A Wicket in Ruby

2013-06-27 Thread Martin Grigorov
On Thu, Jun 27, 2013 at 6:48 PM, Michael Pence  wrote:

> So when you need to add background jobs, message queues, user
> authentication and such, do you just grab your favorite java libraries for
> those kinds of things?
>

Yes. Often they provide much more functionality than what is in the JEE
stack.
I prefer Spring Framework than JEE. It provides integrations for almost
anything and is much more portable than JEE implementations.


>
>
> On Jun 27, 2013, at 11:34 AM, Martin Grigorov 
> wrote:
>
> > On Thu, Jun 27, 2013 at 6:29 PM, Mike Pence 
> wrote:
> >
> >> Forgive my newbie questions, but what is Fodel?
> >>
> >
> >
> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/scala-extensions-parent/wicket-scala/src/main/scala/org/wicketstuff/scala/Fodel.scala?source=cc
> >
> >
> >>
> >> Is JBoss the most promising app server to build on? I have always felt
> like
> >> any sufficiently advanced Rails app is indistinguishable from an ad-hoc
> >> reinvention of a poorly spec'ed Java app server...
> >>
> >
> > I'd prefer Jetty/Tomcat than Java EE application server.
> >
> >
> >>
> >>
> >> On Thu, Jun 27, 2013 at 5:18 AM, Peter Henderson <
> >> peter.hender...@starjar.com> wrote:
> >>
> >>> I've found the combination of Wicket + Scala to be very productive.
> >>>
> >>> Just make sure you use Fodel from Wicketstuff
> >>>
> >>>
> >>> When things get tricky, simply reduce the problem down to a java quick
> >>> start and proceed as usual.
> >>> I find that 99% of the time making a quick start solves the problem,
> >> when I
> >>> realize what I'm doing wrong.
> >>>
> >>> Peter.
> >>>
> >>>
> >>>
> >>> On 26 June 2013 17:28, Michael Pence  wrote:
> >>>
>  Scala is even more expressive and powerful than Ruby, so Scala +
> Wicket
> >>> is
>  definitely my dream stack. I am just nervous about not having a big
> >> peer
>  support community when things get tricky.
> 
>  On Jun 25, 2013, at 11:20 PM, Colin Rogers <
>  colin.rog...@objectconsulting.com.au> wrote:
> 
> > Mike,
> >
> > Java is still pretty verbose, for all 'recent' improvements - I don't
>  think that will really ever change, but then I don't see that as an
> >>> issue.
>  My personal style of coding is to write simple, obvious, testable, but
>  ultimately verbose, code. Code that anyone can read, and understand
> >> what
>  and why I'm attempting something - with the absolute minimum of
> >> comments.
>  But that's just me! :)
> >
> > I've never understood writing one line of code, that takes five lines
> >>> of
>  comments to fully explain what and why it's attempting, when you could
>  write 3 lines of code with no comments - and would be significantly
> >>> easier
>  to modify or extend later.
> >
> > When I was younger, and monitors smaller and lines constrained, I too
>  loved ramming as much functionality into the smallest of visual spaces
> >> in
>  code, but now I love tons of white space and simple, clean code.
> >
> > It's all about scroll wheels and big monitors! :)
> >
> > ... and Wicket and the super-fast modern JVMs... and t's still
> >> quicker
>  and easier and ultimately less verbose to do something in Wicket/Java,
> >>> than
>  pretty much any other Web framework, IMHO - regardless of Java as a
>  language.
> >
> > You could try Scala with Wicket, or Groovy with Wicket - both are
> >>> native
>  JVM languages - would these give you greater benefits to your style?
> >
> > Cheers,
> > Col.
> >
> > -Original Message-
> > From: Mike Pence [mailto:mike.pe...@gmail.com]
> > Sent: 26 June 2013 06:48
> > To: users@wicket.apache.org
> > Subject: Re: A Wicket in Ruby
> >
> > That is a good question that I have been mulling over these last few
>  says.
> > I think that I need to suck it up and just re-familiarize with Java
> >> --
>  it is less verbose, with annotations and closures now, right? -- for
> >> all
> >>> of
>  the benefits that the JVM with Wicket will bring me. I got a bit
> >> spoiled
> >>> by
>  years of Ruby, but man, do you pay for that lack of compile-time
> >> checking
>  and type safety over and over again -- especially with regard to
>  performance and endlessly climbing stack traces over typos.
> >
> >
> > On Sun, Jun 23, 2013 at 8:25 PM, Colin Rogers <
>  colin.rog...@objectconsulting.com.au> wrote:
> >
> >> Mike,
> >>
> >> I hate to be the old cynic and doomsayer, but generally I find that
> >> whenever a two programming technologies are 'crossed' over, with the
> >> idea that you'll get the advantages of both - the exact opposite
> >> occurs and actually you end up with a technology that only has the
> >> disadvantages of both and the advantages of neither.
> >>
> >> After all, Wicket in Java works really well... how would ruby
> >> improve
> >>>

Re: wicket wiki down?

2013-06-27 Thread Martijn Dashorst
This is not the (or a) new wiki. This has been the wiki since we
joined Apache. We were obligated to use an export of the wiki (which
is a java process that is often broken) and link to the static files.
Since a couple of upgrades the export doesn't work anymore, and now
the static content has been removed.

Somehow we are not allowed to link to the pages inside the confluence
instance by rule of infrastructure (as a popular link could bring the
confluence instance down), so we are left with the current situation:
a half arsed wiki.

As we also don't have direct access to those folders, we are unable to
put in anything warning like. Until infrastructure hands us something
workable, we can only hope that google correctly indexes the
confluence instance and replaces all old references with the
confluence URLs

Martijn

On Thu, Jun 27, 2013 at 8:19 PM, Gabriel Landon  wrote:
> Yes I did reach this "404" page with a Google search.
> Yes it would be nice to have a redirect to the new wiki or at least a
> warning message.
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/wicket-wiki-down-tp4659747p4659873.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
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: wicket wiki down?

2013-06-27 Thread Gabriel Landon
Yes I did reach this "404" page with a Google search.
Yes it would be nice to have a redirect to the new wiki or at least a
warning message.



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

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



Re: Select AjaxCheckbox from Another AjaxCheckbox inside ListView

2013-06-27 Thread eugenebalt
I found a solution, but I'm not sure it's the best/most elegant one, there is
a lot of messy code.

Upon selecting a certain AjaxCheckbox A in a ListView, I had to 
1) disable AjaxCheckbox B
2) set its value to TRUE

and conversely, upon deselecting A, I had to (1) enable B and (2) set its
value to FALSE.

First of all, I got the Enable/Disable to work by overriding the
AjaxCheckbox's isEnabled. But in order to make that work, I had to use 2
flags. The first flag holds the current value of A, and the second flag
shows that clicking has begun. These are the flags "Clicked" and "Selected",
and they get updated on onUpdate().

// override isEnabled
public boolean isEnabled() {
if (bean.getKey().equals(DELETEOWN)
&& eNotesMgrClicked)
{
if (eNotesMgrSelected)
return false;
else
return true;
}
else
return super.isEnabled(); 
}

// set the flag that Checkbox A has been clicked and selected/de-selected
@Override
protected void onUpdate(AjaxRequestTarget arg0) {
   if (bean.getKey().equals(ADMIN))
   {
 eNotesMgrClicked = true;

 if (getModelObject())  

   eNotesMgrSelected = true;
else
   eNotesMgrSelected = false
   }
arg0.addComponent(checkboxDeleteOwn);
}
}

The 2nd issue, actually checking/unchecking the checkbox, was more
difficult. I had to actually save a reference to the AjaxCheckbox I want to
select/de-select. To save it, I overrode onBeforeRender(), and if it was the
right checkbox B, I saved its reference in a variable. Then, I could
reference it in onUpdate() and set its model object.

My questions:
1) I also wanted to do the setEnabled(true)/setEnabled(false) on Checkbox B,
now that I have its reference, as part  of onUpdate, but that does NOT work.
Can anyone tell me why this Enable/Disable doesn't work:

if (getModelObject())
{   
  eNotesMgrSelected = true;
  checkboxDeleteOwn.setEnabled(false);
  checkboxDeleteOwn.setModelObject(true);
}
else
{
  eNotesMgrSelected = false;
  checkboxDeleteOwn.setEnabled(true);
  checkboxDeleteOwn.setModelObject(false);
}

The setModelObject works on my saved-reference checkboxDeleteOwn, but
setEnabled() does NOT work.

2) This code is pretty messy, is there any better way to disable and set
individual AjaxCheckboxes based on the action of another AjaxCheckbox?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Select-AjaxCheckbox-from-Another-AjaxCheckbox-inside-ListView-tp4659829p4659872.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket wiki down?

2013-06-27 Thread Niranjan Rao
While I agree with searching mailing list or searching web first, from 
most users perspective, if you google for information before bothering 
others, you end up on old pages and then links are broken. For example 
just google wicket framework documentation. First link shows up in 
google is https://cwiki.apache.org/WICKET/framework-documentation.html 
and any links from there on are broken.


Can we set automatic redirect or at least text in big red color to move 
to new pages. Not expert in wiki syntax, but I am sure something can be 
achieved at server level or by page macros.


Regards,

Niranjan

On 06/24/2013 12:05 PM, Paul Bors wrote:

Last Sat someone noticed this and was asked to:

Use https://cwiki.apache.org/confluence/display/WICKET

Try searching the mailing list prior to posting.

~ Thank you,
   Paul Bors

-Original Message-
From: Gabriel Landon [mailto:glan...@piti.pf]
Sent: Monday, June 24, 2013 1:52 PM
To: users@wicket.apache.org
Subject: wicket wiki down?


Hi,

I've got a 404 when I try to go to wicket wiki :

https://cwiki.apache.org/WICKET/migration-to-wicket-60.html

The homepage is working but not the other pages...

Regards,

Gabriel.



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/wicket-wiki-down-tp4659747.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



-
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



Unusual Serialization issue

2013-06-27 Thread Michael Chandler
I'm getting a serialization error when I shutdown Tomcat that has me confused.

java.io.NotSerializableException: 
com.oa.frontoffice.service.AuthenticationService

I experienced quite a bit of this at first before learning that Wicket 
serializes quite heavily, but gained a more thorough understanding of models 
and wrap my business objects in a LoadableDetachableModel like this:

private boolean authenticate() {
LoadableDetachableModel service = new 
LoadableDetachableModel() {

private static final long serialVersionUID = 1L;

@Override
protected AuthenticationService load() {
return new 
AuthenticationService();
}

};

authMessage = service.getObject().authenticate(username, 
password);

if (authMessage != "SUCCESS") {
return false;
}

return true;
}

Nevertheless, invoking my custom authenticate() method above seems to trigger 
this serialization exception upon shut down and I'm unsure as to why that is.  
The AuthenticationService class itself makes no references to any other classes 
so I don't know the root cause of this issue.  If anyone has any advice on 
where I might need to look, I would greatly appreciate the assistance.

Mike Chandler



Re: A Wicket in Ruby

2013-06-27 Thread Michael Pence
So when you need to add background jobs, message queues, user authentication 
and such, do you just grab your favorite java libraries for those kinds of 
things?


On Jun 27, 2013, at 11:34 AM, Martin Grigorov  wrote:

> On Thu, Jun 27, 2013 at 6:29 PM, Mike Pence  wrote:
> 
>> Forgive my newbie questions, but what is Fodel?
>> 
> 
> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/scala-extensions-parent/wicket-scala/src/main/scala/org/wicketstuff/scala/Fodel.scala?source=cc
> 
> 
>> 
>> Is JBoss the most promising app server to build on? I have always felt like
>> any sufficiently advanced Rails app is indistinguishable from an ad-hoc
>> reinvention of a poorly spec'ed Java app server...
>> 
> 
> I'd prefer Jetty/Tomcat than Java EE application server.
> 
> 
>> 
>> 
>> On Thu, Jun 27, 2013 at 5:18 AM, Peter Henderson <
>> peter.hender...@starjar.com> wrote:
>> 
>>> I've found the combination of Wicket + Scala to be very productive.
>>> 
>>> Just make sure you use Fodel from Wicketstuff
>>> 
>>> 
>>> When things get tricky, simply reduce the problem down to a java quick
>>> start and proceed as usual.
>>> I find that 99% of the time making a quick start solves the problem,
>> when I
>>> realize what I'm doing wrong.
>>> 
>>> Peter.
>>> 
>>> 
>>> 
>>> On 26 June 2013 17:28, Michael Pence  wrote:
>>> 
 Scala is even more expressive and powerful than Ruby, so Scala + Wicket
>>> is
 definitely my dream stack. I am just nervous about not having a big
>> peer
 support community when things get tricky.
 
 On Jun 25, 2013, at 11:20 PM, Colin Rogers <
 colin.rog...@objectconsulting.com.au> wrote:
 
> Mike,
> 
> Java is still pretty verbose, for all 'recent' improvements - I don't
 think that will really ever change, but then I don't see that as an
>>> issue.
 My personal style of coding is to write simple, obvious, testable, but
 ultimately verbose, code. Code that anyone can read, and understand
>> what
 and why I'm attempting something - with the absolute minimum of
>> comments.
 But that's just me! :)
> 
> I've never understood writing one line of code, that takes five lines
>>> of
 comments to fully explain what and why it's attempting, when you could
 write 3 lines of code with no comments - and would be significantly
>>> easier
 to modify or extend later.
> 
> When I was younger, and monitors smaller and lines constrained, I too
 loved ramming as much functionality into the smallest of visual spaces
>> in
 code, but now I love tons of white space and simple, clean code.
> 
> It's all about scroll wheels and big monitors! :)
> 
> ... and Wicket and the super-fast modern JVMs... and t's still
>> quicker
 and easier and ultimately less verbose to do something in Wicket/Java,
>>> than
 pretty much any other Web framework, IMHO - regardless of Java as a
 language.
> 
> You could try Scala with Wicket, or Groovy with Wicket - both are
>>> native
 JVM languages - would these give you greater benefits to your style?
> 
> Cheers,
> Col.
> 
> -Original Message-
> From: Mike Pence [mailto:mike.pe...@gmail.com]
> Sent: 26 June 2013 06:48
> To: users@wicket.apache.org
> Subject: Re: A Wicket in Ruby
> 
> That is a good question that I have been mulling over these last few
 says.
> I think that I need to suck it up and just re-familiarize with Java
>> --
 it is less verbose, with annotations and closures now, right? -- for
>> all
>>> of
 the benefits that the JVM with Wicket will bring me. I got a bit
>> spoiled
>>> by
 years of Ruby, but man, do you pay for that lack of compile-time
>> checking
 and type safety over and over again -- especially with regard to
 performance and endlessly climbing stack traces over typos.
> 
> 
> On Sun, Jun 23, 2013 at 8:25 PM, Colin Rogers <
 colin.rog...@objectconsulting.com.au> wrote:
> 
>> Mike,
>> 
>> I hate to be the old cynic and doomsayer, but generally I find that
>> whenever a two programming technologies are 'crossed' over, with the
>> idea that you'll get the advantages of both - the exact opposite
>> occurs and actually you end up with a technology that only has the
>> disadvantages of both and the advantages of neither.
>> 
>> After all, Wicket in Java works really well... how would ruby
>> improve
>> it over Java? Or Scala in the JVM? Or Groovy on the JVM?
>> 
>> Like I said - sorry - I don't wish to negative, but it seems like a
>> thankless task awaits you! :)
>> 
>> Cheers,
>> Col.
>> 
>> -Original Message-
>> From: Mike Pence [mailto:mike.pe...@gmail.com]
>> Sent: 22 June 2013 02:21
>> To: users@wicket.apache.org
>> Subject: A Wicket in Ruby
>> 
>> So I have this crazy idea to try to write some subset of Wicket
>> using
>>>

Re: A Wicket in Ruby

2013-06-27 Thread Martin Grigorov
On Thu, Jun 27, 2013 at 6:29 PM, Mike Pence  wrote:

> Forgive my newbie questions, but what is Fodel?
>

https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/scala-extensions-parent/wicket-scala/src/main/scala/org/wicketstuff/scala/Fodel.scala?source=cc


>
> Is JBoss the most promising app server to build on? I have always felt like
> any sufficiently advanced Rails app is indistinguishable from an ad-hoc
> reinvention of a poorly spec'ed Java app server...
>

I'd prefer Jetty/Tomcat than Java EE application server.


>
>
> On Thu, Jun 27, 2013 at 5:18 AM, Peter Henderson <
> peter.hender...@starjar.com> wrote:
>
> > I've found the combination of Wicket + Scala to be very productive.
> >
> > Just make sure you use Fodel from Wicketstuff
> >
> >
> > When things get tricky, simply reduce the problem down to a java quick
> > start and proceed as usual.
> > I find that 99% of the time making a quick start solves the problem,
> when I
> > realize what I'm doing wrong.
> >
> > Peter.
> >
> >
> >
> > On 26 June 2013 17:28, Michael Pence  wrote:
> >
> > > Scala is even more expressive and powerful than Ruby, so Scala + Wicket
> > is
> > > definitely my dream stack. I am just nervous about not having a big
> peer
> > > support community when things get tricky.
> > >
> > > On Jun 25, 2013, at 11:20 PM, Colin Rogers <
> > > colin.rog...@objectconsulting.com.au> wrote:
> > >
> > > > Mike,
> > > >
> > > > Java is still pretty verbose, for all 'recent' improvements - I don't
> > > think that will really ever change, but then I don't see that as an
> > issue.
> > > My personal style of coding is to write simple, obvious, testable, but
> > > ultimately verbose, code. Code that anyone can read, and understand
> what
> > > and why I'm attempting something - with the absolute minimum of
> comments.
> > > But that's just me! :)
> > > >
> > > > I've never understood writing one line of code, that takes five lines
> > of
> > > comments to fully explain what and why it's attempting, when you could
> > > write 3 lines of code with no comments - and would be significantly
> > easier
> > > to modify or extend later.
> > > >
> > > > When I was younger, and monitors smaller and lines constrained, I too
> > > loved ramming as much functionality into the smallest of visual spaces
> in
> > > code, but now I love tons of white space and simple, clean code.
> > > >
> > > > It's all about scroll wheels and big monitors! :)
> > > >
> > > > ... and Wicket and the super-fast modern JVMs... and t's still
> quicker
> > > and easier and ultimately less verbose to do something in Wicket/Java,
> > than
> > > pretty much any other Web framework, IMHO - regardless of Java as a
> > > language.
> > > >
> > > > You could try Scala with Wicket, or Groovy with Wicket - both are
> > native
> > > JVM languages - would these give you greater benefits to your style?
> > > >
> > > > Cheers,
> > > > Col.
> > > >
> > > > -Original Message-
> > > > From: Mike Pence [mailto:mike.pe...@gmail.com]
> > > > Sent: 26 June 2013 06:48
> > > > To: users@wicket.apache.org
> > > > Subject: Re: A Wicket in Ruby
> > > >
> > > > That is a good question that I have been mulling over these last few
> > > says.
> > > > I think that I need to suck it up and just re-familiarize with Java
> --
> > > it is less verbose, with annotations and closures now, right? -- for
> all
> > of
> > > the benefits that the JVM with Wicket will bring me. I got a bit
> spoiled
> > by
> > > years of Ruby, but man, do you pay for that lack of compile-time
> checking
> > > and type safety over and over again -- especially with regard to
> > > performance and endlessly climbing stack traces over typos.
> > > >
> > > >
> > > > On Sun, Jun 23, 2013 at 8:25 PM, Colin Rogers <
> > > colin.rog...@objectconsulting.com.au> wrote:
> > > >
> > > >> Mike,
> > > >>
> > > >> I hate to be the old cynic and doomsayer, but generally I find that
> > > >> whenever a two programming technologies are 'crossed' over, with the
> > > >> idea that you'll get the advantages of both - the exact opposite
> > > >> occurs and actually you end up with a technology that only has the
> > > >> disadvantages of both and the advantages of neither.
> > > >>
> > > >> After all, Wicket in Java works really well... how would ruby
> improve
> > > >> it over Java? Or Scala in the JVM? Or Groovy on the JVM?
> > > >>
> > > >> Like I said - sorry - I don't wish to negative, but it seems like a
> > > >> thankless task awaits you! :)
> > > >>
> > > >> Cheers,
> > > >> Col.
> > > >>
> > > >> -Original Message-
> > > >> From: Mike Pence [mailto:mike.pe...@gmail.com]
> > > >> Sent: 22 June 2013 02:21
> > > >> To: users@wicket.apache.org
> > > >> Subject: A Wicket in Ruby
> > > >>
> > > >> So I have this crazy idea to try to write some subset of Wicket
> using
> > > >> CRuby and the variety of technologies it employs (EventMachine,
> etc.)
> > > >>
> > > >> Hard to know where to start though, or how best to form a mental
> 

Re: A Wicket in Ruby

2013-06-27 Thread Mike Pence
Forgive my newbie questions, but what is Fodel?

Is JBoss the most promising app server to build on? I have always felt like
any sufficiently advanced Rails app is indistinguishable from an ad-hoc
reinvention of a poorly spec'ed Java app server...


On Thu, Jun 27, 2013 at 5:18 AM, Peter Henderson <
peter.hender...@starjar.com> wrote:

> I've found the combination of Wicket + Scala to be very productive.
>
> Just make sure you use Fodel from Wicketstuff
>
>
> When things get tricky, simply reduce the problem down to a java quick
> start and proceed as usual.
> I find that 99% of the time making a quick start solves the problem, when I
> realize what I'm doing wrong.
>
> Peter.
>
>
>
> On 26 June 2013 17:28, Michael Pence  wrote:
>
> > Scala is even more expressive and powerful than Ruby, so Scala + Wicket
> is
> > definitely my dream stack. I am just nervous about not having a big peer
> > support community when things get tricky.
> >
> > On Jun 25, 2013, at 11:20 PM, Colin Rogers <
> > colin.rog...@objectconsulting.com.au> wrote:
> >
> > > Mike,
> > >
> > > Java is still pretty verbose, for all 'recent' improvements - I don't
> > think that will really ever change, but then I don't see that as an
> issue.
> > My personal style of coding is to write simple, obvious, testable, but
> > ultimately verbose, code. Code that anyone can read, and understand what
> > and why I'm attempting something - with the absolute minimum of comments.
> > But that's just me! :)
> > >
> > > I've never understood writing one line of code, that takes five lines
> of
> > comments to fully explain what and why it's attempting, when you could
> > write 3 lines of code with no comments - and would be significantly
> easier
> > to modify or extend later.
> > >
> > > When I was younger, and monitors smaller and lines constrained, I too
> > loved ramming as much functionality into the smallest of visual spaces in
> > code, but now I love tons of white space and simple, clean code.
> > >
> > > It's all about scroll wheels and big monitors! :)
> > >
> > > ... and Wicket and the super-fast modern JVMs... and t's still quicker
> > and easier and ultimately less verbose to do something in Wicket/Java,
> than
> > pretty much any other Web framework, IMHO - regardless of Java as a
> > language.
> > >
> > > You could try Scala with Wicket, or Groovy with Wicket - both are
> native
> > JVM languages - would these give you greater benefits to your style?
> > >
> > > Cheers,
> > > Col.
> > >
> > > -Original Message-
> > > From: Mike Pence [mailto:mike.pe...@gmail.com]
> > > Sent: 26 June 2013 06:48
> > > To: users@wicket.apache.org
> > > Subject: Re: A Wicket in Ruby
> > >
> > > That is a good question that I have been mulling over these last few
> > says.
> > > I think that I need to suck it up and just re-familiarize with Java --
> > it is less verbose, with annotations and closures now, right? -- for all
> of
> > the benefits that the JVM with Wicket will bring me. I got a bit spoiled
> by
> > years of Ruby, but man, do you pay for that lack of compile-time checking
> > and type safety over and over again -- especially with regard to
> > performance and endlessly climbing stack traces over typos.
> > >
> > >
> > > On Sun, Jun 23, 2013 at 8:25 PM, Colin Rogers <
> > colin.rog...@objectconsulting.com.au> wrote:
> > >
> > >> Mike,
> > >>
> > >> I hate to be the old cynic and doomsayer, but generally I find that
> > >> whenever a two programming technologies are 'crossed' over, with the
> > >> idea that you'll get the advantages of both - the exact opposite
> > >> occurs and actually you end up with a technology that only has the
> > >> disadvantages of both and the advantages of neither.
> > >>
> > >> After all, Wicket in Java works really well... how would ruby improve
> > >> it over Java? Or Scala in the JVM? Or Groovy on the JVM?
> > >>
> > >> Like I said - sorry - I don't wish to negative, but it seems like a
> > >> thankless task awaits you! :)
> > >>
> > >> Cheers,
> > >> Col.
> > >>
> > >> -Original Message-
> > >> From: Mike Pence [mailto:mike.pe...@gmail.com]
> > >> Sent: 22 June 2013 02:21
> > >> To: users@wicket.apache.org
> > >> Subject: A Wicket in Ruby
> > >>
> > >> So I have this crazy idea to try to write some subset of Wicket using
> > >> CRuby and the variety of technologies it employs (EventMachine, etc.)
> > >>
> > >> Hard to know where to start though, or how best to form a mental model
> > >> of what Wicket does vs. doing a straight class-to-class conversion.
> > >> Maybe there is a test suite in the wicket source I should consider. Of
> > >> course, there is nothing like stepping through the code to understand
> > >> the lifecyle of a wicket request (and to see how it persists session
> > data, especially).
> > >>
> > >> Am I crazy?
> > >> EMAIL DISCLAIMER This email message and its attachments are
> > >> confidential and may also contain copyright or privileged material. If
> > >> you are not the intended r

Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Bas Gooren

I'm not the one who posed the original question.

Andreas, like I said: please show us some code, and we can help you 
pinpoint your issue.
In case your service is being serialized, a quick fix is to inject a 
Provider instead of an EntityManager.


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 14:25, schreef Martin Grigorov:

Here are some discussions:
http://stackoverflow.com/questions/10431640/guice-persist-attempting-to-execute-an-operation-on-a-closed-entitymanager
http://stackoverflow.com/questions/14585505/jpa-guice-persist-permanently-opened-connection-issue


On Thu, Jun 27, 2013 at 3:20 PM, Bas Gooren  wrote:


I agree; Since the EntityManager is bound to the request (scope), it's
usually better to inject Provider

However, in the demo project the service is not a singleton, so it should
be fine. A new instance of the service is created for every injection.


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 9:10, schreef Martin Grigorov:


Hi,

I'm not sure whether this is the best solution but you can inject a
Provider:

@Inject
private Provider em;

...

em.get().find(...);


On Thu, Jun 27, 2013 at 9:36 AM, Bas Gooren  wrote:

  Hi,

Looking at the github project you refer to, it should work.
The GuiceComponentInjector which is set-up in the wicket application
injects proxies. That means that when your form is submitted (and a
second
request is made), a new service instance is created.

So if it's not working for you, there is probably another problem with
your code.
Can you show us some relevant parts of your code, e.g. the validator and
the page which contains the validator?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 26-6-2013 22:32, schreef Andreas Lundblad:

   I've just started using Wicket (I'm half way through Wicket in Action).


I've run into the following problem with a user registration form: In
order to make sure that the provided e-mail is not already registered
I've written a "UniqueEmailValidator" which I attach to the email
field. This validator needs access to the DB-service to query the
database for already registered email-adresses.

The problem is that the DB-service is injected when the registration
page is created and since I'm using open-session-in-view, the
DB-service EntityManager is closed after the page is rendered. This
causes an

 IllegalStateException: EntityManager is closed

once the form is submitted in a subsequent request. (Since the same
old DB-service object is used in the second request.)


(I had the same problem when trying to inject the DB-service in the
session-object. The same DB-service object was used in multiple
requests causing the IllegalStateException.)


I figured this must be a fairly common problem but can't for my life
find any solutions in the archives or through googling. I'm curious
what the best practice is to solve this.


(My project builds upon the code available here:
http://github.com/javadev/wicket-guice-demo


)


best regards, Andreas Lundblad

--**
--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org

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







Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Martin Grigorov
Here are some discussions:
http://stackoverflow.com/questions/10431640/guice-persist-attempting-to-execute-an-operation-on-a-closed-entitymanager
http://stackoverflow.com/questions/14585505/jpa-guice-persist-permanently-opened-connection-issue


On Thu, Jun 27, 2013 at 3:20 PM, Bas Gooren  wrote:

> I agree; Since the EntityManager is bound to the request (scope), it's
> usually better to inject Provider
>
> However, in the demo project the service is not a singleton, so it should
> be fine. A new instance of the service is created for every injection.
>
>
> Met vriendelijke groet,
> Kind regards,
>
> Bas Gooren
>
> Op 27-6-2013 9:10, schreef Martin Grigorov:
>
>> Hi,
>>
>> I'm not sure whether this is the best solution but you can inject a
>> Provider:
>>
>> @Inject
>> private Provider em;
>>
>> ...
>>
>> em.get().find(...);
>>
>>
>> On Thu, Jun 27, 2013 at 9:36 AM, Bas Gooren  wrote:
>>
>>  Hi,
>>>
>>> Looking at the github project you refer to, it should work.
>>> The GuiceComponentInjector which is set-up in the wicket application
>>> injects proxies. That means that when your form is submitted (and a
>>> second
>>> request is made), a new service instance is created.
>>>
>>> So if it's not working for you, there is probably another problem with
>>> your code.
>>> Can you show us some relevant parts of your code, e.g. the validator and
>>> the page which contains the validator?
>>>
>>> Met vriendelijke groet,
>>> Kind regards,
>>>
>>> Bas Gooren
>>>
>>> Op 26-6-2013 22:32, schreef Andreas Lundblad:
>>>
>>>   I've just started using Wicket (I'm half way through Wicket in Action).
>>>
 I've run into the following problem with a user registration form: In
 order to make sure that the provided e-mail is not already registered
 I've written a "UniqueEmailValidator" which I attach to the email
 field. This validator needs access to the DB-service to query the
 database for already registered email-adresses.

 The problem is that the DB-service is injected when the registration
 page is created and since I'm using open-session-in-view, the
 DB-service EntityManager is closed after the page is rendered. This
 causes an

 IllegalStateException: EntityManager is closed

 once the form is submitted in a subsequent request. (Since the same
 old DB-service object is used in the second request.)


 (I had the same problem when trying to inject the DB-service in the
 session-object. The same DB-service object was used in multiple
 requests causing the IllegalStateException.)


 I figured this must be a fairly common problem but can't for my life
 find any solutions in the archives or through googling. I'm curious
 what the best practice is to solve this.


 (My project builds upon the code available here:
 http://github.com/javadev/wicket-guice-demo
 
 >)


 best regards, Andreas Lundblad

 --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apa**che.org
 
 >

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



>


Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Bas Gooren
I agree; Since the EntityManager is bound to the request (scope), it's 
usually better to inject Provider


However, in the demo project the service is not a singleton, so it 
should be fine. A new instance of the service is created for every 
injection.


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 27-6-2013 9:10, schreef Martin Grigorov:

Hi,

I'm not sure whether this is the best solution but you can inject a
Provider:

@Inject
private Provider em;

...

em.get().find(...);


On Thu, Jun 27, 2013 at 9:36 AM, Bas Gooren  wrote:


Hi,

Looking at the github project you refer to, it should work.
The GuiceComponentInjector which is set-up in the wicket application
injects proxies. That means that when your form is submitted (and a second
request is made), a new service instance is created.

So if it's not working for you, there is probably another problem with
your code.
Can you show us some relevant parts of your code, e.g. the validator and
the page which contains the validator?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 26-6-2013 22:32, schreef Andreas Lundblad:

  I've just started using Wicket (I'm half way through Wicket in Action).

I've run into the following problem with a user registration form: In
order to make sure that the provided e-mail is not already registered
I've written a "UniqueEmailValidator" which I attach to the email
field. This validator needs access to the DB-service to query the
database for already registered email-adresses.

The problem is that the DB-service is injected when the registration
page is created and since I'm using open-session-in-view, the
DB-service EntityManager is closed after the page is rendered. This
causes an

IllegalStateException: EntityManager is closed

once the form is submitted in a subsequent request. (Since the same
old DB-service object is used in the second request.)


(I had the same problem when trying to inject the DB-service in the
session-object. The same DB-service object was used in multiple
requests causing the IllegalStateException.)


I figured this must be a fairly common problem but can't for my life
find any solutions in the archives or through googling. I'm curious
what the best practice is to solve this.


(My project builds upon the code available here:
http://github.com/javadev/**wicket-guice-demo)


best regards, Andreas Lundblad

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






RE: Graying Out Disabled Buttons/Controls

2013-06-27 Thread Richard W. Adams
I have egg on my face. After delving into this more deeply, I discovered 
our corporate framework "helpfully" removes disabled buttons before they 
get to the browser. Don't agree with the approach, but it is what it is. 

(slinks away with tail between legs...)




From:   Paul Bors 
To: 
Date:   06/26/2013 11:18 AM
Subject:RE: Graying Out Disabled Buttons/Controls



Create a quick-start attach it to your e-mail and we'll look it over.
Feel free to use drop box or some other file sharing server.

You're doing something wrong...

~ Thank you,
  Paul Bors

-Original Message-
From: Richard W. Adams [mailto:rwada...@up.com] 
Sent: Wednesday, June 26, 2013 11:41 AM
To: users@wicket.apache.org
Subject: RE: Graying Out Disabled Buttons/Controls

Wow. Now it gets even stranger. I modified the code as follows:

public DisabledButtonPage() {

final Form form = new Form("myForm");
add(form);

final Button enabledButton = new Button("enabled-button");
boolean visible = enabledButton.isVisibleInHierarchy();
System.out.printf("Enabled button visible? %s%n", visible ? "Yes" 
: "No");
System.out.printf("Enabled button's ID: %s%n",
enabledButton.getMarkupId());

final Button disabledButton = createDisabledButton();
visible = disabledButton.isVisibleInHierarchy();
System.out.printf("Disabled button visible? %s%n", visible ? "Yes" 

: "No");
System.out.printf("Disabled button's ID: %s%n",
disabledButton.getMarkupId());

form.add(enabledButton);
form.add(disabledButton);
}
private Button createDisabledButton() {

final Button button = new Button("disabled-button") ;
button.setVisibilityAllowed(true);
button.setVisible(true);
button.setEnabled(false);
return button;
}

Strangely, the output says:

Enabled button visible? Yes
Enabled button's ID: id5
Disabled button visible? Yes
Disabled button's ID: id6

But the generated HTML (snippet below) does NOT show the disabled button; 
it
SHOULD be right after the enabled button

 http://wicket.apache.org";>Enabled Button






From:   Paul Bors 
To: 
Date:   06/26/2013 09:48 AM
Subject:RE: Graying Out Disabled Buttons/Controls



Button -> FormComponent -> WebMarkupContainer -> WebMarkupContainer ->
MarkupContainer -> Component

Inside Component:
  /**
  * Gets whether this component and any children are
visible.
  * 
  * WARNING: this method can be called multiple times 
during
a request. If you override this
  * method, it is a good idea to keep it cheap in terms of
processing. Alternatively, you can
  * call {@link #setVisible(boolean)}.
  * 
  * 
  * @return True if component and any children are visible
  */
 public boolean isVisible()
 {
 return getFlag(FLAG_VISIBLE);
 }

So calling isVisible() on any component would only report the current 
state
for the visible flag but not that of the parent.
Try calling isVisibleInHierarchy() instead:

  /**
  * Checks if the component itself and all its parents are
visible.
  * 
  * @return true if the component and all its parents are
visible.
  */
 public final boolean isVisibleInHierarchy()
 {
 Component parent = getParent();
 if (parent != null &&
!parent.isVisibleInHierarchy())
 {
 return false;
 }
 else
 {
 return
determineVisibility();
 }
 }

Second, why would you have a button attached to a page directly? Isn't 
that
invalid HTML?
I through all form components should be inside a  (even w/o a
wicket:id) otherwise the browser might choke on it...

~ Thank you,
  Paul Bors

-Original Message-
From: Richard W. Adams [mailto:rwada...@up.com]
Sent: Wednesday, June 26, 2013 9:42 AM
To: users@wicket.apache.org
Subject: Re: Graying Out Disabled Buttons/Controls

I believe the parent component (the page itself) is visible. My test page 
is
very simple, with only two buttons, one enabled & the other disabled; both
buttons are children of the page itself. However, only the enabled button
appears in the generated HTML. I've tried changing the order of the 
various
method calls in createDisabledButton(), tried overriding
isVisible() with return true, etc. No matter what I do, though, the the
generated HTML does not include the disabled button.

I'm out of ideas. Does this work in a later version of Wicket (after
1.14.17

Re: append javascrit to AjaxTRequestTarget for entire application

2013-06-27 Thread Martin Grigorov
org.apache.wicket.protocol.http.WebApplication#getAjaxRequestTargetListeners().add(new
org.apache.wicket.ajax.AjaxRequestTarget.AbstractListener() {
@Override 
org.apache.wicket.ajax.AjaxRequestTarget.AbstractListener#onBeforeRespond()
})


On Thu, Jun 27, 2013 at 1:02 PM, fachhoch  wrote:

> I want to add some jquery java script for every AjaxRequestTarget, I  dont
> want to repeat this code all over ,  is there a  way to add my java script
> to the target   instance   in a global way?
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/append-javascrit-to-AjaxTRequestTarget-for-entire-application-tp4659855.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
>
>


append javascrit to AjaxTRequestTarget for entire application

2013-06-27 Thread fachhoch
I want to add some jquery java script for every AjaxRequestTarget, I  dont
want to repeat this code all over ,  is there a  way to add my java script
to the target   instance   in a global way?




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/append-javascrit-to-AjaxTRequestTarget-for-entire-application-tp4659855.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: A Wicket in Ruby

2013-06-27 Thread Peter Henderson
I've found the combination of Wicket + Scala to be very productive.

Just make sure you use Fodel from Wicketstuff


When things get tricky, simply reduce the problem down to a java quick
start and proceed as usual.
I find that 99% of the time making a quick start solves the problem, when I
realize what I'm doing wrong.

Peter.



On 26 June 2013 17:28, Michael Pence  wrote:

> Scala is even more expressive and powerful than Ruby, so Scala + Wicket is
> definitely my dream stack. I am just nervous about not having a big peer
> support community when things get tricky.
>
> On Jun 25, 2013, at 11:20 PM, Colin Rogers <
> colin.rog...@objectconsulting.com.au> wrote:
>
> > Mike,
> >
> > Java is still pretty verbose, for all 'recent' improvements - I don't
> think that will really ever change, but then I don't see that as an issue.
> My personal style of coding is to write simple, obvious, testable, but
> ultimately verbose, code. Code that anyone can read, and understand what
> and why I'm attempting something - with the absolute minimum of comments.
> But that's just me! :)
> >
> > I've never understood writing one line of code, that takes five lines of
> comments to fully explain what and why it's attempting, when you could
> write 3 lines of code with no comments - and would be significantly easier
> to modify or extend later.
> >
> > When I was younger, and monitors smaller and lines constrained, I too
> loved ramming as much functionality into the smallest of visual spaces in
> code, but now I love tons of white space and simple, clean code.
> >
> > It's all about scroll wheels and big monitors! :)
> >
> > ... and Wicket and the super-fast modern JVMs... and t's still quicker
> and easier and ultimately less verbose to do something in Wicket/Java, than
> pretty much any other Web framework, IMHO - regardless of Java as a
> language.
> >
> > You could try Scala with Wicket, or Groovy with Wicket - both are native
> JVM languages - would these give you greater benefits to your style?
> >
> > Cheers,
> > Col.
> >
> > -Original Message-
> > From: Mike Pence [mailto:mike.pe...@gmail.com]
> > Sent: 26 June 2013 06:48
> > To: users@wicket.apache.org
> > Subject: Re: A Wicket in Ruby
> >
> > That is a good question that I have been mulling over these last few
> says.
> > I think that I need to suck it up and just re-familiarize with Java --
> it is less verbose, with annotations and closures now, right? -- for all of
> the benefits that the JVM with Wicket will bring me. I got a bit spoiled by
> years of Ruby, but man, do you pay for that lack of compile-time checking
> and type safety over and over again -- especially with regard to
> performance and endlessly climbing stack traces over typos.
> >
> >
> > On Sun, Jun 23, 2013 at 8:25 PM, Colin Rogers <
> colin.rog...@objectconsulting.com.au> wrote:
> >
> >> Mike,
> >>
> >> I hate to be the old cynic and doomsayer, but generally I find that
> >> whenever a two programming technologies are 'crossed' over, with the
> >> idea that you'll get the advantages of both - the exact opposite
> >> occurs and actually you end up with a technology that only has the
> >> disadvantages of both and the advantages of neither.
> >>
> >> After all, Wicket in Java works really well... how would ruby improve
> >> it over Java? Or Scala in the JVM? Or Groovy on the JVM?
> >>
> >> Like I said - sorry - I don't wish to negative, but it seems like a
> >> thankless task awaits you! :)
> >>
> >> Cheers,
> >> Col.
> >>
> >> -Original Message-
> >> From: Mike Pence [mailto:mike.pe...@gmail.com]
> >> Sent: 22 June 2013 02:21
> >> To: users@wicket.apache.org
> >> Subject: A Wicket in Ruby
> >>
> >> So I have this crazy idea to try to write some subset of Wicket using
> >> CRuby and the variety of technologies it employs (EventMachine, etc.)
> >>
> >> Hard to know where to start though, or how best to form a mental model
> >> of what Wicket does vs. doing a straight class-to-class conversion.
> >> Maybe there is a test suite in the wicket source I should consider. Of
> >> course, there is nothing like stepping through the code to understand
> >> the lifecyle of a wicket request (and to see how it persists session
> data, especially).
> >>
> >> Am I crazy?
> >> EMAIL DISCLAIMER This email message and its attachments are
> >> confidential and may also contain copyright or privileged material. If
> >> you are not the intended recipient, you may not forward the email or
> >> disclose or use the information contained in it. If you have received
> >> this email message in error, please advise the sender immediately by
> >> replying to this email and delete the message and any associated
> >> attachments. Any views, opinions, conclusions, advice or statements
> >> expressed in this email message are those of the individual sender and
> >> should not be relied upon as the considered view, opinion,
> >> conclusions, advice or statement of this company except where the
> >> sender expressl

Re: Handling ModalWindow show/close using AjaxCallListeners

2013-06-27 Thread smöker
hi,

thanks for getting back to me! will try onComplete immediately.

-> problem showing ModalWindow contents is, that the content of the
ModalWindow (any kind of panel with components and/or static html) remains
with display:none in style tag -> invisible.

taking a look to whats happening in ModalWindow.show, it seems, that the
content of the panel is invisible by default and will be set to visible
explicitly in ModalWindow.show(). Unfortunately, i dont have an ajaxtarget
here...so i currently only "steal" and execute the OpenWindow Javascript,
but cannot handle visibility of the contents due to a lack of AjaxTarget...
am i right?

thanks a lot for your support!

kind regards



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handling-ModalWindow-show-close-using-AjaxCallListeners-tp4659849p4659853.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Injecting DB service results in "IllegalStateException: EntityManager is closed"

2013-06-27 Thread Martin Grigorov
Hi,

I'm not sure whether this is the best solution but you can inject a
Provider:

@Inject
private Provider em;

...

em.get().find(...);


On Thu, Jun 27, 2013 at 9:36 AM, Bas Gooren  wrote:

> Hi,
>
> Looking at the github project you refer to, it should work.
> The GuiceComponentInjector which is set-up in the wicket application
> injects proxies. That means that when your form is submitted (and a second
> request is made), a new service instance is created.
>
> So if it's not working for you, there is probably another problem with
> your code.
> Can you show us some relevant parts of your code, e.g. the validator and
> the page which contains the validator?
>
> Met vriendelijke groet,
> Kind regards,
>
> Bas Gooren
>
> Op 26-6-2013 22:32, schreef Andreas Lundblad:
>
>  I've just started using Wicket (I'm half way through Wicket in Action).
>>
>> I've run into the following problem with a user registration form: In
>> order to make sure that the provided e-mail is not already registered
>> I've written a "UniqueEmailValidator" which I attach to the email
>> field. This validator needs access to the DB-service to query the
>> database for already registered email-adresses.
>>
>> The problem is that the DB-service is injected when the registration
>> page is created and since I'm using open-session-in-view, the
>> DB-service EntityManager is closed after the page is rendered. This
>> causes an
>>
>>IllegalStateException: EntityManager is closed
>>
>> once the form is submitted in a subsequent request. (Since the same
>> old DB-service object is used in the second request.)
>>
>>
>> (I had the same problem when trying to inject the DB-service in the
>> session-object. The same DB-service object was used in multiple
>> requests causing the IllegalStateException.)
>>
>>
>> I figured this must be a fairly common problem but can't for my life
>> find any solutions in the archives or through googling. I'm curious
>> what the best practice is to solve this.
>>
>>
>> (My project builds upon the code available here:
>> http://github.com/javadev/**wicket-guice-demo)
>>
>>
>> best regards, Andreas Lundblad
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: Handling ModalWindow show/close using AjaxCallListeners

2013-06-27 Thread Martin Grigorov
Hi,

You should use onComplete instead of onAfter.
What is the problem with the contents ?


On Thu, Jun 27, 2013 at 9:48 AM, smöker  wrote:

> hi guys,
>
> i'm stuck in a problem showing up a modal window before a long running task
> started by an ajax button and closing it when the process is finished - any
> help/advice is highly appreciated!
>
> i already managed to show up the ModalWindow using onBeforeSend ajax, but
> one the one hand, the contents of this popup are not shown up and i also
> have problems closing the window after the process.
>
> for having access to the show and close scripts i made a custom ModalWindow
> providing public access to the private scripts :
>
>
>
> furthermore, here's my code for the ajaxButton :
>
>
>
>
> would be nice, if you could take a look and give me some hints, whether
> this
> is going into the right direction or if there are good alternatives for
> this
> use case..
>
> thanks in advance!
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Handling-ModalWindow-show-close-using-AjaxCallListeners-tp4659849.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
>
>