Re: org.apache.wicket.protocol.http.WebSession cannot be cast to my.CustomSession

2008-02-18 Thread Sven Schliesing

I switched over to using an anonymous overridden WebApplication:

--
WebApplication webApplication = new WebApplication() {
@Override
public Session newSession(Request request, Response response) {
return new CustomSession(request);
}

@Override
public Class getHomePage() {
return null;
}
};

WicketTester tester = new WicketTester(webApplication);
--

This way I got my CustomSession (bye bye CCE) and a valid non-spring
WebApplication. I'm curious about what problems I'm going to have with that.
:)

Thanks everyone for your efforts and savvy!
-- 
View this message in context: 
http://www.nabble.com/org.apache.wicket.protocol.http.WebSession-cannot-be-cast-to-my.CustomSession-tp15480791p15540643.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: AjaxEditableLabel in 1.3.0

2008-02-18 Thread Per Ejeklint

This is very odd, I just tested with a clean 1.3.1-based build of my test
app. It works fine on one machine but not on the other! Same code, one
running in Jetty on a MBP (does not work), one running in GlassFish on a Mac
mini (works just fine). Same Java versions on the machines.

So maybe it isn't fixed after all...

/Per


Jonathan Locke wrote:
 
 
 i'm still getting this under 1.3.1 on the mac.  maybe it's my problem
 though.  can anyone verify that this works on the mac?
 
 
 Frank Bille-2 wrote:
 
 It's a known issue[0]. It will be fixed in 1.3.1.
 
 Frank
 
 [0]: https://issues.apache.org/jira/browse/WICKET-1239
 
 On Jan 7, 2008 9:40 PM, givp [EMAIL PROTECTED] wrote:
 

 Hello,

 I'm having some problems with AjaxEditableLabel that seem to happen in
 Wicket 1.3.0 only. When I roll back to rc1, everything works fine. I
 have
 used the example code from:
 http://www.wicket-library.com/wicket-examples/ajax/editable-label.1

 setModel(new CompoundPropertyModel(this));
 add(new AjaxEditableLabel(userStatus));

 I can edit the field but it fails to save. According to Tomcat it's
 setModel that is causing the errors.

 java.lang.IllegalAccessError: tried to access method
 org.apache.wicket.Component.onModelChanging()V from class
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1

 Can anyone please point me to the right direction as to how I can fix
 this
 without having to use rc1?

 Thanks,
 g
 --
 View this message in context:
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p14675483.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15540737.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: AjaxEditableLabel in 1.3.0

2008-02-18 Thread Johan Compagner
Is the error exactly the same?

On 2/18/08, Per Ejeklint [EMAIL PROTECTED] wrote:

 This is very odd, I just tested with a clean 1.3.1-based build of my test
 app. It works fine on one machine but not on the other! Same code, one
 running in Jetty on a MBP (does not work), one running in GlassFish on a Mac
 mini (works just fine). Same Java versions on the machines.

 So maybe it isn't fixed after all...

 /Per


 Jonathan Locke wrote:
 
 
  i'm still getting this under 1.3.1 on the mac.  maybe it's my problem
  though.  can anyone verify that this works on the mac?
 
 
  Frank Bille-2 wrote:
 
  It's a known issue[0]. It will be fixed in 1.3.1.
 
  Frank
 
  [0]: https://issues.apache.org/jira/browse/WICKET-1239
 
  On Jan 7, 2008 9:40 PM, givp [EMAIL PROTECTED] wrote:
 
 
  Hello,
 
  I'm having some problems with AjaxEditableLabel that seem to happen in
  Wicket 1.3.0 only. When I roll back to rc1, everything works fine. I
  have
  used the example code from:
  http://www.wicket-library.com/wicket-examples/ajax/editable-label.1
 
  setModel(new CompoundPropertyModel(this));
  add(new AjaxEditableLabel(userStatus));
 
  I can edit the field but it fails to save. According to Tomcat it's
  setModel that is causing the errors.
 
  java.lang.IllegalAccessError: tried to access method
  org.apache.wicket.Component.onModelChanging()V from class
  org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1
 
  Can anyone please point me to the right direction as to how I can fix
  this
  without having to use rc1?
 
  Thanks,
  g
  --
  View this message in context:
 
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p14675483.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15540737.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: wicketstuff-rome and authentification.

2008-02-18 Thread Murat Yücel
My feed was a shared resource just like the wicketstuff-rome example.
I have changed it to be a page, so now i can add wicket authentification.
http://www.jroller.com/wireframe/entry/wicket_feedpage

/Murat

2008/2/15, Maurice Marrink [EMAIL PROTECTED]:

 Why not use a filter?
 Wicket uses them too.
 I have absolutely no clue how wicketstuff-rome or rss for that matter
 works but it looks like they are using a regular wicket page.
 So the question is what do you want?
 i can think of the following solutions, but there are probably some
 more i haven't thought of
 -do the authentication on the fly in your page (you do not need any
 fancy security framework for this)
 -put a filter in front of your app that does the validation for the
 rss feed for you (you do not need any fancy security framework for
 this)
 -you can secure the page in the recommended way of your security
 framework (wicket-auth roles or swarm)

 whichever you prefer depends on a couple of things
 -are you already using a wicket security-framework? or something like
 acegi?
 -is it enough for you to authenticate the user or does he need extra
 permissions to access the feed?
 -do you prefer keeping everything in wicket or are you ok with
 servletfilters and stuff?

 So you see there is no right or wrong direction, all roads lead to
 rome (pun intended)

 Let me know what you prefer and we go from there.

 Maurice



 On Fri, Feb 15, 2008 at 11:22 AM, Murat Yücel [EMAIL PROTECTED]
 wrote:
  Hi Maurice
 
   Can you point me in the right direction? What I need is the following.
 
   http://localhost:8080/rssfeed?username=adminpassword=12345678
 
   The username and password should be validated against the database
   and if it is correct the feed should be generated. I can of course do
 this
   with a filter but i guess this is not the wicket way
 
   /Murat
 
   2008/2/14, Maurice Marrink [EMAIL PROTECTED]:
 
 
  
For swarm 1.3.1 i am working on this. It allows you to use the same
authorization / authentication mechanism as your wicket app. in
 effect
the policy files.
You can try it out by letting your pom get the latest 1.3-SNAPSHOT.
Some feedback is welcome.
   
   
Maurice
   
   
On Thu, Feb 14, 2008 at 5:03 PM, Ryan Sonnek [EMAIL PROTECTED]
wrote:
 you can mount the wicket rss feed as a bookmarkable url and use a
  filter to ensure security.

  Not sure if wicket has the concept of securing application
 resources
  currently built in?



  On Thu, Feb 14, 2008 at 9:55 AM, Murat Yücel 
 [EMAIL PROTECTED]
wrote:
   Hi All
  
I have started using the wicketstuff-rome project to generate
 rss
feed.
Before this was just done
in a servlet. The servlet would check the parameters submitted.
 If
they were
valid then the rss feed
would get generated.
The parameters are username, password.
  
Is it possible to add authentification in wicket to the feed?
 If it
is how
would you do it?
I have created my feed using this example:
 wicketstuff-rome-examples
  
/Murat
  

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


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

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




Re: A subproject for Just Model State

2008-02-18 Thread Johan Compagner
cant you just use the LoadableDetachableModel and use load() to get the
stuff
from the session?

And on detach you put it back in again (and call dirty() on session)

johan



On Feb 17, 2008 4:29 PM, demirr [EMAIL PROTECTED] wrote:


 Hi, i'm on a project which consists mostly of stateless pages but
 sometimes i
 need to save some ( little ) state from which i can recover the page so i
 have decided to start a subproject of my own to help the developer just
 save
 the models of some componenents to session.

 Can you give me an advice where to start from ? I mean should i work on
 models and create sth like SessionPersistentModel  or should i override or
 change the component api ?

 I think that the model approach is sufficient but i'm not sure how and
 when
 to attach and detach the model to session and how to dirty it for
 clustering.


 --
 View this message in context:
 http://www.nabble.com/A-subproject-for-Just-Model-State-tp15530579p15530579.html
 Sent from the Wicket - User mailing list archive at 
 Nabble.comhttp://nabble.com/
 .


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




Re: AjaxEditableLabel in 1.3.0

2008-02-18 Thread Per Ejeklint

Yes:

java.lang.IllegalAccessError: tried to access method
org.apache.wicket.Component.onModelChanging()V from class
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1

Aha, I just downloaded the source for 1.3.1 and checked. The 1.3.1 release
does NOT contain the small fix I suggested earlier, but it is present in
trunk.

And as for me getting different results on different machines, that was my
mistake - removing a java file from Eclipse build path doesn't remove the
already compiled class file so it was still present on one machine - on the
other I built with maven and did a clean.

/Per


Johan Compagner wrote:
 
 Is the error exactly the same?
 
 On 2/18/08, Per Ejeklint [EMAIL PROTECTED] wrote:

 This is very odd, I just tested with a clean 1.3.1-based build of my test
 app. It works fine on one machine but not on the other! Same code, one
 running in Jetty on a MBP (does not work), one running in GlassFish on a
 Mac
 mini (works just fine). Same Java versions on the machines.

 So maybe it isn't fixed after all...

 /Per


 Jonathan Locke wrote:
 
 
  i'm still getting this under 1.3.1 on the mac.  maybe it's my problem
  though.  can anyone verify that this works on the mac?
 
 
  Frank Bille-2 wrote:
 
  It's a known issue[0]. It will be fixed in 1.3.1.
 
  Frank
 
  [0]: https://issues.apache.org/jira/browse/WICKET-1239
 
  On Jan 7, 2008 9:40 PM, givp [EMAIL PROTECTED] wrote:
 
 
  Hello,
 
  I'm having some problems with AjaxEditableLabel that seem to happen
 in
  Wicket 1.3.0 only. When I roll back to rc1, everything works fine. I
  have
  used the example code from:
  http://www.wicket-library.com/wicket-examples/ajax/editable-label.1
 
  setModel(new CompoundPropertyModel(this));
  add(new AjaxEditableLabel(userStatus));
 
  I can edit the field but it fails to save. According to Tomcat it's
  setModel that is causing the errors.
 
  java.lang.IllegalAccessError: tried to access method
  org.apache.wicket.Component.onModelChanging()V from class
  org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1
 
  Can anyone please point me to the right direction as to how I can fix
  this
  without having to use rc1?
 
  Thanks,
  g
  --
  View this message in context:
 
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p14675483.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15540737.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15541139.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: AjaxEditableLabel in 1.3.0

2008-02-18 Thread Johan Compagner
yes i see that https://issues.apache.org/jira/browse/WICKET-1239 is really
only fixed for 1.3.2

johan



On Feb 18, 2008 10:27 AM, Per Ejeklint [EMAIL PROTECTED] wrote:


 Yes:

 java.lang.IllegalAccessError: tried to access method
 org.apache.wicket.Component.onModelChanging()V from class
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1

 Aha, I just downloaded the source for 1.3.1 and checked. The 1.3.1 release
 does NOT contain the small fix I suggested earlier, but it is present in
 trunk.

 And as for me getting different results on different machines, that was my
 mistake - removing a java file from Eclipse build path doesn't remove the
 already compiled class file so it was still present on one machine - on
 the
 other I built with maven and did a clean.

 /Per


 Johan Compagner wrote:
 
  Is the error exactly the same?
 
  On 2/18/08, Per Ejeklint [EMAIL PROTECTED] wrote:
 
  This is very odd, I just tested with a clean 1.3.1-based build of my
 test
  app. It works fine on one machine but not on the other! Same code, one
  running in Jetty on a MBP (does not work), one running in GlassFish on
 a
  Mac
  mini (works just fine). Same Java versions on the machines.
 
  So maybe it isn't fixed after all...
 
  /Per
 
 
  Jonathan Locke wrote:
  
  
   i'm still getting this under 1.3.1 on the mac.  maybe it's my problem
   though.  can anyone verify that this works on the mac?
  
  
   Frank Bille-2 wrote:
  
   It's a known issue[0]. It will be fixed in 1.3.1.
  
   Frank
  
   [0]: https://issues.apache.org/jira/browse/WICKET-1239
  
   On Jan 7, 2008 9:40 PM, givp [EMAIL PROTECTED] wrote:
  
  
   Hello,
  
   I'm having some problems with AjaxEditableLabel that seem to happen
  in
   Wicket 1.3.0 only. When I roll back to rc1, everything works fine.
 I
   have
   used the example code from:
   http://www.wicket-library.com/wicket-examples/ajax/editable-label.1
  
   setModel(new CompoundPropertyModel(this));
   add(new AjaxEditableLabel(userStatus));
  
   I can edit the field but it fails to save. According to Tomcat it's
   setModel that is causing the errors.
  
   java.lang.IllegalAccessError: tried to access method
   org.apache.wicket.Component.onModelChanging()V from class
   org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1
  
   Can anyone please point me to the right direction as to how I can
 fix
   this
   without having to use rc1?
  
   Thanks,
   g
   --
   View this message in context:
  
 
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p14675483.html
   Sent from the Wicket - User mailing list archive at 
   Nabble.comhttp://nabble.com/
 .
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15540737.html
  Sent from the Wicket - User mailing list archive at 
  Nabble.comhttp://nabble.com/
 .
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p15541139.html
  Sent from the Wicket - User mailing list archive at 
 Nabble.comhttp://nabble.com/
 .


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




Re: annotated class

2008-02-18 Thread freak182

Hello,
Thank you guys for the reply...I finally got to work...i have same
configuration but there is one jar file not imported by the maven
tool...that might be the problem bcoz when i removed it, it run
smoothly..Thanks a lot..anyway, i have a copy of Wicket in Action MEAP to
guide me :)

Cheers...


Nino.Martinez wrote:
 
 Do you use maven to build with?
 
 valuecom.test.server.model.Test/value
 valuecom.test.server.model.Test2/value
 
 
 
 freak182 wrote:
 Hello,
 Im developing an app using hibernate annotations.My problem is when i
 configure my appContext.xml the annotated class cannot be found. here is
 the
 code snippet of appContext.xml found in WEB-INF/config.

 !--  Session factory bean for Hibernate --
  bean
  
 class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
  id=sessionFactory
  property name=dataSource ref=dataSource/property
  property name=hibernateProperties
  props
  prop key=hibernate.dialect
  org.hibernate.dialect.MySQL5Dialect
  /prop
  prop key=hibernate.cache.provider_class
  org.hibernate.cache.OSCacheProvider
  /prop
  !--prop 
 key=hibernate.show_sqltrue/prop--
  prop 
 key=hibernate.c3p0.acquire_increment2/prop
  prop 
 key=hibernate.c3p0.idle_test_period300/prop
  prop key=hibernate.c3p0.max_size100/prop
  prop key=hibernate.connection.release_mode
  after_statement
  /prop
  prop key=hibernate.c3p0.min_size5/prop
  prop key=hibernate.c3p0.preferredTestQuery
  select 1
  /prop
  prop 
 key=hibernate.c3p0.testConnectionOnCheckout
  true
  /prop
  prop key=hibernate.hbm2ddl.autoupdate/prop
  prop
  
 key=hibernate.bytecode.use_reflection_optimizer
  true
  /prop
  !--prop 
 key=hibernate.format_sqltrue/prop--
  /props
  /property
  property name=annotatedClasses  
  list
  valuecom.test.server.model.Test/value
  valuecom.test.server.model.Test2/value
  /list
  /property
  property name=annotatedPackages
  list
  valuecom.test.server/value
  /list
  /property
  /bean

 My question is, the appContext.xml should be put in the classpath or
 /WEB-INF/config ?is there is difference between the two? Any idea.
 Thanks a lot.
 Cheers
   
 
 -- 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/annotated-class-tp15476390p15542017.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



comunication between panels

2008-02-18 Thread Mazzanti Luca

i have a question: how can i comunicate between panels in wicket?

my application contains a frameset of 2 pages, each of these has a
tabbedPanel containing many panels:
structure--

 APP
   PAGE1 PAG2
panel panel panelpanel panel panel

---

what is a good solution?
MY solution is to:

1)extends WicketSession and implements get/set methods to retrieve insances
of these panels
2)use it:

   Panel donald = ( (MySession) panel.getSession() ).getPanel('donaldduck');

so i can retrieve insance of foo panel everywhere and use its public
methods.

IS A CORRECT SOLUTION?
and then... PUTTING PANELS INSTANCES IN SESSION is a bad implementation
about MEMORY AND wicket SERIALIZATION ?

There is a BEST SOLUTION? that i don't know
Thanks.

-- 
View this message in context: 
http://www.nabble.com/comunication-between-panels-tp15542127p15542127.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: comunication between panels

2008-02-18 Thread Martijn Dashorst
WHY ARE YOU SHOUTING?

Martijn

On 2/18/08, Mazzanti Luca [EMAIL PROTECTED] wrote:

 i have a question: how can i comunicate between panels in wicket?

 my application contains a frameset of 2 pages, each of these has a
 tabbedPanel containing many panels:
 structure--

  APP
PAGE1 PAG2
 panel panel panelpanel panel panel

 ---

 what is a good solution?
 MY solution is to:

 1)extends WicketSession and implements get/set methods to retrieve insances
 of these panels
 2)use it:

Panel donald = ( (MySession) panel.getSession() ).getPanel('donaldduck');

 so i can retrieve insance of foo panel everywhere and use its public
 methods.

 IS A CORRECT SOLUTION?
 and then... PUTTING PANELS INSTANCES IN SESSION is a bad implementation
 about MEMORY AND wicket SERIALIZATION ?

 There is a BEST SOLUTION? that i don't know
 Thanks.

 --
 View this message in context: 
 http://www.nabble.com/comunication-between-panels-tp15542127p15542127.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: comunication between panels

2008-02-18 Thread Mazzanti Luca

i don't understand your phrase: 'why are you shouting'
please repeate. 

sorry i don' have a very large vocaboulary. But please help me solving this.

the situation is:

on the left i have a page containg a wicket tree. on the right another page
containing a panel.
on click of a node in the tree, i need to send the object in the node to the
panel ( called panel2 ) in the other page, and reload panel with new
informations.

how can i do?
onNodeClick i call my sessision, i retrieve the instance ( that i put into
at panel2 initialization ) of panel2 and with it i call its method
setItem(), then i reload it.

it's correct? i m currently reading about 'Generic inter-component event
mechanism'
at https://issues.apache.org/jira/browse/WICKET-1312
-- 
View this message in context: 
http://www.nabble.com/comunication-between-panels-tp15542127p15542912.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: comunication between panels

2008-02-18 Thread Ayodeji Aladejebi
panels in session is a bad idea.

Why not just keep the panel state information in the session and then let
them just pull it from there when they instantiate?


By the way, what are you trying to achieve with your panels cuz it is a bad
idea to be stuffing up panels in your session when you can simply keep the
state information the panels need there.

If you instantiate a new Panel, the new Panel can call
getSession().getInformationStateId(), pass that informationState to an
IModel and then the Panel has whatever it needs



On 2/18/08, Martijn Dashorst [EMAIL PROTECTED] wrote:

 WHY ARE YOU SHOUTING?

 Martijn

 On 2/18/08, Mazzanti Luca [EMAIL PROTECTED] wrote:
 
  i have a question: how can i comunicate between panels in wicket?
 
  my application contains a frameset of 2 pages, each of these has a
  tabbedPanel containing many panels:
  structure--
 
   APP
 PAGE1 PAG2
  panel panel panelpanel panel panel
 
  ---
 
  what is a good solution?
  MY solution is to:
 
  1)extends WicketSession and implements get/set methods to retrieve
 insances
  of these panels
  2)use it:
 
 Panel donald = ( (MySession) panel.getSession()
 ).getPanel('donaldduck');
 
  so i can retrieve insance of foo panel everywhere and use its public
  methods.
 
  IS A CORRECT SOLUTION?
  and then... PUTTING PANELS INSTANCES IN SESSION is a bad implementation
  about MEMORY AND wicket SERIALIZATION ?
 
  There is a BEST SOLUTION? that i don't know
  Thanks.
 
  --
  View this message in context:
 http://www.nabble.com/comunication-between-panels-tp15542127p15542127.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.1 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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




-- 
Aladejebi Ayodeji A.,
DabarObjects Solutions
Phone: +234 9 481 7 156
Mobile: +234 803 589 1780
Email: [EMAIL PROTECTED]
Web: www.dabarobjects.com
Blog: blog.dabarobjects.com

Participate, Collaborate, Innovate
Join Community:
http://www.cowblock.net/

Get A Free Blog:
http://blogs.cowblock.net/


Re: comunication between panels

2008-02-18 Thread Ayodeji Aladejebi
Panel A puts the state information in the session during Link.onClick()

Panel B uses Session.getSession() to retrieve the state information during
render()

this simple technique is what i use and its very efficient.


On 2/18/08, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:

 panels in session is a bad idea.

 Why not just keep the panel state information in the session and then let
 them just pull it from there when they instantiate?


 By the way, what are you trying to achieve with your panels cuz it is a
 bad idea to be stuffing up panels in your session when you can simply keep
 the state information the panels need there.

 If you instantiate a new Panel, the new Panel can call
 getSession().getInformationStateId(), pass that informationState to an
 IModel and then the Panel has whatever it needs



 On 2/18/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
 
  WHY ARE YOU SHOUTING?
 
  Martijn
 
  On 2/18/08, Mazzanti Luca [EMAIL PROTECTED] wrote:
  
   i have a question: how can i comunicate between panels in wicket?
  
   my application contains a frameset of 2 pages, each of these has a
   tabbedPanel containing many panels:
   structure--
  
APP
  PAGE1 PAG2
   panel panel panelpanel panel panel
  
   ---
  
   what is a good solution?
   MY solution is to:
  
   1)extends WicketSession and implements get/set methods to retrieve
  insances
   of these panels
   2)use it:
  
  Panel donald = ( (MySession) panel.getSession()
  ).getPanel('donaldduck');
  
   so i can retrieve insance of foo panel everywhere and use its public
   methods.
  
   IS A CORRECT SOLUTION?
   and then... PUTTING PANELS INSTANCES IN SESSION is a bad
  implementation
   about MEMORY AND wicket SERIALIZATION ?
  
   There is a BEST SOLUTION? that i don't know
   Thanks.
  
   --
   View this message in context:
  http://www.nabble.com/comunication-between-panels-tp15542127p15542127.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.1 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Aladejebi Ayodeji A.,
 DabarObjects Solutions
 Phone: +234 9 481 7 156
 Mobile: +234 803 589 1780
 Email: [EMAIL PROTECTED]
 Web: www.dabarobjects.com
 Blog: blog.dabarobjects.com

 Participate, Collaborate, Innovate
 Join Community:
 http://www.cowblock.net/

 Get A Free Blog:
 http://blogs.cowblock.net/




-- 
Aladejebi Ayodeji A.,
DabarObjects Solutions
Phone: +234 9 481 7 156
Mobile: +234 803 589 1780
Email: [EMAIL PROTECTED]
Web: www.dabarobjects.com
Blog: blog.dabarobjects.com

Participate, Collaborate, Innovate
Join Community:
http://www.cowblock.net/

Get A Free Blog:
http://blogs.cowblock.net/


Re: comunication between panels

2008-02-18 Thread Timo Rantalaiho
On Mon, 18 Feb 2008, Mazzanti Luca wrote:
 i have a question: how can i comunicate between panels in wicket?

The normal Wicket way is to share models, pass references etc, 
but it has its limitations. 

You can find an example of a push-type mechanism here

  https://issues.apache.org/jira/browse/WICKET-1312

though it is done with just one page in mind.

 MY solution is to:
 
 1)extends WicketSession and implements get/set methods to retrieve insances
 of these panels
 2)use it:
 
Panel donald = ( (MySession) panel.getSession() ).getPanel('donaldduck');

This seems strage to me, I wouldn't put Components to Session.

You might want to step back to think about what it is that 
you want to achieve, and maybe post here about the more 
general issue. Maybe there is a better solution for your 
real case than the panels of different pages communicating 
between each other.

 There is a BEST SOLUTION? that i don't know

No :)

  http://www.satisfice.com/blog/archives/27

_Best_ wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: comunication between panels

2008-02-18 Thread Timo Rantalaiho
On Mon, 18 Feb 2008, Mazzanti Luca wrote:
 on the left i have a page containg a wicket tree. on the right another page
 containing a panel.
 on click of a node in the tree, i need to send the object in the node to the
 panel ( called panel2 ) in the other page, and reload panel with new
 informations.
 
 how can i do?
 onNodeClick i call my sessision, i retrieve the instance ( that i put into
 at panel2 initialization ) of panel2 and with it i call its method
 setItem(), then i reload it.

But what if you just share the tree instance between the two 
pages? 

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: comunication between panels

2008-02-18 Thread Mazzanti Luca

ok i store in session only objects that contain the state of the page, and i
pass it to the model of the page.

what about PageState? i must watch WebPage source to find where is used and
i modify it to load only data that i really need or there's yet an
implementation of this that i can use?

and for a treePanel, if i don't want to reload every time the tree, i can
put the tree-model in the IModel of panel and at panel instantiation time
retrieve the tree-model from session where i store it?


-- 
View this message in context: 
http://www.nabble.com/comunication-between-panels-tp15542127p15543837.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: comunication between panels

2008-02-18 Thread Timo Rantalaiho
On Mon, 18 Feb 2008, Mazzanti Luca wrote:
 ok i store in session only objects that contain the state of the page, and i
 pass it to the model of the page.

Wicket components (including Page) are stateful, you don't 
need to do that by yourself. To keep the state you just need
to use the same page instance.

 and for a treePanel, if i don't want to reload every time the tree, i can
 put the tree-model in the IModel of panel and at panel instantiation time
 retrieve the tree-model from session where i store it?

Them same here, just use the same Panel instance and its 
state will be stored transparently by Wicket.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: comunication between panels

2008-02-18 Thread Thomas Lutz

Mazzanti Luca schrieb:

i don't understand your phrase: 'why are you shouting'
please repeate. 
  

writing uppercase - shouting

have a look at http://www.dtcc.edu/cs/rfc1855.html and search for 
shouting...


regards,
tom

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



self refreshing table with effects

2008-02-18 Thread okrohne

Hi,

I am new to Wicket and I think of how to achieve the following:

I need a table which refreshes itself every 5 sec. This could be done
with AjaxSelfUpdatingTimerBehavior. The refresh mechanismen shall 
only insert new rows at the beginning (there will be always only 1 new row
in a 5 sec period).
The table shall only display 10 rows (or be configurable), so if a new row
comes in the 10th row should dispear. The new row can have several effects
like sliding in, flashing ...
I need this as monitoring component. 

Has anyone done something like this?
Any suggestions are welcome, maybe it is obvious?

Thanks,
Oliver



-- 
View this message in context: 
http://www.nabble.com/self-refreshing-table-with-effects-tp15545179p15545179.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



AJAX validation and multiple requests

2008-02-18 Thread Federico Fanton
Hi everyone!
I'm having a little problem..
I have an Ajax editable table made with rows of custom components similar to 
AjaxEditableLabel, that while in edit mode use a behavior like this one:

protected class EditorBehavior extends AbstractDefaultAjaxBehavior{
   @Override
   protected void onComponentTag(ComponentTag tag) {
  super.onComponentTag(tag);
  String js={wicketAjaxGet(' + getCallbackUrl() + 
'+this.name+'='+wicketEncode(this.value)); return false;};
  tag.put(onblur, js);
   }

   @Override
   protected void respond(AjaxRequestTarget target) {
  FormComponent c = (FormComponent) getEditorComponent();
  c.processInput();
  if(c.hasErrorMessage()){
 Serializable msg = c.getFeedbackMessage().getMessage();
 Util.showAlert(target, c, msg.toString());
  }
   }
}


(Util.showAlert adds to the component a behavior that shows an alert)

Everything works fine, but I need to add another behavior to intercept when the 
user presses Enter (bound to onkeyup), so that I can validate the row as a 
whole.
When I press enter, two requests are fired: one for onblur and one for onkeyup. 
My problem is that even if the onblur request finds an error during validation 
(and shows the corresponding alert), the second request has no way to know 
that, since feedback messages are cleaned up at the end of each request..
Any hint on how I could handle this? Should I put a flag somewhere? Or maybe 
there's a way to stop the second request when my EditorBehavior finds a 
validation error?

Many thanks for your time!


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



Re: comunication between panels

2008-02-18 Thread Martijn Dashorst
On 2/18/08, Mazzanti Luca [EMAIL PROTECTED] wrote:

 i don't understand your phrase: 'why are you shouting'
 please repeate.

http://www.google.com/search?hl=enclient=safarirls=enq=using+uppercase+in+email+messagebtnG=Search

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: IDataProvider and Hibernate Search

2008-02-18 Thread Ryan Gravener
You could keep an instance of the search results in the dataprovider.
Then on size() and iterator() check to see if results is null.  If it
is perform the query and store the results

ie:

add this to your searchdataprovider

private transient SearchResults results;

private void searchIfNecessary() {

 //if(results!=null) return;

 //get results

}

public int size() {
  searchIfNecessary();
  return results.getTotal();
}



On 18/02/2008, Java Programmer [EMAIL PROTECTED] wrote:
 Hello,
 I want to use DataView to present Search Results from Hibernate
 Search, but I got stuck with implementation of DataProvider - maybe
 first I show you classes:
 private class SearchDataProvider implements IDataProvider {

 private String query;

 public SearchDataProvider(String query) {
 this.query = query;
 }

 @Override
 public Iterator iterator(int first, int count) {
 SearchDAO.SearchResults searchedAdverts =
 searchDAO.getSearchedAdverts(this.query, first, count);
 return searchedAdverts.getResults().iterator();
 }

 @Override
 public IModel model(Object object) {
 return new Model((Advertisement) object);
 }

 @Override
 public int size() {
 SearchDAO.SearchResults searchedAdverts =
 searchDAO.getSearchedAdverts(this.query, 0, 0);
 return searchedAdverts.getCount();
 }

 @Override
 public void detach() {

 }
 }

 in SearchDAO I have:
 public class SearchDAO extends HibernateDaoSupport {
 public SearchResults getSearchedAdverts(final String queryString, int
 first, int count) {
 Session session = getSession(true);
 FullTextSession fullTextSession = 
 Search.createFullTextSession(session);
 SearchResults results = null;
 Transaction tx = fullTextSession.beginTransaction();
 MultiFieldQueryParser parser = new MultiFieldQueryParser( new
 String[]{title, rawBody},
   new StandardAnalyzer());
 Query query;
 try {
 query = parser.parse(queryString);
 FullTextQuery hibQuery = 
 fullTextSession.createFullTextQuery(query,
 Advertisement.class)
 .setFirstResult(first)
 .setMaxResults(count);
 results = new SearchResults(hibQuery.list(), 
 hibQuery.getResultSize());
 } catch (ParseException e) {
 e.printStackTrace();
 } finally {
 tx.commit();
 session.close();
 }
 }
 SearchResults is a wrapper for sublist of results and number of all:
 public class SearchResults {

 private ListAdvertisement results = null;

 private int count = 0;

 public SearchResults(ListAdvertisement results, int count) {
 super();
 this.results = results;
 this.count = count;
 }
   //getters/setters
 }

 As you see I have to repeat searching in size() and iterator()
 (SearchDAO.SearchResults searchedAdverts =
 searchDAO.getSearchedAdverts(this.query, 0, 0); and
 SearchDAO.SearchResults searchedAdverts =
 searchDAO.getSearchedAdverts(this.query, first, count);) in size I do
 not get collection, but searching happens because this method is
 launched before iterator() which could answer with number of all
 results as hibQuery.getResultSize();
 It's very inefficient, and I don't know how can I repair that, without
 writing my own DataView implementation. DataProvider is good for
 databases which need to make additional select count(*), but Lucene
 Hibernate Search make it in one pass.

 Anybody has a suggestion on this topic?

 Best regards,
 Adr

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





-- 
Ryan Gravener
http://ryangravener.com

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



Re: IDataProvider and Hibernate Search

2008-02-18 Thread Java Programmer
On Mon, Feb 18, 2008 at 4:29 PM, Ryan Gravener [EMAIL PROTECTED] wrote:
 You could keep an instance of the search results in the dataprovider.
  Then on size() and iterator() check to see if results is null.  If it
  is perform the query and store the results

Yes, I tried this before and I won't work because of querying size()
before iterator() - to get results I need to know what is first result
and how many of them to fetch, I don't know this in DataProvider
because some other class (DataView?) manage the values provided to
iterator (first and count). As I said size() is used BEFORE iterator()
so size has to ask for results first, as I don't know where I am in
result set (eg. I don't know getCurrentPage() for DataView), I cannot
in size() ask for eg. SearchDAO.SearchResults searchedAdverts =
searchDAO.getSearchedAdverts(this.query, 40, 20);

As I would know or can pass getCurrentPage() to the DataProvider
constructor I could fetch the result set in size() method and put them
into field of SearchDataProvider.

Maybe I should explain how Hibernate Search works here - when asking
DAO for results first search is asked and it returns all the docsId
which next are sliced based on first, count parameters - next same
engine ask database for objects eg form Advertisement a where a.id in
(1,23,45,67,77) - in one pass I can get 20 objects from whole results
set and the exact number of documents which are proper for search
criteria.

Is it more clear now I'm not English specialist :) ?

Best regards,
Adr

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



Re: Exception redirecting to source page

2008-02-18 Thread Cristiano Kliemann

Igor,

It seems to work with Link.onClick also.


Cristiano Kliemann wrote:
 
 Yes, it works, at least when the exception is thrown in Button.onSubmit. I
 haven't tried with Link.onClick.
 
 
 igor.vaynberg wrote:
 
 have you tried it and does it work?
 
 -igor
 
 
 On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote:

 Hi!

 I have some business runtime exceptions that I want to be automatically
 catched and its message rendered in the same page that threw it instead
 of
 redirecting to an error page.

 Is there a safe way to do that?

 These 'business exceptions' are usually thrown in some specific methods
 like
 onSubmit and onClick. Extending the specific components is not an option
 for
 me.

 I did something I think it dangerous. Something like:

 public Page onRuntimeException(Page page, RuntimeException e) {

 Throwable current = e;
 while (current != null  !(current instanceof MyBusinessException))
 {
 current = current.getCause();
 }
 if (current != null) {
 // MyBusinessException detected
 page.error(Error:  + current.getMessage());
 return page;
 } else {
 return super.onRuntimeException(page, e);
 }
 }

 When as exception is thrown, all the execution flow breaks, making some
 things not happen. The question is: is the above code safe assuming that
 MyException could be thrown only by methods like onSubmit and onClick?
 --
 View this message in context:
 http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15547028.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IDataProvider and Hibernate Search

2008-02-18 Thread Java Programmer
Finally I got it - I use such DataProvider:
private class SearchDataProvider implements IDataProvider {

private String query;

private int resultsPerPage;

private SearchDAO.SearchResults searchedAdverts;

private Integer resultsCount;

public SearchDataProvider(String query, int resultsPerPage) {
this.query = query;
this.resultsPerPage = resultsPerPage;
}

public Iterator iterator(int first, int count) {
if(searchedAdverts == null) {
searchedAdverts = 
searchDAO.getSearchedAdverts(this.query, first, count);
}
return searchedAdverts.getResults().iterator();
}

public IModel model(Object object) {
return new Model((Advertisement) object);
}

public int size() {
if(resultsCount == null) {
searchedAdverts = 
searchDAO.getSearchedAdverts(this.query, 0,
this.resultsPerPage);
resultsCount = searchedAdverts.getCount();
}
return resultsCount;
}

public void detach() {
searchedAdverts = null;
}

}

Transient doesn't work in my case, but setting null on object in
detach() makes what transient should. Size is asked only once for a
search, and number of results is set as Integer (also could be added
to iterator if some results appear in time of walking thru the search
results), iterators() if size is known also would be queried once -
this is what should be done.

Best regards,
Adr

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



Re: Exception redirecting to source page

2008-02-18 Thread Igor Vaynberg
good. there are some internals that do not count on a runtime
exception being thrown because of user code...for example throwing it
out of something like validator will abort entire form processing, and
might leave that particular form component in an inconsistent state.
but throwing it out of onclick/onsubmit handlers shouldnt pose much
problem as most wicket processing has already happened.

-igor

On Feb 18, 2008 8:40 AM, Cristiano Kliemann [EMAIL PROTECTED] wrote:

 Igor,

 It seems to work with Link.onClick also.



 Cristiano Kliemann wrote:
 
  Yes, it works, at least when the exception is thrown in Button.onSubmit. I
  haven't tried with Link.onClick.
 
 
  igor.vaynberg wrote:
 
  have you tried it and does it work?
 
  -igor
 
 
  On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote:
 
  Hi!
 
  I have some business runtime exceptions that I want to be automatically
  catched and its message rendered in the same page that threw it instead
  of
  redirecting to an error page.
 
  Is there a safe way to do that?
 
  These 'business exceptions' are usually thrown in some specific methods
  like
  onSubmit and onClick. Extending the specific components is not an option
  for
  me.
 
  I did something I think it dangerous. Something like:
 
  public Page onRuntimeException(Page page, RuntimeException e) {
 
  Throwable current = e;
  while (current != null  !(current instanceof MyBusinessException))
  {
  current = current.getCause();
  }
  if (current != null) {
  // MyBusinessException detected
  page.error(Error:  + current.getMessage());
  return page;
  } else {
  return super.onRuntimeException(page, e);
  }
  }
 
  When as exception is thrown, all the execution flow breaks, making some
  things not happen. The question is: is the above code safe assuming that
  MyException could be thrown only by methods like onSubmit and onClick?
  --
  View this message in context:
  http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15547028.html

 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: AJAX validation and multiple requests

2008-02-18 Thread Igor Vaynberg
one way would be to keep a boolean somewhere that marks if the
component is valid or not...but if i were you i would figure out why
the two requests are fired and how to avoid it. can it be that your
enter key handler does not return false as the last thing and so
doesnt cancel browser's processing of enter key?

-igor


On Feb 18, 2008 6:16 AM, Federico Fanton [EMAIL PROTECTED] wrote:
 Hi everyone!
 I'm having a little problem..
 I have an Ajax editable table made with rows of custom components similar 
 to AjaxEditableLabel, that while in edit mode use a behavior like this one:

 protected class EditorBehavior extends AbstractDefaultAjaxBehavior{
@Override
protected void onComponentTag(ComponentTag tag) {
   super.onComponentTag(tag);
   String js={wicketAjaxGet(' + getCallbackUrl() + 
 '+this.name+'='+wicketEncode(this.value)); return false;};
   tag.put(onblur, js);
}

@Override
protected void respond(AjaxRequestTarget target) {
   FormComponent c = (FormComponent) getEditorComponent();
   c.processInput();
   if(c.hasErrorMessage()){
  Serializable msg = c.getFeedbackMessage().getMessage();
  Util.showAlert(target, c, msg.toString());
   }
}
 }


 (Util.showAlert adds to the component a behavior that shows an alert)

 Everything works fine, but I need to add another behavior to intercept when 
 the user presses Enter (bound to onkeyup), so that I can validate the row as 
 a whole.
 When I press enter, two requests are fired: one for onblur and one for 
 onkeyup. My problem is that even if the onblur request finds an error during 
 validation (and shows the corresponding alert), the second request has no way 
 to know that, since feedback messages are cleaned up at the end of each 
 request..
 Any hint on how I could handle this? Should I put a flag somewhere? Or maybe 
 there's a way to stop the second request when my EditorBehavior finds a 
 validation error?

 Many thanks for your time!


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



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



[wicket-spring] Best Practices...

2008-02-18 Thread James Carman
If I want to use wicket-spring, but I want to try to let Spring wire
everything together, what is the best way to do so?  I realize that
there is the SpringWebApplicationFactory class, but that merely looks
up the application in the Spring context.  The WebApplication class
isn't very beany though (and it's abstract, so I have to subclass it
no matter what).  It doesn't have setters for stuff like the
pageSettings or applicationSettings properties.  The Application (the
parent of WebApplication) class defines an instance variable of type
Settings which covers most of this stuff.  The getters for
applicationSettings and pageSettings merely return getSettings().  Of
course getSettings() is private, so I can't override that
unfortunately.  Anyway, what I want is for the wicket classes to be
more bean-oriented so that I can piece them together how I see fit, by
overriding certain properties (like AuthorizationStrategy) and leaving
the defaults for others.  Has anyone done this before?

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



Re: Error handling for RuntimeExceptions during page construction

2008-02-18 Thread Martijn Dashorst
It depends on the deployment setting what you will see.

Take a look at the wicket in action examples
(http://wicketinaction.googlecode.com), currently chapter 15 (soon to
become chapter 14).

Martijn

On 2/18/08, Doug Leeper [EMAIL PROTECTED] wrote:

 I would like to display a common error page when ever there is a problem (aka
 RuntimeException) in a Page's constructor.  I thought by calling
 getApplicationSettings().setInternalErrorPage(ErrorPage.class); in the
 Application.init class would do the trick...but that is not the case.

 Our scenario is that we encountered a NPE during a Page's constructor.  The
 page displayed showed Unexpected Runtime Exception with the stack trace.
 We want to handle this gracefully (send an email to support) and nicer
 looking (same Look and Feel as our site).

 What am I missing? or what do I need to do?

 Thanks in advance,
 - Doug
 --
 View this message in context: 
 http://www.nabble.com/Error-handling-for-RuntimeExceptions-during-page-construction-tp15547476p15547476.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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