Re: Component initModel() order (design issue?)

2009-10-01 Thread Edmund Urbani
Can't be done, because the component does not yet know its parent during object
initialization. initModel/getDefaultModel needs to be called later, when the
component knows its place in the hierarchy. by giving the child component a
model that obtains the model from its parent (MyTextfield) the call to
getDefaultModel is delayed and it works.

Cheers
 Edmund

Igor Vaynberg wrote:
 why not
 
 class mytextefield extends panel {
   public mytextfield {
add(new textfield() { initmodel() { return
 mytextfield.this.getdefaultmodel(); }});
}
 }
 
 since this is essentially what you want to do - have textfield use the
 same model as the panel.
 
 -igor
 
 On Wed, Sep 30, 2009 at 9:47 AM, Edmund Urbani e...@liland.org wrote:
 You're right, getDefaultModel ensures initialization. I should have suggested
 that instead of getModel (which is not available in the component class 
 anymore
 in 1.4.x).

 However, I did not want to override the initModel() method (and copy most of 
 its
 code) just for that. So now I solved it by creating a new wrap model, which I
 pass to the child component and which wraps around the 
 parent.getDefaultModel().

 public class ComponentWrapModelT implements IWrapModelT {
private Component component;
public ComponentWrapModel(Component component) { // component = parent
this.component=component;
}

@Override
public IModel? getWrappedModel() {
return component.getDefaultModel();
}
 
 }

 Here's some more background which should explain why I chose to do this:
 I replace form components (eg. Textfield) with custom components (eg.
 MyTextfield) to add a few things my application needs to them. The name
 MyTextfield is a bit misleading here, because this is actually a subclass of
 Panel, and it merely contains a Textfield as a child. Still I wanted to use
 MyTextfield as a drop-in replacement, even when used in a form with a
 CompoundPropertyModel. This is where things got a little tricky, because the
 Textfield would end up trying to retrieve a property model matching its own
 wicket:id, when the relevant wicket:id had now become that of MyTextfield.

 Anyway I would have expected that wicket ensures the parent component model 
 gets
 initialized first, seeing how components generally query their parents when 
 they
 don't have a model of their own. And I'm still considering to report this as 
 a
 bug in Jira.

 Cheers
  Edmund


 Pedro Santos wrote:
 The child model's initModel() gets called first
 There are no especial ordering programing to initModels calls. Basically
 they are called by

 public final IModel? getDefaultModel()
 {
 IModel? model = getModelImpl();
 // If model is null
 if (model == null)
 {
 // give subclass a chance to lazy-init model
 model = initModel();
 setModelImpl(model);
 }

 return model;
 }
 What about your custom component gain an model that implements
 IComponentInheritedModel and assign his children default models with the
 desired logic? On IComponentInheritedModel you can access your custom
 component parent model, and if you use getDefaultModel method, you don't
 need to care with initialization ordering too...

 On Wed, Sep 30, 2009 at 9:51 AM, Edmund Urbani e...@liland.org wrote:

 Hi,

 I was just trying to create a component of my own which - in some of my
 pages -
 is created without a model. In the initModel() method I would then call
 super.initModel() and wrap the resulting model for use in a child
 component. The
 problem is the initialization order:

 The child model's initModel() gets called first, the parent (my custom
 component) does not yet have a model (getModelImpl() returns null) so it
 goes up
 farther in the component hierarchy and retrieves a wrong model.

 Looking at the Component source code (Wicket 1.4.1) I see a commented out
 line
 where initModel() used to to call the parent getModel() instead of
 getModelImpl(). There's also a comment explaining that doing so would
 initialize many inbetween completely useless models. Well, not so useless
 for
 what I am trying to do I guess.

 So, from my perspective this looks like a bug that causes necessary
 initialization to be bypassed. Obviously though it was done like that on
 purpose, so I decided to put the issue up here instead of filing a bug
 report.

 Has anyone else run into similar issues?
 Would it really be so bad to just call getModel()?

 Cheers
  Edmund


 -
 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
 


-- 
Liland ...does IT better

Liland IT 

Re: Default implementation of IChainingModel

2009-10-01 Thread Daniel Stoch
Hi,

Jeremy Thomerson wrote:
 I don't think one was ever created and it fell off my radar.  If you create
 one, can you post yours and post a link to it back on this thread?

Here is my implementation for Wicket 1.4 (with generics). It is a
little bit different than Scott's one.


import org.apache.wicket.model.IChainingModel;
import org.apache.wicket.model.IDetachable;
import org.apache.wicket.model.IModel;

/**
 * Basic implementation of {...@link IChainingModel} interface.
 *
 * @author Daniel Stoch
 *
 */
public class ChainingModelT implements IChainingModelT {

  /** Any model object (which may or may not implement IModel) */
  private Object target;

  public ChainingModel(final Object modelObject) {
target = modelObject;
  }

  @Override
  public IModel? getChainedModel() {
if (target instanceof IModel?) {
  return (IModel?)target;
}
return null;
  }

  @Override
  public void setChainedModel(IModel? model) {
target = model;
  }

  @SuppressWarnings(unchecked)
  public T getObject() {
if (target instanceof IModel) {
  return ((IModelT)target).getObject();
}
return (T)target;
  }

  @SuppressWarnings(unchecked)
  public void setObject(T object) {
if (target instanceof IModel) {
  ((IModelT)target).setObject(object);
} else {
  target = object;
}
  }

  public void detach() {
// Detach nested object if it's a detachable
if (target instanceof IDetachable) {
  ((IDetachable)target).detach();
}
  }

  @Override
  public String toString() {
StringBuffer sb = new StringBuffer(Model:classname=[);
sb.append(getClass().getName()).append(]);
sb.append(:nestedModel=[).append(target).append(]);
return sb.toString();
  }

  @Override
  public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((target == null) ? 0 : target.hashCode());
return result;
  }

  @Override
  public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
ChainingModel? other = (ChainingModel?)obj;
if (target == null) {
  if (other.target != null) return false;
} else if (!target.equals(other.target)) return false;
return true;
  }

}


--
Daniel

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



Click link lost during self updating

2009-10-01 Thread Alessandro Novarini
Hello everybody,

I've just subscribed to this ml, and even thou I searched past mails about
my problem, I couldn't find any hint.

I have a page that's refreshing its components every n seconds using
AbstractAjaxTimerBehavior.
Among these components there's a list of links.

If I try to click a link near the refresh interval, the request get lost
because of the refresh.

One of the solution I'm trying is to disable the refresh on the onMouseDown,
and re-enabling it on the onMouseUp event, but this doesn't work as the
first event stops forever the ajax method call (the refresh).

Every kind of help will be really appreciated :)

Thank you in advance
Ale


Re: Click link lost during self updating

2009-10-01 Thread Ernesto Reinaldo Barreiro
Is blocking the page with a veil while refreshing a valid solution? That
way users could not click on links while the page is refreshing...

Best,

Ernesto

On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
a.novar...@sourcesense.com wrote:

 Hello everybody,

 I've just subscribed to this ml, and even thou I searched past mails about
 my problem, I couldn't find any hint.

 I have a page that's refreshing its components every n seconds using
 AbstractAjaxTimerBehavior.
 Among these components there's a list of links.

 If I try to click a link near the refresh interval, the request get lost
 because of the refresh.

 One of the solution I'm trying is to disable the refresh on the
 onMouseDown,
 and re-enabling it on the onMouseUp event, but this doesn't work as the
 first event stops forever the ajax method call (the refresh).

 Every kind of help will be really appreciated :)

 Thank you in advance
 Ale



Re: AjaxPagingNavigation

2009-10-01 Thread Pedro Santos
Hi Douglas,
you extend the AjaxPagingNavigator and override his method newNavigation to
return an PagingNavigation. The default implementation for ajax return an
AjaxPagingNavigation. That is what your links don't work asynchronously.

On Wed, Sep 30, 2009 at 8:49 PM, Douglas Ferguson 
doug...@douglasferguson.us wrote:

 I just realized that this might be what you wanted to know..

 a class=font-xsmall title=Go to page 2 wicket:id=pageLink
 href=?wicket:interface=:3:pagination:navigation:
 1:pageLink::ILinkListener::
 span class=pagin-number wicket:id=pageNumber2/span
 /a


 On Sep 30, 2009, at 2:07 PM, Pedro Santos wrote:

  Ok, it is a bug. Could you send us some code? I'm curios to see the
  html
  code generated to link on your page.
 
  On Wed, Sep 30, 2009 at 3:59 PM, Douglas Ferguson 
  doug...@douglasferguson.us wrote:
 
  That's my point.
 
  If your url is getting replaced, then it isn't using ajax.
  It is redrawing the page.
 
  D/
 
  On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote:
 
  I'm using the AjaxPagingNavigation component and it works well, but
  when I
  click on one of the links, my url  is replaced with
 
  /?wicket:interface=:3:4:::
 
  You refers to html A tag generated by navigations links. What you
  got on
  onclick tag attribute on your rendered page?
 
  On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson 
  doug...@douglasferguson.us wrote:
 
  I'm using the AjaxPagingNavigation component and it works well, but
  when I
  click on one of the links, my url  is replaced with
 
  /?wicket:interface=:3:4:::
 
  This is making me thing that the entire page is getting replaced
  and not
  using ajax.
 
  Is is possible to get IPagingNavigationIncrementLink to use
  href=#
  instead of updating the url?
 
  D/
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos


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




-- 
Pedro Henrique Oliveira dos Santos


Re: Click link lost during self updating

2009-10-01 Thread Pedro Santos
I have a page that's refreshing its components every n seconds using
AbstractAjaxTimerBehavior.
Among these components there's a list of links.

Would be nice if you apply AbstractAjaxTimerBehavior only to components that
need to be updated. Than you don't get in trouble with your links...

On Thu, Oct 1, 2009 at 7:45 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Is blocking the page with a veil while refreshing a valid solution? That
 way users could not click on links while the page is refreshing...

 Best,

 Ernesto

 On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
 a.novar...@sourcesense.com wrote:

  Hello everybody,
 
  I've just subscribed to this ml, and even thou I searched past mails
 about
  my problem, I couldn't find any hint.
 
  I have a page that's refreshing its components every n seconds using
  AbstractAjaxTimerBehavior.
  Among these components there's a list of links.
 
  If I try to click a link near the refresh interval, the request get lost
  because of the refresh.
 
  One of the solution I'm trying is to disable the refresh on the
  onMouseDown,
  and re-enabling it on the onMouseUp event, but this doesn't work as the
  first event stops forever the ajax method call (the refresh).
 
  Every kind of help will be really appreciated :)
 
  Thank you in advance
  Ale
 




-- 
Pedro Henrique Oliveira dos Santos


RE: is it possible to somehow create a url to return the contents of a panel

2009-10-01 Thread Joe Hudson
Thank you so much for the response, that was very helpful.

So, I've got half of the equation figured out but now, I have the issue of how 
to generate a URL that call a component that allows for a straight HTML 
response.

Here is the issue now:

Component someMadeUpAjaxComponent = ... {
onClick(AjaxRequestTarget target) {
// return the component output 
}
}

1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL for 
which will trigger the onClick method
2) I need to attach the URL for the component to a link - not add the component 
directly - is this possible?
3) Given an AjaxRequestTarget, is there any way I can write out the HTML 
response (as opposed to adding components for rendering)?


Because, the result will look something like this:
a href={the AJAX URL that will respond with the component HTML content}View 
Details/a

I will then attach a tooltip to this link which will know that it can take the 
href attribute of the link to obtain the tooltip content.

Thank you very much for any help you could offer.

Joe



-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Wednesday, September 30, 2009 9:15 PM
To: users@wicket.apache.org
Subject: Re: is it possible to somehow create a url to return the contents of a 
panel

search this list for how to generate emails with wicket.  there are a bunch
of posts of that sort.  that will teach you how to render a component to a
string.  this could be used to return the contents.

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



On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson joe.hud...@clear2pay.comwrote:

 Hi - hopefully I can explain this clearly...

 I understand that I can use the AjaxEventBehavior to refresh the contents
 of any components that I have on the screen or add new components.

 I am trying to use a tooltip to display additional details for grid data.
  I plan to use a tooltip library which supports retrieving content via an
 ajax call.  The question is: how (or is it possible at all) can I take a
 Panel and get a url that would return the contents of that Panel.  I'm
 probably not explaining this well so, here is an example:

 AbstractLink link = createLink(IModel rowModel);

 Private AbstractLink createLink(IModel rowModel) {
// I need to return a URL which would contain the contents
 of the additional details panel
// for this particular row in the grid

// the tooltip library will use the href attribute of this
 link to dynamically retrieve the contents of the tooltip when displayed
 }

 Any help or ideas would be greatly appreciated.  Thanks.

 Joe


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



Re: is it possible to somehow create a url to return the contents of a panel

2009-10-01 Thread Pedro Santos
1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
for which will trigger the onClick method
http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html
http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29

2) I need to attach the URL for the component to a link - not add the
component directly - is this possible?
I don't understand. Is possible to do a lot overriding onComponentTag,
onRender, 

3) Given an AjaxRequestTarget, is there any way I can write out the HTML
response (as opposed to adding components for rendering)?
you can append javascript to response...

On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson joe.hud...@clear2pay.com wrote:

 Thank you so much for the response, that was very helpful.

 So, I've got half of the equation figured out but now, I have the issue of
 how to generate a URL that call a component that allows for a straight HTML
 response.

 Here is the issue now:

 Component someMadeUpAjaxComponent = ... {
onClick(AjaxRequestTarget target) {
// return the component output
}
 }

 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
 for which will trigger the onClick method
 2) I need to attach the URL for the component to a link - not add the
 component directly - is this possible?
 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
 response (as opposed to adding components for rendering)?


 Because, the result will look something like this:
 a href={the AJAX URL that will respond with the component HTML
 content}View Details/a

 I will then attach a tooltip to this link which will know that it can take
 the href attribute of the link to obtain the tooltip content.

 Thank you very much for any help you could offer.

 Joe



 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Wednesday, September 30, 2009 9:15 PM
 To: users@wicket.apache.org
 Subject: Re: is it possible to somehow create a url to return the contents
 of a panel

 search this list for how to generate emails with wicket.  there are a bunch
 of posts of that sort.  that will teach you how to render a component to a
 string.  this could be used to return the contents.

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



 On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson joe.hud...@clear2pay.com
 wrote:

  Hi - hopefully I can explain this clearly...
 
  I understand that I can use the AjaxEventBehavior to refresh the contents
  of any components that I have on the screen or add new components.
 
  I am trying to use a tooltip to display additional details for grid data.
   I plan to use a tooltip library which supports retrieving content via an
  ajax call.  The question is: how (or is it possible at all) can I take a
  Panel and get a url that would return the contents of that Panel.  I'm
  probably not explaining this well so, here is an example:
 
  AbstractLink link = createLink(IModel rowModel);
 
  Private AbstractLink createLink(IModel rowModel) {
 // I need to return a URL which would contain the contents
  of the additional details panel
 // for this particular row in the grid
 
 // the tooltip library will use the href attribute of this
  link to dynamically retrieve the contents of the tooltip when displayed
  }
 
  Any help or ideas would be greatly appreciated.  Thanks.
 
  Joe
 

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




-- 
Pedro Henrique Oliveira dos Santos


download file inside panel caching tab

2009-10-01 Thread tubin gen
My page have several tabls all of them are panel cahcing tab   it worked
fine loading only once   , I added a new pancel caching tab   which has a
download link , here clicking on the link i should create a response
stream with byte array  and

here   is the code

setRedirect(false);
WebResponse response = (WebResponse) getResponse();
response.setAttachmentHeader(filename);
response.setLastModifiedTime(Time.now());
response.setContentType(application/octet-stream);
response.write(
new ByteArrayInputStream(filedata));
response.close();



immediately after this code is executed the tab reloads the content ,  the
tab has a  listview and its populateItems method is calledis therey any
way i can avoid this ?


Re: 1 EAR, 2 WARs causes Spring Context Problem

2009-10-01 Thread shetc

Thanks Martin! That did the trick.

Here's some info for other developers fortunate enough to work with IBM's
WebSphere:

Firstly, IBM's docs claim that, by default, each application server instance
has
a WAR class loader policy in which a different class loader is used for each
WAR file.
This is not true: I checked my local server (installed with Rational
Software Architect),
dev, QA and prod servers. All of them were set to using a single class
loader for all
WARs within an enterprise application. I was not asked how to set this
policy when I
installed RSA on my machine.

Secondly, there seems to be a bug that prevents changing the WAR class
loader policy
when working within RSA. That is, that policy setting was in read only mode
when 
displayed in the WebSphere admin console (aka the Integrated Solutions
Console).
The solution seems to be as follows:

1) In RSA, double click on the WebSphere 6.1 server displayed in the Servers
view;
this opens the Server Overview window.
2) In the Server Overview window, go to the Publishing section and uncheck
the
Minimize application files copied to the server setting.
3) Save the change.
4) Restart the server.
5) Start the admin console.
6) Select an enterprise application,
7) Click Class loading and update detection
8) Set the WAR class loader policy to Class loader for each WAR file in
application
9) Apply and save the change.

-- 
View this message in context: 
http://www.nabble.com/1-EAR%2C-2-WARs-causes-Spring-Context-Problem-tp25684384p25696859.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: Click link lost during self updating

2009-10-01 Thread Alessandro Novarini
Ernesto,

Thanks for the quick reply, but maybe I haven't explained in an accurate way
the problem.
Please correct me if I'm wrong; I get that you're suggesting me to disable
all the components after the user clicks on a link, and enabling them after
the server sends back the response. Is it correct?

The problem I'm experiencing is than the first click is lost if the whole
page is being refreshed. It seems that the client doesn't send the event to
the server; I'm assuming it because our log of the DataRequestCycle doesn't
print anythink.

Thanks you again
Ale

On Thu, Oct 1, 2009 at 12:45 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Is blocking the page with a veil while refreshing a valid solution? That
 way users could not click on links while the page is refreshing...

 Best,

 Ernesto

 On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
 a.novar...@sourcesense.com wrote:

  Hello everybody,
 
  I've just subscribed to this ml, and even thou I searched past mails
 about
  my problem, I couldn't find any hint.
 
  I have a page that's refreshing its components every n seconds using
  AbstractAjaxTimerBehavior.
  Among these components there's a list of links.
 
  If I try to click a link near the refresh interval, the request get lost
  because of the refresh.
 
  One of the solution I'm trying is to disable the refresh on the
  onMouseDown,
  and re-enabling it on the onMouseUp event, but this doesn't work as the
  first event stops forever the ajax method call (the refresh).
 
  Every kind of help will be really appreciated :)
 
  Thank you in advance
  Ale
 



RE: is it possible to somehow create a url to return the contents of a panel

2009-10-01 Thread Joe Hudson
So, it is looking like I could do something like this:

LinkString link = new AjaxLinkString(componentId, new 
ModelString(View Details)) {
@Override
public void onClick(AjaxRequestTarget target) {
String resultHTML = convertPanelToHTML();  // I 
understand this

// how can I override the target response with the 
result HTML?
}
};

1) I just want to return straight HTML (not contents within the ajax-response 
node)
2) I need the link to return the contents directly (not handle the contents 
with the Wicket ajax javascript code)

Is type of behavior possible?  If not, does anyone have any other ideas as to 
how I could show a dynamic tooltip with data retrieved using ajax?  Thank you 
very much.

Joe


-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Thursday, October 01, 2009 8:19 AM
To: users@wicket.apache.org
Subject: Re: is it possible to somehow create a url to return the contents of a 
panel

1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
for which will trigger the onClick method
http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html
http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29

2) I need to attach the URL for the component to a link - not add the
component directly - is this possible?
I don't understand. Is possible to do a lot overriding onComponentTag,
onRender, 

3) Given an AjaxRequestTarget, is there any way I can write out the HTML
response (as opposed to adding components for rendering)?
you can append javascript to response...

On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson joe.hud...@clear2pay.com wrote:

 Thank you so much for the response, that was very helpful.

 So, I've got half of the equation figured out but now, I have the issue of
 how to generate a URL that call a component that allows for a straight HTML
 response.

 Here is the issue now:

 Component someMadeUpAjaxComponent = ... {
onClick(AjaxRequestTarget target) {
// return the component output
}
 }

 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
 for which will trigger the onClick method
 2) I need to attach the URL for the component to a link - not add the
 component directly - is this possible?
 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
 response (as opposed to adding components for rendering)?


 Because, the result will look something like this:
 a href={the AJAX URL that will respond with the component HTML
 content}View Details/a

 I will then attach a tooltip to this link which will know that it can take
 the href attribute of the link to obtain the tooltip content.

 Thank you very much for any help you could offer.

 Joe



 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Wednesday, September 30, 2009 9:15 PM
 To: users@wicket.apache.org
 Subject: Re: is it possible to somehow create a url to return the contents
 of a panel

 search this list for how to generate emails with wicket.  there are a bunch
 of posts of that sort.  that will teach you how to render a component to a
 string.  this could be used to return the contents.

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



 On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson joe.hud...@clear2pay.com
 wrote:

  Hi - hopefully I can explain this clearly...
 
  I understand that I can use the AjaxEventBehavior to refresh the contents
  of any components that I have on the screen or add new components.
 
  I am trying to use a tooltip to display additional details for grid data.
   I plan to use a tooltip library which supports retrieving content via an
  ajax call.  The question is: how (or is it possible at all) can I take a
  Panel and get a url that would return the contents of that Panel.  I'm
  probably not explaining this well so, here is an example:
 
  AbstractLink link = createLink(IModel rowModel);
 
  Private AbstractLink createLink(IModel rowModel) {
 // I need to return a URL which would contain the contents
  of the additional details panel
 // for this particular row in the grid
 
 // the tooltip library will use the href attribute of this
  link to dynamically retrieve the contents of the tooltip when displayed
  }
 
  Any help or ideas would be greatly appreciated.  Thanks.
 
  Joe
 

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




-- 
Pedro Henrique Oliveira dos Santos

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



Re: Click link lost during self updating

2009-10-01 Thread Alessandro Novarini
Pedro,

Thank you.

This is indeed a solution, but it would mean rewriting the whole
application. There are lots of components that need to be refreshed, and
adding to each of them the behavior don't seem trivial.

I'll give it a try anyway.

Thank you
Ale

On Thu, Oct 1, 2009 at 1:17 PM, Pedro Santos pedros...@gmail.com wrote:

 I have a page that's refreshing its components every n seconds using
 AbstractAjaxTimerBehavior.
 Among these components there's a list of links.

 Would be nice if you apply AbstractAjaxTimerBehavior only to components
 that
 need to be updated. Than you don't get in trouble with your links...

 On Thu, Oct 1, 2009 at 7:45 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Is blocking the page with a veil while refreshing a valid solution?
 That
  way users could not click on links while the page is refreshing...
 
  Best,
 
  Ernesto
 
  On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
  a.novar...@sourcesense.com wrote:
 
   Hello everybody,
  
   I've just subscribed to this ml, and even thou I searched past mails
  about
   my problem, I couldn't find any hint.
  
   I have a page that's refreshing its components every n seconds using
   AbstractAjaxTimerBehavior.
   Among these components there's a list of links.
  
   If I try to click a link near the refresh interval, the request get
 lost
   because of the refresh.
  
   One of the solution I'm trying is to disable the refresh on the
   onMouseDown,
   and re-enabling it on the onMouseUp event, but this doesn't work as the
   first event stops forever the ajax method call (the refresh).
  
   Every kind of help will be really appreciated :)
  
   Thank you in advance
   Ale
  
 



 --
 Pedro Henrique Oliveira dos Santos



Re: is it possible to somehow create a url to return the contents of a panel

2009-10-01 Thread Pedro Santos
1) I just want to return straight HTML (not contents within the
ajax-response node)

return to where? to broser?
target.appendjavascript(document.body.innerHTML = '+resultHTML);

how I could show a dynamic tooltip with data retrieved using ajax?

target.appendjavascript(Wicket.$('+myLabelComp.getMarkupId()+').alt = '+
myNewTooltip+');
( alt or title... any tag attribute you need to change)

On Thu, Oct 1, 2009 at 9:58 AM, Joe Hudson joe.hud...@clear2pay.com wrote:

 So, it is looking like I could do something like this:

LinkString link = new AjaxLinkString(componentId, new
 ModelString(View Details)) {
@Override
public void onClick(AjaxRequestTarget target) {
String resultHTML = convertPanelToHTML();  // I
 understand this

// how can I override the target response with the
 result HTML?
}
};

 1) I just want to return straight HTML (not contents within the
 ajax-response node)
 2) I need the link to return the contents directly (not handle the contents
 with the Wicket ajax javascript code)

 Is type of behavior possible?  If not, does anyone have any other ideas as
 to how I could show a dynamic tooltip with data retrieved using ajax?  Thank
 you very much.

 Joe


 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: Thursday, October 01, 2009 8:19 AM
 To: users@wicket.apache.org
 Subject: Re: is it possible to somehow create a url to return the contents
 of a panel

 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
 for which will trigger the onClick method
 http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html

 http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29

 2) I need to attach the URL for the component to a link - not add the
 component directly - is this possible?
 I don't understand. Is possible to do a lot overriding onComponentTag,
 onRender, 

 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
 response (as opposed to adding components for rendering)?
 you can append javascript to response...

 On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson joe.hud...@clear2pay.com
 wrote:

  Thank you so much for the response, that was very helpful.
 
  So, I've got half of the equation figured out but now, I have the issue
 of
  how to generate a URL that call a component that allows for a straight
 HTML
  response.
 
  Here is the issue now:
 
  Component someMadeUpAjaxComponent = ... {
 onClick(AjaxRequestTarget target) {
 // return the component output
 }
  }
 
  1) Is there a component (the someMadeUpAjaxComponent) that I can get a
 URL
  for which will trigger the onClick method
  2) I need to attach the URL for the component to a link - not add the
  component directly - is this possible?
  3) Given an AjaxRequestTarget, is there any way I can write out the HTML
  response (as opposed to adding components for rendering)?
 
 
  Because, the result will look something like this:
  a href={the AJAX URL that will respond with the component HTML
  content}View Details/a
 
  I will then attach a tooltip to this link which will know that it can
 take
  the href attribute of the link to obtain the tooltip content.
 
  Thank you very much for any help you could offer.
 
  Joe
 
 
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Wednesday, September 30, 2009 9:15 PM
  To: users@wicket.apache.org
  Subject: Re: is it possible to somehow create a url to return the
 contents
  of a panel
 
  search this list for how to generate emails with wicket.  there are a
 bunch
  of posts of that sort.  that will teach you how to render a component to
 a
  string.  this could be used to return the contents.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson joe.hud...@clear2pay.com
  wrote:
 
   Hi - hopefully I can explain this clearly...
  
   I understand that I can use the AjaxEventBehavior to refresh the
 contents
   of any components that I have on the screen or add new components.
  
   I am trying to use a tooltip to display additional details for grid
 data.
I plan to use a tooltip library which supports retrieving content via
 an
   ajax call.  The question is: how (or is it possible at all) can I take
 a
   Panel and get a url that would return the contents of that Panel.  I'm
   probably not explaining this well so, here is an example:
  
   AbstractLink link = createLink(IModel rowModel);
  
   Private AbstractLink createLink(IModel rowModel) {
  // I need to return a URL which would contain the
 contents
   of the additional details panel
  // for this particular row in the grid
  
  // the tooltip library will use the href attribute of
 this
   link to dynamically 

Re: Click link lost during self updating

2009-10-01 Thread Pedro Santos
Hi, consider to use Wicket api like IVisitor to help keep your code clear

On Thu, Oct 1, 2009 at 10:00 AM, Alessandro Novarini 
a.novar...@sourcesense.com wrote:

 Pedro,

 Thank you.

 This is indeed a solution, but it would mean rewriting the whole
 application. There are lots of components that need to be refreshed, and
 adding to each of them the behavior don't seem trivial.

 I'll give it a try anyway.

 Thank you
 Ale

 On Thu, Oct 1, 2009 at 1:17 PM, Pedro Santos pedros...@gmail.com wrote:

  I have a page that's refreshing its components every n seconds using
  AbstractAjaxTimerBehavior.
  Among these components there's a list of links.
 
  Would be nice if you apply AbstractAjaxTimerBehavior only to components
  that
  need to be updated. Than you don't get in trouble with your links...
 
  On Thu, Oct 1, 2009 at 7:45 AM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Is blocking the page with a veil while refreshing a valid solution?
  That
   way users could not click on links while the page is refreshing...
  
   Best,
  
   Ernesto
  
   On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
   a.novar...@sourcesense.com wrote:
  
Hello everybody,
   
I've just subscribed to this ml, and even thou I searched past mails
   about
my problem, I couldn't find any hint.
   
I have a page that's refreshing its components every n seconds using
AbstractAjaxTimerBehavior.
Among these components there's a list of links.
   
If I try to click a link near the refresh interval, the request get
  lost
because of the refresh.
   
One of the solution I'm trying is to disable the refresh on the
onMouseDown,
and re-enabling it on the onMouseUp event, but this doesn't work as
 the
first event stops forever the ajax method call (the refresh).
   
Every kind of help will be really appreciated :)
   
Thank you in advance
Ale
   
  
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 




-- 
Pedro Henrique Oliveira dos Santos


java.lang.StackOverflowError and ModalWindow

2009-10-01 Thread Altuğ B . Altıntaş
Hi all;

I have a modal window; In that modal window i put a flash upload tool which
calls a Servlet to post data.

System works fine. But sometimes it gives java.lang.StackOverflowError. I
couldn't understand this issue.

Note : Also i increased Tomcat heap size...
My wicket version is 1.4.1
JDK version : 1.6
Tomcat 6.x


SEVERE: Servlet.service() for servlet default threw exception
java.lang.StackOverflowError
at java.lang.ref.ReferenceQueue.poll(ReferenceQueue.java:82)
at
java.io.ObjectStreamClass.processQueue(ObjectStreamClass.java:2234)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:266)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
at
java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
at org.apache.wicket.Component.writeObject(Component.java:4447)
at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at
org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.prepareForSerialization(DiskPageStore.java:1190)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(SecondLevelCacheSessionStore.java:386)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at

Re: Click link lost during self updating

2009-10-01 Thread Ernesto Reinaldo Barreiro
What I suggested was the other way round... When the page is refreshing
block it so that users can't click on a link while that is happening... And
the way to block it could be using a veil (e.g. a transparent div layer with
a loading icon) that does not allows the user to click on a link (the same
as modal windows), not on the server side. I'm not 100% sure but I think
wicket chains the AJAX requests so that only one request is processed at a
time...(core developers, please correct me if I'm saying something
wrong:-(. So, if you click on a link while the page sent a refresh
request, then the click will be execute only after page is refreshed...
and get lost somehow? There was a thread dealing with a similar situation
some time ago...
I use a similar approach with a GRID component that allows to drag and drop
columns: while table is repainting I block the page so that user can't do
anything... I do the same for ajax links, etc.

Best,

Ernesto

On Thu, Oct 1, 2009 at 2:57 PM, Alessandro Novarini 
a.novar...@sourcesense.com wrote:

 Ernesto,

 Thanks for the quick reply, but maybe I haven't explained in an accurate
 way
 the problem.
 Please correct me if I'm wrong; I get that you're suggesting me to
 disable
 all the components after the user clicks on a link, and enabling them after
 the server sends back the response. Is it correct?

 The problem I'm experiencing is than the first click is lost if the whole
 page is being refreshed. It seems that the client doesn't send the event to
 the server; I'm assuming it because our log of the DataRequestCycle doesn't
 print anythink.

 Thanks you again
 Ale

 On Thu, Oct 1, 2009 at 12:45 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Is blocking the page with a veil while refreshing a valid solution?
 That
  way users could not click on links while the page is refreshing...
 
  Best,
 
  Ernesto
 
  On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
  a.novar...@sourcesense.com wrote:
 
   Hello everybody,
  
   I've just subscribed to this ml, and even thou I searched past mails
  about
   my problem, I couldn't find any hint.
  
   I have a page that's refreshing its components every n seconds using
   AbstractAjaxTimerBehavior.
   Among these components there's a list of links.
  
   If I try to click a link near the refresh interval, the request get
 lost
   because of the refresh.
  
   One of the solution I'm trying is to disable the refresh on the
   onMouseDown,
   and re-enabling it on the onMouseUp event, but this doesn't work as the
   first event stops forever the ajax method call (the refresh).
  
   Every kind of help will be really appreciated :)
  
   Thank you in advance
   Ale
  
 



Custom session is null

2009-10-01 Thread Stephen Nelson

Hello Wicket Users,

I'm a beginner to wicket having previously used Spring MVC and Struts  
1/2 so definitely from the other side as far as web frameworks go!


Anyway I have a custom session to store a logged-in user; a panel  
component which performs the login; and a form web page.


I'm using Wicket 1.4.1 on Glassfish 2.x and Spring 2.5.6 to hook it  
all together.


I have bookmarkable pages for the login and the form page.

Anyway when I deploy the app I go to login. This works fine and I have  
logger statements when storing the user in the session. Now I go to  
the form page, which after clicking submit, checks if you're logged  
in. This test fails and I'm asked to login. If I now do a further  
login I can return to this form page and it functions as expected. I'm  
not sure why this session object is null the first time around.


If you want me to provide a few code snippets I can.

Many thanks

Stephen

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



Re: Click link lost during self updating

2009-10-01 Thread Ernesto Reinaldo Barreiro
Maybe this thread has information useful to you.
http://www.nabble.com/How-to-tackle-Ajax-Flooding-td25216116.html#a25221503http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503

http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503
Ernesto

On Thu, Oct 1, 2009 at 3:34 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 What I suggested was the other way round... When the page is refreshing
 block it so that users can't click on a link while that is happening... And
 the way to block it could be using a veil (e.g. a transparent div layer with
 a loading icon) that does not allows the user to click on a link (the same
 as modal windows), not on the server side. I'm not 100% sure but I think
 wicket chains the AJAX requests so that only one request is processed at a
 time...(core developers, please correct me if I'm saying something
 wrong:-(. So, if you click on a link while the page sent a refresh
 request, then the click will be execute only after page is refreshed...
 and get lost somehow? There was a thread dealing with a similar situation
 some time ago...
 I use a similar approach with a GRID component that allows to drag and drop
 columns: while table is repainting I block the page so that user can't do
 anything... I do the same for ajax links, etc.

 Best,

 Ernesto


 On Thu, Oct 1, 2009 at 2:57 PM, Alessandro Novarini 
 a.novar...@sourcesense.com wrote:

 Ernesto,

 Thanks for the quick reply, but maybe I haven't explained in an accurate
 way
 the problem.
 Please correct me if I'm wrong; I get that you're suggesting me to
 disable
 all the components after the user clicks on a link, and enabling them
 after
 the server sends back the response. Is it correct?

 The problem I'm experiencing is than the first click is lost if the whole
 page is being refreshed. It seems that the client doesn't send the event
 to
 the server; I'm assuming it because our log of the DataRequestCycle
 doesn't
 print anythink.

 Thanks you again
 Ale

 On Thu, Oct 1, 2009 at 12:45 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Is blocking the page with a veil while refreshing a valid solution?
 That
  way users could not click on links while the page is refreshing...
 
  Best,
 
  Ernesto
 
  On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
  a.novar...@sourcesense.com wrote:
 
   Hello everybody,
  
   I've just subscribed to this ml, and even thou I searched past mails
  about
   my problem, I couldn't find any hint.
  
   I have a page that's refreshing its components every n seconds using
   AbstractAjaxTimerBehavior.
   Among these components there's a list of links.
  
   If I try to click a link near the refresh interval, the request get
 lost
   because of the refresh.
  
   One of the solution I'm trying is to disable the refresh on the
   onMouseDown,
   and re-enabling it on the onMouseUp event, but this doesn't work as
 the
   first event stops forever the ajax method call (the refresh).
  
   Every kind of help will be really appreciated :)
  
   Thank you in advance
   Ale
  
 





Re: Custom session is null

2009-10-01 Thread Pedro Santos
 I have bookmarkable pages for the login and the form page.
Now I go to the form page
If you using a link to go to form page, for some reason you don't get an
cookie on your browser holding your session information. If you just writing
the url to form page on browser, you are not passing session information
encoded on url because it is bookmarkable.

which implies that the URL will not have any session information encoded in
it, and that you can call this page directly without having a session first
directly from your browser
http://cwiki.apache.org/WICKET/bookmarkable-pages-and-links.html

On Thu, Oct 1, 2009 at 10:47 AM, Stephen Nelson step...@eccostudio.comwrote:

 Hello Wicket Users,

 I'm a beginner to wicket having previously used Spring MVC and Struts 1/2
 so definitely from the other side as far as web frameworks go!

 Anyway I have a custom session to store a logged-in user; a panel component
 which performs the login; and a form web page.

 I'm using Wicket 1.4.1 on Glassfish 2.x and Spring 2.5.6 to hook it all
 together.

 I have bookmarkable pages for the login and the form page.

 Anyway when I deploy the app I go to login. This works fine and I have
 logger statements when storing the user in the session. Now I go to the form
 page, which after clicking submit, checks if you're logged in. This test
 fails and I'm asked to login. If I now do a further login I can return to
 this form page and it functions as expected. I'm not sure why this session
 object is null the first time around.

 If you want me to provide a few code snippets I can.

 Many thanks

 Stephen

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Custom session is null

2009-10-01 Thread Stephen Nelson


On 1 Oct 2009, at 15:11, Pedro Santos wrote:


I have bookmarkable pages for the login and the form page.
Now I go to the form page
If you using a link to go to form page, for some reason you don't  
get an
cookie on your browser holding your session information. If you just  
writing
the url to form page on browser, you are not passing session  
information

encoded on url because it is bookmarkable.

which implies that the URL will not have any session information  
encoded in
it, and that you can call this page directly without having a  
session first

directly from your browser
http://cwiki.apache.org/WICKET/bookmarkable-pages-and-links.html
--
Pedro Henrique Oliveira dos Santos


Hi Pedro,

Thanks for the reply. You are correct - I just added a link component  
on my login page to my form page and it now functions as expected.


However I don't quite follow why it doesn't work when manually typing  
a url in. If I'm logged-in I would expect to stay logged-in whether I  
manually type a url or follow a link. Which bit am I misunderstanding?


--
Stephen Nelson

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



Re: User name validation - how to check database to find if a name has already been taken?

2009-10-01 Thread Nicolas Melendez
Thanks Igor.Always is good another point of view.
NM


On Wed, Sep 30, 2009 at 5:14 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 actually you got it completely wrong. especially as your project, and
 the number of devs who work on it, grows exceptions are a much more
 scalable way of handling errors.

 1) the compiler tells you exactly what the exceptions are right off the bat
 2) exception class name gives you a clue as to what the error is
 without reading javadoc
 3) exception classes can contain error-related data that is easy to
 retrieve
 4) you cannot forget to handle a checked exception
 5) if someone adds a new error code you do not have to hunt down all
 the places that now need to be changed - once again you get a compile
 time error
 6) a bunch of other stuff i dont feel like typing out

 -igor

 On Wed, Sep 30, 2009 at 7:55 AM, Nicolas Melendez
 nmelen...@getsense.com.ar wrote:
  why do you use an exception for user already exits?Don`t you think that
  return true/false, could be better?
  i said that, because if the application start growing, you will have lot
 of
  exceptions class.
  thanks,
  NM
 
 
  On Wed, Sep 30, 2009 at 4:43 PM, Paul Huang paulhuan...@gmail.com
 wrote:
 
 
 
 
  igor.vaynberg wrote:
  
   form {
 onsubmit() {
  try {
 users.persist(getmodelobject());
  } catch (usernamealreadyexistsexception e) {
 error(error.username.exists);
  }
  }
   }
  
   -igor
  
 
  Thanks, it works like a charm. I did not  know I could show an error
  message
  by calling Component.error and then use a filter to catch all error
  messages targeting a specific FormComponent.
 
 
  --
  View this message in context:
 
 http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.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




models from component parents

2009-10-01 Thread Troy Cauble
If this works

Panel  // no explicit model
   WebMarkupContainer  // no explicit model
  RefreshingView (listModel)

should this?

Panel (listModel)
   WebMarkupContainer  // no explicit model
  RefreshingView  // no explicit model

RefreshingView#getModelObject() returns null.
I thought it would get the list.
The LDM#load is not being called.

Any ideas?
Thanks,
-troy

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



Re: java.lang.StackOverflowError and ModalWindow

2009-10-01 Thread Altuğ B . Altıntaş
I think problem occurs because of old disk written Session.
I cleaned Tomcat work directory. It works for now.



2009/10/1 Altuğ B. Altıntaş alt...@gmail.com

 Hi all;

 I have a modal window; In that modal window i put a flash upload tool which
 calls a Servlet to post data.

 System works fine. But sometimes it gives java.lang.StackOverflowError. I
 couldn't understand this issue.

 Note : Also i increased Tomcat heap size...
 My wicket version is 1.4.1
 JDK version : 1.6
 Tomcat 6.x


 SEVERE: Servlet.service() for servlet default threw exception
 java.lang.StackOverflowError
 at java.lang.ref.ReferenceQueue.poll(ReferenceQueue.java:82)
 at
 java.io.ObjectStreamClass.processQueue(ObjectStreamClass.java:2234)
 at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:266)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
 at
 java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416)
 at org.apache.wicket.Component.writeObject(Component.java:4447)
 at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
 at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
 at
 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
 at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
 at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
 at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
 at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.prepareForSerialization(DiskPageStore.java:1190)
 at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(SecondLevelCacheSessionStore.java:386)
 at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
 at
 

Re: Component initModel() order (design issue?)

2009-10-01 Thread Igor Vaynberg
initmodel isnt called until the first getmodel/object call. why would
that happen before the component is added to its parent?

-igor

On Thu, Oct 1, 2009 at 1:03 AM, Edmund Urbani e...@liland.org wrote:
 Can't be done, because the component does not yet know its parent during 
 object
 initialization. initModel/getDefaultModel needs to be called later, when the
 component knows its place in the hierarchy. by giving the child component a
 model that obtains the model from its parent (MyTextfield) the call to
 getDefaultModel is delayed and it works.

 Cheers
  Edmund

 Igor Vaynberg wrote:
 why not

 class mytextefield extends panel {
   public mytextfield {
        add(new textfield() { initmodel() { return
 mytextfield.this.getdefaultmodel(); }});
    }
 }

 since this is essentially what you want to do - have textfield use the
 same model as the panel.

 -igor

 On Wed, Sep 30, 2009 at 9:47 AM, Edmund Urbani e...@liland.org wrote:
 You're right, getDefaultModel ensures initialization. I should have 
 suggested
 that instead of getModel (which is not available in the component class 
 anymore
 in 1.4.x).

 However, I did not want to override the initModel() method (and copy most 
 of its
 code) just for that. So now I solved it by creating a new wrap model, which 
 I
 pass to the child component and which wraps around the 
 parent.getDefaultModel().

 public class ComponentWrapModelT implements IWrapModelT {
        private Component component;
        public ComponentWrapModel(Component component) { // component = 
 parent
                this.component=component;
        }

       �...@override
        public IModel? getWrappedModel() {
                return component.getDefaultModel();
        }
 
 }

 Here's some more background which should explain why I chose to do this:
 I replace form components (eg. Textfield) with custom components (eg.
 MyTextfield) to add a few things my application needs to them. The name
 MyTextfield is a bit misleading here, because this is actually a subclass of
 Panel, and it merely contains a Textfield as a child. Still I wanted to use
 MyTextfield as a drop-in replacement, even when used in a form with a
 CompoundPropertyModel. This is where things got a little tricky, because the
 Textfield would end up trying to retrieve a property model matching its own
 wicket:id, when the relevant wicket:id had now become that of MyTextfield.

 Anyway I would have expected that wicket ensures the parent component model 
 gets
 initialized first, seeing how components generally query their parents when 
 they
 don't have a model of their own. And I'm still considering to report this 
 as a
 bug in Jira.

 Cheers
  Edmund


 Pedro Santos wrote:
 The child model's initModel() gets called first
 There are no especial ordering programing to initModels calls. Basically
 they are called by

     public final IModel? getDefaultModel()
     {
         IModel? model = getModelImpl();
         // If model is null
         if (model == null)
         {
             // give subclass a chance to lazy-init model
             model = initModel();
             setModelImpl(model);
         }

         return model;
     }
 What about your custom component gain an model that implements
 IComponentInheritedModel and assign his children default models with the
 desired logic? On IComponentInheritedModel you can access your custom
 component parent model, and if you use getDefaultModel method, you don't
 need to care with initialization ordering too...

 On Wed, Sep 30, 2009 at 9:51 AM, Edmund Urbani e...@liland.org wrote:

 Hi,

 I was just trying to create a component of my own which - in some of my
 pages -
 is created without a model. In the initModel() method I would then call
 super.initModel() and wrap the resulting model for use in a child
 component. The
 problem is the initialization order:

 The child model's initModel() gets called first, the parent (my custom
 component) does not yet have a model (getModelImpl() returns null) so it
 goes up
 farther in the component hierarchy and retrieves a wrong model.

 Looking at the Component source code (Wicket 1.4.1) I see a commented out
 line
 where initModel() used to to call the parent getModel() instead of
 getModelImpl(). There's also a comment explaining that doing so would
 initialize many inbetween completely useless models. Well, not so 
 useless
 for
 what I am trying to do I guess.

 So, from my perspective this looks like a bug that causes necessary
 initialization to be bypassed. Obviously though it was done like that on
 purpose, so I decided to put the issue up here instead of filing a bug
 report.

 Has anyone else run into similar issues?
 Would it really be so bad to just call getModel()?

 Cheers
  Edmund


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



 

Re: Click link lost during self updating

2009-10-01 Thread Alessandro Novarini
Ok, thank you to everyone.

I've made further investigation and I (think) can describe the problem:

The refresh of the page is set to 3 seconds;
The server takes 2 seconds to give the response back to the client;
If the user clicks during the 2 seconds interval, the event is lost, and the
dialog (or whatever needs to be displayed) doesn't appear.

I think that the click is queued to be processed after the refresh is
completed, but the page has been changed, and the client doesn't recognize
the source of the event anymore.
Maybe if I define the ids for each component in the hierarchy, so that
wicket doesn't generate them...
Do you think this is likely to occur or is just a speculation? Any of you
had a similar experience?

I'm reading the links in the meantime.

Thanks again
Ale

On Thu, Oct 1, 2009 at 3:49 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Maybe this thread has information useful to you.
 http://www.nabble.com/How-to-tackle-Ajax-
 Flooding-td25216116.html#a25221503
 http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503
 

 
 http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503
 
 Ernesto

 On Thu, Oct 1, 2009 at 3:34 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  What I suggested was the other way round... When the page is refreshing
  block it so that users can't click on a link while that is happening...
 And
  the way to block it could be using a veil (e.g. a transparent div layer
 with
  a loading icon) that does not allows the user to click on a link (the
 same
  as modal windows), not on the server side. I'm not 100% sure but I think
  wicket chains the AJAX requests so that only one request is processed at
 a
  time...(core developers, please correct me if I'm saying something
  wrong:-(. So, if you click on a link while the page sent a refresh
  request, then the click will be execute only after page is refreshed...
  and get lost somehow? There was a thread dealing with a similar situation
  some time ago...
  I use a similar approach with a GRID component that allows to drag and
 drop
  columns: while table is repainting I block the page so that user can't do
  anything... I do the same for ajax links, etc.
 
  Best,
 
  Ernesto
 
 
  On Thu, Oct 1, 2009 at 2:57 PM, Alessandro Novarini 
  a.novar...@sourcesense.com wrote:
 
  Ernesto,
 
  Thanks for the quick reply, but maybe I haven't explained in an accurate
  way
  the problem.
  Please correct me if I'm wrong; I get that you're suggesting me to
  disable
  all the components after the user clicks on a link, and enabling them
  after
  the server sends back the response. Is it correct?
 
  The problem I'm experiencing is than the first click is lost if the
 whole
  page is being refreshed. It seems that the client doesn't send the event
  to
  the server; I'm assuming it because our log of the DataRequestCycle
  doesn't
  print anythink.
 
  Thanks you again
  Ale
 
  On Thu, Oct 1, 2009 at 12:45 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Is blocking the page with a veil while refreshing a valid solution?
  That
   way users could not click on links while the page is refreshing...
  
   Best,
  
   Ernesto
  
   On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
   a.novar...@sourcesense.com wrote:
  
Hello everybody,
   
I've just subscribed to this ml, and even thou I searched past mails
   about
my problem, I couldn't find any hint.
   
I have a page that's refreshing its components every n seconds using
AbstractAjaxTimerBehavior.
Among these components there's a list of links.
   
If I try to click a link near the refresh interval, the request get
  lost
because of the refresh.
   
One of the solution I'm trying is to disable the refresh on the
onMouseDown,
and re-enabling it on the onMouseUp event, but this doesn't work as
  the
first event stops forever the ajax method call (the refresh).
   
Every kind of help will be really appreciated :)
   
Thank you in advance
Ale
   
  
 
 
 



Re: Custom session is null

2009-10-01 Thread Pedro Santos
The cookie used to keep session information. When you use link to access the
form page, you are sending the session cookie stored on browser back to
server, that now can to know with what session he has to work.

Creates a cookie, a small amount of information sent by a servlet to a Web
browser, saved by the browser, and later sent back to the server. A cookie's
value can uniquely identify a client, so cookies are commonly used for
session management. 
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/Cookie.html

On Thu, Oct 1, 2009 at 11:48 AM, Stephen Nelson step...@eccostudio.comwrote:


 On 1 Oct 2009, at 15:11, Pedro Santos wrote:

  I have bookmarkable pages for the login and the form page.
 Now I go to the form page
 If you using a link to go to form page, for some reason you don't get an
 cookie on your browser holding your session information. If you just
 writing
 the url to form page on browser, you are not passing session information
 encoded on url because it is bookmarkable.

 which implies that the URL will not have any session information encoded
 in
 it, and that you can call this page directly without having a session
 first
 directly from your browser
 http://cwiki.apache.org/WICKET/bookmarkable-pages-and-links.html
 --
 Pedro Henrique Oliveira dos Santos


 Hi Pedro,

 Thanks for the reply. You are correct - I just added a link component on my
 login page to my form page and it now functions as expected.

 However I don't quite follow why it doesn't work when manually typing a url
 in. If I'm logged-in I would expect to stay logged-in whether I manually
 type a url or follow a link. Which bit am I misunderstanding?

 --
 Stephen Nelson


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




-- 
Pedro Henrique Oliveira dos Santos


Re: download file inside panel caching tab

2009-10-01 Thread Igor Vaynberg
listviews refresh on every render. you can use repeatingview if you
want to control/do the refreshing yourself.

-igor

On Thu, Oct 1, 2009 at 5:26 AM, tubin gen fachh...@gmail.com wrote:
 My page have several tabls all of them are panel cahcing tab   it worked
 fine loading only once   , I added a new pancel caching tab   which has a
 download link , here clicking on the link i should create a response
 stream with byte array  and

 here   is the code

        setRedirect(false);
        WebResponse response = (WebResponse) getResponse();
        response.setAttachmentHeader(filename);
        response.setLastModifiedTime(Time.now());
        response.setContentType(application/octet-stream);
        response.write(
                new ByteArrayInputStream(filedata));
        response.close();



 immediately after this code is executed the tab reloads the content ,  the
 tab has a  listview and its populateItems method is called    is therey any
 way i can avoid this ?


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



Re: models from component parents

2009-10-01 Thread Igor Vaynberg
inly if your ldm implemetns IInheritedModel which it does not by default

-igor

On Thu, Oct 1, 2009 at 8:34 AM, Troy Cauble troycau...@gmail.com wrote:
 If this works

 Panel  // no explicit model
   WebMarkupContainer  // no explicit model
      RefreshingView (listModel)

 should this?

 Panel (listModel)
   WebMarkupContainer  // no explicit model
      RefreshingView  // no explicit model

 RefreshingView#getModelObject() returns null.
 I thought it would get the list.
 The LDM#load is not being called.

 Any ideas?
 Thanks,
 -troy

 -
 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: Custom session is null

2009-10-01 Thread Stephen Nelson


On 1 Oct 2009, at 17:06, Pedro Santos wrote:

The cookie used to keep session information. When you use link to  
access the
form page, you are sending the session cookie stored on browser back  
to

server, that now can to know with what session he has to work.

Creates a cookie, a small amount of information sent by a servlet  
to a Web
browser, saved by the browser, and later sent back to the server. A  
cookie's

value can uniquely identify a client, so cookies are commonly used for
session management. 
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/Cookie.html

--
Pedro Henrique Oliveira dos Santos


Sure, I'm aware of how cookies work but there shouldn't be a  
difference, in terms of whether a cookie is sent, from clicking a link  
to typing in a url. So long as the domain matches that of the cookie  
it will be sent every request.


So I'm not sure of the difference between accessing the page directly,  
or accessing the page through a link. My session should be retrieved  
on each request. This is what I'm not understanding I feel.


--

Stephen Nelson

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



WebMarkupContainer and SimpleAttributeModifier problems on 1.4.1 upgrade.

2009-10-01 Thread VGJ
I've got a little helper method for replacing HTML tag attributes:

public static WebMarkupContainer getContainer(
String name,
String attribute,
String value)
{
//modify check add-on img tag
WebMarkupContainer container = new WebMarkupContainer(name);
container.add(new SimpleAttributeModifier(attribute, value));

return container;
}

I just upgraded from 1.3.2 to 1.4.1, and I'm getting this exception every
time the above method calls the add method:

java.lang.NoSuchMethodError:
org.apache.wicket.markup.html.WebMarkupContainer.add(Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component;

I just looked at the 1.4 Javadocs...it looks like this is still valid.  What
am I doing wrong?

Thanks!

-v


Re: Click link lost during self updating

2009-10-01 Thread Ernesto Reinaldo Barreiro
You have to be very careful about what you are doing. Think about the
following situation:
1-You have panel A that contains a panel B which in turn contains a check
box.
2-Suppose panel B in recreated every time panel A is rendered (e.g. on
onBeforeRendered()).
3-The state of the check box depends on a boolean that is set to false on
the constructor of panel B.
4-Now suppose the user clicks the checkbox and generates an AJAX request and
the boolean is set to true...
5-But right after you have your timer request that repaints A (and recreates
B showing an unchecked checkbox).
6-So the effect is that your action of clicking the check box was over-riden
by the refresh,

I'm not telling this is your situation but if you are not careful many
strange things could happen...

Best,

Ernesto

On Thu, Oct 1, 2009 at 6:06 PM, Alessandro Novarini 
a.novar...@sourcesense.com wrote:

 Ok, thank you to everyone.

 I've made further investigation and I (think) can describe the problem:

 The refresh of the page is set to 3 seconds;
 The server takes 2 seconds to give the response back to the client;
 If the user clicks during the 2 seconds interval, the event is lost, and
 the
 dialog (or whatever needs to be displayed) doesn't appear.

 I think that the click is queued to be processed after the refresh is
 completed, but the page has been changed, and the client doesn't recognize
 the source of the event anymore.
 Maybe if I define the ids for each component in the hierarchy, so that
 wicket doesn't generate them...
 Do you think this is likely to occur or is just a speculation? Any of you
 had a similar experience?

 I'm reading the links in the meantime.

 Thanks again
 Ale

 On Thu, Oct 1, 2009 at 3:49 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  Maybe this thread has information useful to you.
  http://www.nabble.com/How-to-tackle-Ajax-
  Flooding-td25216116.html#a25221503
 
 http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503
  
 
  
 
 http://www.nabble.com/How-to-tackle-Ajax-%22Flooding%22-td25216116.html#a25221503
  
  Ernesto
 
  On Thu, Oct 1, 2009 at 3:34 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   What I suggested was the other way round... When the page is refreshing
   block it so that users can't click on a link while that is happening...
  And
   the way to block it could be using a veil (e.g. a transparent div layer
  with
   a loading icon) that does not allows the user to click on a link (the
  same
   as modal windows), not on the server side. I'm not 100% sure but I
 think
   wicket chains the AJAX requests so that only one request is processed
 at
  a
   time...(core developers, please correct me if I'm saying something
   wrong:-(. So, if you click on a link while the page sent a refresh
   request, then the click will be execute only after page is
 refreshed...
   and get lost somehow? There was a thread dealing with a similar
 situation
   some time ago...
   I use a similar approach with a GRID component that allows to drag and
  drop
   columns: while table is repainting I block the page so that user can't
 do
   anything... I do the same for ajax links, etc.
  
   Best,
  
   Ernesto
  
  
   On Thu, Oct 1, 2009 at 2:57 PM, Alessandro Novarini 
   a.novar...@sourcesense.com wrote:
  
   Ernesto,
  
   Thanks for the quick reply, but maybe I haven't explained in an
 accurate
   way
   the problem.
   Please correct me if I'm wrong; I get that you're suggesting me to
   disable
   all the components after the user clicks on a link, and enabling them
   after
   the server sends back the response. Is it correct?
  
   The problem I'm experiencing is than the first click is lost if the
  whole
   page is being refreshed. It seems that the client doesn't send the
 event
   to
   the server; I'm assuming it because our log of the DataRequestCycle
   doesn't
   print anythink.
  
   Thanks you again
   Ale
  
   On Thu, Oct 1, 2009 at 12:45 PM, Ernesto Reinaldo Barreiro 
   reier...@gmail.com wrote:
  
Is blocking the page with a veil while refreshing a valid
 solution?
   That
way users could not click on links while the page is refreshing...
   
Best,
   
Ernesto
   
On Thu, Oct 1, 2009 at 12:37 PM, Alessandro Novarini 
a.novar...@sourcesense.com wrote:
   
 Hello everybody,

 I've just subscribed to this ml, and even thou I searched past
 mails
about
 my problem, I couldn't find any hint.

 I have a page that's refreshing its components every n seconds
 using
 AbstractAjaxTimerBehavior.
 Among these components there's a list of links.

 If I try to click a link near the refresh interval, the request
 get
   lost
 because of the refresh.

 One of the solution I'm trying is to disable the refresh on the
 onMouseDown,
 and re-enabling it on the onMouseUp event, but this doesn't work
 as
   the
 first event stops forever the ajax method call 

Exceptions and Ajax Events

2009-10-01 Thread Nicolas Melendez
Hi there,Our team was discussing about if there is a place where all
exceptions, that come from an ajax behaviour, can be catched.
We want to do this because we strongly belive that exceptions should be
catched in one place, but now we have to catch  the exception in every
ajax method( onSubmit, onChance, etc) in the application.
Is there one place in wicket where we can do that?

Thank in advance.
Our team.


Re: Exceptions and Ajax Events

2009-10-01 Thread Jeremy Thomerson
something like this in your application should work:

@Override
public RequestCycle newRequestCycle(Request request, Response response) {
return new WebRequestCycle(this, (WebRequest)request,
(WebResponse)response) {
@Override
public Page onRuntimeException(Page page, RuntimeException e) {
if (RequestCycle.get().getRequestTarget() instanceof
AjaxRequestTarget) {
// do something with ajax request targets
}
return super.onRuntimeException(page, e);
}
};
}


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



On Thu, Oct 1, 2009 at 1:59 PM, Nicolas Melendez
nmelen...@getsense.com.arwrote:

 Hi there,Our team was discussing about if there is a place where all
 exceptions, that come from an ajax behaviour, can be catched.
 We want to do this because we strongly belive that exceptions should be
 catched in one place, but now we have to catch  the exception in every
 ajax method( onSubmit, onChance, etc) in the application.
 Is there one place in wicket where we can do that?

 Thank in advance.
 Our team.



AutoCompleteTextField stops showing completions

2009-10-01 Thread Julian Sinai
I'm having trouble with AutoCompleteTextField. It works great most of the time, 
but occasionally the autocompletions won't show up. This seems to be more of a 
problem on Safari and IE6. It happens either when the page first renders, or 
after clicking OK to take action based on the user's selection (there's an ajax 
button next to my AutoCompleteTextField). 

I've tried manually reinitializing the autocomplete JS code by calling 
target.appendJavascript(initialize()).

I've also tried re-rendering the AutoCompleteTextField using 
target.addComponent(field).

None of these techniques work.

I'm using Wicket 1.4.0.

If someone can help, I'd appreciate it.

Thanks,
Julian

Doubt with Link

2009-10-01 Thread Pedro Sena
Hi Guys,

First of all, sorry for a so newbie question, but I'm really a newbie in
Wicket.

I'm trying to add a Behaviou to my link, it works fine with
link.add(myBehaviourHere)

I'd like to know how to avoid any page redirect the link does. I left
onClick without code but it redirects to the page that I'm actually(expected
behavior)

Any tips?

Thanks in advance,

-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: Doubt with Link

2009-10-01 Thread Pedro Santos
Refresh the page is default link behavior, you may want to use AjaxLink to
avoid it

On Thu, Oct 1, 2009 at 5:44 PM, Pedro Sena sena.pe...@gmail.com wrote:

 Hi Guys,

 First of all, sorry for a so newbie question, but I'm really a newbie in
 Wicket.

 I'm trying to add a Behaviou to my link, it works fine with
 link.add(myBehaviourHere)

 I'd like to know how to avoid any page redirect the link does. I left
 onClick without code but it redirects to the page that I'm
 actually(expected
 behavior)

 Any tips?

 Thanks in advance,

 --
 /**
 * Pedro Sena
 * Systems Architect
 * Sun Certified Java Programmer
 * Sun Certified Web Component Developer
 */




-- 
Pedro Henrique Oliveira dos Santos


Re: Doubt with Link

2009-10-01 Thread Pedro Sena
It worked.

Thanks for the quick input.

Regards,

On Thu, Oct 1, 2009 at 5:53 PM, Pedro Santos pedros...@gmail.com wrote:

 Refresh the page is default link behavior, you may want to use AjaxLink to
 avoid it

 On Thu, Oct 1, 2009 at 5:44 PM, Pedro Sena sena.pe...@gmail.com wrote:

  Hi Guys,
 
  First of all, sorry for a so newbie question, but I'm really a newbie in
  Wicket.
 
  I'm trying to add a Behaviou to my link, it works fine with
  link.add(myBehaviourHere)
 
  I'd like to know how to avoid any page redirect the link does. I left
  onClick without code but it redirects to the page that I'm
  actually(expected
  behavior)
 
  Any tips?
 
  Thanks in advance,
 
  --
  /**
  * Pedro Sena
  * Systems Architect
  * Sun Certified Java Programmer
  * Sun Certified Web Component Developer
  */
 



 --
 Pedro Henrique Oliveira dos Santos




-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: WebMarkupContainer and SimpleAttributeModifier problems on 1.4.1 upgrade.

2009-10-01 Thread VGJ
Hmm...nevermind, I guess?  It seems like the problem just went away.  I
can't explain it...a few redeploys later and it's all working as if the
error never happened.

I'll submit this one to the X-Files.

On Thu, Oct 1, 2009 at 12:01 PM, VGJ zambi...@gmail.com wrote:

 I've got a little helper method for replacing HTML tag attributes:

 public static WebMarkupContainer getContainer(
 String name,
 String attribute,
 String value)
 {
 //modify check add-on img tag
 WebMarkupContainer container = new WebMarkupContainer(name);
 container.add(new SimpleAttributeModifier(attribute, value));

 return container;
 }

 I just upgraded from 1.3.2 to 1.4.1, and I'm getting this exception every
 time the above method calls the add method:

 java.lang.NoSuchMethodError:
 org.apache.wicket.markup.html.WebMarkupContainer.add(Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component;

 I just looked at the 1.4 Javadocs...it looks like this is still valid.
 What am I doing wrong?

 Thanks!

 -v



Re: Exceptions and Ajax Events

2009-10-01 Thread Esteban Masoero

Hi:

We found out we need something else. Is there a way we can access to the 
component asociated to the listener that was processing the event? (of 
course it only applies to ajax events), becase from onRuntimeException 
we ony have the Page.


Thanks,

Esteban

Jeremy Thomerson escribió:

something like this in your application should work:

@Override
public RequestCycle newRequestCycle(Request request, Response response) {
return new WebRequestCycle(this, (WebRequest)request,
(WebResponse)response) {
@Override
public Page onRuntimeException(Page page, RuntimeException e) {
if (RequestCycle.get().getRequestTarget() instanceof
AjaxRequestTarget) {
// do something with ajax request targets
}
return super.onRuntimeException(page, e);
}
};
}


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



On Thu, Oct 1, 2009 at 1:59 PM, Nicolas Melendez
nmelen...@getsense.com.arwrote:

  

Hi there,Our team was discussing about if there is a place where all
exceptions, that come from an ajax behaviour, can be catched.
We want to do this because we strongly belive that exceptions should be
catched in one place, but now we have to catch  the exception in every
ajax method( onSubmit, onChance, etc) in the application.
Is there one place in wicket where we can do that?

Thank in advance.
Our team.




  


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



Re: WebMarkupContainer and SimpleAttributeModifier problems on 1.4.1 upgrade.

2009-10-01 Thread Jeremy Thomerson
It was a classpath issue - you had an old version of Wicket somewhere.  1.3
/ 1.4 are not binary compatible.  Perhaps even in a serialized session?

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



On Thu, Oct 1, 2009 at 4:21 PM, VGJ zambi...@gmail.com wrote:

 Hmm...nevermind, I guess?  It seems like the problem just went away.  I
 can't explain it...a few redeploys later and it's all working as if the
 error never happened.

 I'll submit this one to the X-Files.

 On Thu, Oct 1, 2009 at 12:01 PM, VGJ zambi...@gmail.com wrote:

  I've got a little helper method for replacing HTML tag attributes:
 
  public static WebMarkupContainer getContainer(
  String name,
  String attribute,
  String value)
  {
  //modify check add-on img tag
  WebMarkupContainer container = new WebMarkupContainer(name);
  container.add(new SimpleAttributeModifier(attribute, value));
 
  return container;
  }
 
  I just upgraded from 1.3.2 to 1.4.1, and I'm getting this exception every
  time the above method calls the add method:
 
  java.lang.NoSuchMethodError:
 
 org.apache.wicket.markup.html.WebMarkupContainer.add(Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component;
 
  I just looked at the 1.4 Javadocs...it looks like this is still valid.
  What am I doing wrong?
 
  Thanks!
 
  -v
 



Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor

2009-10-01 Thread Nicolas Melendez
hi, in your example, there aren't behaviours, or where are they?

On Thu, Sep 24, 2009 at 5:54 AM, jWeekend jweekend_for...@cabouge.comwrote:

 Chris,

 The fact that you've chosen to use Wicket probably shows there's not so
 much danger of that!

 To better see what's going on, try the snippet below in the project you
 attached
   // ... mark t2 final and
   // append this to your BasePage constructor
   con.add(t2.setOutputMarkupId(true));
   add(new AjaxLink(toggleVisiblity){
  @Override
  public void onClick(AjaxRequestTarget target) {
  t2.setVisible(!t2.isVisible());
  target.addComponent(t2);
  }
   });

 Fix your BasePage.html accordingly eg, add an anchor to the body with
 wicket:id=toggleVisiblity.

 When you fire up your app, click on that link once and you can use FireBug
 in Firefox to verify that the onblur code you wanted is indeed in place.

 Is that the effect you were after?

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

 PS Nabble is not showing posts to our list (I think it's pointing back to
 SourceForge again!) so I am replying here in case you need a solution
 quickly and this happens to be the actual issue you are faced with!


  maybe i'm to stupid to understand what you mean.
 so please provide an example.
 thx

 -Ursprüngliche Nachricht-
 Von: Giambalvo, Christian [mailto:christian.giamba...@excelsisnet.com]
 Gesendet: Do 24.09.2009 02:45
 An: users@wicket.apache.org
 Betreff: AW: FXValidationAjaxHandler - Javascript not added if component
 is set visible(false) in page constructor
 - Hide quoted text -


 well, it makes no sense to add the javascript to another container.
 how should i validate the textfields if the javascript points to a
 different component?
 or could you give me an example?


 -Ursprüngliche Nachricht-
 Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Gesendet: Do 24.09.2009 02:32
 An: users@wicket.apache.org
 Betreff: Re: FXValidationAjaxHandler - Javascript not added if component
 is set visible(false) in page constructor

 i meant add the javascript to a container that is visible.

 components that are not visible do not render their javascript, it
 wouldnt make any sense for them to do otherwise.

 -igor

 On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian
 christian.giamba...@excelsisnet.com wrote:

 i'm sorry, but doesn't work.

 i attached a simple project.
 i added the needed components to a webmarkupcontainer.
 instead of panels this time i used requiredtextfields to keep it as
 simple
 as possible.
 one textfield is visible the other invisible.

 here is the generated markup:

 ?xml version=1.0 encoding=UTF-8?
 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
head
meta http-equiv=Content-Type content=text/html;
 charset=UTF-8/
titleWicket Demo/title
link rel=stylesheet type=text/css href=/css/style.css/
script type=text/javascript

 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
 script type=text/javascript

 src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
 script type=text/javascript

 src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script

 script type=text/javascript
 id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
 wicketAjaxDebugEnable=true;
 /*--]]*//script

 script type=text/javascript

 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug!--/*--![CDATA[/*!--*/
 var djConfig = {};
 djConfig.isDebug = true;
 djConfig.parseWidgets = false;
 djConfig.searchIds = []

 /*--]]*//script

 script type=text/javascript

 src=resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js/script
 script type=text/javascript

 src=resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js/script
 script type=text/javascript

 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff!--/*--![CDATA[/*!--*/
 dojo.registerModulePath(wicketstuff,
 ../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior);
 /*--]]*//script

 script type=text/javascript

 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug!--/*--![CDATA[/*!--*/
 dojo.require(dojo.debug.console);
 dojo.require(dojo.widget.Tree);

 /*--]]*//script

 script type=text/javascript

 id=org.wicketstuff.dojo.AbstractRequireDojoBehavior!--/*--![CDATA[/*!--*/
dojo.require(dojo.lfx.*);
dojo.require(dojo.gfx.*);
dojo.require(dojo.html.*);


 /*--]]*//script

 script type=text/javascript
 id=txt11DojoParse!--/*--![CDATA[/*!--*/
 djConfig.searchIds.push(txt11);
 /*--]]*//script

 script language='JavaScript' type='text/javascript'
var txt11_first = false;
function txt11_validate(type) {
with(dojo.byId('txt11').style){backgroundColor =
 '#FFF';}

ModalWindow and LazyLoading Exception

2009-10-01 Thread Albert Romanius
Hi,

I am working with wicket and jpa/hibernate/spring. I am trying to
create a ModalWindow, but I get a LazyLoadingException. I tryed the
OSIVpattern, but it did not work.
Using the modal inside a form does not make any difference also.

Has anyone else this problem?


The page which the modalWindow is triggered has:
===
  AjaxLink link = new AjaxLink(openModal) {
@Override
public void onClick(AjaxRequestTarget target) {
modalWindow.setPageCreator(new
ModalWindow.PageCreator() {
public Page createPage() {
return new MyModalPage(modalWindow,
messageListModel.getObject().get(0));
}
});
modalWindow.show(target);
}
   };
==

#Modal Panel
==
public class MyModalPage extends WebPage {

@SpringBean
GeneralRepository generalRepository;

SetSubMessage selectedSubs = new HashSetSubMessage();

public MyModalPage(final ModalWindow window, Message message) {

Message showMessage = (Message)
generalRepository.MessagegetById(message.getId(), Message.class);

//showMessage.getLazyList().size();

Form f = new Form(form);
add(f);

CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
subMessages, new PropertyModel(this,
selectedSubs), showMessage.getLazyList());
f.add(subMessagesCB);

AjaxButton saveButton = new AjaxButton(save) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form? arg1) {
window.close(target);
}
};

f.add(saveButton);

add(new AjaxLink(closeCancel)
{
@Override
public void onClick(AjaxRequestTarget target)
{
window.close(target);
}
});


}
==


-- 
Albert

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



Re: AjaxPagingNavigation

2009-10-01 Thread Douglas Ferguson
Umm...

I apologize. Somebody else wrote this wrapper and I didn't catch that.

Thanks!

D/

On Oct 1, 2009, at 6:08 AM, Pedro Santos wrote:

 Hi Douglas,
 you extend the AjaxPagingNavigator and override his method  
 newNavigation to
 return an PagingNavigation. The default implementation for ajax  
 return an
 AjaxPagingNavigation. That is what your links don't work  
 asynchronously.

 On Wed, Sep 30, 2009 at 8:49 PM, Douglas Ferguson 
 doug...@douglasferguson.us wrote:

 I just realized that this might be what you wanted to know..

 a class=font-xsmall title=Go to page 2 wicket:id=pageLink
 href=?wicket:interface=:3:pagination:navigation:
 1:pageLink::ILinkListener::
 span class=pagin-number wicket:id=pageNumber2/span
 /a


 On Sep 30, 2009, at 2:07 PM, Pedro Santos wrote:

 Ok, it is a bug. Could you send us some code? I'm curios to see the
 html
 code generated to link on your page.

 On Wed, Sep 30, 2009 at 3:59 PM, Douglas Ferguson 
 doug...@douglasferguson.us wrote:

 That's my point.

 If your url is getting replaced, then it isn't using ajax.
 It is redrawing the page.

 D/

 On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote:

 I'm using the AjaxPagingNavigation component and it works well,  
 but
 when I
 click on one of the links, my url  is replaced with

 /?wicket:interface=:3:4:::

 You refers to html A tag generated by navigations links. What  
 you
 got on
 onclick tag attribute on your rendered page?

 On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson 
 doug...@douglasferguson.us wrote:

 I'm using the AjaxPagingNavigation component and it works well,  
 but
 when I
 click on one of the links, my url  is replaced with

 /?wicket:interface=:3:4:::

 This is making me thing that the entire page is getting replaced
 and not
 using ajax.

 Is is possible to get IPagingNavigationIncrementLink to use
 href=#
 instead of updating the url?

 D/




 --
 Pedro Henrique Oliveira dos Santos


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




 --
 Pedro Henrique Oliveira dos Santos


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




 -- 
 Pedro Henrique Oliveira dos Santos


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



Re: Preventing Copy Pasting URL's In Same Browser Session

2009-10-01 Thread Douglas Ferguson
What are the implications of turning this one?

D/


On Sep 30, 2009, at 1:23 AM, Igor Vaynberg wrote:

 the javadoc in the later versions mentions that it is enabled by
 default, however if you are using the default secondlevel caching page
 store it will be disabled...

 -igor

 On Tue, Sep 29, 2009 at 11:10 PM, Carlo Camerino
 carlo.camer...@gmail.com wrote:
 hi,

 actually i'm able to make it work some how using this setting

 getPageSettings().setAutomaticMultiWindowSupport(true);

 it creates a new page map everytime i open a page in a new tab or  
 new window.
 however in the wicket documentation it says that it is enabled by
 default. but upon checking it seems that it is not enabled by default
 that's why i'm confused.

 any recommendations regarding this?

 i can now check the page map name for each page and throw a redirect
 if a new page map is encountered other than the default.

 carlo

 On Wed, Sep 30, 2009 at 5:50 AM, Phil Housley undeconstruc...@gmail.com 
  wrote:
 2009/9/29 Carlo Camerino carlo.camer...@gmail.com:
 Hi everyone,

 We have this requirement in which we cannot allow the customer to  
 copy
 paste the url that's appearing in the address bar into the same
 browser. For example in a different tab or in a new window. This  
 can
 easily be done in Wicket Framework since the url has a  
 corresponding
 page attached to it. For example if i get
 http://localhost/wicket:interface=1 appearing in the address bar, I
 can open anew tab paste the url and I could get into the same page.
 The users don't want this behavior. Could I make it work in such  
 a way
 that I copy http://localhost/wicket:inteface=1, when i try to  
 copy and
 paste it, it will redirect me to an error page? This happens even
 after the user has already logged in. Really need help on this
 one.


 I've been playing with the ideas from
 http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html
 for something of my own, which might fit the bill in a way.   
 Following
 that you can convince wicket to serve up every instance of a mounted
 page from exactly the same URL.  That means if you copy the url, you
 get a brand new instance of the page.  You lose the ability to
 refresh, but if you are being strict on that sort of thing, I guess
 you will have a refresh button on the page when and only when it is
 appropriate.

 --
 Phil Housley

 -
 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 component cannot be found from page relative component path.

2009-10-01 Thread yong mook kim
Hi, 

  Any comments and feedback on it? Thanks

Best Regards,
yong

--- On Mon, 9/28/09, yong mook kim mkyong2...@yahoo.com wrote:

 From: yong mook kim mkyong2...@yahoo.com
 Subject: Wicket component cannot be found from page relative component path.
 To: users@wicket.apache.org
 Date: Monday, September 28, 2009, 9:40 PM
 Hi, 
 
 Wicket will render its component based on page relative
 component path. For an example, a bookmarkable page is
 requested, then the
 BookmarkableListenerInterfaceRequestTarget.processEvent() is
 triggered to lookup the component. But some of the component
 are only exist when the user session is still available.
 Then I encounter some component cannot be found due to this
 condition. Therefore WicketRuntimeException will be thrown.
 How do I render the page as usual but display label to ask
 user to sign on for those components are required to sign on
 instead of exception is thrown.
 
 Thanks
 
 
       
 
 -
 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



Immediate need for Wicket developer

2009-10-01 Thread Eric Glass
Hi All,

We have the immediate need for a Wicket developer in the Canton/Akron 
Ohio, USA area. The candidate needs to be a Senior Java Developer with at 
least one year of Wicket experience. It would be great if the candidate 
also has JQuery experience, but any JavaScript/Ajax experience would be 
welcomed.

Thank you!

Eric Glass

CourtView Justice Solutions
5399 Lauby Road Suite 230
North Canton, OH 44720
(330)490-8234
eric.gl...@courtview.com



Re: ModalWindow and LazyLoading Exception

2009-10-01 Thread Marcelo Fukushima
while i couldnt identify which object is throwing the
lazyInitialization, the problem is probably that the entity is not
associated with the hibernate session. On the request that opens the
ModalWindow you must either reload or reatach the entity

On Thu, Oct 1, 2009 at 7:55 PM, Albert Romanius a.roman...@gmail.com wrote:
 Hi,

 I am working with wicket and jpa/hibernate/spring. I am trying to
 create a ModalWindow, but I get a LazyLoadingException. I tryed the
 OSIVpattern, but it did not work.
 Using the modal inside a form does not make any difference also.

 Has anyone else this problem?


 The page which the modalWindow is triggered has:
 ===
  AjaxLink link = new AjaxLink(openModal) {
                   �...@override
                    public void onClick(AjaxRequestTarget target) {
                        modalWindow.setPageCreator(new
 ModalWindow.PageCreator() {
                            public Page createPage() {
                                return new MyModalPage(modalWindow,
 messageListModel.getObject().get(0));
                            }
                        });
                        modalWindow.show(target);
                    }
   };
 ==

 #Modal Panel
 ==
 public class MyModalPage extends WebPage {

   �...@springbean
    GeneralRepository generalRepository;

    SetSubMessage selectedSubs = new HashSetSubMessage();

 public MyModalPage(final ModalWindow window, Message message) {

        Message showMessage = (Message)
 generalRepository.MessagegetById(message.getId(), Message.class);

        //showMessage.getLazyList().size();

        Form f = new Form(form);
        add(f);

        CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
                subMessages, new PropertyModel(this,
 selectedSubs), showMessage.getLazyList());
        f.add(subMessagesCB);

        AjaxButton saveButton = new AjaxButton(save) {

           �...@override
            protected void onSubmit(AjaxRequestTarget target, Form? arg1) {
                window.close(target);
            }
        };

        f.add(saveButton);

        add(new AjaxLink(closeCancel)
        {
           �...@override
            public void onClick(AjaxRequestTarget target)
            {
                window.close(target);
            }
        });


    }
 ==


 --
 Albert

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





-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

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