wicket and javascript

2010-02-15 Thread bj�rn liffers
hello,
i tried to generate a.js-file, but i wasn´t able to generate it in the folder 
where i wanted it to be.
so i decided to generate it from a StringModel but it still didn´t work.

i have several scripts that are implemented via resource...
like this one:
 add(JavascriptPackageResource.getHeaderContribution(Start.class, 
js/raphael-min.js));

the StringModel was added after the script-ressource
 add(JavascriptPackageResource.getHeaderContribution(Start.class, 
js/raphael-min.js));
 add(new Label(rScript, Model.of(rScript)).setEscapeModelStrings(false));

but when the page rendered the StringModel was implemented before the 
ressources where added.

i dislike to place the StringModel´s script-tag in the body-tag instead of the 
head-tag of my html-file
is there any possibility to solve that?
if it´s not possible to do it this way, is there anyone who can tell me how to 
get the absolute path to my Start.class dynamically?
would be glad to get answers to both questions :)

in my company there isn´t anyone dealing with wicket, it´s some kind of 
explorative task for me

thank you
*exceptionist*

Immer auf dem Laufenden! Sport, Auto, Reise, Politik und Promis. Von uns für 
Sie: der neue Arcor.de-Newsletter!
Jetzt anmelden und einfach alles wissen: 
http://www.arcor.de/rd/footer.newsletter

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



Re: modal in a modal problem

2010-02-15 Thread Jens Alenius

Martin Asenov skrev:

Does anyone know? Please, people, I'm getting despaired of this...

-Original Message-
From: Martin Asenov [mailto:mase...@velti.com] 
Sent: Friday, February 12, 2010 10:23 AM

To: users@wicket.apache.org
Subject: RE: modal in a modal problem

I forgot to mention that the first time I click yes, I get:

confirmation dialog called
yes button clicked

in console, and the conf dialog closes itself. when I open it for second time, 
I get
confirmation dialog called
yes button clicked
removal supposed to be called

and the item really gets removed, but why triggering it twice?

Thanks in advance!

From: Martin Asenov
Sent: Friday, February 12, 2010 10:20 AM
To: 'users@wicket.apache.org'
Subject: modal in a modal problem

Hello, everyone!

I experience a problem when triggering a modal window from another modal 
window. When a removal icon is clicked in the first modal, there's a 
confirmation dialog, that pops up. Although I've set everything up, the 
windowClosedCallback gets activated only when I confirm removal twice. I have 
no idea why it happens this way. The confirmation dialog works fine for all 
RepeaterHoldingPage-s I have, excluding the one I have placed in another modal. 
Here's the code of the conf dialog:

   public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, final Object entry) {

 System.out.println(confirmation dialog called);

 questionLabel = new Label(question, question);
 yesButton = new AjaxButton(yes_button, new 
ModelString(getString(yes))) {

private static final long serialVersionUID = 1l;

@Override
protected void onSubmit(AjaxRequestTarget target, Form? 
form) {
   System.out.println(yes button clicked);
   parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {

  private static final long serialVersionUID = 
1L;

  @Override
  public void onClose(AjaxRequestTarget target) 
{
page.removeItem(entry, target);
System.out.println(removal supposed to be 
called);
  }
   });

   parent.close(target);
}
 };

What happens is that I trigger the conf dialog, press the 'yes' button and in 
the console the following gets printed:
confirmation dialog called;


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

  
Are you using pagecreator with page or adding a panel as a content. I 
have found some problems with the AjaxRequestTarget when working with 
pagecreator. It will have a source form another page and might not 
update the destination page.

Jens


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



RE: setPageExpiredErrorPage only for certain pages?

2010-02-15 Thread Andreas Lüdtke
Martijn,

the page I'm talking about is already bookmarked but the problem arises
when the user submits new data to that page and the list on that page should
be updated.

Andreas

 -Original Message-
 From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
 Sent: Sunday, February 14, 2010 5:05 PM
 To: users@wicket.apache.org
 Subject: Re: setPageExpiredErrorPage only for certain pages?
 
 How would you know which page was requested when the session has
 expired? The whole reason for the PageExpiredException is that wicket
 doesn't know which page was requested. Use bookmarkablepagelinks for
 links you don't want to expire.
 
 Martijn
 
 2010/2/14 Major Péter majorpe...@sch.bme.hu:
  My guess would be to override RequestCycle#onRuntimeException and do
  your logic there if the exception is PageExpiredException.
 
  Regards,
  Peter
 
  2010-02-14 13:54 keltezéssel, Andreas Lüdtke írta:
  In my WebApplication class I use 
 setPageExpiredErrorPage(). So far, so good.
  But this happens also for the main/home page that 
 everybody can access. I
  would like to redirect only the pages where a user has to 
 login, not for the
  home page. If the homepage expires, a simple redirect to a 
 new session with
  that page should be made.
 
  Is this possible with wicket?
 
  Andreas
 
  
 -
  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
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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



Re: Re: jdbc

2010-02-15 Thread Leo . Erlandsson
now problem is not accessing object fields..

problem is transform resultset to these objects..

You could just work with Maps in Wicket instead of Domain Objects. The 
transformation from ResultSet to a Map containing the Column name as Key 
and the data as Value should be trivial (if not; reply and I'll provide 
sample code) using MetaData (this is how we do it in our JSP pages today).

Or you could write / find a software that does the mapping from JDBC 
ResultSet to Domain Objects... But why not use an ORM such as Hibernate / 
Cayenne / iBatis then.. ?





Re: jdbc

2010-02-15 Thread Ilja Pavkovic
use any preferred OR mapper like hibernate, toplink, 

 now problem is not accessing object fields..
 
 problem is transform resultset to these objects..
 
 2010/2/12 James Carman jcar...@carmanconsulting.com:
  You could create a reference from Honey to Milk, since you have a
  milkid field there.  Then, you'd use a list of Honey objects and
  you'd display these properties:
  
  id
  milk.id
  name
  milk.name
  
  On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko ivan.du...@gmail.com wrote:
  For example..
  class Honey {
  int id;
  int milkid;
  String name;
  // getters and setters
  }
  class Milk {
  int id;
  String name;
  // getters and setters
  }
  
  and my query:
  SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
  milk.name MILKNAME FROM honey, milk
  WHERE  honey.milkid=milk.id;
  
  And i want to display table with these fields.
  
  Which object i must use?
  
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  Well, what sort of object do you want to display?  Are you going to
  just create an Object[] for each row in the table?  Or, are you
  creating a DTO of some sort?
  
  On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko ivan.du...@gmail.com 
wrote:
  Thank you.
  I already do simple things with hibernate and spring ioc.
  Now i want to use plain old jdbc.
  I already get the datatable wich works with one pojo (table).
  Now i am in trouble.. how i can get table for two joined tables, for
  example?
  
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  Yeah, but this doesn't give them an example of how to get the results
  out of a JDBC result set.  This is based on a static, in-memory list
  of Contact objects.  What I would recommend is to look at a
  Hibernate-based example and come up with the JDBC analog.  Here's an
  example from my Advanced Wicket talk I gave a while back:
  
  http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main
  /java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java
  
  At the bottom, there's a data provider which talks to a repository
  to get its data.
  
  
  
  On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
  
  christian.giamba...@excelsisnet.com wrote:
  http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.htm
  l
  
  -Ursprüngliche Nachricht-
  Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
  Gesendet: Donnerstag, 11. Februar 2010 15:47
  An: users@wicket.apache.org
  Betreff: Re: jdbc
  
  I already have method that return my data from db as arraylist. And
  i use this in iterator() method of dataprovider.
  But which object (i think model) i must return?
  
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  You need to create a provider for your data.  Look at what the
  constructor takes and then implement the interface.
  
  On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko ivan.du...@gmail.com 
wrote:
  Hello!
  
  I can't understand how to populate data from a resultset object
  into datatable. Anyone have an example?
  
  Thank you!
  
  --
  --- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  ---
  -- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
  
  
  - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  -
  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 

Re: jdbc

2010-02-15 Thread Ivan Dudko
Can you give me an example, how i can use ResultSet transformed into
Map with for example datatable component?
I think i can write method transforming ResultSet to a Map.

I do not want to use any ORM, because web tier for my app is just
control panel and main features implemented in the backend.


2010/2/15 Ilja Pavkovic ilja.pavko...@binaere-bauten.de:
 use any preferred OR mapper like hibernate, toplink, 

 now problem is not accessing object fields..

 problem is transform resultset to these objects..

 2010/2/12 James Carman jcar...@carmanconsulting.com:
  You could create a reference from Honey to Milk, since you have a
  milkid field there.  Then, you'd use a list of Honey objects and
  you'd display these properties:
 
  id
  milk.id
  name
  milk.name
 
  On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko ivan.du...@gmail.com wrote:
  For example..
  class Honey {
  int id;
  int milkid;
  String name;
  // getters and setters
  }
  class Milk {
  int id;
  String name;
  // getters and setters
  }
 
  and my query:
  SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
  milk.name MILKNAME FROM honey, milk
  WHERE  honey.milkid=milk.id;
 
  And i want to display table with these fields.
 
  Which object i must use?
 
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  Well, what sort of object do you want to display?  Are you going to
  just create an Object[] for each row in the table?  Or, are you
  creating a DTO of some sort?
 
  On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko ivan.du...@gmail.com
 wrote:
  Thank you.
  I already do simple things with hibernate and spring ioc.
  Now i want to use plain old jdbc.
  I already get the datatable wich works with one pojo (table).
  Now i am in trouble.. how i can get table for two joined tables, for
  example?
 
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  Yeah, but this doesn't give them an example of how to get the results
  out of a JDBC result set.  This is based on a static, in-memory list
  of Contact objects.  What I would recommend is to look at a
  Hibernate-based example and come up with the JDBC analog.  Here's an
  example from my Advanced Wicket talk I gave a while back:
 
  http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main
  /java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java
 
  At the bottom, there's a data provider which talks to a repository
  to get its data.
 
 
 
  On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
 
  christian.giamba...@excelsisnet.com wrote:
  http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.htm
  l
 
  -Ursprüngliche Nachricht-
  Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
  Gesendet: Donnerstag, 11. Februar 2010 15:47
  An: users@wicket.apache.org
  Betreff: Re: jdbc
 
  I already have method that return my data from db as arraylist. And
  i use this in iterator() method of dataprovider.
  But which object (i think model) i must return?
 
  2010/2/11 James Carman jcar...@carmanconsulting.com:
  You need to create a provider for your data.  Look at what the
  constructor takes and then implement the interface.
 
  On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko ivan.du...@gmail.com
 wrote:
  Hello!
 
  I can't understand how to populate data from a resultset object
  into datatable. Anyone have an example?
 
  Thank you!
 
  --
  --- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  ---
  -- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
 
  
  - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
 
 
  
  - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
  additional commands, e-mail: users-h...@wicket.apache.org
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  

Re: jdbc

2010-02-15 Thread Ilja Pavkovic
 Can you give me an example, how i can use ResultSet transformed into
 Map with for example datatable component?
 I think i can write method transforming ResultSet to a Map.
 
 I do not want to use any ORM, because web tier for my app is just
 control panel and main features implemented in the backend.

You want to swim without getting wet. Fine :)

public class MyMilkFactory {
public ListMilk provideHoneyObjects() {
// iterate over sql statement/REsultSet
   Milk milk = createMilk(rs);
   Honey honey provideHoney(rs.getInteger(honeyid));
   
}

public Milk createMilk(ResultSet rs) { // do not use an OR/mapper here 
but do the dirty work on your own}

public Honey provideHoney(int id) {//read from database, again do the 
dirty work on your own }
}




 2010/2/15 Ilja Pavkovic ilja.pavko...@binaere-bauten.de:
  use any preferred OR mapper like hibernate, toplink, 
  
  now problem is not accessing object fields..
  
  problem is transform resultset to these objects..
  
  2010/2/12 James Carman jcar...@carmanconsulting.com:
   You could create a reference from Honey to Milk, since you have a
   milkid field there.  Then, you'd use a list of Honey objects and
   you'd display these properties:
   
   id
   milk.id
   name
   milk.name
   
   On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko ivan.du...@gmail.com 
wrote:
   For example..
   class Honey {
   int id;
   int milkid;
   String name;
   // getters and setters
   }
   class Milk {
   int id;
   String name;
   // getters and setters
   }
   
   and my query:
   SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
   milk.name MILKNAME FROM honey, milk
   WHERE  honey.milkid=milk.id;
   
   And i want to display table with these fields.
   
   Which object i must use?
   
   2010/2/11 James Carman jcar...@carmanconsulting.com:
   Well, what sort of object do you want to display?  Are you going to
   just create an Object[] for each row in the table?  Or, are you
   creating a DTO of some sort?
   
   On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko ivan.du...@gmail.com
  
  wrote:
   Thank you.
   I already do simple things with hibernate and spring ioc.
   Now i want to use plain old jdbc.
   I already get the datatable wich works with one pojo (table).
   Now i am in trouble.. how i can get table for two joined tables,
   for example?
   
   2010/2/11 James Carman jcar...@carmanconsulting.com:
   Yeah, but this doesn't give them an example of how to get the
   results out of a JDBC result set.  This is based on a static,
   in-memory list of Contact objects.  What I would recommend is to
   look at a Hibernate-based example and come up with the JDBC
   analog.  Here's an example from my Advanced Wicket talk I gave a
   while back:
   
   http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/m
   ain
   /java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.j
   ava
   
   At the bottom, there's a data provider which talks to a
   repository to get its data.
   
   
   
   On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
   
   christian.giamba...@excelsisnet.com wrote:
   http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.
   htm l
   
   -Ursprüngliche Nachricht-
   Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
   Gesendet: Donnerstag, 11. Februar 2010 15:47
   An: users@wicket.apache.org
   Betreff: Re: jdbc
   
   I already have method that return my data from db as arraylist.
   And i use this in iterator() method of dataprovider.
   But which object (i think model) i must return?
   
   2010/2/11 James Carman jcar...@carmanconsulting.com:
   You need to create a provider for your data.  Look at what the
   constructor takes and then implement the interface.
   
   On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko
   ivan.du...@gmail.com
  
  wrote:
   Hello!
   
   I can't understand how to populate data from a resultset object
   into datatable. Anyone have an example?
   
   Thank you!
   
   ---
   --- --- To unsubscribe, e-mail:
   users-unsubscr...@wicket.apache.org For additional commands,
   e-mail: users-h...@wicket.apache.org
   
   
   --- -- To unsubscribe, e-mail:
   users-unsubscr...@wicket.apache.org For additional commands,
   e-mail: users-h...@wicket.apache.org
   
   -
   --- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
   
   
   -
   --- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
   
   --
   --- To unsubscribe, e-mail: 

Re: Re: jdbc

2010-02-15 Thread Leo . Erlandsson
If you want to use a Map and display it in a Datatable there's no 
difference from using an Object in Wicket. 

You access the key/values using PropertyColumn as usual (i.e. you don't 
really need to make any changes to your code). For Objects you use e. g. 
name for the getName() method. When using Maps name will return the 
value corresponding to the key name.




 Can you give me an example, how i can use ResultSet transformed into
 Map with for example datatable component?
 I think i can write method transforming ResultSet to a Map.
 
 I do not want to use any ORM, because web tier for my app is just
 control panel and main features implemented in the backend.

 You want to swim without getting wet. Fine :)

 public class MyMilkFactory {
public ListMilk provideHoneyObjects() {
// iterate over sql statement/REsultSet
   Milk milk = createMilk(rs);
   Honey honey provideHoney(rs.getInteger(honeyid));
 
}

public Milk createMilk(ResultSet rs) { // do not use an 
OR/mapper here 
 but do the dirty work on your own}

public Honey provideHoney(int id) {//read from database, 
again do the 
 dirty work on your own }
}


PanelCachingTab

2010-02-15 Thread Leszek Gawron

hello,

is there any reason why PanelCachingTab.isVisible() does not delegate to 
inner tab ?. This results in such spaghetti code:




tabs.add( new PanelCachingTab( new AbstractTab( new ResourceModel( 
configuration ) ) {
@Override
public Panel getPanel( String panelId ) {
return new UnitConfigurationPanel( panelId, 
getModel(), notificationsPanel );
}
} ) {
@Override
public boolean isVisible() {
MonitoringUserDetails userDetails = 
(MonitoringUserDetails) UserUtils.getPrincipal();
return 
userDetails.getMonitoringUser().isConfigurationAccess();
};
});



lg

--
Leszek Gawron  http://lgawron.blogspot.com

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



Re: Re: jdbc

2010-02-15 Thread Ivan Dudko
Thank you!
I just discovered this sample:
http://www.brettdutton.com/blog/?p=4

What i can do.. if i want to use FilterToolbar with DataTable?

2010/2/15  leo.erlands...@tyringe.com:
 If you want to use a Map and display it in a Datatable there's no
 difference from using an Object in Wicket.

 You access the key/values using PropertyColumn as usual (i.e. you don't
 really need to make any changes to your code). For Objects you use e. g.
 name for the getName() method. When using Maps name will return the
 value corresponding to the key name.




 Can you give me an example, how i can use ResultSet transformed into
 Map with for example datatable component?
 I think i can write method transforming ResultSet to a Map.

 I do not want to use any ORM, because web tier for my app is just
 control panel and main features implemented in the backend.

 You want to swim without getting wet. Fine :)

 public class MyMilkFactory {
                public ListMilk provideHoneyObjects() {
                                // iterate over sql statement/REsultSet
                               Milk milk = createMilk(rs);
               Honey honey provideHoney(rs.getInteger(honeyid));

                }

                public Milk createMilk(ResultSet rs) { // do not use an
 OR/mapper here
 but do the dirty work on your own}

                public Honey provideHoney(int id) {//read from database,
 again do the
 dirty work on your own }
}


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



Re: jdbc

2010-02-15 Thread James Carman
Sorry, man.  Some things just have to be left as an exercise for the
reader.  That's not a Wicket question.

On Mon, Feb 15, 2010 at 6:14 AM, Ivan Dudko ivan.du...@gmail.com wrote:
 now problem is not accessing object fields..

 problem is transform resultset to these objects..

 2010/2/12 James Carman jcar...@carmanconsulting.com:
 You could create a reference from Honey to Milk, since you have a
 milkid field there.  Then, you'd use a list of Honey objects and
 you'd display these properties:

 id
 milk.id
 name
 milk.name




 On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko ivan.du...@gmail.com wrote:
 For example..
 class Honey {
 int id;
 int milkid;
 String name;
 // getters and setters
 }
 class Milk {
 int id;
 String name;
 // getters and setters
 }

 and my query:
 SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
 milk.name MILKNAME FROM honey, milk
 WHERE  honey.milkid=milk.id;

 And i want to display table with these fields.

 Which object i must use?

 2010/2/11 James Carman jcar...@carmanconsulting.com:
 Well, what sort of object do you want to display?  Are you going to
 just create an Object[] for each row in the table?  Or, are you
 creating a DTO of some sort?

 On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko ivan.du...@gmail.com wrote:
 Thank you.
 I already do simple things with hibernate and spring ioc.
 Now i want to use plain old jdbc.
 I already get the datatable wich works with one pojo (table).
 Now i am in trouble.. how i can get table for two joined tables, for 
 example?

 2010/2/11 James Carman jcar...@carmanconsulting.com:
 Yeah, but this doesn't give them an example of how to get the results
 out of a JDBC result set.  This is based on a static, in-memory list
 of Contact objects.  What I would recommend is to look at a
 Hibernate-based example and come up with the JDBC analog.  Here's an
 example from my Advanced Wicket talk I gave a while back:

 http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java

 At the bottom, there's a data provider which talks to a repository
 to get its data.



 On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
 christian.giamba...@excelsisnet.com wrote:
 http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html

 -Ursprüngliche Nachricht-
 Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
 Gesendet: Donnerstag, 11. Februar 2010 15:47
 An: users@wicket.apache.org
 Betreff: Re: jdbc

 I already have method that return my data from db as arraylist. And i
 use this in iterator() method of dataprovider.
 But which object (i think model) i must return?

 2010/2/11 James Carman jcar...@carmanconsulting.com:
 You need to create a provider for your data.  Look at what the
 constructor takes and then implement the interface.

 On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko ivan.du...@gmail.com 
 wrote:
 Hello!

 I can't understand how to populate data from a resultset object into 
 datatable.
 Anyone have an example?

 Thank you!

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



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



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


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



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



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



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



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



 -
 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: 

Re: Re: Re: jdbc

2010-02-15 Thread Leo . Erlandsson
Should be no different when using JDBC than using it when using Domain 
Objects.

Check out Wicket Phonebook Example that uses FilterToolbar:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook

Source Code Example:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/phonebook/src/main/java/wicket/contrib/phonebook/web/page/ListContactsPage.java


 Thank you!
 I just discovered this sample:
 http://www.brettdutton.com/blog/?p=4

 What i can do.. if i want to use FilterToolbar with DataTable?


How to add Images in wicket Navigator instead of ?

2010-02-15 Thread saravana kumar
How to add Images in wicket Navigator instead of?

-- 
Thanks  Regards,
SaravanaKumar G.


Re: How to add Images in wicket Navigator instead of ?

2010-02-15 Thread Leo . Erlandsson
 How to add Images in wicket Navigator instead of?

One way, I'm sure there are others:

Write your own MyPagingNavigator that extends PagingNavigator or 
AjaxPagingNavigator. Provide your own markup.
Override  protected PagingNavigator newPagingNavigator(String navigatorId, 
final DataTable? table); in NavigationToolbar / AjaxNavigationToolbar 
and provide your own MyPagingNavigator there.



Med vänlig hälsning / Sincerely yours
Leo Erlandsson

Tyringekonsult AB

Phone: +46-(0)451- 594 54
Email: leo.erlands...@tyringe.com
Website: www.tyringe.com





saravana kumar shav...@gmail.com 
2010-02-15 13:34
Sänd svar till
users@wicket.apache.org


Till
users@wicket.apache.org
Kopia

Ärende
How to add Images in wicket Navigator instead of?







-- 
Thanks  Regards,
SaravanaKumar G.



Re: How to add Images in wicket Navigator instead of ?

2010-02-15 Thread shavang

thank u for your reply.I didn't understand. please send code or link.

Leo Erlandsson wrote:
 
 How to add Images in wicket Navigator instead of?
 
 One way, I'm sure there are others:
 
 Write your own MyPagingNavigator that extends PagingNavigator or 
 AjaxPagingNavigator. Provide your own markup.
 Override  protected PagingNavigator newPagingNavigator(String navigatorId, 
 final DataTable? table); in NavigationToolbar / AjaxNavigationToolbar 
 and provide your own MyPagingNavigator there.
 
 
 
 Med vänlig hälsning / Sincerely yours
 Leo Erlandsson
 
 Tyringekonsult AB
 
 Phone: +46-(0)451- 594 54
 Email: leo.erlands...@tyringe.com
 Website: www.tyringe.com
 
 
 
 
 
 saravana kumar shav...@gmail.com 
 2010-02-15 13:34
 Sänd svar till
 users@wicket.apache.org
 
 
 Till
 users@wicket.apache.org
 Kopia
 
 Ärende
 How to add Images in wicket Navigator instead of?
 
 
 
 
 
 
 
 -- 
 Thanks  Regards,
 SaravanaKumar G.
 
 
 
 -
 ---
 Leo Erlandsson, M. Sc.
 

-- 
View this message in context: 
http://old.nabble.com/How-to-add-Images-in-wicket-Navigator-instead-of-%3C%3C-%3C-%3E-%3E%3E--tp27593215p27593428.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



NullPointerException in ResourceReference.bind (Line141)

2010-02-15 Thread Andreas Strafner

Hello everyone,

in our application (with wicket 1.4.5) we 're using a static 
ResourceReferences and pass it into several Wicket Images 
(setImageResourceReference) that are displayed in multiple rows of 
several DataViews. At the first glanze everything works fine, but during 
performancetests we ran occasionally into NullpointerExceptions in the 
bind method of the Resource Reference. A deeper look into the wicket 
source showed us, that the field resource of the ResourceReference has 
to be 'null' (see ResourceReference line 141). As the field is checked 
for not being 'null' just the line above this seems to be a 
multithreading issue.


Actually we thought that ResourceReferences could be shared as statics  
through the application. Is this assumption wrong?

Is there a standard mechanism to be used then instead?

Thanks for your help,

andy

_Details:

A deeper Look into wicket brought us to the following point:
The Image class is using a LocalizedImageResource. On calling 
setImageResourceReference the LocalizedImageResource.bind Method is 
called. In there, the resourceReference.bind is called and afterwards 
(as the resource is a PackageReource) resource.setLocale. Set Locale is 
invalidating the field 'resource' by setting it to 'null' and could be 
the root cause of the NullpointerException thrown.


__The ResourceReference Definition:
class ImageAnchor {
   public static final IMAGE = new ResourceReference(ImageAnchor.class, 
image.gif);

}

___The Exception thrown:
Root cause: class java.lang.NullPointerException
 java.lang.NullPointerException
 at 
org.apache.wicket.ResourceReference.bind(ResourceReference.java:141)
 at 
org.apache.wicket.markup.html.image.resource.LocalizedImageResource.bind(LocalizedImageResource.java:180) 

 at 
org.apache.wicket.markup.html.image.resource.LocalizedImageResource.setResourceReference(LocalizedImageResource.java:246) 

 at 
org.apache.wicket.markup.html.image.resource.LocalizedImageResource.setResourceReference(LocalizedImageResource.java:220) 

 at 
org.apache.wicket.markup.html.image.Image.setImageResourceReference(Image.java:166) 


 [..]
 at 
org.apache.wicket.markup.repeater.RefreshingView$1.newItem(RefreshingView.java:114) 

 at 
org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:71) 

 at 
org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:68) 

 at 
org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:186) 

 at 
org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:98) 

 at 
org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131) 

 at 
org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:116) 



_ ResourceReference.java:138-141:

if ((resource != null)  (resource instanceof PackageResource))
{
  // see newResource() as well.
  locale = ((PackageResource)resource).getLocale();

 [..]

}



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


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



Re: problem dynamic image - explorer

2010-02-15 Thread pechenique

Hi, (Monday, back to work :) )

The DynamicImageResource im using has by default 'contentType = image/ +
format;' where format is 'png'..

So, i think there is no need to set again the content type, or you mean set
the content type in other place?

Could be a problem in explorer that doesn't recognize the type of the
dynamic image?


thanks,




igor.vaynberg wrote:
 
 make sure you correctly set the content type
 
 -igor
 
 On Fri, Feb 12, 2010 at 10:12 AM, _Eynob _ ey...@hotmail.com wrote:

 Hi

 Im creating a dynamic image with the DynamicImageResource, and my problem
 with this is in explorer, since my generated image is a png and
 there(explorer) when i choose 'save as..' it try to save it as a 'bmp'.

 In firefox it works well and when i try to save it, i get the image as
 'png'.

 Someone know what should i set for explorer to know the type of the image
 ?


 When it renders the image tag has this format:

  ?wicket:interface=modal-dialog-pagemap:10:svgImage::IResourceListener:: 

 So i guess the problem is in the 'src' attribute


 Any help will be appreciated..

 thanks.


 _
 Hotmail: Powerful Free email with security by Microsoft.
 https://signup.live.com/signup.aspx?id=60969
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/problem-dynamic-image---explorer-tp27567365p27593795.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



wicket Google maps integration

2010-02-15 Thread Josh Kamau
Hi guys;

Is the wicket-contrib-gmap project still active? I need to intergrate google
maps and i was wondering if i can use it.

Regards

Joshua


Re: Re: How to add Images in wicket Navigator instead of ?

2010-02-15 Thread Leo . Erlandsson
 thank u for your reply.I didn't understand. please send code or link.

Unfortunately I can't include code from our project. However, if you 
search this mailing list you'll find several examples and other solutions 
to your problem:

http://old.nabble.com/PagingNavigator-with-custom-images-ts13422772.html#a13422772
http://old.nabble.com/Help%3A-Graphic-link-in-PagingNavigator-ts21453859.html#a21453994
http://old.nabble.com/How-to-change-the-style-of-navigator-in-PageableViewList-ts14978321.html#a1501
 
  --- Including code






Re: wicket Google maps integration

2010-02-15 Thread Erik van Oosten

Hi Joshue,

I believe wicket-contrib-gmap is not active anymore.
You are probably better off with wicket-gmap2 project.

Regards,
   Erik.


Josh Kamau wrote:

Hi guys;

Is the wicket-contrib-gmap project still active? I need to intergrate 
google

maps and i was wondering if i can use it.

Regards
Joshua


--
Send from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: wicket Google maps integration

2010-02-15 Thread Josh Kamau
Thanks alot Erik. Is the library in maven repository?

regards

On Mon, Feb 15, 2010 at 5:03 PM, Erik van Oosten e.vanoos...@grons.nlwrote:

 Hi Joshue,

 I believe wicket-contrib-gmap is not active anymore.
 You are probably better off with wicket-gmap2 project.

 Regards,
   Erik.



 Josh Kamau wrote:

 Hi guys;

 Is the wicket-contrib-gmap project still active? I need to intergrate
 google
 maps and i was wondering if i can use it.

 Regards
 Joshua


 --
 Send from my SMTP compliant software
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/



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




How to ajax update a component without triggered ajaxrequesttarget

2010-02-15 Thread Martin Asenov
Hello guys!

How can I update a component without having AjaxRequestTarget triggered from a 
button or a link?

I tried this:
myComponent.renderComponent();
new AjaxRequestTarget(getPage()).addComponent(myComponent)

myComponent has output markup id set to true

both didn't work for me...

Thanks in advance for your help!

Regards,
Martin


Re: How to ajax update a component without triggered ajaxrequesttarget

2010-02-15 Thread Ernesto Reinaldo Barreiro
Can you explain a bit more what you want to achieve? Or your use case?

Ernesto

On Mon, Feb 15, 2010 at 4:38 PM, Martin Asenov mase...@velti.com wrote:

 Hello guys!

 How can I update a component without having AjaxRequestTarget triggered
 from a button or a link?

 I tried this:
 myComponent.renderComponent();
 new AjaxRequestTarget(getPage()).addComponent(myComponent)

 myComponent has output markup id set to true

 both didn't work for me...

 Thanks in advance for your help!

 Regards,
 Martin



RE: How to ajax update a component without triggered ajaxrequesttarget

2010-02-15 Thread Martin Asenov
Hello, Ernesto!

The use case is that I have modal in a modal. 

The first modal displays some information and the second modal is a 
confirmation dialog that asks the user if he really wants to remove the entry.

when I say in the conf dialog under the 'yes' button; 
dialog.setWindowClosedCallback(...);
dialog.close(target);

the dialog really gets closed, but the callback is never executed.
this error occurs only in this specific case, when the parent page is in 
another modal. When it's not, everything works fine.

So I replaced the above mentioned paragraph with:

parentPage.executeSomeMethod(target);
dialog.close(target);

of course the target isn't a valid one, because it comes from another window 
(or so I think)

so my idea is to trigger ajaxrequesttarget for a page, without having to 
trigger it from a ajax button/link or a modal window callback

Thanks,
Martin

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Monday, February 15, 2010 5:42 PM
To: users@wicket.apache.org
Subject: Re: How to ajax update a component without triggered ajaxrequesttarget

Can you explain a bit more what you want to achieve? Or your use case?

Ernesto

On Mon, Feb 15, 2010 at 4:38 PM, Martin Asenov mase...@velti.com wrote:

 Hello guys!

 How can I update a component without having AjaxRequestTarget triggered
 from a button or a link?

 I tried this:
 myComponent.renderComponent();
 new AjaxRequestTarget(getPage()).addComponent(myComponent)

 myComponent has output markup id set to true

 both didn't work for me...

 Thanks in advance for your help!

 Regards,
 Martin


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



Re: wicket and javascript

2010-02-15 Thread Igor Vaynberg
allow your component to implement IHeaderContributor and output both
your base js and string js from the renderhread() method

-igor

2010/2/15 björn liffers bad.ad...@arcor.de:
 hello,
 i tried to generate a.js-file, but i wasn´t able to generate it in the folder 
 where i wanted it to be.
 so i decided to generate it from a StringModel but it still didn´t work.

 i have several scripts that are implemented via resource...
 like this one:
     add(JavascriptPackageResource.getHeaderContribution(Start.class, 
 js/raphael-min.js));

 the StringModel was added after the script-ressource
     add(JavascriptPackageResource.getHeaderContribution(Start.class, 
 js/raphael-min.js));
     add(new Label(rScript, Model.of(rScript)).setEscapeModelStrings(false));

 but when the page rendered the StringModel was implemented before the 
 ressources where added.

 i dislike to place the StringModel´s script-tag in the body-tag instead of 
 the head-tag of my html-file
 is there any possibility to solve that?
 if it´s not possible to do it this way, is there anyone who can tell me how 
 to get the absolute path to my Start.class dynamically?
 would be glad to get answers to both questions :)

 in my company there isn´t anyone dealing with wicket, it´s some kind of 
 explorative task for me

 thank you
 *exceptionist*

 Immer auf dem Laufenden! Sport, Auto, Reise, Politik und Promis. Von uns für 
 Sie: der neue Arcor.de-Newsletter!
 Jetzt anmelden und einfach alles wissen: 
 http://www.arcor.de/rd/footer.newsletter

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



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



Re: PanelCachingTab

2010-02-15 Thread Igor Vaynberg
open an rfe in jira

-igor

2010/2/15 Leszek Gawron lgaw...@apache.org:
 hello,

 is there any reason why PanelCachingTab.isVisible() does not delegate to
 inner tab ?. This results in such spaghetti code:


                tabs.add( new PanelCachingTab( new AbstractTab( new
 ResourceModel( configuration ) ) {
                       �...@override
                        public Panel getPanel( String panelId ) {
                                return new UnitConfigurationPanel( panelId,
 getModel(), notificationsPanel );
                        }
                } ) {
                       �...@override
                        public boolean isVisible() {
                                MonitoringUserDetails userDetails =
 (MonitoringUserDetails) UserUtils.getPrincipal();
                                return
 userDetails.getMonitoringUser().isConfigurationAccess();
                        };
                });


        lg

 --
 Leszek Gawron                              http://lgawron.blogspot.com

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



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



Re: best way to detect session termination

2010-02-15 Thread Eelco Hillenius
You could use a HttpSessionBindingListener like Wicket does internally
(see AbstractHttpSessionStore). Or as a hack store references to the
session objects in the session listener. That's the easy fix, but
doesn't scale if you need session replication (unless maybe you use
e.g. Terracotta).

Eelco

On Sun, Feb 14, 2010 at 4:36 AM, Andreas Lüdtke sam.lued...@t-online.de wrote:
 Hi Eelco,

 thanks for the hint. Now I can detect the end of a session. Unfortunately I
 can't access my own wicket session in that sessionDestroyed() method in order
 to get the info about the connected user. I've got ther error message
 java.lang.IllegalStateException: you can only locate or create sessions in
 the context of a request cycle.

 Do you know how I can achieve this?

 Andreas

 -Original Message-
 From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com]
 Sent: Saturday, February 13, 2010 7:02 PM
 To: users@wicket.apache.org; sam.lued...@t-online.de
 Subject: Re: best way to detect session termination

 http://www.xyzws.com/Servletfaq/when-do-i-use-httpsessionlistener/7

 Eelco

 On Sat, Feb 13, 2010 at 8:38 AM, Andreas Lüdtke
 sam.lued...@t-online.de wrote:
  I would like to detect the termination of the session to set the
  lastAccesTime in the user profile. This should also
 happen if the session
  times out.
 
  I read in archive about a HttpSessionListener that should
 do the trick.
  Unfortunately I can't find a place to install it.
 
  Thanks
 
  Andreas
 
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




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



Re: wicket Google maps integration

2010-02-15 Thread TahitianGabriel

You can get the source code here :
https://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-core/gmap2-parent
https://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-core/gmap2-parent
 

And use it in your pom.xml like that :
dependency
groupIdorg.wicketstuff/groupId
artifactIdgmap2/artifactId
version1.4.1/version
/dependency


I'm using it for a couple of projects and it's working just fine.

Regards,

Gabriel.


Josh Kamau wrote:
 
 Thanks alot Erik. Is the library in maven repository?
 
 regards
 
 On Mon, Feb 15, 2010 at 5:03 PM, Erik van Oosten
 e.vanoos...@grons.nlwrote:
 
 Hi Joshue,

 I believe wicket-contrib-gmap is not active anymore.
 You are probably better off with wicket-gmap2 project.

 Regards,
   Erik.



 Josh Kamau wrote:

 Hi guys;

 Is the wicket-contrib-gmap project still active? I need to intergrate
 google
 maps and i was wondering if i can use it.

 Regards
 Joshua


 --
 Send from my SMTP compliant software
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/



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


 
 

-- 
View this message in context: 
http://old.nabble.com/wicket-Google-maps-integration-tp27593866p27597761.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: quickstart POM has wrong artifactId for jetty maven plugin

2010-02-15 Thread TahitianGabriel

Had the same behavior when lauching maven in command line (OK within
eclipse). Just add the jetty plugin with the version you want in your
pom.xml :

plugin
groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
version6.1.4/version
/plugin


-- 
View this message in context: 
http://old.nabble.com/quickstart-POM-has-wrong-artifactId-for-jetty-maven-plugin-tp27555192p27597866.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to add Images in wicket Navigator instead of ?

2010-02-15 Thread Peter Karich

For code see the resources here (the example with db4o):
http://karussell.wordpress.com/2010/01/18/crud-with-wicket-guice-db4o-neodatis/

Peter.

--
Free your timetabling!
http://timefinder.sourceforge.net/


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



Image that loads from a database, and use a default when no data exists

2010-02-15 Thread Esteban Masoero

Hi there:

I know how to instanciate an image component that loads the image from a 
database, and I know how to make an image component that loads an image 
from a static resource.
Can I make a single image component that upon some condition, uses the 
database and upon another uses the static resource?


Thanks,

Esteban

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



Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2010-02-15 Thread Leon Nieuwoudt
Hi all,

After about 5 minutes of omfg not that error again, I think I found a
quick hack to avoid org.hibernate.LazyInitializationException with
WicketTester. I've checked everywhere on the lists but didn't find a similar
solution, so apologies if someone else already posted this. There may also
be a better way to do it.

If I can explain it properly:

* I have an abstract BaseAdminApplication class that extends WebApplication,
and does the standard application configurations (mounting/stuff), but no
Spring injection configuration yet.

* Then I have a SpringAdminApplication that extends from
BaseAdminApplication. This is referenced for the normal
applicationContext.xml, and correctly configures Spring Injection.

* There is another subclass, called JUnitAdminApplication, that also extends
from BaseAdminApplication. This is referenced in the Unit Testing
application context.

* The JUnitAdminApplication mimics the OSIV pattern, inside Wicket's
WebSession.attach() and .detach() methods.

* Configure Spring Injection outside of the WebApplication. For some reason
there were odd errors when configuring during the WebApplication.init()
process.

I do hope it makes sense. Unfortunately I can't give out all the code, but
I'm sure it'll set the next person on the right track before redoing tests
with Selenium at the 11th hour. So far there are no strange surprises, yet.

---

package com.SECRETAPP.web;

import ..;

public class JUnitAdminApplication extends BaseAdminApplication {
@Autowired
SessionFactory sessionFactory;

@Override
public Session newSession(Request request, Response response) {
return new WebSession(request) {
@Override
protected void attach() {
// Do the attach magic that I don't care about right now
super.attach();

// Force the creation of a new Hibernate session using
Spring
SessionFactoryUtils.getSession(sessionFactory, true);

// Force the session to be closed only when we tell it to
// By default, the Hibernate session is closed somewhere
during
// the request cycle. Similar to OpenSessionInViewFilter
SessionFactoryUtils.initDeferredClose(sessionFactory);
}


@Override
protected void detach() {
super.detach();
// Only close the Hibernate Session now, after all rendering
is done
SessionFactoryUtils.processDeferredClose(sessionFactory);
}

};
}

// Other code...
}



In com/SECRETAPP/web/BaseTester-context.xml ..

beans.
context:component-scan base-package=com.SECRETAPP /

bean id=wicketApplication
class=com.SECRETAPP.web.JUnitAdminApplication/


!-- other stuff --
/beans



In my WicketTestBase abstract class...

public abstract class WicketTestBase {

// Stripped code

protected WicketTester createTester() {
if(tester != null) {
return tester;
}
WebApplication app = (WebApplication)
applicationContext.getBean(wicketApplication);

tester = new WicketTester(app) {

@Override
public ServletContext newServletContext(String path) {
MockServletContext servletContext = (MockServletContext)
super.newServletContext(path);


servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
applicationContext);
return servletContext;
}
};

app.addComponentInstantiationListener(new
SpringComponentInjector(tester.getApplication(), applicationContext, true))

// Stripped code

return tester;
}
}


Re: NullPointerException in ResourceReference.bind (Line141)

2010-02-15 Thread Igor Vaynberg
it is peculiar that no one else has seen such an error...

if you can provide us with a way to reproduce this we would be happy
to look into it.

-igor

On Mon, Feb 15, 2010 at 5:19 AM, Andreas Strafner
andreas.straf...@web.de wrote:
 Hello everyone,

 in our application (with wicket 1.4.5) we 're using a static
 ResourceReferences and pass it into several Wicket Images
 (setImageResourceReference) that are displayed in multiple rows of several
 DataViews. At the first glanze everything works fine, but during
 performancetests we ran occasionally into NullpointerExceptions in the bind
 method of the Resource Reference. A deeper look into the wicket source
 showed us, that the field resource of the ResourceReference has to be
 'null' (see ResourceReference line 141). As the field is checked for not
 being 'null' just the line above this seems to be a multithreading issue.

 Actually we thought that ResourceReferences could be shared as statics
  through the application. Is this assumption wrong?
 Is there a standard mechanism to be used then instead?

 Thanks for your help,

 andy

 _Details:

 A deeper Look into wicket brought us to the following point:
 The Image class is using a LocalizedImageResource. On calling
 setImageResourceReference the LocalizedImageResource.bind Method is called.
 In there, the resourceReference.bind is called and afterwards (as the
 resource is a PackageReource) resource.setLocale. Set Locale is invalidating
 the field 'resource' by setting it to 'null' and could be the root cause of
 the NullpointerException thrown.

 __The ResourceReference Definition:
 class ImageAnchor {
   public static final IMAGE = new ResourceReference(ImageAnchor.class,
 image.gif);
 }

 ___The Exception thrown:
 Root cause: class java.lang.NullPointerException
  java.lang.NullPointerException
     at org.apache.wicket.ResourceReference.bind(ResourceReference.java:141)
     at
 org.apache.wicket.markup.html.image.resource.LocalizedImageResource.bind(LocalizedImageResource.java:180)
     at
 org.apache.wicket.markup.html.image.resource.LocalizedImageResource.setResourceReference(LocalizedImageResource.java:246)
     at
 org.apache.wicket.markup.html.image.resource.LocalizedImageResource.setResourceReference(LocalizedImageResource.java:220)
     at
 org.apache.wicket.markup.html.image.Image.setImageResourceReference(Image.java:166)
     [..]
     at
 org.apache.wicket.markup.repeater.RefreshingView$1.newItem(RefreshingView.java:114)
     at
 org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:71)
     at
 org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:68)
     at
 org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:186)
     at
 org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:98)
     at
 org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131)
     at
 org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:116)

 _ ResourceReference.java:138-141:

 if ((resource != null)  (resource instanceof PackageResource))
 {
      // see newResource() as well.
      locale = ((PackageResource)resource).getLocale();

  [..]

 }



 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __

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



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



Re: Image that loads from a database, and use a default when no data exists

2010-02-15 Thread Steve Swinsburg
Hi Esteban,

Make a component  which takes a parameter and performs the appropriate action 
for its logic, then displays the image.
I do this is an app of mine, where the image comes from one of several sources.

cheers,
Steve


On 16/02/2010, at 6:30 AM, Esteban Masoero wrote:

 Hi there:
 
 I know how to instanciate an image component that loads the image from a 
 database, and I know how to make an image component that loads an image from 
 a static resource.
 Can I make a single image component that upon some condition, uses the 
 database and upon another uses the static resource?
 
 Thanks,
 
 Esteban
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



smime.p7s
Description: S/MIME cryptographic signature


Selenium Testing - Ajax Loads

2010-02-15 Thread Douglas Ferguson
Hey,

I'm starting to write selenium tests for my wicket app and am running into 
issues with a couple of wicket related problems that I thought perhaps somebody 
else may have solved.

1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
elements.. Other times it might be  element_path_name_4 to  element_path_name_7 
after some ajax calls, I'm not sure when/why this happens. Need to play with it 
more. 

2) I have issues with timing which is typical, and most people call 
waitForPageToLoad which works fine for normal http requests, but if It is an 
ajax request I'm waiting for, then I have to implement a waitForContition. Is 
there a wicket convention I could use here? i.e. how can I know that a wicket 
ajax call has completed?

Thanks,

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



Re: Re: How to add Images in wicket Navigator instead of ?

2010-02-15 Thread shavang

Hi, Thank  u for your reply. Here with i sent my coding for Wicket navigator.
please tell me where to add images in wicket navigator. 

navigator = new PagingNavigator(navigator, dataView);
dataView.setItemsPerPage(5);
navigator.setVisible(false);
addListViewPanel.add(navigator);

navigator-- this is my Wicket Id.
dataView --Displays record through DataView.

I waiting for your Valuable reply. It would be great reply soon.


Leo Erlandsson wrote:
 
 thank u for your reply.I didn't understand. please send code or link.
 
 Unfortunately I can't include code from our project. However, if you 
 search this mailing list you'll find several examples and other solutions 
 to your problem:
 
 http://old.nabble.com/PagingNavigator-with-custom-images-ts13422772.html#a13422772
 http://old.nabble.com/Help%3A-Graphic-link-in-PagingNavigator-ts21453859.html#a21453994
 http://old.nabble.com/How-to-change-the-style-of-navigator-in-PageableViewList-ts14978321.html#a1501
  
   --- Including code
 
 
 
 
 
 
 -
 ---
 Leo Erlandsson, M. Sc.
 

-- 
View this message in context: 
http://old.nabble.com/How-to-add-Images-in-wicket-Navigator-instead-of-%3C%3C-%3C-%3E-%3E%3E--tp27593215p27603628.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Help: Graphic link in PagingNavigator

2010-02-15 Thread shavang

Thank u for your reply.Can u please Send me Custom Navigator complete coding?

Pills wrote:
 
 Overriding the protected method 
 PagingNavigator#newPagingNavigationIncrementLink(String id, IPageable 
 pageable, int increment) should do the trick, too.
 
 Dipu a écrit :
 extend the PagingNavigator and provide your own markup with the
 graphics you want.

 regards
 dipu

 On Wed, Jan 14, 2009 at 11:04 AM, freak182 eman.noll...@gmail.com
 wrote:
   
 Hello,

 The clients wants the   and   should be graphic. Is there a
 way to
 do this?

 Thanks a lot.
 Cheers.
 --
 View this message in context:
 http://www.nabble.com/Help%3A-Graphic-link-in-PagingNavigator-tp21453859p21453859.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 

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


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

-- 
View this message in context: 
http://old.nabble.com/Help%3A-Graphic-link-in-PagingNavigator-tp21453859p27603800.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: setPageExpiredErrorPage only for certain pages?

2010-02-15 Thread Andreas Lüdtke
Peter,

I implemented my own RequestCycle and that did the trick.

Thanks

Andreas 

 -Original Message-
 From: Major Péter [mailto:majorpe...@sch.bme.hu] 
 Sent: Sunday, February 14, 2010 2:00 PM
 To: users@wicket.apache.org
 Subject: Re: setPageExpiredErrorPage only for certain pages?
 
 My guess would be to override RequestCycle#onRuntimeException and do
 your logic there if the exception is PageExpiredException.
 
 Regards,
 Peter
 
 2010-02-14 13:54 keltezéssel, Andreas Lüdtke írta:
  In my WebApplication class I use setPageExpiredErrorPage(). 
 So far, so good.
  But this happens also for the main/home page that everybody 
 can access. I
  would like to redirect only the pages where a user has to 
 login, not for the
  home page. If the homepage expires, a simple redirect to a 
 new session with
  that page should be made.
  
  Is this possible with wicket?
  
  Andreas
 
 -
 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



Delegate a Modelchange to the child components. Or using a ModalWindow for displaying different Models of a specific Type.

2010-02-15 Thread Martin U
Its not easy to find the right topic, but i will try to explain my problem
as best as i can.

I want to display an user-detail View (User is an BusinessObject in my
Application) inside a specific Modal window.


So at the rendering of the Site i place an empty or dummy UserObject
inside my UserEdit-Panel and later if the user choose one specific user from
a Table i want to replace this dummy-Model with the clicked-User-Model.

public class UserEdit extends Panel {

/**
 * @param id
 * @param model
 */

private IModelUser model;
CompoundPropertyModelUser cpm;

public UserEdit(String id, IModelUser _model) {
super(id, _model);

this.model = _model;

init();
}

private void init(){

cpm = new CompoundPropertyModelUser(this.getDefaultModelObject());

this.add(new TextField(lastname,  cpm.bind(lastName)) );
}
}

I dont know if its the right choice to  use a cpm ... but i think its the
proper way right?

The UserEdit is the content of my ModalWindow implementation so i bore up
the show method with a new Model-Parameter to delegate them to the Inside
Content...

(inside ModelOverlay.class)

public void show(final AjaxRequestTarget target, IModelT model)
{
if (shown == false)
{
getContent().setVisible(true);
getContent().setDefaultModel(model);  // - my new Line ;o)
target.addComponent(this);
target.appendJavascript(getWindowOpenJavascript());
shown = true;
}
}

The Model inside UserEdit is changed. But how can i archieve that the
lastname-Textfield now displays the Value of getLastName() from the new,
submitted Model?
In my opinion i tried everything... tried to override the
onModelChange-Event and tryed to set the new Model with an Visitor of
every childfield... but than i
lost my expression from the CPM and only
pages.adminuserpage$u...@17eea10is shown inside the Textfield.

Thanks for any help. Am i totally lost.. or am i on the right way and few
steps before the solution?

I hope you understand my problem... if not so tell me and i will try to
explain it in another way or even better...


Apologise my english, its not my mothers tongue!

- Martin


Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Igor Vaynberg
On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
doug...@douglasferguson.us wrote:
 Hey,

 I'm starting to write selenium tests for my wicket app and am running into 
 issues with a couple of wicket related problems that I thought perhaps 
 somebody else may have solved.

 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
 sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
 elements.. Other times it might be  element_path_name_4 to  
 element_path_name_7 after some ajax calls, I'm not sure when/why this 
 happens. Need to play with it more.

there is an option to output wicket:path attribute for tags. this attr
will contain page-relative path of the component which should be more
stable then the id. if you want to have stable ids then you should
manage them yourself using setmarkupid()

 2) I have issues with timing which is typical, and most people call 
 waitForPageToLoad which works fine for normal http requests, but if It is 
 an ajax request I'm waiting for, then I have to implement a waitForContition. 
 Is there a wicket convention I could use here? i.e. how can I know that a 
 wicket ajax call has completed?

there are global ajax callbacks that are invoked when an ajax request
completes. you can search this list for what they are. i imagine you
can write a bit of javascript to hook into those and implement
waitForCondition.

when you get all this working maybe you can create a wiki page about
it to help users who will have the same questions in the future.

-igor



 Thanks,

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



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



Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Douglas Ferguson

On Feb 16, 2010, at 12:34 AM, Igor Vaynberg wrote:

 On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
 doug...@douglasferguson.us wrote:
 Hey,
 
 I'm starting to write selenium tests for my wicket app and am running into 
 issues with a couple of wicket related problems that I thought perhaps 
 somebody else may have solved.
 
 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
 sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 4 
 elements.. Other times it might be  element_path_name_4 to  
 element_path_name_7 after some ajax calls, I'm not sure when/why this 
 happens. Need to play with it more.
 
 there is an option to output wicket:path attribute for tags. this attr
 will contain page-relative path of the component which should be more
 stable then the id. if you want to have stable ids then you should
 manage them yourself using setmarkupid()

I am using the wicket path already. The problem is that the wicket path seems 
to change.. The examples above I'm referring to the wicket path of my repeater.
It seems to normally give the elements a number from 1 - n, tacked onto the 
wicket path of the root component of the repeater.
Sometimes after some ajax calls, it seems to renumber them.. i.e. instead of 
1-4 it becomes 4-7 or something...

 
 2) I have issues with timing which is typical, and most people call 
 waitForPageToLoad which works fine for normal http requests, but if It is 
 an ajax request I'm waiting for, then I have to implement a 
 waitForContition. Is there a wicket convention I could use here? i.e. how 
 can I know that a wicket ajax call has completed?
 
 there are global ajax callbacks that are invoked when an ajax request
 completes. you can search this list for what they are. i imagine you
 can write a bit of javascript to hook into those and implement
 waitForCondition.

I'm actually using the window.wicketGlobalPreCallHandler and 
window.wicketGlobalPostCallHandler in my code already.
Do you think it would be safe to use those? I.E. preHander sets a boolean 
isWaitingOnAjax and postHander unsets it?

Then I can do a waitForConition(!isWaitingOnAjax)

 
 when you get all this working maybe you can create a wiki page about
 it to help users who will have the same questions in the future.

Sounds good...

 
 -igor
 
 
 
 Thanks,
 
 D/
 -
 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



Send me Complete Coding PagingNavigator with custom images instead of ?

2010-02-15 Thread saravana kumar
 Can u Send me any one Complete Coding PagingNavigator with custom images
instead of ?
 Like Navigator.html, Navigator.java, navigator.css

This is my Navigator coding now:
navigator = new PagingNavigator(navigator, dataView);
dataView.setItemsPerPage(5);
navigator.setVisible(false);
addListViewPanel.add(navigator);


-- 
Thanks  Regards,
SaravanaKumar G.


Re: Selenium Testing - Ajax Loads

2010-02-15 Thread Igor Vaynberg
On Mon, Feb 15, 2010 at 11:14 PM, Douglas Ferguson
doug...@douglasferguson.us wrote:

 On Feb 16, 2010, at 12:34 AM, Igor Vaynberg wrote:

 On Mon, Feb 15, 2010 at 8:08 PM, Douglas Ferguson
 doug...@douglasferguson.us wrote:
 Hey,

 I'm starting to write selenium tests for my wicket app and am running into 
 issues with a couple of wicket related problems that I thought perhaps 
 somebody else may have solved.

 1) Sometimes my repeaters don't print out consistent wicket paths, i.e. 
 sometimes it may go  element_path_name_1 to  element_path_name_4 if I have 
 4 elements.. Other times it might be  element_path_name_4 to  
 element_path_name_7 after some ajax calls, I'm not sure when/why this 
 happens. Need to play with it more.

 there is an option to output wicket:path attribute for tags. this attr
 will contain page-relative path of the component which should be more
 stable then the id. if you want to have stable ids then you should
 manage them yourself using setmarkupid()

 I am using the wicket path already. The problem is that the wicket path seems 
 to change.. The examples above I'm referring to the wicket path of my 
 repeater.
 It seems to normally give the elements a number from 1 - n, tacked onto the 
 wicket path of the root component of the repeater.
 Sometimes after some ajax calls, it seems to renumber them.. i.e. instead of 
 1-4 it becomes 4-7 or something...

the path in repeaters is never stable, it depends on a lot of factors
and is hard to predict. i think what may be a good way to deal with it
is to use an IComponentInstantiationListener to add a behavior to Item
subclasses to output their index in some attribute. install this
listener only during test time or simply make it output nothing if not
during the test.

 2) I have issues with timing which is typical, and most people call 
 waitForPageToLoad which works fine for normal http requests, but if It is 
 an ajax request I'm waiting for, then I have to implement a 
 waitForContition. Is there a wicket convention I could use here? i.e. how 
 can I know that a wicket ajax call has completed?

 there are global ajax callbacks that are invoked when an ajax request
 completes. you can search this list for what they are. i imagine you
 can write a bit of javascript to hook into those and implement
 waitForCondition.

 I'm actually using the window.wicketGlobalPreCallHandler and 
 window.wicketGlobalPostCallHandler in my code already.
 Do you think it would be safe to use those? I.E. preHander sets a boolean 
 isWaitingOnAjax and postHander unsets it?

 Then I can do a waitForConition(!isWaitingOnAjax)

yeah, that sounds like a good starting point.

-igor



 when you get all this working maybe you can create a wiki page about
 it to help users who will have the same questions in the future.

 Sounds good...


 -igor



 Thanks,

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



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



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



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



Re: wicket Google maps integration

2010-02-15 Thread Josh Kamau
Team;;


Whats wrong with this code?

The map is being displayed properly and when i click on it, a new marker is
added and the infoWindow is shown. when i click on the info window, i get
the below error.



package org.at.example;

import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

import wicket.contrib.gmap.GMap2;
import wicket.contrib.gmap.api.GControl;
import wicket.contrib.gmap.api.GEvent;
import wicket.contrib.gmap.api.GEventHandler;
import wicket.contrib.gmap.api.GLatLng;
import wicket.contrib.gmap.api.GMarker;
import wicket.contrib.gmap.api.GMarkerOptions;
import wicket.contrib.gmap.api.GOverlay;
import wicket.contrib.gmap.event.ClickListener;
import wicket.contrib.gmap.event.InfoWindowCloseListener;
import wicket.contrib.gmap.event.InfoWindowOpenListener;

/**
 * Homepage
 */
public class HomePage extends WebPage {

private static final long serialVersionUID = 1L;

/**
 * Constructor that is invoked when page is invoked without a session.
 *
 * @param parameters
 *Page parameters
 */
public HomePage(final PageParameters parameters) {

final GMap2 gmap = new GMap2(
gmap,
ABQI5IYWHbtyKMSxjbiygH-jRxQqloa41_x1QYpvvO_ao_uBs0dQxxQQyhzR9MXmD-ENkRmQIOig-WC-iw);

gmap.addControl(GControl.GMapTypeControl);
gmap.addControl(GControl.GLargeMapControl);

gmap.setOutputMarkupId(true);
gmap.setScrollWheelZoomEnabled(true);

gmap.add(new ClickListener() {

@Override
protected void onClick(AjaxRequestTarget target, GLatLng glatLng,
GOverlay overlay) {

// GMarkerOptions gmo = new GMarkerOptions();
// gmo.draggable(true);
// gmo.bouncy(true);
if (!(overlay instanceof GMarker)) {//This section was added
to stop the same error from occouring when the marker is clicked.
GMarker gm = new GMarker(glatLng);
gmap.getInfoWindow().open(glatLng,
new Label(Hello, Hi , am here));
gmap.addOverlay(gm);
}

}

});

 add(gmap);
}
}




Error:

ERROR - RequestCycle   -
java.lang.NullPointerException
at wicket.contrib.gmap.api.GInfoWindow.getJSopen(GInfoWindow.java:162)
at wicket.contrib.gmap.api.GInfoWindow.open(GInfoWindow.java:115)
at wicket.contrib.gmap.api.GInfoWindow.open(GInfoWindow.java:91)
at org.at.example.HomePage$1.onClick(HomePage.java:56)
at wicket.contrib.gmap.event.ClickListener.onEvent(ClickListener.java:61)
at
wicket.contrib.gmap.event.GEventListenerBehavior.respond(GEventListenerBehavior.java:58)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




On Mon, Feb 15, 2010 at 9:15 PM, TahitianGabriel glan...@piti.pf wrote:


 You can get the source code here :

 https://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-core/gmap2-parent

 https://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-core/gmap2-parent

 And use it in your pom.xml like that :
dependency
groupIdorg.wicketstuff/groupId