Re: Updating a Dynamic Image with AJAX (and JFreeChart)

2009-11-14 Thread Wojtek

Hi there,
is JFreeChart your only possible approach? Check out flot integration 
from wicketstuff-core.
It draws nicer charts and you can update datasets sending json object 
and redraw it by js.


Regards,
Wojtek


Swarnim Ranjitkar pisze:

I couldn't override getResourceState of DynamicImageResource as it new Resource 
state uses variable from DynamicImageResource eg format. Instead i copied 
DynamicImageResource class and made my own version of it and modified the 
getResourceState() get method. When I changed the drop down I was expecting it 
to call the geImageData but it wasn't calling it. Could you please advice.
Here is the modified method.
protected synchronized ResourceState getResourceState()
{
return new ResourceState()
{
private byte[] imageData;
private final String contentType = image/ + format;

@Override
public Time lastModifiedTime()
{
if (lastModifiedTime == null)
{
lastModifiedTime = 
DynamicImageResource.this.lastModifiedTime;
if (lastModifiedTime == null)
{
lastModifiedTime = Time.now();
}
}
return lastModifiedTime;
}

@Override
public byte[] getData()
{
// here is what I made the change.
imageData = getImageData();
return imageData;
}

@Override
public String getContentType()
{
return contentType;
}
};
}

From my  Image Class I called the copied version of   in getImageResource() {

return new DynamicImageResource(){


public class TugboatChartImage extends NonCachingImage  {

private int width;
private int height;

public TugboatChartImage(String id, JFreeChart chart, int width, int 
height){
super(id, new Model(chart));
this.width = width;
this.height = height;
}

@Override
protected Resource getImageResource() {
return new DynamicImageResource(){//my copied version of DynamicResouce
@Override
protected byte[] getImageData() {
JFreeChart chart = (JFreeChart)getDefaultModelObject();
return toImageData(chart.createBufferedImage(width, height));
}



};
}

}


  

To: users@wicket.apache.org
From: craig.mcil...@openroadsconsulting.com
Subject: Re: Updating a Dynamic Image with AJAX (and JFreeChart)
Date: Fri, 13 Nov 2009 23:31:39 -0500

Look at the source of the DynamicImageResource class.  The getResourceState 
method does something like (sorry for the lame pseudocode) 'if image data is 
null then save and return value of getImageData else return the previous image 
data'.  So its gonna call your getImageData() method once and save the value.  
This falls in line with the super class's (DynamicWebResource) javadoc that 
says:

very useful for things you   generate dynamically, but reuse for a while after 
that. If you need resources that stream   directly and are not cached, extend 
WebResource directly and implement Resouce.getResourceStream() yourself.

It has nothing to do with HTTP caching, which it looks like you're trying to 
solve with your headers, but server-side caching.  Anyways... in this case, 
getResourceStream of WebResource ends up calling getResourceState of 
DynamicImageResource.  All you need to do is is override getResourceState (and 
therefore kind of overrides the behavior of getResourceStream) of your 
DynamicImageResource and ensure that it doesn't cache the result of 
getImageData() and you should be set.

Craig
  _  


From: wicketnewuser [mailto:swarn...@hotmail.com]
To: users@wicket.apache.org
Sent: Fri, 13 Nov 2009 20:32:05 -0500
Subject: Re: Updating a Dynamic Image with AJAX (and JFreeChart)


  I have same situation. I'm not able to refresh my image. But if i view the
  image i do get refreshed image
  Here is my code. Based on my dropdownchoice it should make new Jfreechart
  and the image should refresh. I couldn't get it working so i wrapped the
  image with in a span but it still doesn't work. TugboatChartImage extends
  NonCachingImage . Can any one point out what I'm doing wrong
  Chart chart1 = new Chart(this.getString(column1.toString()), Date,
  Dollars);
final String yAxisType = linear;
final int smallChartWidth=400;
final int smallChartHeight=200;
JFreeChart jfChartOne = chart1.render(chartOneCollection, null, yAxisType,
  smallChartWidth, smallChartHeight);


// make an image

final TugboatChartImage imageOne = new TugboatChartImage(chart1image,
  jfChartOne, smallChartWidth, smallChartHeight);
final WebMarkupContainer chart1Span = new
  WebMarkupContainer(chart1Span);
chart1Span.add(imageOne);
add(chart1Span);
  
// draw 

Re: When NOT to use models ?

2009-11-14 Thread Martin Makundi
 it's more like an model graph.. so you say

 IModelListSomething dataFromDB=new LoadableDetachedModel() ...
 IModelInteger countModel=new
 CascadingLoad..ModelInteger,ListSomething(dataFromDB);
 add(new Label(counter,countModel));

 countModel.detach() is called from Label, and dataFromDB.detach() is
 called fram countModel.

 Because it's generic you can use it everywhere..


Ok. I came up with something similar based on the assumption: models
do not change during render.

I made a ModelLatch that caches the model value after onBeforeRender
and frees the latch at onDetach.

The problem is that there is no onBeforeRender event and one must
implement it for each container at least and for components that need
it and are ajax updated without their parent container:


public class ModelLatch implements IDetachable {
  private boolean latched;
  private boolean strict = true;

  /**
   *
   */
  public void onBeforeRender() {
this.setLatched(true);
  }

  /**
   * @see org.apache.wicket.model.IDetachable#detach()
   */
  public void detach() {
this.setLatched(false);
  }

  /**
   * @param DataType
   * @param DataTypeModel
   * @param dataTypeModel
   * @return IModelDataType
   */
  public DataType, DataTypeModel extends IModelDataType
IModelDataType getInstance(
  DataTypeModel dataTypeModel) {
return new LatchModelDataType(dataTypeModel);
  }

  /**
   * @param latched the latched to set
   */
  public void setLatched(boolean latched) {
this.latched = latched;
  }

  /**
   * @return the latched
   */
  public boolean isLatched() {
return latched;
  }

  /**
   * @author Martin
   *
   * @param T
   */
  private class LatchModelT implements IModelT {
private IModelT rootModel;
private boolean cached;
private T cache;

/**
 * @param rootModel
 */
public LatchModel(IModelT rootModel) {
  this.rootModel = rootModel;
}

/**
 * @see org.apache.wicket.model.IModel#getObject()
 */
@Override
public T getObject() {
  if (isLatched()) {
return getCachedValue();
  }

  return rootModel.getObject();
}

/**
 * @return T
 */
private T getCachedValue() {
  if (cached) {
return cache;
  }

  try {
return cache = rootModel.getObject();
  } finally {
cached = true;
  }
}

/**
 * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
 */
@Override
public void setObject(T object) {
  if (isLatched()  isStrict()) {
throw new IllegalStateException(Strict latch does not allow
modifying values in latched state.);
  }
  rootModel.setObject(object);
}

/**
 * @see org.apache.wicket.model.IDetachable#detach()
 */
@Override
public void detach() {
  setLatched(false);
  cached = false;
}
  }

  /**
   * @return the strict
   */
  public boolean isStrict() {
return strict;
  }
}

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



CompoundPropertyModel

2009-11-14 Thread Николай Кучумов
Hello.
I have a Person class, describing a person, which has a member
credentials of type Credentials (username/password).
I tried to make a registration page in this way:

Page
{
super();

Person person = [create a person with empty credentials];

Form form = new Form(form, new CompoundPropertyModel(person));

add(form);

form.add(new TextField(familyName));
form.add(new TextField(givenName));

form.add(new TextField(credentials.userName));
form.add(new TextField(credentials.passWord));

// also add a submit button
}

And now when I push the Submit button, it outputs this error:

org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
rendered page in session [pagemap=null,componentPath=0,versionNumber=0]

I like the idea of compound object model, and I wouldn't like to deprive
myself from using it just because of this strange error...
Can you give me a hint on what have I done wrong in the code above?


Re: CompoundPropertyModel

2009-11-14 Thread Jeremy Thomerson
Do both Person and Credentials (and everything else Person holds on to)
implement Serializable?

Watch the logs to see if there are serialization errors.  It's a problem of
the page not being in the session - which means it either didn't make it
there or the session is somehow gone.

--
Jeremy Thomerson
http://www.wickettraining.com



On Sat, Nov 14, 2009 at 7:26 AM, Николай Кучумов kuchum...@gmail.comwrote:

 Hello.
 I have a Person class, describing a person, which has a member
 credentials of type Credentials (username/password).
 I tried to make a registration page in this way:

 Page
 {
super();

Person person = [create a person with empty credentials];

Form form = new Form(form, new CompoundPropertyModel(person));

add(form);

form.add(new TextField(familyName));
form.add(new TextField(givenName));

form.add(new TextField(credentials.userName));
form.add(new TextField(credentials.passWord));

// also add a submit button
 }

 And now when I push the Submit button, it outputs this error:

 org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
 rendered page in session [pagemap=null,componentPath=0,versionNumber=0]

 I like the idea of compound object model, and I wouldn't like to deprive
 myself from using it just because of this strange error...
 Can you give me a hint on what have I done wrong in the code above?



Re: CompoundPropertyModel

2009-11-14 Thread Николай Кучумов
Hi, Jeremy.
No, the log contained only this error...
But to be honest, although it didn't fix the error, your advice is still
valuable, because not all of the classes were Serializable.
And you know what?
I think I'll reinstall my application server.
I used Glassfish 2 before, and this time I tried Glassfish 3, but it
appeared to be a bitch...
It hangs oftenly and operates strangely...
So maybe it somehow messes with the sessions...
I'll install Glassfish 2 back then, when I have more time for this (maybe
tomorrow), and then I'll post the results here.
Thanks for your reply.

On Sat, Nov 14, 2009 at 5:11 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Do both Person and Credentials (and everything else Person holds on to)
 implement Serializable?

 Watch the logs to see if there are serialization errors.  It's a problem of
 the page not being in the session - which means it either didn't make it
 there or the session is somehow gone.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Sat, Nov 14, 2009 at 7:26 AM, Николай Кучумов kuchum...@gmail.com
 wrote:

  Hello.
  I have a Person class, describing a person, which has a member
  credentials of type Credentials (username/password).
  I tried to make a registration page in this way:
 
  Page
  {
 super();
 
 Person person = [create a person with empty credentials];
 
 Form form = new Form(form, new CompoundPropertyModel(person));
 
 add(form);
 
 form.add(new TextField(familyName));
 form.add(new TextField(givenName));
 
 form.add(new TextField(credentials.userName));
 form.add(new TextField(credentials.passWord));
 
 // also add a submit button
  }
 
  And now when I push the Submit button, it outputs this error:
 
  org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
  rendered page in session [pagemap=null,componentPath=0,versionNumber=0]
 
  I like the idea of compound object model, and I wouldn't like to deprive
  myself from using it just because of this strange error...
  Can you give me a hint on what have I done wrong in the code above?
 



Re: CompoundPropertyModel

2009-11-14 Thread Jeremy Thomerson
Try running your project in Jetty for development (you can use the Maven
quickstart to help you get started).  It's usually much easier to get
running and see what's going on.  It also allows for very easy on-the-fly
changes and reloading.

--
Jeremy Thomerson
http://www.wickettraining.com



On Sat, Nov 14, 2009 at 8:32 AM, Николай Кучумов kuchum...@gmail.comwrote:

 Hi, Jeremy.
 No, the log contained only this error...
 But to be honest, although it didn't fix the error, your advice is still
 valuable, because not all of the classes were Serializable.
 And you know what?
 I think I'll reinstall my application server.
 I used Glassfish 2 before, and this time I tried Glassfish 3, but it
 appeared to be a bitch...
 It hangs oftenly and operates strangely...
 So maybe it somehow messes with the sessions...
 I'll install Glassfish 2 back then, when I have more time for this (maybe
 tomorrow), and then I'll post the results here.
 Thanks for your reply.

 On Sat, Nov 14, 2009 at 5:11 PM, Jeremy Thomerson 
 jer...@wickettraining.com
  wrote:

  Do both Person and Credentials (and everything else Person holds on to)
  implement Serializable?
 
  Watch the logs to see if there are serialization errors.  It's a problem
 of
  the page not being in the session - which means it either didn't make it
  there or the session is somehow gone.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Sat, Nov 14, 2009 at 7:26 AM, Николай Кучумов kuchum...@gmail.com
  wrote:
 
   Hello.
   I have a Person class, describing a person, which has a member
   credentials of type Credentials (username/password).
   I tried to make a registration page in this way:
  
   Page
   {
  super();
  
  Person person = [create a person with empty credentials];
  
  Form form = new Form(form, new CompoundPropertyModel(person));
  
  add(form);
  
  form.add(new TextField(familyName));
  form.add(new TextField(givenName));
  
  form.add(new TextField(credentials.userName));
  form.add(new TextField(credentials.passWord));
  
  // also add a submit button
   }
  
   And now when I push the Submit button, it outputs this error:
  
   org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
   rendered page in session [pagemap=null,componentPath=0,versionNumber=0]
  
   I like the idea of compound object model, and I wouldn't like to
 deprive
   myself from using it just because of this strange error...
   Can you give me a hint on what have I done wrong in the code above?
  
 



RE: Updating a Dynamic Image with AJAX (and JFreeChart)

2009-11-14 Thread Swarnim Ranjitkar

I would be nice for this work as we have a JFreeChart written which is called 
by other apps too.

 Date: Sat, 14 Nov 2009 10:23:38 +0100
 From: zabia...@gmail.com
 To: user
se...@wicket.apache.org
 Subject: Re: Updating a Dynamic Image with AJAX (and JFreeChart)
 
 Hi there,
 is JFreeChart your only possible approach? Check out flot integration 
 from wicketstuff-core.
 It draws nicer charts and you can update datasets sending json object 
 and redraw it by js.
 
 Regards,
 Wojtek
 
 
 Swarnim Ranjitkar pisze:
  I couldn't override getResourceState of DynamicImageResource as it new 
  Resource state uses variable from DynamicImageResource eg format. Instead i 
  copied DynamicImageResource class and made my own version of it and 
  modified the getResourceState() get method. When I changed the drop down I 
  was expecting it to call the geImageData but it wasn't calling it. Could 
  you please advice.
  Here is the modified method.
  protected synchronized ResourceState getResourceState()
  {
  return new ResourceState()
  {
  private byte[] imageData;
  private final String contentType = image/ + format;
 
  @Override
  public Time lastModifiedTime()
  {
  if (lastModifiedTime == null)
  {
  lastModifiedTime = 
  DynamicImageResource.this.lastModifiedTime;
  if (lastModifiedTime == null)
  {
  lastModifiedTime = Time.now();
  }
  }
  return lastModifiedTime;
  }
 
  @Override
  public byte[] getData()
  {
  // here is what I made the change.
  imageData = getImageData();
  return imageData;
  }
 
  @Override
  public String getContentType()
  {
  return contentType;
  }
  };
  }
 
  From my  Image Class I called the copied version of   in getImageResource() 
  {
 
  return new DynamicImageResource(){
 
 
  public class TugboatChartImage extends NonCachingImage  {
 
  private int width;
  private int height;
 
  public TugboatChartImage(String id, JFreeChart chart, int width, int 
  height){
  super(id, new Model(chart));
  this.width = width;
  this.height = height;
  }
 
  @Override
  protected Resource getImageResource() {
  return new DynamicImageResource(){//my copied version of 
  DynamicResouce
  @Override
  protected byte[] getImageData() {
  JFreeChart chart = (JFreeChart)getDefaultModelObject();
  return toImageData(chart.createBufferedImage(width, 
  height));
  }
  
 
  };
  }
 
  }
 
 

  To: users@wicket.apache.org
  From: craig.mcil...@openroadsconsulting.com
  Subject: Re: Updating a Dynamic Image with AJAX (and JFreeChart)
  Date: Fri, 13 Nov 2009 23:31:39 -0500
 
  Look at the source of the DynamicImageResource class.  The 
  getResourceState method does something like (sorry for the lame 
  pseudocode) 'if image data is null then save and return value of 
  getImageData else return the previous image data'.  So its gonna call your 
  getImageData() method once and save the value.  This falls in line with 
  the super class's (DynamicWebResource) javadoc that says:
 
  very useful for things you   generate dynamically, but reuse for a while 
  after that. If you need resources that stream   directly and are not 
  cached, extend WebResource directly and implement 
  Resouce.getResourceStream() yourself.
 
  It has nothing to do with HTTP caching, which it looks like you're trying 
  to solve with your headers, but server-side caching.  Anyways... in this 
  case, getResourceStream of WebResource ends up calling getResourceState of 
  DynamicImageResource.  All you need to do is is override getResourceState 
  (and therefore kind of overrides the behavior of getResourceStream) of 
  your DynamicImageResource and ensure that it doesn't cache the result of 
  getImageData() and you should be set.
 
  Craig
_  
 
  From: wicketnewuser [mailto:swarn...@hotmail.com]
  To: users@wicket.apache.org
  Sent: Fri, 13 Nov 2009 20:32:05 -0500
  Subject: Re: Updating a Dynamic Image with AJAX (and JFreeChart)
 
 
I have same situation. I'm not able to refresh my image. But if i view 
  the
image i do get refreshed image
Here is my code. Based on my dropdownchoice it should make new Jfreechart
and the image should refresh. I couldn't get it working so i wrapped the
image with in a span but it still doesn't work. TugboatChartImage extends
NonCachingImage . Can any one point out what I'm doing wrong
Chart chart1 = new Chart(this.getString(column1.toString()), Date,
Dollars);
  final String 

RE: CompoundPropertyModel

2009-11-14 Thread Alex Rass
Kolya,

2 things:
1) If you still have the old setup:
  Try stopping server, deploying your stuff to it, starting server.
  I've had issues with redeploying at runtime (hot deploy) with Tomcat
(which is what Glassfish is based on).  This is where Jeremy's advice to run
Jetty is a good idea.

2) Make sure that you refresh the form in your web browser before you try to
enter data and submit.  Wicket needs to do stuff to that form before you can
submit it and if you keep same browser open between deployments, you are
sending data back to wicket that it knows nothing about, so it blows up with
pageexpired.

The fact that you don't get serialization errors in the log (if it wasn't
serialized) is b/c it didn't get that far yet, so problems are elsewhere.

Hope this helps,
- Alex. 

-Original Message-
From: Николай Кучумов [mailto:kuchum...@gmail.com] 
Sent: Saturday, November 14, 2009 9:33 AM
To: users@wicket.apache.org
Subject: Re: CompoundPropertyModel

Hi, Jeremy.
No, the log contained only this error...
But to be honest, although it didn't fix the error, your advice is still
valuable, because not all of the classes were Serializable.
And you know what?
I think I'll reinstall my application server.
I used Glassfish 2 before, and this time I tried Glassfish 3, but it
appeared to be a bitch...
It hangs oftenly and operates strangely...
So maybe it somehow messes with the sessions...
I'll install Glassfish 2 back then, when I have more time for this (maybe
tomorrow), and then I'll post the results here.
Thanks for your reply.

On Sat, Nov 14, 2009 at 5:11 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Do both Person and Credentials (and everything else Person holds on to)
 implement Serializable?

 Watch the logs to see if there are serialization errors.  It's a problem
of
 the page not being in the session - which means it either didn't make it
 there or the session is somehow gone.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Sat, Nov 14, 2009 at 7:26 AM, Николай Кучумов kuchum...@gmail.com
 wrote:

  Hello.
  I have a Person class, describing a person, which has a member
  credentials of type Credentials (username/password).
  I tried to make a registration page in this way:
 
  Page
  {
 super();
 
 Person person = [create a person with empty credentials];
 
 Form form = new Form(form, new CompoundPropertyModel(person));
 
 add(form);
 
 form.add(new TextField(familyName));
 form.add(new TextField(givenName));
 
 form.add(new TextField(credentials.userName));
 form.add(new TextField(credentials.passWord));
 
 // also add a submit button
  }
 
  And now when I push the Submit button, it outputs this error:
 
  org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
  rendered page in session [pagemap=null,componentPath=0,versionNumber=0]
 
  I like the idea of compound object model, and I wouldn't like to deprive
  myself from using it just because of this strange error...
  Can you give me a hint on what have I done wrong in the code above?
 



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



Intellij9 integration

2009-11-14 Thread Alex Rass
If any of you guys are using Intellij Idea, I HIGHLY suggest you go to the 
EAP Forum http://intellij.net/forums/forum.jspa?forumID=22 
and post that you want Wicket support in 9.

They have opened up EAP for version 9 and it's now or god knows when.

They are starting an Open Source version this time. And their product is
100x better than Eclipse.

Lets get them to integrate wicket in, so it gets popularity and recognition
it deserves.



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



Re: Intellij9 integration

2009-11-14 Thread Andreas Petersson
i think getting official support for wicket in idea is too late. the 
roadmap was published about 6 months ago, for example at

http://blogs.jetbrains.com/idea/2009/05/maia-eap-is-finally-here/
and there is already a beta version available at
http://www.jetbrains.com/idea/nextversion/index.html

but maybe it is the right time to give wicketforge some polish. my 
suggestions for enhancements, since it should be possible to better 
develop plugins since it is open source now.
*) validation of propertymodels/CPM like idea does for expression 
Language for jsp. ability to ctrl-click to the corresponding getter and 
find usages of those getters

*) support for find usages for wicket:ids
*) central facet for wicket, to control its settings.
*) ability to turn off the non-serializable field in serializable 
class warning in components for fields that are injected.


br
andreas

If any of you guys are using Intellij Idea, I HIGHLY suggest you go to the 
EAP Forum http://intellij.net/forums/forum.jspa?forumID=22 
and post that you want Wicket support in 9.
  



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



RE: Intellij9 integration

2009-11-14 Thread Alex Rass
You have a point, but I've been using Idea for... 6+ years now.
These guys are very sales oriented.
They added GWT support as a point release, like it was a no big deal.
When they see there's a demand - they move on it. 
And if they can add a new popular framework for the launch - they just may,
to make it sell better. They are in a war with Eclipse and we got that and
it's better has been their selling angle.

But if someone wants to make the wicketidea plugin actually work - that'd be
cool too :)  Current one barely shows up and is VERY sensitive.


-Original Message-
From: Andreas Petersson [mailto:andr...@petersson.at] 
Sent: Saturday, November 14, 2009 5:00 PM
To: users@wicket.apache.org
Subject: Re: Intellij9 integration

i think getting official support for wicket in idea is too late. the 
roadmap was published about 6 months ago, for example at
http://blogs.jetbrains.com/idea/2009/05/maia-eap-is-finally-here/
 and there is already a beta version available at
http://www.jetbrains.com/idea/nextversion/index.html

but maybe it is the right time to give wicketforge some polish. my 
suggestions for enhancements, since it should be possible to better 
develop plugins since it is open source now.
*) validation of propertymodels/CPM like idea does for expression 
Language for jsp. ability to ctrl-click to the corresponding getter and 
find usages of those getters
*) support for find usages for wicket:ids
*) central facet for wicket, to control its settings.
*) ability to turn off the non-serializable field in serializable 
class warning in components for fields that are injected.

br
andreas

 If any of you guys are using Intellij Idea, I HIGHLY suggest you go to the

 EAP Forum http://intellij.net/forums/forum.jspa?forumID=22 
 and post that you want Wicket support in 9.
   


-
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



Listview in a listview refresh with AjaxLink don't work

2009-11-14 Thread pieter claassen
I am trying to follow wicket in action advice P263 but

I have a ListView in a ListView with a panel added to my inner
listview. On that panel, I have  an AjaxLink and I want to move items
in the order of the listview around. But to display them, I need to
refresh my matrix. Nothing seems to work. Any tips or references.

QuestionEditPanel.html
=
wicket:extend
div id=document
span wicket:id=parent
div wicket:id=rows
span wicket:id=row
span wicket:id=question /
/span
/div
/span
/div
/wicket:extend

QuestionEditPanel.java
==

final WebMarkupContainer parent=new WebMarkupContainer(parent);
add(parent);
parent.setOutputMarkupId(true);
ListListQuestionBase rows =
QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
ListView rowslistview = new ListView(rows, rows) {

@Override
protected void populateItem(ListItem item) {
ListQuestionBase row = (ListQuestionBase)
item.getModelObject();
ListView rowlistview = new ListView(row, row) {

@Override
protected void populateItem(ListItem item) {
final QuestionBase question = (QuestionBase)
item.getModelObject();
item.setModel(new CompoundPropertyModel(question));
EditableQuestionPanel questionpanel=new
EditableQuestionPanel(question, new
QuestionBaseWebModel(question),templateWebModel,parent);
item.add(questionpanel);



and then on my EditableQuestionPanel.java I have :

AjaxLink up = new AjaxLink(up) {

@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(parent);
Template template = templatemodel.getEntity();
template.moveQuestionUp(question);
tf.store(template);
}
};
-- 
Pieter Claassen
musmato.com

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



Re: Listview in a listview refresh with AjaxLink don't work

2009-11-14 Thread Pedro Santos
Can you send the moveQuestionUp implementation?

On Sat, Nov 14, 2009 at 9:03 PM, pieter claassen
pieter.claas...@gmail.comwrote:

 I am trying to follow wicket in action advice P263 but

 I have a ListView in a ListView with a panel added to my inner
 listview. On that panel, I have  an AjaxLink and I want to move items
 in the order of the listview around. But to display them, I need to
 refresh my matrix. Nothing seems to work. Any tips or references.

 QuestionEditPanel.html
 =
wicket:extend
div id=document
span wicket:id=parent
div wicket:id=rows
span wicket:id=row
span wicket:id=question /
/span
/div
/span
/div
/wicket:extend

 QuestionEditPanel.java
 ==

final WebMarkupContainer parent=new WebMarkupContainer(parent);
add(parent);
parent.setOutputMarkupId(true);
ListListQuestionBase rows =

 QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
ListView rowslistview = new ListView(rows, rows) {

@Override
protected void populateItem(ListItem item) {
ListQuestionBase row = (ListQuestionBase)
 item.getModelObject();
ListView rowlistview = new ListView(row, row) {

@Override
protected void populateItem(ListItem item) {
final QuestionBase question = (QuestionBase)
 item.getModelObject();
item.setModel(new CompoundPropertyModel(question));
EditableQuestionPanel questionpanel=new
 EditableQuestionPanel(question, new
 QuestionBaseWebModel(question),templateWebModel,parent);
item.add(questionpanel);
 


 and then on my EditableQuestionPanel.java I have :

 AjaxLink up = new AjaxLink(up) {

@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(parent);
Template template = templatemodel.getEntity();
template.moveQuestionUp(question);
tf.store(template);
}
};
 --
 Pieter Claassen
 musmato.com

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




-- 
Pedro Henrique Oliveira dos Santos


Modal window (1.4.1) and IE - Slow load times

2009-11-14 Thread Ed _

Hi,

I am using version 1.4.1 of wickets. P

Contents of a Modal Window take extremely long time upto 10-20 sec to load on 
Internet Explorer 8. 

 FireFox or Chrome on the same machine are really fast. with load times of 2-3 
sec on a slow connection.

Any one else seen this issue or has suggestion around fixing it.

thanks,

Ed
  
_
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2

Re: Intellij9 integration

2009-11-14 Thread Nick Heudecker
What do you mean that the current one shows up?  I haven't updated
WicketForge to work with IDEA 9 because I'm not on IDEA 9.

Feel free to submit patches.  Right now WicketForge does everything I need
it to do, so unless I start using Wicket more often or it doesn't meet my
needs, I'm not really inclined to spend my limited free time on it.

On Sat, Nov 14, 2009 at 3:12 PM, Alex Rass a...@itbsllc.com wrote:

 You have a point, but I've been using Idea for... 6+ years now.
 These guys are very sales oriented.
 They added GWT support as a point release, like it was a no big deal.
 When they see there's a demand - they move on it.
 And if they can add a new popular framework for the launch - they just may,
 to make it sell better. They are in a war with Eclipse and we got that and
 it's better has been their selling angle.

 But if someone wants to make the wicketidea plugin actually work - that'd
 be
 cool too :)  Current one barely shows up and is VERY sensitive.


 -Original Message-
 From: Andreas Petersson [mailto:andr...@petersson.at]
 Sent: Saturday, November 14, 2009 5:00 PM
 To: users@wicket.apache.org
 Subject: Re: Intellij9 integration

 i think getting official support for wicket in idea is too late. the
 roadmap was published about 6 months ago, for example at
 http://blogs.jetbrains.com/idea/2009/05/maia-eap-is-finally-here/
  and there is already a beta version available at
 http://www.jetbrains.com/idea/nextversion/index.html

 but maybe it is the right time to give wicketforge some polish. my
 suggestions for enhancements, since it should be possible to better
 develop plugins since it is open source now.
 *) validation of propertymodels/CPM like idea does for expression
 Language for jsp. ability to ctrl-click to the corresponding getter and
 find usages of those getters
 *) support for find usages for wicket:ids
 *) central facet for wicket, to control its settings.
 *) ability to turn off the non-serializable field in serializable
 class warning in components for fields that are injected.

 br
 andreas




Re: AutoCompleteTextFieldT in 1.4-SNAPSHOT

2009-11-14 Thread m_salman

Hi,

This was a big help for me in getting what I wanted to do.  It works really
good except for one problem.  When the form shows up with a non null empty
object, the autocomplete field has the class name for the object in it,
i.e., com.michni.search.bean.urll...@c1853.  Once I load an object in the
form works fine.


Here is my code:


form = new FormGUIBeanInventoryItem(
form, new 
CompoundPropertyModelGUIBeanInventoryItem(
new 
GUIBeanInventoryItem()));


IAutoCompleteRendererUrlLink urlLinkRenderer 
= new AbstractAutoCompleteTextRendererUrlLink() 
{  
private static final long serialVersionUID = 1L;

@Override 
 protected String getTextValue(UrlLink urlLink) 
{ 
 return urlLink.getUrl(); 
} 
};



autoCompleteUrl = new AutoCompleteTextFieldUrlLink(

urlLink, 
new 
CompoundPropertyModelUrlLink(new UrlLink()), 

urlLinkRenderer)
{
private static final long serialVersionUID = 
-5590853972046975757L;

@Override
protected IteratorUrlLink getChoices(
String valueLike)
{
try
{
ListUrlLink urlLink = dao...
return urlLink.iterator();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
};

form.add(autoCompleteUrl);


In the code I have made sure that the UrlLink in GUIBeanInventoryItem is not
null and that urlLink.getUrl() returns .

I have solved this problem with other items before but for some reason can't
seem to solve it now.

Appreciate any help.

Thanks.
-- 
View this message in context: 
http://old.nabble.com/AutoCompleteTextField%3CT%3E-in-1.4-SNAPSHOT-tp17365392p26355482.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: Modal window (1.4.1) and IE - Slow load times

2009-11-14 Thread James Carman
Does your page have a lot of links on it?

On Sat, Nov 14, 2009 at 6:36 PM, Ed _ ed_b...@hotmail.com wrote:

 Hi,

 I am using version 1.4.1 of wickets. P

 Contents of a Modal Window take extremely long time upto 10-20 sec to load on 
 Internet Explorer 8.

  FireFox or Chrome on the same machine are really fast. with load times of 
 2-3 sec on a slow connection.

 Any one else seen this issue or has suggestion around fixing it.

 thanks,

 Ed

 _
 Windows 7: It works the way you want. Learn more.
 http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2

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