Re: Form in modal using Internet Explorer 8

2011-06-07 Thread Matthew Goodson
Hi, I figured out what was causing my problem.
For anyone else that gets the same thing...

I had a jquery modal with a form in it. Inside the form I had an input tag
of type image. (input type=image src=/assets/img.jpg/)
I found that when I clicked the input tag ie was submitting the form. It
only happened when using ie 8 older.
It turns out that when I use an input tag of a different type then the
problem stopped.

Thanks


On Tue, Jun 7, 2011 at 4:41 PM, Matthew Goodson matt...@spidertracks.comwrote:

 Hi guys,
 I have a jquery modal which contains a form which has an ajax button.
 The problem I have is that when using internet explorer 8 (and presumibly
 older versions) when the button is clicked an ajax callback is fired for the
 button AND also an ajax form submit callback is fired.
 This doesn't happen with ie9, firefox or chrome. For these browsers I just
 get the one ajax callback for the button which is what I would expect.

 Does anyone know what would cause the form submit to fire on ie8?

 Thanks for your help.

 Matthew Goodson




-- 

Matthew

Software Engineer

Matthew Goodson | spidertracks

po box 5203 | 117a the square | Palmerston North 4441 | new zealand

P: +64 6 353 3395 | M: +64 27 6969639

E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
www.spidertracks.com*

spiderwatch - because in the rescue game, time = life.


Form in modal using Internet Explorer 8

2011-06-06 Thread Matthew Goodson
Hi guys,
I have a jquery modal which contains a form which has an ajax button.
The problem I have is that when using internet explorer 8 (and presumibly
older versions) when the button is clicked an ajax callback is fired for the
button AND also an ajax form submit callback is fired.
This doesn't happen with ie9, firefox or chrome. For these browsers I just
get the one ajax callback for the button which is what I would expect.

Does anyone know what would cause the form submit to fire on ie8?

Thanks for your help.

Matthew Goodson


Re: WELCOME to users@wicket.apache.org

2011-04-28 Thread Matthew Goodson
Yeah on the javascript side it will fire off a request to the server to
reload the tab each time. But wicket on the server thinks that the requested
tab is already loaded so ignores the request

On Thu, Apr 28, 2011 at 9:07 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 The random parameter is there to prevent caching of the Ajax response.
 AFAIK clicking on a tab will reload its content each time. I.e. Wicket
 doesn't think that the tab is already loaded.

 On Thu, Apr 28, 2011 at 12:41 AM, Matthew Goodson
 matt...@spidertracks.com wrote:
  Yeah I'm not feeling too hopeful
  I have a tabbed panel which loads the tabs via ajax. When the page is
 loaded
  from the browsers cache i.e. the user hits the back button, the ajax
 request
  to load the tab is sent but wicket thinks that tab is already loaded
  (getSelectedTab()) so ignores the request.
 
  Here's the request that's sent. Wicket adds the random parameter. I'm not
  sure if I removed the random param (somehow) if that would breaks things.
 
 
 http://localhost?wicket:interface=:27::IActivePageBehaviorListener:21:2wicket:ignoreIfNotActive=truetab=privacysettingsrandom=0.8811610792763531
 
  Any ideas?
 
 
  On Wed, Apr 27, 2011 at 7:22 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
 
  Hi,
 
  I'm not sure whether this is possible at all.
  Why do you need to do this ?
 
  On Wed, Apr 27, 2011 at 8:12 AM, Matthew Goodson
  matt...@spidertracks.com wrote:
   Hi guys,
   I'm trying to find out if an ajax request has come from page that was
  loaded
   from the browsers cache. Does anyone have any ideas of how I could
  achieve
   this?
   Thanks
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 

Matthew

Software Engineer

Matthew Goodson | spidertracks

po box 5203 | 117a the square | Palmerston North 4441 | new zealand

P: +64 6 353 3395 | M: +64 27 6969639

E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
www.spidertracks.com*

spiderwatch - because in the rescue game, time = life.


Re: WELCOME to users@wicket.apache.org

2011-04-28 Thread Matthew Goodson
I finally managed to figure out a workaround for this so it's all workin
now.
Thanks for your help!

On Fri, Apr 29, 2011 at 8:49 AM, Matthew Goodson
matt...@spidertracks.comwrote:


 Yeah on the javascript side it will fire off a request to the server to
 reload the tab each time. But wicket on the server thinks that the requested
 tab is already loaded so ignores the request

 On Thu, Apr 28, 2011 at 9:07 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 The random parameter is there to prevent caching of the Ajax response.
 AFAIK clicking on a tab will reload its content each time. I.e. Wicket
 doesn't think that the tab is already loaded.

 On Thu, Apr 28, 2011 at 12:41 AM, Matthew Goodson
 matt...@spidertracks.com wrote:
  Yeah I'm not feeling too hopeful
  I have a tabbed panel which loads the tabs via ajax. When the page is
 loaded
  from the browsers cache i.e. the user hits the back button, the ajax
 request
  to load the tab is sent but wicket thinks that tab is already loaded
  (getSelectedTab()) so ignores the request.
 
  Here's the request that's sent. Wicket adds the random parameter. I'm
 not
  sure if I removed the random param (somehow) if that would breaks
 things.
 
 
 http://localhost?wicket:interface=:27::IActivePageBehaviorListener:21:2wicket:ignoreIfNotActive=truetab=privacysettingsrandom=0.8811610792763531
 
  Any ideas?
 
 
  On Wed, Apr 27, 2011 at 7:22 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
 
  Hi,
 
  I'm not sure whether this is possible at all.
  Why do you need to do this ?
 
  On Wed, Apr 27, 2011 at 8:12 AM, Matthew Goodson
  matt...@spidertracks.com wrote:
   Hi guys,
   I'm trying to find out if an ajax request has come from page that was
  loaded
   from the browsers cache. Does anyone have any ideas of how I could
  achieve
   this?
   Thanks
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --

 Matthew

 Software Engineer

 Matthew Goodson | spidertracks

 po box 5203 | 117a the square | Palmerston North 4441 | new zealand

 P: +64 6 353 3395 | M: +64 27 6969639

 E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
 www.spidertracks.com*

 spiderwatch - because in the rescue game, time = life.




-- 

Matthew

Software Engineer

Matthew Goodson | spidertracks

po box 5203 | 117a the square | Palmerston North 4441 | new zealand

P: +64 6 353 3395 | M: +64 27 6969639

E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
www.spidertracks.com*

spiderwatch - because in the rescue game, time = life.


Re: WELCOME to users@wicket.apache.org

2011-04-28 Thread Matthew Goodson
I didn't find a way to tell if the page was loaded from the browsers cache.
I found a work around that's specific to our application but doesn't really
solve my initial question.
Thanks

On Fri, Apr 29, 2011 at 9:53 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Please post for future people who find this thread.

 On Thu, Apr 28, 2011 at 5:41 PM, Matthew Goodson
 matt...@spidertracks.comwrote:

  I finally managed to figure out a workaround for this so it's all workin
  now.
  Thanks for your help!
 
  On Fri, Apr 29, 2011 at 8:49 AM, Matthew Goodson
  matt...@spidertracks.comwrote:
 
  
   Yeah on the javascript side it will fire off a request to the server to
   reload the tab each time. But wicket on the server thinks that the
  requested
   tab is already loaded so ignores the request
  
   On Thu, Apr 28, 2011 at 9:07 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
  
   The random parameter is there to prevent caching of the Ajax response.
   AFAIK clicking on a tab will reload its content each time. I.e. Wicket
   doesn't think that the tab is already loaded.
  
   On Thu, Apr 28, 2011 at 12:41 AM, Matthew Goodson
   matt...@spidertracks.com wrote:
Yeah I'm not feeling too hopeful
I have a tabbed panel which loads the tabs via ajax. When the page
 is
   loaded
from the browsers cache i.e. the user hits the back button, the ajax
   request
to load the tab is sent but wicket thinks that tab is already loaded
(getSelectedTab()) so ignores the request.
   
Here's the request that's sent. Wicket adds the random parameter.
 I'm
   not
sure if I removed the random param (somehow) if that would breaks
   things.
   
   
  
 
 http://localhost?wicket:interface=:27::IActivePageBehaviorListener:21:2wicket:ignoreIfNotActive=truetab=privacysettingsrandom=0.8811610792763531
   
Any ideas?
   
   
On Wed, Apr 27, 2011 at 7:22 PM, Martin Grigorov 
  mgrigo...@apache.org
   wrote:
   
Hi,
   
I'm not sure whether this is possible at all.
Why do you need to do this ?
   
On Wed, Apr 27, 2011 at 8:12 AM, Matthew Goodson
matt...@spidertracks.com wrote:
 Hi guys,
 I'm trying to find out if an ajax request has come from page that
  was
loaded
 from the browsers cache. Does anyone have any ideas of how I
 could
achieve
 this?
 Thanks

   
   
   
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
   
   
 -
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
   --
  
   Matthew
  
   Software Engineer
  
   Matthew Goodson | spidertracks
  
   po box 5203 | 117a the square | Palmerston North 4441 | new zealand
  
   P: +64 6 353 3395 | M: +64 27 6969639
  
   E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
   www.spidertracks.com*
  
   spiderwatch - because in the rescue game, time = life.
  
  
 
 
  --
 
  Matthew
 
  Software Engineer
 
  Matthew Goodson | spidertracks
 
  po box 5203 | 117a the square | Palmerston North 4441 | new zealand
 
  P: +64 6 353 3395 | M: +64 27 6969639
 
  E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
  www.spidertracks.com*
 
  spiderwatch - because in the rescue game, time = life.
 



 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*




-- 

Matthew

Software Engineer

Matthew Goodson | spidertracks

po box 5203 | 117a the square | Palmerston North 4441 | new zealand

P: +64 6 353 3395 | M: +64 27 6969639

E: *matt...@spidertracks.co.nz* matt...@spidertracks.co.nz   *
www.spidertracks.com*

spiderwatch - because in the rescue game, time = life.


Re: WELCOME to users@wicket.apache.org

2011-04-27 Thread Matthew Goodson
Yeah I'm not feeling too hopeful
I have a tabbed panel which loads the tabs via ajax. When the page is loaded
from the browsers cache i.e. the user hits the back button, the ajax request
to load the tab is sent but wicket thinks that tab is already loaded
(getSelectedTab()) so ignores the request.

Here's the request that's sent. Wicket adds the random parameter. I'm not
sure if I removed the random param (somehow) if that would breaks things.

http://localhost?wicket:interface=:27::IActivePageBehaviorListener:21:2wicket:ignoreIfNotActive=truetab=privacysettingsrandom=0.8811610792763531

Any ideas?


On Wed, Apr 27, 2011 at 7:22 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 I'm not sure whether this is possible at all.
 Why do you need to do this ?

 On Wed, Apr 27, 2011 at 8:12 AM, Matthew Goodson
 matt...@spidertracks.com wrote:
  Hi guys,
  I'm trying to find out if an ajax request has come from page that was
 loaded
  from the browsers cache. Does anyone have any ideas of how I could
 achieve
  this?
  Thanks
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: WELCOME to users@wicket.apache.org

2011-04-26 Thread Matthew Goodson
Hi guys,
I'm trying to find out if an ajax request has come from page that was loaded
from the browsers cache. Does anyone have any ideas of how I could achieve
this?
Thanks


Re: Dynamically loading image

2010-12-01 Thread Matthew Goodson

Thanks for the help guys.
I've got it all working correctly now. For other people's future reference.
I think this is the page that Igor was referring to which I pretty much
copied : https://cwiki.apache.org/WICKET/uploaddownload.html
I am retrieving the images from a db as a byte array

//heres a simplified version of my code. Hope this helps someone!

//this is the class that serves up the images
public class ImageResource extends DynamicWebResource {
private static final long serialVersionUID = 1L;

public ImageResource() {
super();
}

@Override
protected ResourceState getResourceState() {

ValueMap params = getParameters();

String id = params.getString(id);

if (id.equals(image1)) {
//show image 1
return new ResourceState() {
  @Override
  public byte[] getData() {
  //get the image1 from server  
  return image;
  }

  @Override
  public String getContentType() {
return image/jpeg;
  }
}
} else (id.equals(image2)) {
//show image 2
return new ResourceState() {
  @Override
  public byte[] getData() {
  //get the image2 from server  
  return image;
  }

  @Override
  public String getContentType() {
return image/jpeg;
  }
}
   }
  }
}


//this is how I access the image from wicket
add(new Label(profileImage, ) {
private static final long serialVersionUID = 1L;

@Override
protected void onComponentTag(ComponentTag tag) {
ResourceReference imageResource = new 
ResourceReference(imageResource);
tag.put(src,
RequestUtils.toAbsolutePath(getRequestCycle().urlFor(imageResource).toString())+?id=image1);
super.onComponentTag(tag);
}
});

//and this needs to be added to the wicket application init method
getSharedResources().add(imageResource, new ImageResource());

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3068044.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Dynamically loading image

2010-11-29 Thread Matthew Goodson

Hi all,
I'm needing to generate the url to an image dynamically on the client.
i.e. I want to be able to chuck a generated url (e.g
localhost:8080/images?imageId=blah) into the src of an img which would then
go off and hit a wicket page which returns the binary data for the image.
I'm not really getting anywhere by myself.
Does anyone have any pointers?!
Hope that makes sense.
Thanks! 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamically-loading-image-tp3064795p3064795.html
Sent from the Users forum mailing list archive at Nabble.com.

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



spring bean null during ajax call back

2010-11-14 Thread Matthew Goodson

Hi guys/girls,
I'm having a bit of a problem accessing a spring bean from a call back.
Before I render the page I can access the spring bean 'userService' just
fine but during a callback when I go to access it it's null for some reason. 
Here's a simplified version of my code. Anyone got any ideas?
Thanks

@SpringBean
private transient IUserService userService;

private AbstractDefaultAjaxBehavior pilotAdded;

@Override
protected void onBeforeRender() {
ListPerson pilots = userService.getFollowing();
add(new Label(pilotAdded, $(document).ready(function() { +
wicketAjaxGet('+pilotAdded.getCallbackUrl()+', 
function() {},
function() {}); +
});).setEscapeModelStrings(false));
super.onBeforeRender();
}

public AssignPilotForm(String id) {
 super(id);
 pilotAdded = new AbstractDefaultAjaxBehavior() {   
protected void respond(final AjaxRequestTarget target) {
 ListPerson pilots = userService.getFollowing();
);
  }
  add(pilotAdded);
};





-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/spring-bean-null-during-ajax-call-back-tp3042434p3042434.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Bookmarking, getting the url hash value

2010-09-28 Thread Matthew Goodson

Hi, I've seen this topic mention a little bit around the place but I haven't
seen any implementation of it so far. I'm looking into adding the ability to
bookmark changes done by ajax in wicket. I'm planning on using the BBQ
Jquery plugin and integration it with wicket. The hardest step is getting
hash value from the url. The best way that I can see would be to get it
passed into the page alongside with the page parameters.  Is there anyway in
wicket to access the hash value? I can add a bit of javscript to do a call
back to wicket on page load but this isn't ideal.
Or does anyone have any thoughts about this?
 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Bookmarking-getting-the-url-hash-value-tp2718131p2718131.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Wicket javascript callback get variable

2010-09-26 Thread Matthew Goodson
Hi guys,
I'm trying to call wicket from javascript. I have figured out how to do this
but its not quite behaving as I expect. On the code below I would expect the
success handler (alert('first')) to be fired before the alert('second') but
this doesn't prove to be the case.

wicketAjaxPost('+behave.getCallbackUrl()+', function() {alert('first');},
function() { });
if (blah == true) {
 alert('second');
}

Can anyone explain this to me? What I'm ultimately trying to do is do a
callback to wicket and retrieve a string variable but that variable has to
be accessible to the lines below the wicketAjxPost.
Thanks!