Re: IE7 + Vista + SP1 + AjaxFallbackLink.

2009-02-07 Thread Graeme Knight

For anyone who cares - IE7 Enable Protected Mode appears to be a problem...

Makes sense. 


Graeme Knight wrote:
> 
> Hi.
> 
> My friend has a default installation of the above. I notice that
> onClick(null) is being called in AjaxFallbackLink therefore making the
> target null. He tells me that XMLHttp is enabled and the browser appears
> to work fine with other AJAX enabled sites.
> 
> Any thoughts as to why this may be? Anyone encountered this? It doesn't
> happen with other Vista +IE7 computers... (unfortunately I run Linux/Mac
> so can't test). 
> 
> A search on the forum showed nothing significant.
> 
> Cheers for any help, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/IE7-%2B-Vista-%2B-SP1-%2B-AjaxFallbackLink.-tp21890718p21892272.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to execute Wicket project in Eclipse

2009-02-07 Thread Graeme Knight

I just created a Main application using Jetty and run it through that... my
main server is jboss/tomcat but for development Jetty works real fine and is
very easy to set up.

Something like:

public static void main( String[] args ) throws Exception
{
logger.debug( "Starting web server..." );

// create an instance of the web server
Server server = new Server();

// Create a connector channel to allow communication with our local
web server
Connector connector = new SelectChannelConnector();
connector.setPort( 8080 );
connector.setHost( "127.0.0.1" );

// add the connector to the server
server.addConnector( connector );

// create a web application context
WebAppContext applicationContext = new WebAppContext();

// set the context path of the application
applicationContext.setContextPath( "/" );

// path to the exploded application. Will automatically locate
web.xml
applicationContext.setWar( APPLICATION_BASE_DIRECTORY );

// set the application context onto the server
server.setHandler( applicationContext );

// kill server on shutdown
server.setStopAtShutdown( true );

// start the web server
server.start();
server.join();
}



Swapna Rachamalla wrote:
> 
> yeah i got it using Apache Tomcat 6.0 also..
> 
> Thanks a lot..
> 
> 
> 
> On Fri, Feb 6, 2009 at 3:04 PM, Trent Larson 
> wrote:
> 
>> You will have to run your Wicket application with a J2EE application
>> server.
>>
>> I've found Run-Jetty-Run to be extremely easy-to-use:
>>
>> http://code.google.com/p/run-jetty-run/
>>
>> Trent
>>
>> On Fri, Feb 6, 2009 at 2:43 PM, Swapna Rachamalla <
>> swapna.rachama...@gmail.com> wrote:
>>
>> > Hi All
>> >
>> > I have installed Apache wicket plug-ins in Eclipse.
>> >
>> > Now iam able to create Wicket Project from
>> File->New->Other->Wicket->Wicket
>> > Project.
>> >
>> > Then it is asking for Project name. So gave some name..
>> >
>> > Then it is creating MyApplication which extends WebApplication and
>> > configured in the web.xml file.
>> >
>> > then i created HelloWorld.java
>> >
>> > package com.example;
>> > import org.apache.wicket.markup.html.WebPage;
>> > import org.apache.wicket.markup.html.basic.Label;
>> >
>> >
>> > public class HelloWorld extends WebPage {
>> >
>> >HelloWorld()
>> >{
>> >add(new Label("msg","sfjhdsjfdhjdjkf"));
>> >}
>> >
>> > }
>> >
>> > and modified MyApplication.java file
>> >
>> > public class MyApplication extends WebApplication {
>> >public MyApplication() {
>> >
>> >}
>> >
>> >public void init() {
>> >
>> >}
>> >
>> >@Override
>> >public Class getHomePage() {
>> >// TODO Auto-generated method stub
>> >return HelloWorld.class;
>> >}
>> > }
>> >
>> > and created HelloWorld.html
>> >
>> > 
>> > 
>> > Insert title here
>> > 
>> > 
>> > Message goes here
>> > 
>> > 
>> >
>> > Now Iam unable deploy and run the application.
>> > can u Plz suggest me how to run this application.
>> > Iam not using Maven for building the files and i configured Apache
>> Geronimo
>> > 2.0 Server in Eclipse
>> >
>> > Thanks
>> > Swapna
>> >
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-execute-Wicket-project-in-Eclipse-tp21881247p21891215.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: IE7 + Vista + SP1 + AjaxFallbackLink.

2009-02-07 Thread Graeme Knight

I'm thinking it might be a security setting... 


Graeme Knight wrote:
> 
> Hi.
> 
> My friend has a default installation of the above. I notice that
> onClick(null) is being called in AjaxFallbackLink therefore making the
> target null. He tells me that XMLHttp is enabled and the browser appears
> to work fine with other AJAX enabled sites.
> 
> Any thoughts as to why this may be? Anyone encountered this? It doesn't
> happen with other Vista +IE7 computers... (unfortunately I run Linux/Mac
> so can't test). 
> 
> A search on the forum showed nothing significant.
> 
> Cheers for any help, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/IE7-%2B-Vista-%2B-SP1-%2B-AjaxFallbackLink.-tp21890718p21891159.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



IE7 + Vista + SP1 + AjaxFallbackLink.

2009-02-07 Thread Graeme Knight

Hi.

My friend has a default installation of the above. I notice that
onClick(null) is being called in AjaxFallbackLink therefore making the
target null. He tells me that XMLHttp is enabled and the browser appears to
work fine with other AJAX enabled sites.

Any thoughts as to why this may be? Anyone encountered this? It doesn't
happen with other Vista +IE7 computers... (unfortunately I run Linux/Mac so
can't test). 

A search on the forum showed nothing significant.

Cheers for any help, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IE7-%2B-Vista-%2B-SP1-%2B-AjaxFallbackLink.-tp21890718p21890718.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



Feedback panel filtering...

2009-01-21 Thread Graeme Knight

Hi.

I couldn't find the answer on the forum, but I'm sure its been done before:

I have a page with a feedback panel at the top for 'serious' errors.

The page contains a form. The form has input components (for example text
required field).

When the user hits submit I want the form component feedback panels to show
the form component related errors.

Only on a major issue (for example after submit we try to connect to a
server - if the server cannot be connected to then there is a major issue) I
want to appear in the page feedback panel.

For the life of me I cannot figure out how to get this filtering working.

Any advice welcome. Regards, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Feedback-panel-filtering...-tp21586788p21586788.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: Getting the Exception from Exception Page (for logging purposes)...

2009-01-20 Thread Graeme Knight

AWESOME! Thanks!


igor.vaynberg wrote:
> 
> you can override requestcycle#onruntimeexception(exception e) and log it
> there.
> 
> -igor
> 
> On Mon, Jan 19, 2009 at 6:40 PM, Graeme Knight 
> wrote:
>>
>> Hi,
>>
>> Is it possible that after setting UnexpectedExceptionDisplay page, you
>> can
>> get the exception that caused this page to be fired up?
>>
>> Cheers, Graeme.
>> --
>> View this message in context:
>> http://www.nabble.com/Getting-the-Exception-from-Exception-Page-%28for-logging-purposes%29...-tp21555998p21555998.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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Getting-the-Exception-from-Exception-Page-%28for-logging-purposes%29...-tp21555998p21564064.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



Getting the Exception from Exception Page (for logging purposes)...

2009-01-19 Thread Graeme Knight

Hi,

Is it possible that after setting UnexpectedExceptionDisplay page, you can
get the exception that caused this page to be fired up?

Cheers, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Getting-the-Exception-from-Exception-Page-%28for-logging-purposes%29...-tp21555998p21555998.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: Autocomplete text concatenation

2008-12-15 Thread Graeme Knight

One idea I had was to do something like the following code:

This class would be added to the AutocompleteTextField (as below).

inputSoFar would be the input to the getChoices() method minus the string we
are looking for, so for example:   

fred,jim,b

inputSoFar would be 'fred,jim'. input (to getChoices( String input )) would
be 'b' after chopping off "fred,jim," - once the user selects 'bob' from the
autocompleter, then input would be 'bob' also.

So finally in the ChangeBehavor class, inputSoFar + input would resolve to
"fred,jim,bob" and be populated in the text field. 

Two problems with this:

a) It seems a bit hokey.
b) I have to store inputSoFar as a private member variable in the
AutocompleteTextField, which seems like an overhead to me.

Anyone got any thoughts?

Many thanks, Graeme.

public class ChangeBehavior extends AjaxFormComponentUpdatingBehavior 
{
private static final long serialVersionUID = 8090648380154153004L;

public ChangeBehavior()
{
super( "onchange" );
}

/* (non-Javadoc)
 * @see
org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget)
 */
@Override
protected void onUpdate( AjaxRequestTarget target )
{
String input = String.class.cast( getModelObject() );

setModel( new Model( inputSoFar + input ) );

target.addComponent( AutoCompleteContactTextField.this );
}
}



Graeme Knight wrote:
> 
> Hi there!
> 
> Something like that - but I was hoping it might be easy to somehow do this
> with autocompletetextfield from wicket extensions - I guess there may be a
> little trickery to manipulating the unsubmitted text in the textfield
> itself (although this comes in as the input for getChoice so I was
> wondering if it were somehow useable from that).
> 
> 
> francisco treacy-2 wrote:
>> 
>> if i understand correctly you need a "multi" autocompleter.
>> 
>> do you mean something like this?
>> http://digitarald.de/project/autocompleter/1-1/showcase/delicious-tags/
>> (i have integrated it with wicket, it's indeed used when you edit
>> topics of a module in wickethub).
>> 
>> francisco
>> 
>> 
>> On Mon, Dec 15, 2008 at 8:36 PM, Graeme Knight 
>> wrote:
>>>
>>> Hi.
>>>
>>> Couldn't find an answer but perhaps this is a common thing to want to
>>> do:
>>>
>>> Using an AutoCompleteTextField I want to allow the user to select
>>> choices as
>>> he types, then update the text area by appending the selected choice.
>>> Similar to the way a web mail application would allow a user to type
>>> email
>>> address after email address and see them appended to the text field.
>>>
>>> Is there an easy way to achieve this?
>>>
>>> Many thanks, Graeme.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Autocomplete-text-concatenation-tp21020322p21020322.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
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Autocomplete-text-concatenation-tp21020322p21021857.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: Autocomplete text concatenation

2008-12-15 Thread Graeme Knight

Hi there!

Something like that - but I was hoping it might be easy to somehow do this
with autocompletetextfield from wicket extensions - I guess there may be a
little trickery to manipulating the unsubmitted text in the textfield itself
(although this comes in as the input for getChoice so I was wondering if it
were somehow useable from that).


francisco treacy-2 wrote:
> 
> if i understand correctly you need a "multi" autocompleter.
> 
> do you mean something like this?
> http://digitarald.de/project/autocompleter/1-1/showcase/delicious-tags/
> (i have integrated it with wicket, it's indeed used when you edit
> topics of a module in wickethub).
> 
> francisco
> 
> 
> On Mon, Dec 15, 2008 at 8:36 PM, Graeme Knight 
> wrote:
>>
>> Hi.
>>
>> Couldn't find an answer but perhaps this is a common thing to want to do:
>>
>> Using an AutoCompleteTextField I want to allow the user to select choices
>> as
>> he types, then update the text area by appending the selected choice.
>> Similar to the way a web mail application would allow a user to type
>> email
>> address after email address and see them appended to the text field.
>>
>> Is there an easy way to achieve this?
>>
>> Many thanks, Graeme.
>> --
>> View this message in context:
>> http://www.nabble.com/Autocomplete-text-concatenation-tp21020322p21020322.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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Autocomplete-text-concatenation-tp21020322p21020726.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



Autocomplete text concatenation

2008-12-15 Thread Graeme Knight

Hi.

Couldn't find an answer but perhaps this is a common thing to want to do:

Using an AutoCompleteTextField I want to allow the user to select choices as
he types, then update the text area by appending the selected choice.
Similar to the way a web mail application would allow a user to type email
address after email address and see them appended to the text field.

Is there an easy way to achieve this?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Autocomplete-text-concatenation-tp21020322p21020322.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: IMG SRC URL in iframe - part 2.

2008-12-09 Thread Graeme Knight

Hi Ernesto,

Certainly the way you suggested makes a lot of sense to me. It is a nice
resource that can just receive the requests and process based resolution of
the SRC attribute - given that the content if the iframe is populated after
the body has been rendered and really Wicket is not doing any processing
from a component point of view. 

Thanks again, Graeme.


reiern70 wrote:
> 
> Hi Graeme,
> Yes more or less... As I said I do no longer  have access to the code I
> wrote (it was for a project on my previous Job)  but as far as I remember
> all I did was:
> 
> 1-mount a resource for servicing files (I suppose I did the same way you
> are
> doing it;-)
> 2-"generate" HTML code asking for those files.
> 
> Maybe part 1) can also be solved by:
> 
> 1- having on the same page containing your HTML a wicket component, maybe
> the same iframe you are using, implementing IResourceListener and, instead
> of having a global resource use, that component to stream back your
> images.
> 2- or using a servlet.
> 
> I really don't know which of these would be the best solution in terms of
> efficiency and use of resources...
> 
> Best,
> 
> Ernesto
> 
> On Tue, Dec 9, 2008 at 3:20 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Ernesto - similar to what you did?
>>
>>
>> Graeme Knight wrote:
>> >
>> > Hi.
>> >
>> > I recently had a question which I put to the forum here:
>> >
>> >  http://www.nabble.com/IMG-SRC-URL-in-iframe.-td20805408.html
>> Generating
>> > IMG SRC to replace CIDs.
>> >
>> > I believe I have found the answer (thanks to Ernesto's help) which I
>> would
>> > like some verification of if possible (not sure if it needs a wiki
>> page):
>> >
>> > Here's the solution:
>> >
>> > 1) In my application I create a new shared resource:
>> >
>> > @Override
>> > protected void init()
>> > {
>> > getSharedResources().add( "cidImageResource", new
>> > CIDImageResource() );
>> > mountSharedResource( "/imageStuff", "cidImageResource" );
>> > }
>> >
>> > 2) My CIDImageResource class is a subclass of DynamicImageResource.
>> >
>> > It has a single important implementation of a method in it: byte[]
>> > getImageData().
>> >
>> > This method will be passed a filename as a parameter. This filename
>> is
>> > the image file we wish to render and is known by its attachment on
>> > url-to-cid-image-resource?filename=image.png . Note that 'image.png' is
>> > the name of a file that has previously been serialized onto the file
>> > system and replaces the CID in the HTML email that we are rendering.
>> >
>> > 3) There is a magic class that I have that loads the HTML email data
>> from
>> > the filesystem and parses out the CIDs, replacing the
>> > SRC="CID:sdkfhsakhfskdfh13213123" with the correct URL to the correct
>> > file. This URL is gotten in the following way:
>> >
>> > First we get the following:
>> >
>> > ResourceReference ref = new ResourceReference(
>> > "cidImageResource" );
>> >
>> > RequestCycle requestCycle = getRequestCycle();
>> >
>> > We then loop around all our known CID references in the HTML email and
>> > call the following:
>> >
>> >String contentFileName = UserDefaults.resolveUserHomePath(
>> > userName ) + uploadData.getUploadFileName();
>> >
>> >ValueMap parameters = new ValueMap();
>> >parameters.put( "filename", contentFileName );
>> >
>> >   String link = requestCycle.urlFor( resourceReference,
>> parameters
>> > ).toString();
>> >
>> > Once we have the link to the file, we replace the correct "CID:". We do
>> > this numerous times for the entire HTML email.
>> >
>> > 4) The HTML email is rendered in an iframe.
>> >
>> > See my previous post, which I got working, and sets the innerHTML on
>> the
>> > iframe:
>> >
>> http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-td20887803.html
>> > iframe innerHTML post.
>> >
>> > The shared resource (cidImageResource) that I created in the
>> application
>> > is then called repeatedly during rendering of the iframe, and the

Re: IMG SRC URL in iframe - part 2.

2008-12-09 Thread Graeme Knight

Ernesto - similar to what you did?


Graeme Knight wrote:
> 
> Hi.
> 
> I recently had a question which I put to the forum here:
> 
>  http://www.nabble.com/IMG-SRC-URL-in-iframe.-td20805408.html Generating
> IMG SRC to replace CIDs. 
> 
> I believe I have found the answer (thanks to Ernesto's help) which I would
> like some verification of if possible (not sure if it needs a wiki page):
> 
> Here's the solution:
> 
> 1) In my application I create a new shared resource:
> 
> @Override
> protected void init()
> {
> getSharedResources().add( "cidImageResource", new
> CIDImageResource() );
> mountSharedResource( "/imageStuff", "cidImageResource" );
> }
> 
> 2) My CIDImageResource class is a subclass of DynamicImageResource.
> 
> It has a single important implementation of a method in it: byte[]
> getImageData().
> 
> This method will be passed a filename as a parameter. This filename is
> the image file we wish to render and is known by its attachment on 
> url-to-cid-image-resource?filename=image.png . Note that 'image.png' is
> the name of a file that has previously been serialized onto the file
> system and replaces the CID in the HTML email that we are rendering.
> 
> 3) There is a magic class that I have that loads the HTML email data from
> the filesystem and parses out the CIDs, replacing the
> SRC="CID:sdkfhsakhfskdfh13213123" with the correct URL to the correct
> file. This URL is gotten in the following way:
> 
> First we get the following:
> 
> ResourceReference ref = new ResourceReference(
> "cidImageResource" );
> 
> RequestCycle requestCycle = getRequestCycle();
> 
> We then loop around all our known CID references in the HTML email and
> call the following:
> 
>String contentFileName = UserDefaults.resolveUserHomePath(
> userName ) + uploadData.getUploadFileName();
> 
>ValueMap parameters = new ValueMap();
>parameters.put( "filename", contentFileName );
> 
>   String link = requestCycle.urlFor( resourceReference, parameters
> ).toString();
> 
> Once we have the link to the file, we replace the correct "CID:". We do
> this numerous times for the entire HTML email.
> 
> 4) The HTML email is rendered in an iframe.
> 
> See my previous post, which I got working, and sets the innerHTML on the
> iframe: 
> http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-td20887803.html
> iframe innerHTML post. 
> 
> The shared resource (cidImageResource) that I created in the application
> is then called repeatedly during rendering of the iframe, and the image
> byte data is returned to the browser and rendered correctly in place of
> the CIDs.
> 
> Does this sound about right? I hope this may be useful to someone else if
> it is!
> 
> All the best, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe---part-2.-tp20907919p20915492.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



IMG SRC URL in iframe - part 2.

2008-12-08 Thread Graeme Knight

Hi.

I recently had a question which I put to the forum here:

http://www.nabble.com/IMG-SRC-URL-in-iframe.-td20805408.html Generating IMG
SRC to replace CIDs. 

I believe I have found the answer (thanks to Ernesto's help) which I would
like some verification of if possible (not sure if it needs a wiki page):

Here's the solution:

1) In my application I create a new shared resource:

@Override
protected void init()
{
getSharedResources().add( "cidImageResource", new CIDImageResource()
);
mountSharedResource( "/imageStuff", "cidImageResource" );
}

2) My CIDImageResource class is a subclass of DynamicImageResource.

It has a single important implementation of a method in it: byte[]
getImageData().

This method will be passed a filename as a parameter. This filename is
the image file we wish to render and is known by its attachment on 
url-to-cid-image-resource?filename=image.png . Note that 'image.png' is the
name of a file that has previously been serialized onto the file system and
replaces the CID in the HTML email that we are rendering.

3) There is a magic class that I have that loads the HTML email data from
the filesystem and parses out the CIDs, replacing the
SRC="CID:sdkfhsakhfskdfh13213123" with the correct URL to the correct file.
This URL is gotten in the following way:

First we get the following:

ResourceReference ref = new ResourceReference(
"cidImageResource" );

RequestCycle requestCycle = getRequestCycle();

We then loop around all our known CID references in the HTML email and call
the following:

   String contentFileName = UserDefaults.resolveUserHomePath(
userName ) + uploadData.getUploadFileName();

   ValueMap parameters = new ValueMap();
   parameters.put( "filename", contentFileName );

  String link = requestCycle.urlFor( resourceReference, parameters
).toString();

Once we have the link to the file, we replace the correct "CID:". We do this
numerous times for the entire HTML email.

4) The HTML email is rendered in an iframe.

See my previous post, which I got working, and sets the innerHTML on the
iframe: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-td20887803.html
iframe innerHTML post. 

The shared resource (cidImageResource) that I created in the application is
then called repeatedly during rendering of the iframe, and the image byte
data is returned to the browser and rendered correctly in place of the CIDs.

Does this sound about right? I hope this may be useful to someone else if it
is!

All the best, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe---part-2.-tp20907919p20907919.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Gotya.

I'll get to it as soon as I can (perhaps a few days).

Thanks for your help. I hope I can give back to the community!

Rgds, Graeme.


Bruno Cesar Borges wrote:
> 
> Just go to http://cwiki.apache.org/WICKET
> 
> The website is self explanatory. ;-)
> 
> Good luck!
> 
> -Original Message-
> From: Graeme Knight [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 4:02 PM
> To: users@wicket.apache.org
> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
> 
> 
> 
> Hi Bruno.
> 
> I WILL create a Wiki page soon. How do I do this - is there a process?
> 
> Rgds, Graeme.
> 
> 
> Bruno Cesar Borges wrote:
>> 
>> Well done Graeme!
>> 
>> =)
>> 
>> Now, please create a Wiki page with all this information, for God's sake! 
>> 
>> cheers,
>> bruno
>> 
>> -Original Message-
>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>> Sent: Monday, December 08, 2008 3:46 PM
>> To: users@wicket.apache.org
>> Subject: RE: Populate IFRAME innerHTML on AJAX load of panel.
>> 
>> 
>> 
>> Yahhhyahhh!
>> 
>> The answer appears to be a HeaderContributor with a call to
>> renderOnLoadJavascript.
>> 
>> Bruno - you're a star!
>> 
>> I will respond with a more sensible sentence than above as soon as I have
>> proven it (so far it works).
>> 
>> Rgds, Graeme.
>> 
>> 
>> Bruno Cesar Borges wrote:
>>> 
>>> Try the setTimeout('myfunction()', 100); function. The second argument
>>> is
>>> the timeout (in miliseconds) to wait before evaluating the first
>>> argument.
>>> 
>>> There's also a way to execute your javascript function only after body
>>> is
>>> fully loaded. Google for that. Maybe that's your answer.
>>> 
>>> cheers,
>>> Bruno (becoming a JS developer rather Wicket)
>>> 
>>> -Original Message-
>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>> Sent: Monday, December 08, 2008 2:31 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>> 
>>> 
>>> 
>>> Not sure about this solution. The content of the iframe is visible then
>>> disappears... Hhm.
>>> 
>>> 
>>> Graeme Knight wrote:
>>>> 
>>>> Hi guys,
>>>> 
>>>> I'm making some progress. wicketGlobalPostCallHandler doesn't seem to
>>>> be
>>>> working for me, but I can do something like this after the iframe:
>>>> 
>>>> StringBuilder buffer = new StringBuilder( "" );
>>>> buffer.append( "IFrameArea.populateContent( false, true, 'hello
>>>> world' );" );
>>>> buffer.append( "" );
>>>> 
>>>> Label scriptLabel = new Label( "scriptLabel", buffer.toString()
>>>> );
>>>> 
>>>> scriptLabel.setRenderBodyOnly( true );
>>>> scriptLabel.setEscapeModelStrings( false );
>>>> 
>>>> add( scriptLabel );
>>>> 
>>>> This will add a nice bit of Javascript into the whole lot that will
>>>> call
>>>> the populateContent function (hurray).
>>>> 
>>>> Now the thing is, the text (hello world) flashes on the screen - then
>>>> disappears.
>>>> 
>>>> If I hit the 'refresh' button on the browser then the innerHTML 'hello
>>>> world' sticks. If I can solve this tricky problem then I think I'm good
>>>> to
>>>> go.
>>>> 
>>>> Is it REALLY this simple? Why does Wicket have to be so cool?
>>>> 
>>>> Cheers, Graeme. 
>>>> 
>>>> 
>>>> Graeme Knight wrote:
>>>>> 
>>>>> Hi Ernesto,
>>>>> 
>>>>> No - I didn't solve this problem as yet. However, this is part of the
>>>>> process of parsing the HTML prior to insertion on the innerHTML. If I
>>>>> can
>>>>> get that bit working I'm going to get back to our thread on the CIDs
>>>>> very
>>>>> soon!
>>>>> 
>>>>> Cheers, Graeme.
>>>>> 
>>>>> 
>>>>> Graeme Knight wrote:
>>>>>> 
>>>>>> Hi Bruno,
&

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hi Bruno.

I WILL create a Wiki page soon. How do I do this - is there a process?

Rgds, Graeme.


Bruno Cesar Borges wrote:
> 
> Well done Graeme!
> 
> =)
> 
> Now, please create a Wiki page with all this information, for God's sake! 
> 
> cheers,
> bruno
> 
> -----Original Message-
> From: Graeme Knight [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 3:46 PM
> To: users@wicket.apache.org
> Subject: RE: Populate IFRAME innerHTML on AJAX load of panel.
> 
> 
> 
> Yahhhyahhh!
> 
> The answer appears to be a HeaderContributor with a call to
> renderOnLoadJavascript.
> 
> Bruno - you're a star!
> 
> I will respond with a more sensible sentence than above as soon as I have
> proven it (so far it works).
> 
> Rgds, Graeme.
> 
> 
> Bruno Cesar Borges wrote:
>> 
>> Try the setTimeout('myfunction()', 100); function. The second argument is
>> the timeout (in miliseconds) to wait before evaluating the first
>> argument.
>> 
>> There's also a way to execute your javascript function only after body is
>> fully loaded. Google for that. Maybe that's your answer.
>> 
>> cheers,
>> Bruno (becoming a JS developer rather Wicket)
>> 
>> -Original Message-
>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>> Sent: Monday, December 08, 2008 2:31 PM
>> To: users@wicket.apache.org
>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>> 
>> 
>> 
>> Not sure about this solution. The content of the iframe is visible then
>> disappears... Hhm.
>> 
>> 
>> Graeme Knight wrote:
>>> 
>>> Hi guys,
>>> 
>>> I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
>>> working for me, but I can do something like this after the iframe:
>>> 
>>> StringBuilder buffer = new StringBuilder( "" );
>>> buffer.append( "IFrameArea.populateContent( false, true, 'hello
>>> world' );" );
>>> buffer.append( "" );
>>> 
>>> Label scriptLabel = new Label( "scriptLabel", buffer.toString()
>>> );
>>> 
>>> scriptLabel.setRenderBodyOnly( true );
>>> scriptLabel.setEscapeModelStrings( false );
>>> 
>>> add( scriptLabel );
>>> 
>>> This will add a nice bit of Javascript into the whole lot that will call
>>> the populateContent function (hurray).
>>> 
>>> Now the thing is, the text (hello world) flashes on the screen - then
>>> disappears.
>>> 
>>> If I hit the 'refresh' button on the browser then the innerHTML 'hello
>>> world' sticks. If I can solve this tricky problem then I think I'm good
>>> to
>>> go.
>>> 
>>> Is it REALLY this simple? Why does Wicket have to be so cool?
>>> 
>>> Cheers, Graeme. 
>>> 
>>> 
>>> Graeme Knight wrote:
>>>> 
>>>> Hi Ernesto,
>>>> 
>>>> No - I didn't solve this problem as yet. However, this is part of the
>>>> process of parsing the HTML prior to insertion on the innerHTML. If I
>>>> can
>>>> get that bit working I'm going to get back to our thread on the CIDs
>>>> very
>>>> soon!
>>>> 
>>>> Cheers, Graeme.
>>>> 
>>>> 
>>>> Graeme Knight wrote:
>>>>> 
>>>>> Hi Bruno,
>>>>> 
>>>>> No I didn't try this the Label idea... I'll give it a go!
>>>>> 
>>>>> Thanks for the link I'll let you know how it works out ... watch this
>>>>> space!
>>>>> 
>>>>> 
>>>>> 
>>>>> Bruno Cesar Borges wrote:
>>>>>> 
>>>>>> Did you try to add a Label with CSS hidden attribute that executes
>>>>>> your
>>>>>> script? Something like this:
>>>>>> 
>>>>>> 
>>>>>>   myJavascriptMethod();
>>>>>> 
>>>>>> 
>>>>>> I'm really not sure if this actually works, but you could also check
>>>>>> this Wiki page (yeah, it exists)
>>>>>> 
>>>>>> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
>>>>>> 
>>>>>&

RE: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Yahhhyahhh!

The answer appears to be a HeaderContributor with a call to
renderOnLoadJavascript.

Bruno - you're a star!

I will respond with a more sensible sentence than above as soon as I have
proven it (so far it works).

Rgds, Graeme.


Bruno Cesar Borges wrote:
> 
> Try the setTimeout('myfunction()', 100); function. The second argument is
> the timeout (in miliseconds) to wait before evaluating the first argument.
> 
> There's also a way to execute your javascript function only after body is
> fully loaded. Google for that. Maybe that's your answer.
> 
> cheers,
> Bruno (becoming a JS developer rather Wicket)
> 
> -Original Message-
> From: Graeme Knight [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 2:31 PM
> To: users@wicket.apache.org
> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
> 
> 
> 
> Not sure about this solution. The content of the iframe is visible then
> disappears... Hhm.
> 
> 
> Graeme Knight wrote:
>> 
>> Hi guys,
>> 
>> I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
>> working for me, but I can do something like this after the iframe:
>> 
>> StringBuilder buffer = new StringBuilder( "" );
>> buffer.append( "IFrameArea.populateContent( false, true, 'hello
>> world' );" );
>> buffer.append( "" );
>> 
>> Label scriptLabel = new Label( "scriptLabel", buffer.toString()
>> );
>> 
>> scriptLabel.setRenderBodyOnly( true );
>> scriptLabel.setEscapeModelStrings( false );
>> 
>> add( scriptLabel );
>> 
>> This will add a nice bit of Javascript into the whole lot that will call
>> the populateContent function (hurray).
>> 
>> Now the thing is, the text (hello world) flashes on the screen - then
>> disappears.
>> 
>> If I hit the 'refresh' button on the browser then the innerHTML 'hello
>> world' sticks. If I can solve this tricky problem then I think I'm good
>> to
>> go.
>> 
>> Is it REALLY this simple? Why does Wicket have to be so cool?
>> 
>> Cheers, Graeme. 
>> 
>> 
>> Graeme Knight wrote:
>>> 
>>> Hi Ernesto,
>>> 
>>> No - I didn't solve this problem as yet. However, this is part of the
>>> process of parsing the HTML prior to insertion on the innerHTML. If I
>>> can
>>> get that bit working I'm going to get back to our thread on the CIDs
>>> very
>>> soon!
>>> 
>>> Cheers, Graeme.
>>> 
>>> 
>>> Graeme Knight wrote:
>>>> 
>>>> Hi Bruno,
>>>> 
>>>> No I didn't try this the Label idea... I'll give it a go!
>>>> 
>>>> Thanks for the link I'll let you know how it works out ... watch this
>>>> space!
>>>> 
>>>> 
>>>> 
>>>> Bruno Cesar Borges wrote:
>>>>> 
>>>>> Did you try to add a Label with CSS hidden attribute that executes
>>>>> your
>>>>> script? Something like this:
>>>>> 
>>>>> 
>>>>>   myJavascriptMethod();
>>>>> 
>>>>> 
>>>>> I'm really not sure if this actually works, but you could also check
>>>>> this Wiki page (yeah, it exists)
>>>>> 
>>>>> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
>>>>> 
>>>>> cheers,
>>>>> Bruno
>>>>> 
>>>>> -Original Message-
>>>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>>>> Sent: Monday, December 08, 2008 12:12 PM
>>>>> To: users@wicket.apache.org
>>>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>>>> 
>>>>> 
>>>>> 
>>>>> Hi Bruno,
>>>>> 
>>>>> Right, that far I DID get. I have a Javascript file that contains the
>>>>> required Javascript for my editor. 
>>>>> 
>>>>> (Sorry, I don't have the code now):
>>>>> 
>>>>> When the user hits the tab and the panel goes into another context I
>>>>> create
>>>>> the panel, add a HeaderContributor that adds the Javascript file. 
>>>>> 
>>>>> This panel is not created via a p

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Not sure about this solution. The content of the iframe is visible then
disappears... Hhm.


Graeme Knight wrote:
> 
> Hi guys,
> 
> I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
> working for me, but I can do something like this after the iframe:
> 
> StringBuilder buffer = new StringBuilder( "" );
> buffer.append( "IFrameArea.populateContent( false, true, 'hello
> world' );" );
> buffer.append( "" );
> 
> Label scriptLabel = new Label( "scriptLabel", buffer.toString() );
> 
> scriptLabel.setRenderBodyOnly( true );
> scriptLabel.setEscapeModelStrings( false );
> 
> add( scriptLabel );
> 
> This will add a nice bit of Javascript into the whole lot that will call
> the populateContent function (hurray).
> 
> Now the thing is, the text (hello world) flashes on the screen - then
> disappears.
> 
> If I hit the 'refresh' button on the browser then the innerHTML 'hello
> world' sticks. If I can solve this tricky problem then I think I'm good to
> go.
> 
> Is it REALLY this simple? Why does Wicket have to be so cool?
> 
> Cheers, Graeme. 
> 
> 
> Graeme Knight wrote:
>> 
>> Hi Ernesto,
>> 
>> No - I didn't solve this problem as yet. However, this is part of the
>> process of parsing the HTML prior to insertion on the innerHTML. If I can
>> get that bit working I'm going to get back to our thread on the CIDs very
>> soon!
>> 
>> Cheers, Graeme.
>> 
>> 
>> Graeme Knight wrote:
>>> 
>>> Hi Bruno,
>>> 
>>> No I didn't try this the Label idea... I'll give it a go!
>>> 
>>> Thanks for the link I'll let you know how it works out ... watch this
>>> space!
>>> 
>>> 
>>> 
>>> Bruno Cesar Borges wrote:
>>>> 
>>>> Did you try to add a Label with CSS hidden attribute that executes your
>>>> script? Something like this:
>>>> 
>>>> 
>>>>   myJavascriptMethod();
>>>> 
>>>> 
>>>> I'm really not sure if this actually works, but you could also check
>>>> this Wiki page (yeah, it exists)
>>>> 
>>>> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
>>>> 
>>>> cheers,
>>>> Bruno
>>>> 
>>>> -Original Message-
>>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>>> Sent: Monday, December 08, 2008 12:12 PM
>>>> To: users@wicket.apache.org
>>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>>> 
>>>> 
>>>> 
>>>> Hi Bruno,
>>>> 
>>>> Right, that far I DID get. I have a Javascript file that contains the
>>>> required Javascript for my editor. 
>>>> 
>>>> (Sorry, I don't have the code now):
>>>> 
>>>> When the user hits the tab and the panel goes into another context I
>>>> create
>>>> the panel, add a HeaderContributor that adds the Javascript file. 
>>>> 
>>>> This panel is not created via a page refresh - it is replaced as per
>>>> the
>>>> code above (i.e. currentPanel = new  ). Will the HeaderContributor
>>>> actually be utilized at this point or is a full page refresh required?
>>>> 
>>>> My BIG problem (this is the crux) is HOW to call that Javascript
>>>> function -
>>>> the call to 'popupateContent' effectively has to be AFTER the iframe is
>>>> initialized (so an innerHTML exists). This can't be part of a
>>>> HeaderContributor - it has to be further down the chain of execution.
>>>> My
>>>> confusion is how to make this happen.
>>>> 
>>>> Almost there! What are the guidelines for the Wiki when I get this
>>>> working?
>>>> Perhaps I can submit to the Wicket people for verification?
>>>> 
>>>> REALLY appreciate your discussion on this.
>>>> 
>>>> Cheers, Graeme.
>>>> 
>>>> 
>>>> Bruno Cesar Borges wrote:
>>>>> 
>>>>> Put that code into some .js file and add it to your panel as a
>>>>> HeaderContributor. Then you are ready to go.
>>>>> 
>>>>> -Original Message-
>>>>> From:

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hi guys,

I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
working for me, but I can do something like this after the iframe:

StringBuilder buffer = new StringBuilder( "" );
buffer.append( "IFrameArea.populateContent( false, true, 'hello
world' );" );
buffer.append( "" );

Label scriptLabel = new Label( "scriptLabel", buffer.toString() );

scriptLabel.setRenderBodyOnly( true );
scriptLabel.setEscapeModelStrings( false );

add( scriptLabel );

This will add a nice bit of Javascript into the whole lot that will call the
populateContent function (hurray).

Now the thing is, the text (hello world) flashes on the screen - then
disappears.

If I hit the 'refresh' button on the browser then the innerHTML 'hello
world' sticks. If I can solve this tricky problem then I think I'm good to
go.

Is it REALLY this simple? Why does Wicket have to be so cool?

Cheers, Graeme. 


Graeme Knight wrote:
> 
> Hi Ernesto,
> 
> No - I didn't solve this problem as yet. However, this is part of the
> process of parsing the HTML prior to insertion on the innerHTML. If I can
> get that bit working I'm going to get back to our thread on the CIDs very
> soon!
> 
> Cheers, Graeme.
> 
> 
> Graeme Knight wrote:
>> 
>> Hi Bruno,
>> 
>> No I didn't try this the Label idea... I'll give it a go!
>> 
>> Thanks for the link I'll let you know how it works out ... watch this
>> space!
>> 
>> 
>> 
>> Bruno Cesar Borges wrote:
>>> 
>>> Did you try to add a Label with CSS hidden attribute that executes your
>>> script? Something like this:
>>> 
>>> 
>>>   myJavascriptMethod();
>>> 
>>> 
>>> I'm really not sure if this actually works, but you could also check
>>> this Wiki page (yeah, it exists)
>>> 
>>> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
>>> 
>>> cheers,
>>> Bruno
>>> 
>>> -Original Message-
>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>> Sent: Monday, December 08, 2008 12:12 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>> 
>>> 
>>> 
>>> Hi Bruno,
>>> 
>>> Right, that far I DID get. I have a Javascript file that contains the
>>> required Javascript for my editor. 
>>> 
>>> (Sorry, I don't have the code now):
>>> 
>>> When the user hits the tab and the panel goes into another context I
>>> create
>>> the panel, add a HeaderContributor that adds the Javascript file. 
>>> 
>>> This panel is not created via a page refresh - it is replaced as per the
>>> code above (i.e. currentPanel = new  ). Will the HeaderContributor
>>> actually be utilized at this point or is a full page refresh required?
>>> 
>>> My BIG problem (this is the crux) is HOW to call that Javascript
>>> function -
>>> the call to 'popupateContent' effectively has to be AFTER the iframe is
>>> initialized (so an innerHTML exists). This can't be part of a
>>> HeaderContributor - it has to be further down the chain of execution. My
>>> confusion is how to make this happen.
>>> 
>>> Almost there! What are the guidelines for the Wiki when I get this
>>> working?
>>> Perhaps I can submit to the Wicket people for verification?
>>> 
>>> REALLY appreciate your discussion on this.
>>> 
>>> Cheers, Graeme.
>>> 
>>> 
>>> Bruno Cesar Borges wrote:
>>>> 
>>>> Put that code into some .js file and add it to your panel as a
>>>> HeaderContributor. Then you are ready to go.
>>>> 
>>>> -Original Message-
>>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>>> Sent: Monday, December 08, 2008 11:48 AM
>>>> To: users@wicket.apache.org
>>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>>> 
>>>> 
>>>> 
>>>> Hey Bruno,
>>>> 
>>>> Perhaps my ramblings with myself didn't make myself clear.
>>>> 
>>>> I am simply wanting to populate the innerHTML with content. I have it
>>>> working wonderfully with Tapestry but not with Wicke

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hi Ernesto,

No - I didn't solve this problem as yet. However, this is part of the
process of parsing the HTML prior to insertion on the innerHTML. If I can
get that bit working I'm going to get back to our thread on the CIDs very
soon!

Cheers, Graeme.


Graeme Knight wrote:
> 
> Hi Bruno,
> 
> No I didn't try this the Label idea... I'll give it a go!
> 
> Thanks for the link I'll let you know how it works out ... watch this
> space!
> 
> 
> 
> Bruno Cesar Borges wrote:
>> 
>> Did you try to add a Label with CSS hidden attribute that executes your
>> script? Something like this:
>> 
>> 
>>   myJavascriptMethod();
>> 
>> 
>> I'm really not sure if this actually works, but you could also check this
>> Wiki page (yeah, it exists)
>> 
>> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
>> 
>> cheers,
>> Bruno
>> 
>> -Original Message-
>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>> Sent: Monday, December 08, 2008 12:12 PM
>> To: users@wicket.apache.org
>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>> 
>> 
>> 
>> Hi Bruno,
>> 
>> Right, that far I DID get. I have a Javascript file that contains the
>> required Javascript for my editor. 
>> 
>> (Sorry, I don't have the code now):
>> 
>> When the user hits the tab and the panel goes into another context I
>> create
>> the panel, add a HeaderContributor that adds the Javascript file. 
>> 
>> This panel is not created via a page refresh - it is replaced as per the
>> code above (i.e. currentPanel = new  ). Will the HeaderContributor
>> actually be utilized at this point or is a full page refresh required?
>> 
>> My BIG problem (this is the crux) is HOW to call that Javascript function
>> -
>> the call to 'popupateContent' effectively has to be AFTER the iframe is
>> initialized (so an innerHTML exists). This can't be part of a
>> HeaderContributor - it has to be further down the chain of execution. My
>> confusion is how to make this happen.
>> 
>> Almost there! What are the guidelines for the Wiki when I get this
>> working?
>> Perhaps I can submit to the Wicket people for verification?
>> 
>> REALLY appreciate your discussion on this.
>> 
>> Cheers, Graeme.
>> 
>> 
>> Bruno Cesar Borges wrote:
>>> 
>>> Put that code into some .js file and add it to your panel as a
>>> HeaderContributor. Then you are ready to go.
>>> 
>>> -Original Message-
>>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>>> Sent: Monday, December 08, 2008 11:48 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>>> 
>>> 
>>> 
>>> Hey Bruno,
>>> 
>>> Perhaps my ramblings with myself didn't make myself clear.
>>> 
>>> I am simply wanting to populate the innerHTML with content. I have it
>>> working wonderfully with Tapestry but not with Wicket as I'm not sure of
>>> the
>>> correct way of doing it.
>>> 
>>> Essentially my component will be a wysiwyg editor. I don't want to use
>>> standard ones because I have written my own AND I will be doing some
>>> fancy
>>> stuff with the content at a later date.
>>> 
>>> So perhaps here's the correct question:
>>> 
>>> What's the best way to set innerHTML on an iframe?
>>> 
>>> I have a javascript function that I would like to call, which is
>>> something
>>> like the following:
>>> 
>>> IFrameArea.populateContent = function( isEditable, allowDocumentTags,
>>> content )
>>> {
>>> var iFrame = document.getElementById( IFrameArea.FRAME_NAME );
>>> 
>>> if( iFrame.contentWindow != null )
>>> {
>>> if( iFrame.contentWindow.document != null )
>>> {
>>> var iFrameDocument = 
>>> iFrame.contentWindow.document;
>>> 
>>> iFrameDocument.open();
>>> 
>>> if( allowDocumentTags == true )
>>> {
>>>

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hi Bruno,

No I didn't try this the Label idea... I'll give it a go!

Thanks for the link I'll let you know how it works out ... watch this space!



Bruno Cesar Borges wrote:
> 
> Did you try to add a Label with CSS hidden attribute that executes your
> script? Something like this:
> 
> 
>   myJavascriptMethod();
> 
> 
> I'm really not sure if this actually works, but you could also check this
> Wiki page (yeah, it exists)
> 
> http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
> 
> cheers,
> Bruno
> 
> -Original Message-
> From: Graeme Knight [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 12:12 PM
> To: users@wicket.apache.org
> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
> 
> 
> 
> Hi Bruno,
> 
> Right, that far I DID get. I have a Javascript file that contains the
> required Javascript for my editor. 
> 
> (Sorry, I don't have the code now):
> 
> When the user hits the tab and the panel goes into another context I
> create
> the panel, add a HeaderContributor that adds the Javascript file. 
> 
> This panel is not created via a page refresh - it is replaced as per the
> code above (i.e. currentPanel = new  ). Will the HeaderContributor
> actually be utilized at this point or is a full page refresh required?
> 
> My BIG problem (this is the crux) is HOW to call that Javascript function
> -
> the call to 'popupateContent' effectively has to be AFTER the iframe is
> initialized (so an innerHTML exists). This can't be part of a
> HeaderContributor - it has to be further down the chain of execution. My
> confusion is how to make this happen.
> 
> Almost there! What are the guidelines for the Wiki when I get this
> working?
> Perhaps I can submit to the Wicket people for verification?
> 
> REALLY appreciate your discussion on this.
> 
> Cheers, Graeme.
> 
> 
> Bruno Cesar Borges wrote:
>> 
>> Put that code into some .js file and add it to your panel as a
>> HeaderContributor. Then you are ready to go.
>> 
>> -Original Message-
>> From: Graeme Knight [mailto:[EMAIL PROTECTED]
>> Sent: Monday, December 08, 2008 11:48 AM
>> To: users@wicket.apache.org
>> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
>> 
>> 
>> 
>> Hey Bruno,
>> 
>> Perhaps my ramblings with myself didn't make myself clear.
>> 
>> I am simply wanting to populate the innerHTML with content. I have it
>> working wonderfully with Tapestry but not with Wicket as I'm not sure of
>> the
>> correct way of doing it.
>> 
>> Essentially my component will be a wysiwyg editor. I don't want to use
>> standard ones because I have written my own AND I will be doing some
>> fancy
>> stuff with the content at a later date.
>> 
>> So perhaps here's the correct question:
>> 
>> What's the best way to set innerHTML on an iframe?
>> 
>> I have a javascript function that I would like to call, which is
>> something
>> like the following:
>> 
>>  IFrameArea.populateContent = function( isEditable, allowDocumentTags,
>> content )
>>  {
>>  var iFrame = document.getElementById( IFrameArea.FRAME_NAME );
>>  
>>  if( iFrame.contentWindow != null )
>>  {
>>  if( iFrame.contentWindow.document != null )
>>  {
>>  var iFrameDocument = 
>> iFrame.contentWindow.document;
>>  
>>  iFrameDocument.open();
>>  
>>  if( allowDocumentTags == true )
>>  {
>>  iFrameDocument.write('');
>>  
>>  iFrameDocument.write( '> rel="stylesheet" type="text/css"
>> href="styles/IFrameStyle.css">' );
>>  
>> 
>>  iFrameDocument.write('');
>>  }
>>  
>>  iFrameDocument.write( content );
>> 
>>  
>>  if( allowDocumentTags == true )
>>  {
>>

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hi Bruno,

Right, that far I DID get. I have a Javascript file that contains the
required Javascript for my editor. 

(Sorry, I don't have the code now):

When the user hits the tab and the panel goes into another context I create
the panel, add a HeaderContributor that adds the Javascript file. 

This panel is not created via a page refresh - it is replaced as per the
code above (i.e. currentPanel = new  ). Will the HeaderContributor
actually be utilized at this point or is a full page refresh required?

My BIG problem (this is the crux) is HOW to call that Javascript function -
the call to 'popupateContent' effectively has to be AFTER the iframe is
initialized (so an innerHTML exists). This can't be part of a
HeaderContributor - it has to be further down the chain of execution. My
confusion is how to make this happen.

Almost there! What are the guidelines for the Wiki when I get this working?
Perhaps I can submit to the Wicket people for verification?

REALLY appreciate your discussion on this.

Cheers, Graeme.


Bruno Cesar Borges wrote:
> 
> Put that code into some .js file and add it to your panel as a
> HeaderContributor. Then you are ready to go.
> 
> -Original Message-
> From: Graeme Knight [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2008 11:48 AM
> To: users@wicket.apache.org
> Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
> 
> 
> 
> Hey Bruno,
> 
> Perhaps my ramblings with myself didn't make myself clear.
> 
> I am simply wanting to populate the innerHTML with content. I have it
> working wonderfully with Tapestry but not with Wicket as I'm not sure of
> the
> correct way of doing it.
> 
> Essentially my component will be a wysiwyg editor. I don't want to use
> standard ones because I have written my own AND I will be doing some fancy
> stuff with the content at a later date.
> 
> So perhaps here's the correct question:
> 
> What's the best way to set innerHTML on an iframe?
> 
> I have a javascript function that I would like to call, which is something
> like the following:
> 
>   IFrameArea.populateContent = function( isEditable, allowDocumentTags,
> content )
>   {
>   var iFrame = document.getElementById( IFrameArea.FRAME_NAME );
>   
>   if( iFrame.contentWindow != null )
>   {
>   if( iFrame.contentWindow.document != null )
>   {
>   var iFrameDocument = 
> iFrame.contentWindow.document;
>   
>   iFrameDocument.open();
>   
>   if( allowDocumentTags == true )
>   {
>   iFrameDocument.write('');
>   
>   iFrameDocument.write( ' rel="stylesheet" type="text/css"
> href="styles/IFrameStyle.css">' );
>   
> 
>   iFrameDocument.write('');
>   }
>   
>   iFrameDocument.write( content );
> 
>   
>   if( allowDocumentTags == true )
>   {
>   iFrameDocument.write('');
>   }
>   
>   iFrameDocument.close(); 
>   
>   if( isEditable == true )
>   {   
>   IFrameArea.designModeOn();
>   }
>   }
>   }
>   };
> 
> isEditable indicates whether the iframe is editable or not,
> allowDocumentTags indicates whether the iframe should contain basic html
> tags and CSS, and the content is ... the content (created by the server) -
> this is my Tapestry-esq implementation, so of course it is open to change.
> 
> The magic question: How do I get this in the HTML for the 'context' panel?
> 
> 
> Bruno Borges wrote:
>> 
>> I've just read your thread and looks like what you want to do is quite...
>> invalid. Iframes are just like normal frames, or even, a separate
>> window/tab. If you think that way, you will notice that what you want to
>> do
>> is not p

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Graeme Knight

Hey Bruno,

Perhaps my ramblings with myself didn't make myself clear.

I am simply wanting to populate the innerHTML with content. I have it
working wonderfully with Tapestry but not with Wicket as I'm not sure of the
correct way of doing it.

Essentially my component will be a wysiwyg editor. I don't want to use
standard ones because I have written my own AND I will be doing some fancy
stuff with the content at a later date.

So perhaps here's the correct question:

What's the best way to set innerHTML on an iframe?

I have a javascript function that I would like to call, which is something
like the following:

IFrameArea.populateContent = function( isEditable, allowDocumentTags,
content )
{
var iFrame = document.getElementById( IFrameArea.FRAME_NAME );

if( iFrame.contentWindow != null )
{
if( iFrame.contentWindow.document != null )
{
var iFrameDocument = 
iFrame.contentWindow.document;

iFrameDocument.open();

if( allowDocumentTags == true )
{
iFrameDocument.write('');

iFrameDocument.write( '' );


iFrameDocument.write('');
}

iFrameDocument.write( content );


if( allowDocumentTags == true )
{
iFrameDocument.write('');
}

iFrameDocument.close(); 

if( isEditable == true )
{   
IFrameArea.designModeOn();
}
}
}
};

isEditable indicates whether the iframe is editable or not,
allowDocumentTags indicates whether the iframe should contain basic html
tags and CSS, and the content is ... the content (created by the server) -
this is my Tapestry-esq implementation, so of course it is open to change.

The magic question: How do I get this in the HTML for the 'context' panel?


Bruno Borges wrote:
> 
> I've just read your thread and looks like what you want to do is quite...
> invalid. Iframes are just like normal frames, or even, a separate
> window/tab. If you think that way, you will notice that what you want to
> do
> is not possible. From a Javascript developer's perspective, of course.
> This
> has nothing to do with Wicket.
> 
> If you want to set the innerHTML property of some DOM object, that object
> *has* to have that property. Check these URLs:
> 
> http://www.htmlite.com/lite021.php
> http://msdn.microsoft.com/en-us/library/ms535258(VS.85).aspx#
> 
> So, stop talking with yourself about something impossible to accomplish
> and
> go get some sleep buddy... ;-)
> 
> Cheers,
> Bruno Borges
> blog.brunoborges.com.br
> +55 21 76727099
> 
> "The glory of great men should always be
> measured by the means they have used to
> acquire it."
> - Francois de La Rochefoucauld
> 
> 
> On Mon, Dec 8, 2008 at 1:07 AM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Bruno!
>>
>> I absolutely would love to write a wiki page on this if I can make it
>> work
>> -
>> and you are right - conversation with myself *might* help others who
>> perhaps
>> have a similar problem.
>>
>> I'm not quite there yet :-( - perhaps tomorrow!
>>
>> Cheers, Graeme.
>>
>>
>> Bruno Borges wrote:
>> >
>> > With all that conversation with yourself, how about writing a Wiki page
>> > after you succeed ?! :-D
>> >
>> > Cheers,
>> > Bruno Borges
>> > blog.brunoborges.com.br
>> > +55 21 76727099
>> >
>> > "The glory of great men should always be
>> > measured by the means they have used to
>> > acquire it."
>> > - Francois de La Rochefoucauld
>> >
>> >
>> > On Sun, Dec 7, 2008 at 11:51 PM, Graeme Knight <[EMAIL PROTECTED]>
>>

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-07 Thread Graeme Knight

Bruno! 

I absolutely would love to write a wiki page on this if I can make it work -
and you are right - conversation with myself *might* help others who perhaps
have a similar problem.

I'm not quite there yet :-( - perhaps tomorrow!

Cheers, Graeme.


Bruno Borges wrote:
> 
> With all that conversation with yourself, how about writing a Wiki page
> after you succeed ?! :-D
> 
> Cheers,
> Bruno Borges
> blog.brunoborges.com.br
> +55 21 76727099
> 
> "The glory of great men should always be
> measured by the means they have used to
> acquire it."
> - Francois de La Rochefoucauld
> 
> 
> On Sun, Dec 7, 2008 at 11:51 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi.
>>
>> I'm making some progress by using an IPageLink to a page that might
>> contain
>> (if I can) the rendered content... HHmm...
>>
>> Cheers, Graeme.
>>
>>
>> Graeme Knight wrote:
>> >
>> > Hi.
>> >
>> > I have an application with links that switch panels using AJAX:
>> >
>> > :
>> > private Panel currentPanel;
>> > :
>> > ContactsListPanel manageContactsPanel = new ContactsListPanel();
>> >
>> > currentPanel.replaceWith( manageContactsPanel );
>> >
>> > currentPanel = manageContactsPanel;
>> > :
>> >
>> > One of my panels has an IFRAME on it which I wish to populate with
>> content
>> > on rendering. I would like to set the innerHTML through Javascript,
>> rather
>> > than set the SRC (the innerHTML will be injected with content that is
>> > modified on the server and not a static source page).
>> >
>> > I have a Javascript function that can be called once the IFRAME has
>> > (effectively) been rendered (using a Variables Model for replacing
>> > 'originalContent' with text):
>> >
>> > function initializeIFrameArea()
>> > {
>> >   IFrameArea.populateContent( "${originalContent}" );
>> > }
>> >
>> > The populateContent function simply sets the innerHTML on the IFRAME.
>> The
>> > 'originalContent' is my modified content to be injected into the
>> > innerHTML.
>> >
>> > My question is this:
>> >
>> > 1) On entering the panel, I was wondering if it is possible to use a
>> > HeaderContributor (i.e. this is NOT a full page rerender) to add the
>> > script containing the IFrameArea Javascript on which the
>> populateContent
>> > is called. I can't have the initializeIFrameArea function on the page
>> from
>> > the start because I am using a Variables Model to change the value of
>> > originalContent on the fly (i.e. when the user enters this panel the
>> > content could be one of many possibilities).
>> >
>> > 2) On rendering I want to be able to call initializeIFrameArea, but I
>> do
>> > not understand how I can get this into the HTML of the panel so that it
>> > calls the function after the IFRAME is effectively rendered and
>> innerHTML
>> > exists.
>> >
>> > Perhaps there is a better approach - as this seems complicated (I had
>> to
>> > do this with Tapestry, so I'm not sure if Wicket has a more elegant
>> > approach).
>> >
>> > Any thoughts most welcome.
>> >
>> > Thanks, Graeme.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20888407.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -
> Bruno Borges
> blog.brunoborges.com.br
> +55 21 76727099
> 
> "The glory of great men should always be
> measured by the means they have used to
> acquire it."
> - Francois de La Rochefoucauld
> 

-- 
View this message in context: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20888901.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-07 Thread Graeme Knight

Hi.

I'm making some progress by using an IPageLink to a page that might contain
(if I can) the rendered content... HHmm...

Cheers, Graeme.


Graeme Knight wrote:
> 
> Hi.
> 
> I have an application with links that switch panels using AJAX:
> 
> :
> private Panel currentPanel;
> :
> ContactsListPanel manageContactsPanel = new ContactsListPanel();
> 
> currentPanel.replaceWith( manageContactsPanel );
> 
> currentPanel = manageContactsPanel;
> :
> 
> One of my panels has an IFRAME on it which I wish to populate with content
> on rendering. I would like to set the innerHTML through Javascript, rather
> than set the SRC (the innerHTML will be injected with content that is
> modified on the server and not a static source page).
> 
> I have a Javascript function that can be called once the IFRAME has
> (effectively) been rendered (using a Variables Model for replacing
> 'originalContent' with text):
> 
> function initializeIFrameArea()
> { 
>   IFrameArea.populateContent( "${originalContent}" );
> }
> 
> The populateContent function simply sets the innerHTML on the IFRAME. The
> 'originalContent' is my modified content to be injected into the
> innerHTML.
> 
> My question is this:
> 
> 1) On entering the panel, I was wondering if it is possible to use a
> HeaderContributor (i.e. this is NOT a full page rerender) to add the
> script containing the IFrameArea Javascript on which the populateContent
> is called. I can't have the initializeIFrameArea function on the page from
> the start because I am using a Variables Model to change the value of
> originalContent on the fly (i.e. when the user enters this panel the
> content could be one of many possibilities).
> 
> 2) On rendering I want to be able to call initializeIFrameArea, but I do
> not understand how I can get this into the HTML of the panel so that it
> calls the function after the IFRAME is effectively rendered and innerHTML
> exists.
> 
> Perhaps there is a better approach - as this seems complicated (I had to
> do this with Tapestry, so I'm not sure if Wicket has a more elegant
> approach).
> 
> Any thoughts most welcome.
> 
> Thanks, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20888407.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-07 Thread Graeme Knight

Hi.

Perhaps AbstractAjaxBehavior may help - I will have a look. Anyone with any
experience with this please let me know. It would be appreciated!

Rgds, Graeme.


Graeme Knight wrote:
> 
> Hi.
> 
> I have an application with links that switch panels using AJAX:
> 
> :
> private Panel currentPanel;
> :
> ContactsListPanel manageContactsPanel = new ContactsListPanel();
> 
> currentPanel.replaceWith( manageContactsPanel );
> 
> currentPanel = manageContactsPanel;
> :
> 
> One of my panels has an IFRAME on it which I wish to populate with content
> on rendering. I would like to set the innerHTML through Javascript, rather
> than set the SRC (the innerHTML will be injected with content that is
> modified on the server and not a static source page).
> 
> I have a Javascript function that can be called once the IFRAME has
> (effectively) been rendered (using a Variables Model for replacing
> 'originalContent' with text):
> 
> function initializeIFrameArea()
> { 
>   IFrameArea.populateContent( "${originalContent}" );
> }
> 
> The populateContent function simply sets the innerHTML on the IFRAME. The
> 'originalContent' is my modified content to be injected into the
> innerHTML.
> 
> My question is this:
> 
> 1) On entering the panel, I was wondering if it is possible to use a
> HeaderContributor (i.e. this is NOT a full page rerender) to add the
> script containing the IFrameArea Javascript on which the populateContent
> is called. I can't have the initializeIFrameArea function on the page from
> the start because I am using a Variables Model to change the value of
> originalContent on the fly (i.e. when the user enters this panel the
> content could be one of many possibilities).
> 
> 2) On rendering I want to be able to call initializeIFrameArea, but I do
> not understand how I can get this into the HTML of the panel so that it
> calls the function after the IFRAME is effectively rendered and innerHTML
> exists.
> 
> Perhaps there is a better approach - as this seems complicated (I had to
> do this with Tapestry, so I'm not sure if Wicket has a more elegant
> approach).
> 
> Any thoughts most welcome.
> 
> Thanks, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20888142.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Populate IFRAME innerHTML on AJAX load of panel.

2008-12-07 Thread Graeme Knight

Hi.

I have an application with links that switch panels using AJAX:

:
private Panel currentPanel;
:
ContactsListPanel manageContactsPanel = new ContactsListPanel();

currentPanel.replaceWith( manageContactsPanel );

currentPanel = manageContactsPanel;
:

One of my panels has an IFRAME on it which I wish to populate with content
on rendering. I would like to set the innerHTML through Javascript, rather
than set the source (the innerHTML will be injected with content that is
modified on the server and not a static source page).

I have a Javascript function that can be called once the IFRAME has
(effectively) been rendered:

function initializeIFrameArea()
{   
IFrameArea.populateContent( "${originalContent}" );
}

The populateContent function simply sets the innerHTML on the IFRAME. The
'originalContent' is my modified content to be injected into the innerHTML.

My question is this:

1) On entering the panel, I was wondering if it is possible to use a
HeaderContributor (i.e. this is NOT a full page rerender) to add the script
containing the IFrameArea Javascript on which the populateContent is called.
I can't have the initializeIFrameArea function on the page from the start
because I am using a Variables Model to change the value of originalContent
on the fly (i.e. when the user enters this panel the content could be one of
many possibilities).

2) On rendering I want to be able to call initializeIFrameArea, but I do not
understand how I can get this into the HTML of the panel so that it calls
the function after the IFRAME is effectively rendered and innerHTML exists.

Perhaps there is a better approach - as this seems complicated (I had to do
this with Tapestry, so I'm not sure if Wicket has a more elegant approach).

Any thoughts most welcome.

Thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20887803.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Calling Javascript on AJAX load of panel.

2008-12-07 Thread Graeme Knight

Hi.

I have  a panel that loads different content depending on a context (i.e.
clicking on a tab moves it to another view, etc).

One of the views is an iframe which will have content populated by
Javascript. 

I have something like this as a header contributor, which populates 'hello
world' into the iframe:

IModel variablesModel = new AbstractReadOnlyModel()
{
private static final long serialVersionUID =
-4744542904096678956L;

public Map getObject()
{
Map< String, CharSequence > variables = new HashMap< String,
CharSequence >();

variables.put( "originalContent", "Hello world" );

return variables;
}
};

add( TextTemplateHeaderContributor.forJavaScript(
TextReadPanel.class, "IFrameLoader.js", variablesModel ) );

Two questions:

1) Is the header contributor added to the html (this is ajax so there is no
page refresh).
2) How to call the function in IFrameLoader.js (initializeIFrame()) AFTER
the iframe has rendered?

Perhaps the above is the wrong way to do the following:

1) User clicks on tab.
2) Panel is switched into text reading 'context'.
3) IFrame is rendered, innerHTML of iframe is populated through the
initializeIFrame() Javascript function (rendering originalContent).

Does this sound plausible in Wicket?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Calling-Javascript-on-AJAX-load-of-panel.-tp20886721p20886721.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IMG SRC URL in iframe.

2008-12-03 Thread Graeme Knight

Ernesto,

I really appreciate your help - thanks for the information. I will try to
take a look at it tonight! 

Cheers, Graeme.


reiern70 wrote:
> 
> Hi Graeme,
> 
> Yes, it is the approach I would follow... I'm not 100% sure about all
> the details (e.g maybe the URL is not exactly /images/xxx), but I'm sure
> that approach that will work.   As said I used a similar approach
> sometime ago for displaying a documents inside an iframe: I mounted a
> dynamic resource that was generating the content based on some ID and
> the iframe src just contained the URL of the resource. Your use case is
> a bit different but it will also work. Another possibility is to have on
> the same page , where the "HTML" is going to be displayed, a component
> implementing IResourceListener and have that component generate the
> images...
>  
> Right now I'm very busy with other pressing issues at  work but if I
> find time I'll try to build a small example illustrating this.
> 
> Best,
> 
> Ernesto
>  
> 
> Graeme Knight wrote:
>> Hi, thank you - this is invaluable information.
>>
>> So basically what you are suggesting is something like:
>>
>> 1) Read the HTML content (this will be set on the innerHTML of the
>> iframe).
>> 2) Parse the content to find the each IMG SRC CID - replace this CID with
>> a
>> URL to /images/xxx.
>> 3) Set the HTML into the iframe.
>> 4) On rendering the iframe IMG SRC will point back at the server that
>> will
>> serve up the image, essentially.
>>
>> Appreciate your help!
>>
>> Graeme.
>>
>>
>> reiern70 wrote:
>>   
>>> ...something like:
>>>
>>> private static String ID = "MyImages";
>>>  @Override
>>>  protected void init() {
>>> super.init();
>>>  getSharedResources().add(ID, new
>>> MyDynamicImageResource());
>>>  mountSharedResource("/images", ID);
>>>  
>>> }
>>>
>>> On you WebApplication class... Then ask back to the server for
>>> /images/xxx
>>> and your MyDynamicImageResource will pick up the xxx and stream back
>>> that
>>> xxx image... MyDynamicImageResource should implement some of the
>>> extensions
>>> of DynamicImageResource... Long time ago I implemented something like
>>> that
>>> but I don not have that code at hand anymore... But it shouldn't be that
>>> difficult to get that working.
>>>
>>> I have seen this
>>> http://cwiki.apache.org/WICKET/how-to-create-dynamic-image-overlays.html
>>> example
>>> but don't if it will be of any help to you...
>>>
>>> Best,
>>>
>>> Ernesto
>>>
>>> Best
>>>
>>>
>>>
>>> On Wed, Dec 3, 2008 at 3:16 PM, Ernesto Reinaldo Barreiro <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>> 
>>>> Why not mount a resource that is servicing back images based of the
>>>> CID?
>>>> Best,
>>>>
>>>> Ernesto
>>>>
>>>>
>>>> On Wed, Dec 3, 2008 at 2:59 PM, Graeme Knight
>>>> <[EMAIL PROTECTED]>wrote:
>>>>
>>>>   
>>>>> Oh,
>>>>>
>>>>> My use case is this:
>>>>>
>>>>> 1) Load up HTML email content. This content has CIDs which need to be
>>>>> resolved to URLs.
>>>>>
>>>>> 2) I will put the HTML content into the iframe using some Javascript
>>>>> to
>>>>> manipulate the innerHTML.
>>>>>
>>>>> 3) Before I do step 2 I need to convert the CID to a URL that points
>>>>> to
>>>>> an
>>>>> image file on the server.
>>>>>
>>>>> Its this URL construction that concerns me.
>>>>>
>>>>> Many thanks for any suggestions, Graeme.
>>>>>
>>>>>
>>>>> Graeme Knight wrote:
>>>>> 
>>>>>> Hi,
>>>>>>
>>>>>> I would like to use an iframe on my page that contains IMG tags. I
>>>>>>   
>>>>> would
>>>>> 
>>>>>> like the IMG tag SRC to point back to the server to load up the
>>>>>> image.
>>>>>>
>>>>>> What would be the best way to construct the URLs in Wicket?
>>>>>>
>>>>>> Many thanks for any advice, Graeme.
>>>>>>
>>>>>>   
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20813419.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>> 
>>> 
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20821557.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IMG SRC URL in iframe.

2008-12-03 Thread Graeme Knight

Hi, thank you - this is invaluable information.

So basically what you are suggesting is something like:

1) Read the HTML content (this will be set on the innerHTML of the iframe).
2) Parse the content to find the each IMG SRC CID - replace this CID with a
URL to /images/xxx.
3) Set the HTML into the iframe.
4) On rendering the iframe IMG SRC will point back at the server that will
serve up the image, essentially.

Appreciate your help!

Graeme.


reiern70 wrote:
> 
> ...something like:
> 
> private static String ID = "MyImages";
>  @Override
>  protected void init() {
> super.init();
>  getSharedResources().add(ID, new
> MyDynamicImageResource());
>  mountSharedResource("/images", ID);
>  
> }
> 
> On you WebApplication class... Then ask back to the server for /images/xxx
> and your MyDynamicImageResource will pick up the xxx and stream back that
> xxx image... MyDynamicImageResource should implement some of the
> extensions
> of DynamicImageResource... Long time ago I implemented something like that
> but I don not have that code at hand anymore... But it shouldn't be that
> difficult to get that working.
> 
> I have seen this
> http://cwiki.apache.org/WICKET/how-to-create-dynamic-image-overlays.html
> example
> but don't if it will be of any help to you...
> 
> Best,
> 
> Ernesto
> 
> Best
> 
> 
> 
> On Wed, Dec 3, 2008 at 3:16 PM, Ernesto Reinaldo Barreiro <
> [EMAIL PROTECTED]> wrote:
> 
>> Why not mount a resource that is servicing back images based of the CID?
>> Best,
>>
>> Ernesto
>>
>>
>> On Wed, Dec 3, 2008 at 2:59 PM, Graeme Knight
>> <[EMAIL PROTECTED]>wrote:
>>
>>>
>>> Oh,
>>>
>>> My use case is this:
>>>
>>> 1) Load up HTML email content. This content has CIDs which need to be
>>> resolved to URLs.
>>>
>>> 2) I will put the HTML content into the iframe using some Javascript to
>>> manipulate the innerHTML.
>>>
>>> 3) Before I do step 2 I need to convert the CID to a URL that points to
>>> an
>>> image file on the server.
>>>
>>> Its this URL construction that concerns me.
>>>
>>> Many thanks for any suggestions, Graeme.
>>>
>>>
>>> Graeme Knight wrote:
>>> >
>>> > Hi,
>>> >
>>> > I would like to use an iframe on my page that contains IMG tags. I
>>> would
>>> > like the IMG tag SRC to point back to the server to load up the image.
>>> >
>>> > What would be the best way to construct the URLs in Wicket?
>>> >
>>> > Many thanks for any advice, Graeme.
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20813419.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20818656.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IMG SRC URL in iframe.

2008-12-03 Thread Graeme Knight

Hi Ernesto,

I think that is exactly what I am after - just not certain how this
implementation works in Wicket. It was real easy with Tapestry as all I did
was get hold of the URL, append a path to the image, and replace the CID in
the HTML with the image URL.

Are there any examples of this sort of functionality?

Many thanks, Graeme.


reiern70 wrote:
> 
> Why not mount a resource that is servicing back images based of the CID?
> Best,
> 
> Ernesto
> 
> On Wed, Dec 3, 2008 at 2:59 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Oh,
>>
>> My use case is this:
>>
>> 1) Load up HTML email content. This content has CIDs which need to be
>> resolved to URLs.
>>
>> 2) I will put the HTML content into the iframe using some Javascript to
>> manipulate the innerHTML.
>>
>> 3) Before I do step 2 I need to convert the CID to a URL that points to
>> an
>> image file on the server.
>>
>> Its this URL construction that concerns me.
>>
>> Many thanks for any suggestions, Graeme.
>>
>>
>> Graeme Knight wrote:
>> >
>> > Hi,
>> >
>> > I would like to use an iframe on my page that contains IMG tags. I
>> would
>> > like the IMG tag SRC to point back to the server to load up the image.
>> >
>> > What would be the best way to construct the URLs in Wicket?
>> >
>> > Many thanks for any advice, Graeme.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20813419.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20814164.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IMG SRC URL in iframe.

2008-12-03 Thread Graeme Knight

Oh,

My use case is this: 

1) Load up HTML email content. This content has CIDs which need to be
resolved to URLs.

2) I will put the HTML content into the iframe using some Javascript to
manipulate the innerHTML.

3) Before I do step 2 I need to convert the CID to a URL that points to an
image file on the server.

Its this URL construction that concerns me.

Many thanks for any suggestions, Graeme.


Graeme Knight wrote:
> 
> Hi,
> 
> I would like to use an iframe on my page that contains IMG tags. I would
> like the IMG tag SRC to point back to the server to load up the image. 
> 
> What would be the best way to construct the URLs in Wicket?
> 
> Many thanks for any advice, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20813419.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



IMG SRC URL in iframe.

2008-12-02 Thread Graeme Knight

Hi,

I would like to use an iframe on my page that contains IMG tags. I would
like the IMG tag SRC to point back to the server to load up the image. 

What would be the best way to construct the URLs in Wicket?

Many thanks for any advice, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IMG-SRC-URL-in-iframe.-tp20805408p20805408.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Map File Sizes.

2008-11-17 Thread Graeme Knight

I think you are right! Thanks once again!


Matej Knopp-2 wrote:
> 
> Look at DiskPageStore constructor. But i think the defaults should be
> sane enough for you usecase. Although 1000 concurrent users would IMHO
> require quite a beefy server, on which 5gb pagestore should not be
> problematic.
> 
> -Matej
> 
> On Tue, Nov 18, 2008 at 4:16 AM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
>>
>> Thanks Matej!
>>
>> That's awesome! I will look into it!
>>
>> Regards, Graeme.
>>
>>
>> Matej Knopp-2 wrote:
>>>
>>> Hi,
>>>
>>> the maximal file size of each pagemap file is configurable.
>>>
>>> -Matej
>>>
>>> On Tue, Nov 18, 2008 at 3:06 AM, Graeme Knight <[EMAIL PROTECTED]>
>>> wrote:
>>>>
>>>> I guess I can answer my own question:
>>>>
>>>> So let's say our page is 50k. We have 1000 users on a server. With each
>>>> user
>>>> having 100 click throughs before cleanup.
>>>>
>>>> So I figure roughly (51200x100) * 1000 = 5,120,000,000
>>>>
>>>> So 1000 users clicking 100 times each on a 50k page will take up 5 GB
>>>> of
>>>> space.
>>>>
>>>> The above scenario is pretty far fetched!
>>>>
>>>> Does anyone know how page cleanup occurs?
>>>>
>>>> Thanks, Graeme.
>>>>
>>>>
>>>> Graeme Knight wrote:
>>>>>
>>>>> Hi. I hope this appropriate for this forum.
>>>>>
>>>>> I am writing a fairly heavy AJAX rich application with two pages - A
>>>>> login
>>>>> page and a work page. I was interested in progress so far regarding
>>>>> serialized page state, so I tracked the size of my page map file as I
>>>>> clicked around the application. Below is the size change in the file
>>>>> for
>>>>> my single user. I would like to know if this is as expected as I have
>>>>> no
>>>>> metrics from any other place - perhaps you have experience.
>>>>>
>>>>> Each value is the size of the page file in kilobytes after each click
>>>>> of
>>>>> a
>>>>> link:
>>>>>
>>>>> 5.9
>>>>> 25.5
>>>>> 49.3
>>>>> 71.9
>>>>> 95.7
>>>>> 116.4
>>>>> 140.2  < so I see my page map file is growing as I
>>>>> assumed
>>>>> it would.
>>>>>
>>>>> My file therefore changed by the following amount each click,
>>>>> indicating
>>>>> that my page is around the 22 kilobyte mark:
>>>>>
>>>>> 19.6
>>>>> 23.8
>>>>> 22.6
>>>>> 23.8
>>>>> 20.7
>>>>> 23.8
>>>>>
>>>>> Does this sound about right? Is there something wrong with the growth
>>>>> of
>>>>> the file? Is it excessive?
>>>>>
>>>>> When does the file cleanup?
>>>>>
>>>>> Thanks for any input, Graeme.
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552286.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552886.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552976.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Map File Sizes.

2008-11-17 Thread Graeme Knight

Thanks Matej!

That's awesome! I will look into it!

Regards, Graeme.


Matej Knopp-2 wrote:
> 
> Hi,
> 
> the maximal file size of each pagemap file is configurable.
> 
> -Matej
> 
> On Tue, Nov 18, 2008 at 3:06 AM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
>>
>> I guess I can answer my own question:
>>
>> So let's say our page is 50k. We have 1000 users on a server. With each
>> user
>> having 100 click throughs before cleanup.
>>
>> So I figure roughly (51200x100) * 1000 = 5,120,000,000
>>
>> So 1000 users clicking 100 times each on a 50k page will take up 5 GB of
>> space.
>>
>> The above scenario is pretty far fetched!
>>
>> Does anyone know how page cleanup occurs?
>>
>> Thanks, Graeme.
>>
>>
>> Graeme Knight wrote:
>>>
>>> Hi. I hope this appropriate for this forum.
>>>
>>> I am writing a fairly heavy AJAX rich application with two pages - A
>>> login
>>> page and a work page. I was interested in progress so far regarding
>>> serialized page state, so I tracked the size of my page map file as I
>>> clicked around the application. Below is the size change in the file for
>>> my single user. I would like to know if this is as expected as I have no
>>> metrics from any other place - perhaps you have experience.
>>>
>>> Each value is the size of the page file in kilobytes after each click of
>>> a
>>> link:
>>>
>>> 5.9
>>> 25.5
>>> 49.3
>>> 71.9
>>> 95.7
>>> 116.4
>>> 140.2  < so I see my page map file is growing as I
>>> assumed
>>> it would.
>>>
>>> My file therefore changed by the following amount each click, indicating
>>> that my page is around the 22 kilobyte mark:
>>>
>>> 19.6
>>> 23.8
>>> 22.6
>>> 23.8
>>> 20.7
>>> 23.8
>>>
>>> Does this sound about right? Is there something wrong with the growth of
>>> the file? Is it excessive?
>>>
>>> When does the file cleanup?
>>>
>>> Thanks for any input, Graeme.
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552286.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552886.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Map File Sizes.

2008-11-17 Thread Graeme Knight

I guess I can answer my own question:

So let's say our page is 50k. We have 1000 users on a server. With each user
having 100 click throughs before cleanup.

So I figure roughly (51200x100) * 1000 = 5,120,000,000

So 1000 users clicking 100 times each on a 50k page will take up 5 GB of
space.

The above scenario is pretty far fetched!

Does anyone know how page cleanup occurs?

Thanks, Graeme.


Graeme Knight wrote:
> 
> Hi. I hope this appropriate for this forum.
> 
> I am writing a fairly heavy AJAX rich application with two pages - A login
> page and a work page. I was interested in progress so far regarding
> serialized page state, so I tracked the size of my page map file as I
> clicked around the application. Below is the size change in the file for
> my single user. I would like to know if this is as expected as I have no
> metrics from any other place - perhaps you have experience.
> 
> Each value is the size of the page file in kilobytes after each click of a
> link:
> 
> 5.9
> 25.5
> 49.3
> 71.9
> 95.7
> 116.4
> 140.2  < so I see my page map file is growing as I assumed
> it would.
> 
> My file therefore changed by the following amount each click, indicating
> that my page is around the 22 kilobyte mark:
> 
> 19.6
> 23.8
> 22.6
> 23.8
> 20.7
> 23.8
> 
> Does this sound about right? Is there something wrong with the growth of
> the file? Is it excessive? 
> 
> When does the file cleanup?
> 
> Thanks for any input, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20552286.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Page Map File Sizes.

2008-11-17 Thread Graeme Knight

Hi. I hope this appropriate for this forum.

I am writing a fairly heavy AJAX rich application with two pages - A login
page and a work page. I was interested in progress so far regarding
serialized page state, so I tracked the size of my page map file as I
clicked around the application. Below is the size change in the file for my
single user. I would like to know if this is as expected as I have no
metrics from any other place - perhaps you have experience.

Each value is the size of the page file in kilobytes after each click of a
link:

5.9
25.5
49.3
71.9
95.7
116.4
140.2  < so I see my page map file is growing as I assumed
it would.

My file therefore changed by the following amount each click, indicating
that my page is around the 22 kilobyte mark:

19.6
23.8
22.6
23.8
20.7
23.8

Does this sound about right? Is there something wrong with the growth of the
file? Is it excessive? 

When does the file cleanup?

Thanks for any input, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Page-Map-File-Sizes.-tp20551680p20551680.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Adding/Removing a AjaxSelfUpdatingTimerBehavior...

2008-11-17 Thread Graeme Knight

Hi.

Thanks for that. I was worried about removing behaviors - but thanks for the
information.

I'm going to look at how easy it is to change time on an
AjaxSelfUpdatingTimerBehavior?

I need a poll anyway so I am thinking of polling once every five minutes and
then when the refresh is occurring I can poll evey 5 seconds, then when
finished - back to five minutes...

Cheers, Graeme.


reiern70 wrote:
> 
> Hi Graeme,
> I don't know if what follows is the best way...   but when I export a file
> on my applications sometimes I want to display a progress bar to give
> users
> some feed back... I have done the following:
> 
> 
> public abstract class DefaultExportPanel extends Panel {
> 
> /**
>  *
>  */
> private static final long serialVersionUID = 1L;
> 
> private AbstractExportDialogButton button;
>  private WebMarkupContainer progress;
>  /**
>  * @param id
>  */
> public DefaultExportPanel(String id, AbstractExportDialogButton button) {
> super(id);
> this.button = button;
> setOutputMarkupId(true);
> }
>  @Override
> protected void onBeforeRender() {
> if(!this.button.getExportTask().isFinished()) {
> for(Object behavior : getBehaviors()) {
> if(behavior instanceof AjaxSelfUpdatingTimerBehavior) {
> remove((AjaxSelfUpdatingTimerBehavior)behavior);
> }
> }
> add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)));
> progress = new ProgressReportPanel("progress",
> DefaultExportPanel.this.button.getExportTask().getProgressReporter());
> addOrReplace(progress);
>  } else {
> for(Object behavior : getBehaviors()) {
> if(behavior instanceof AjaxSelfUpdatingTimerBehavior) {
> remove((AjaxSelfUpdatingTimerBehavior)behavior);
> }
> }
> add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(100)));
> progress = new DownLoadExportPanel("progress",
> this.button.getExportTask().getFile()) {
>  private static final long serialVersionUID = 1L;
> 
> @Override
> public String getContentType() {
> return DefaultExportPanel.this.getContentType();
> }
>  @Override
> public String getMessage() {
> return DefaultExportPanel.this.getDowloadMessage();
> }
> };
> progress.setOutputMarkupId(true);
> addOrReplace(progress);
> }
> super.onBeforeRender();
> }
>  public abstract String getContentType();
>  public abstract String getDowloadMessage();
> 
> }
> 
> and the corresponding markup:
> 
> 
> 
> 
> 
> 
> 
> 
>  
>  
>  
> 
> 
> 
> The part:
> 
> add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(100)));
> progress = new DownLoadExportPanel("progress",
> this.button.getExportTask().getFile()) {
>  private static final long serialVersionUID = 1L;
> 
> @Override
> public String getContentType() {
> return DefaultExportPanel.this.getContentType();
> }
>  @Override
> public String getMessage() {
> return DefaultExportPanel.this.getDowloadMessage();
> }
> };
> progress.setOutputMarkupId(true);
> 
> after removing the behaviors I had to add it because otherwise I would get
> an exception when using  IE... I know this works, or is working  for me
> with
> the snapshot of 1.4.X  branch I use, but I'm not sure if its the best way
> to
> achieve this...
> 
> Best,
> 
> Ernesto
> 
> On Sun, Nov 16, 2008 at 10:54 PM, Graeme Knight
> <[EMAIL PROTECTED]>wrote:
> 
>>
>> Oh. I'm wondering: https://issues.apache.org/jira/browse/WICKET-1525
>>
>> Perhaps there is another way?
>>
>>
>> Graeme Knight wrote:
>> >
>> > Maybe I'm trying to do something silly. Is there an alternative?
>> >
>> >
>> > Graeme Knight wrote:
>> >>
>> >> Hi.
>> >>
>> >> What's the best way of achieving this effect:
>> >>
>> >> 1) Button is pressed to start a process.
>> >> 2) Updating of various panels contained within a WebMarkupContainer
>> >> occurs on a 5 second period.
>> >> 3) Process stops and updating of WebMarkupContainer also stops.
>> >>
>> >> I understand the use of AjaxSelfUpdatingTimerBehavior - this really is
>> a
>> >> question of the best way to add/remove from the WebMarkupContainer on
>> >> demand, or enable/disable on demand.
>> >>
>> >> Any thoughts most welcome.
>> >>
>> >> Rgds, Graeme.
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Adding-Removing-a-AjaxSelfUpdatingTimerBehavior...-tp20520576p20530559.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Adding-Removing-a-AjaxSelfUpdatingTimerBehavior...-tp20520576p20539844.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



isEnabled on AjaxSelfUpdatingTimerBehavior.

2008-11-16 Thread Graeme Knight

Hi.

I have looked at removing the timer from a component when a condition is not
true, but according to the forums this is not possible. 

Recommended is the use of isEnabled. I have the following code, but
isEnabled doesn't appear to be working. 

I'm after a way of allowing a user to start a process by pressing a link,
then as the process continues over several minutes the WebMarkupContainer is
updated (every 5 seconds using an AjaxSelfUpdatingTimerBehavior) and when
the process finishes, stopping the timerbahavior until the link is next
pressed. I think this must be a common thing to do so any information would
be most welcome.

My refresh link that the user presses to render an indicator and a
percentage based on the fact a refresh is occuring:

public final class RefreshLink extends AbstractAjaxFallbackButtonLink
{
private static final long serialVersionUID = 1825145981122180572L;

@Override
public void onClick( AjaxRequestTarget target )
{
// create the refresh process worker
RefreshWorker refreshWorker = new RefreshWorker();

// execute the refresh thread
refreshWorker.refresh( Visit.get() );

// get the page
AccountViewPage page = AccountViewPage.class.cast( getPage() );

// get a reference to the markup container component containing a
refresh indicator and percentage complete
Component container = page.get( RefreshPanel.CONTAINER_ID_PATH );

target.addComponent( container );
}
}

In the panel containing the indicator (shown as the process continues along
with a percentage complete):

  :
WebMarkupContainer container = new WebMarkupContainer( CONTAINER );

Image refreshIndicator = new Image( REFRESH_INDICATOR,
IconFactory.getSmallGIF( REFRESH_INDICATOR ) );

AttributeModifier attributeModifier = new
RefreshImageAttributeModifier();

Label percentageCompleteLabel = new Label(
PERCENTAGE_COMPLETE_LABEL, new RefreshLabelReadOnlyModel() );

container.add( percentageLabel );
container.add( refreshIndicator );
container.add( attributeModifier );

container.setOutputMarkupId( true );

container.add( new RefreshTimerBehavior() );

add( refreshButton );
add( container );
 :

And the refresh timer:

public final class RefreshTimerBehavior extends
AjaxSelfUpdatingTimerBehavior
{
private static final long serialVersionUID = -6061033495202259806L;

private static final int FIVE_SECONDS = 5;

/**
 * @param updateInterval
 */
public RefreshTimerBehavior()
{
super( Duration.seconds( FIVE_SECONDS ) );
}

/*
 * (non-Javadoc)
 * 
 * @see
org.apache.wicket.behavior.AbstractBehavior#isEnabled(org.apache.wicket.Component)
 */
@Override
public boolean isEnabled( Component component )
{
boolean isEnabled = false;

if( Visit.get().isRefreshing() )
{
isEnabled = true;
}

return isEnabled;
}
}

Now, isEnabled is getting called, but the base class method onTimer is also
getting called - indicating to me that the value of isEnabled is being
ignored - I was hoping that a return value of false would tell the timer to
stop, but it keeps ticking away every five seconds. I obviously can't remove
the timer behavior but I would like to disable and enable it in the
following conditions:

 1) Enable: The timer gets enabled (i.e. isEnabled is true?) on
Visit.get().isRefreshing() equal to 'true'.

 2) Disable: The timer gets disabled (i.e. isEnabled is false?) on
Visit.get().isRefreshing() equal to 'false'.

I simply only want the timer to tick when the refreshing process via the
worker is occuring and not otherwise.

I hope this is clear... Any thoughts? This is with 1.3.5 Wicket.

Many thanks for your time, Graeme.
-- 
View this message in context: 
http://www.nabble.com/isEnabled-on-AjaxSelfUpdatingTimerBehavior.-tp20532502p20532502.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Adding/Removing a AjaxSelfUpdatingTimerBehavior...

2008-11-16 Thread Graeme Knight

Oh. I'm wondering: https://issues.apache.org/jira/browse/WICKET-1525

Perhaps there is another way?


Graeme Knight wrote:
> 
> Maybe I'm trying to do something silly. Is there an alternative?
> 
> 
> Graeme Knight wrote:
>> 
>> Hi.
>> 
>> What's the best way of achieving this effect:
>> 
>> 1) Button is pressed to start a process.
>> 2) Updating of various panels contained within a WebMarkupContainer
>> occurs on a 5 second period.
>> 3) Process stops and updating of WebMarkupContainer also stops.
>> 
>> I understand the use of AjaxSelfUpdatingTimerBehavior - this really is a
>> question of the best way to add/remove from the WebMarkupContainer on
>> demand, or enable/disable on demand.
>> 
>> Any thoughts most welcome.
>> 
>> Rgds, Graeme.
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Adding-Removing-a-AjaxSelfUpdatingTimerBehavior...-tp20520576p20530559.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Adding/Removing a AjaxSelfUpdatingTimerBehavior...

2008-11-16 Thread Graeme Knight

Maybe I'm trying to do something silly. Is there an alternative?


Graeme Knight wrote:
> 
> Hi.
> 
> What's the best way of achieving this effect:
> 
> 1) Button is pressed to start a process.
> 2) Updating of various panels contained within a WebMarkupContainer occurs
> on a 5 second period.
> 3) Process stops and updating of WebMarkupContainer also stops.
> 
> I understand the use of AjaxSelfUpdatingTimerBehavior - this really is a
> question of the best way to add/remove from the WebMarkupContainer on
> demand, or enable/disable on demand.
> 
> Any thoughts most welcome.
> 
> Rgds, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/Adding-Removing-a-AjaxSelfUpdatingTimerBehavior...-tp20520576p20527143.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Adding/Removing a AjaxSelfUpdatingTimerBehavior...

2008-11-15 Thread Graeme Knight

Hi.

What's the best way of achieving this effect:

1) Button is pressed to start a process.
2) Updating of various panels contained within a WebMarkupContainer occurs
on a 5 second period.
3) Process stops and updating of WebMarkupContainer also stops.

I understand the use of AjaxSelfUpdatingTimerBehavior - this really is a
question of the best way to add/remove from the WebMarkupContainer on
demand, or enable/disable on demand.

Any thoughts most welcome.

Rgds, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Adding-Removing-a-AjaxSelfUpdatingTimerBehavior...-tp20520576p20520576.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IDataProvider Implementation.

2008-11-11 Thread Graeme Knight

Hi guys,

I am using hibernate and it is caching (which is great) so that overhead is
not a problem -

after some reflection I think it appears to me that because you get rid of
the loadabledetachablemodel to 'save database hits' (which if cached,
doesn't really) then the affect is more serialized data. Bad.

Got it.

Thanks, Graeme.
 

Martijn Dashorst wrote:
> 
> That, and that typically your ORM (hibernate, etc) will put the object
> in second level cache. The LDM should hit that cache most of the time
> between requests.
> 
> Martijn
> 
> On Tue, Nov 11, 2008 at 3:58 PM, Erik van Oosten <[EMAIL PROTECTED]>
> wrote:
>> Not a good idea for large objects. A few days back I improved load time
>> of a
>> page from more then 40 sec to about 5 sec by replacing "new
>> Model(object)"
>> with a proper LoadableDetachableModel.
>>
>> Nevertheless, there is no reason to let the LoadableDetachableModel get
>> the
>> object if you already have it, just pass the object to the constructor!
>>
>> E.g. see first ctor below.
>>
>> public class LoadableMemberModel
>>   extends LoadableDetachableModel {
>>
>>   @SpringBean
>>   private MemberService memberService;
>>
>>   private long memberId;
>>
>>   //
>>   // Constructor that has object has direct parameter
>>   //
>>   public LoadableMemberModel(Member member) {
>>   super(member);
>>   this.memberId = member.getId();
>>   }
>> *
>> *public LoadableMemberModel(long memberId) {
>>   this.memberId = memberId;
>>   }
>>
>>   protected Member load() {
>>   InjectorHolder.getInjector().inject(this);
>>   return memberService.getById(memberId);
>>   }
>> }
>>
>>
>>
>> Regards,
>>   Erik.
>>
>>
>> Graeme Knight wrote:
>>>
>>> Hey Jeremy,
>>>
>>> Thanks for the heads up - actually that's what I ended up doing this
>>> morning. Works like a charm!
>>>
>>> Cheers, Graeme.
>>>
>>>
>>> Jeremy Thomerson-5 wrote:
>>>
>>>>
>>>> In my apps, I bring them all in whenever the first call to iterator or
>>>> size
>>>> is done, and cache them until detach.  It's a very reasonable pattern.
>>>> Then
>>>> in the model method, I basically do new Model(object)
>>>>
>>>>
>>>> --
>>>> Jeremy Thomerson
>>>> http://www.wickettraining.com
>>>>
>>>>
>>>> On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight <[EMAIL PROTECTED]>
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> Hi.
>>>>>
>>>>> From the examples I've seen the IDataProvider implementation of the
>>>>> iterator
>>>>> method brings back (for example) a list of keys from the database.
>>>>>
>>>>> The model method uses something like a LoadableDetachableModel to
>>>>> populate
>>>>> a
>>>>> model for use by the consumer using the list of keys previously
>>>>> retrieved.
>>>>>
>>>>> This seems like a lot of database hits to me. Is this simply because
>>>>> of
>>>>> the
>>>>> serialization/model mechanism?
>>>>>
>>>>> It seems to me that the iterator could/should bring back the data in
>>>>> one
>>>>> hit
>>>>> and then after use be detached. Is this common?
>>>>>
>>>>> Many thanks, Graeme.
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.com/
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


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



Re: IDataProvider Implementation.

2008-11-11 Thread Graeme Knight

Hey Jeremy,

Thanks for the heads up - actually that's what I ended up doing this
morning. Works like a charm!

Cheers, Graeme.


Jeremy Thomerson-5 wrote:
> 
> In my apps, I bring them all in whenever the first call to iterator or
> size
> is done, and cache them until detach.  It's a very reasonable pattern. 
> Then
> in the model method, I basically do new Model(object)
> 
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi.
>>
>> From the examples I've seen the IDataProvider implementation of the
>> iterator
>> method brings back (for example) a list of keys from the database.
>>
>> The model method uses something like a LoadableDetachableModel to
>> populate
>> a
>> model for use by the consumer using the list of keys previously
>> retrieved.
>>
>> This seems like a lot of database hits to me. Is this simply because of
>> the
>> serialization/model mechanism?
>>
>> It seems to me that the iterator could/should bring back the data in one
>> hit
>> and then after use be detached. Is this common?
>>
>> Many thanks, Graeme.
>> --
>> View this message in context:
>> http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

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


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



IDataProvider Implementation.

2008-11-11 Thread Graeme Knight

Hi.

>From the examples I've seen the IDataProvider implementation of the iterator
method brings back (for example) a list of keys from the database.

The model method uses something like a LoadableDetachableModel to populate a
model for use by the consumer using the list of keys previously retrieved.

This seems like a lot of database hits to me. Is this simply because of the
serialization/model mechanism?

It seems to me that the iterator could/should bring back the data in one hit
and then after use be detached. Is this common?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: IDataProvider and Session related data.

2008-11-10 Thread Graeme Knight

Hey guys,

Thanks! Being dumb I forgot about YourCustomSession.get().getUser().getID()
for the second time this week (and yes, its only Monday)

That totally answers my questions!

Cheers, Graeme.


Graeme Knight wrote:
> 
> Hi. 
> 
> Just learning about IDataProvider and DataViews.
> 
> I've scoped out the repeaters examples but this may be a little
> different...
> 
> If I have a userId (for example stored in the Session) of the user as he
> is logged in and I wish to use that userId as a criteria for getting hold
> of the correct data using a IDataProvider call to a database (for a
> DataView list), then should I pass in the userID to the IDataProvider
> implementation and just store as a private variable? 
> 
> Is there a better way of getting hold of (or passing this) information
> into the IDataProvider implementation to limit storage/serialization?
> 
> Many thanks, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20429027.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



IDataProvider and Session related data.

2008-11-10 Thread Graeme Knight

Hi. 

Just learning about IDataProvider and DataViews.

I've scoped out the repeaters examples but this may be a little different...

If I have a userId (for example stored in the Session) of the user as he is
logged in and I wish to use that userId as a criteria for getting hold of
the correct data using a IDataProvider (for a DataView list), then should I
pass in the userID to the IDataProvider implementation and just store as a
private variable? 

Is there a better way of getting hold of (or passing this) information into
the IDataProvider implementation to limit storage/serialization?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IDataProvider-and-Session-related-data.-tp20428354p20428354.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: LoadableDetachableModels with replicated data fed in through constructors.

2008-11-08 Thread Graeme Knight

Timo,

You are the man! Thanks!  

  long userId = MySession.get().getUser().getId() 

Of course!

Cheers, Graeme.



Timo Rantalaiho wrote:
> 
> On Thu, 06 Nov 2008, Graeme Knight wrote:
>> perform a task of getting data from a database. Each model is dependent
>> on a
>> couple of pieces of information (1) an identifier about the current user
>> (2)
>> a primary key of a parent data object. I'm trying to work out the
>> mechanics
> 
> If "the current user" means what it sounds like, I would 
> probably have it stored in the Wicket Session and get it
> each time like this
> 
>   long userId = MySession.get().getUser().getId()
> 
> (Or you can make your user available in a custom ThreadLocal
> which is populated and depopulated in a custom RequestCycle.)
> 
>> Now my example above is not too bad resource wize - you may only be
>> talking
>> about a couple of Longs being serialized ten times (not a massive hit),
>> but
>> what about if the objects in my LoadableDetachableModel are fairly big?
> 
> The point of LoadableDetachableModel is to store in it only
> so little data that it doesn't matter, but load the big data
> again in load() on each request that needs it. The big data 
> is referenced directly only during the request, so it does
> not get serialised.
> 
>> Is there a way of destructing and reconstructing the model automatically
>> so
>> I don't need to worry about this serialization of the model private data?
> 
> The only automatic part is that if the model is "the default
> model" of a rendered component, its detach() will be called
> automatically at the end of the request processing. The 
> wrapping models that come with Wicket also detach their
> wrapped models in their own detach() (and any custom model
> should in general do the same).
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho   
> Reaktor Innovations Oyhttp://www.ri.fi/ >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModels-with-replicated-data-fed-in-through-constructors.-tp20374062p20402019.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: LoadableDetachableModels with replicated data fed in through constructors.

2008-11-07 Thread Graeme Knight

Thanks Jeremy.

I have those conversations often - especially over silly things.

I need to go back and look at the ins and outs of serialization. I guess if
I have several private references to the same object in multiple
LoadableDetachableModels I guess the actual object itself only gets
serialized once (i.e. there are never multiple copies of it being stored
over time on disk)... Not to concerned. Just a mad moment :-) One of many
:-) More to come :-)

Cheers, Graeme. 


Jeremy Thomerson-5 wrote:
> 
> I hate to interrupt your conversation with yourself (I've had those days
> myself) :)
> 
> Basically, I would say you needn't worry so much about serializing a
> couple
> of Longs - that's the point of the LoadableDetachableModel - serializing a
> couple of Longs rather than dozens (or hundreds) of User / Customer /
> Article / WhateverYourDomainObject instances.
> 
> You can't make the private variables in your example transient - then they
> wouldn't get serialized, which means they wouldn't be available later when
> the page is deserialized and the model is supposed to reinflate itself.
> 
> Hope this helps put your mind at ease.  Get some rest.  :)
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> On Thu, Nov 6, 2008 at 9:58 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Oh - tired! Long hard days working with spaghetti in my day job and
>> lasagna
>> in my night time...
>>
>> I realized this may be a dumb question. Doesn't an object only get
>> serialized once no matter how many references would be made to it in a
>> LoadableDetatchableModel? I.e. you wouldn't get 10 userIds serialized,
>> just
>> 1... (which would be just peachy and fine).
>>
>> Thanks, Graeme. :-)
>>
>>
>> Graeme Knight wrote:
>> >
>> > Hi.
>> >
>> > I have a number of LoadableDetachableModels that are each designed to
>> > perform a task of getting data from a database. Each model is dependent
>> on
>> > a couple of pieces of information (1) an identifier about the current
>> user
>> > (2) a primary key of a parent data object. I'm trying to work out the
>> > mechanics and life cycle of the model object...
>> >
>> > So, my class might look like:
>> >
>> > public class GetAccountsModel extends LoadableDetachableModel
>> > {
>> > private Long userId;
>> > private Long parentPrimaryKey;
>> >
>> >public GetAccountsModel( Long userId, Long parentPrimaryKey )
>> >{
>> >   this.userId = userId;
>> >   this.parentPrimaryKey = parentPrimaryKey;
>> >}
>> >
>> >.. override load here .
>> > }
>> >
>> > Let's say I have ten similar LoadableDetachableModels all of which take
>> > the same parameters in the constructor, but all of which return
>> different
>> > data from the database.
>> >
>> > When I create a LoadableDetachableModel as above and call the super
>> > constructor of (for example) a ListView, the model is fed into the
>> > ListView and load is called (with the transient object being detached).
>> >
>> > The userId and primaryKey get serialized. So if I have ten similar
>> models
>> > which get different data, I am serializing the same (or very similar)
>> data
>> > 10 times, specifically the userid.
>> >
>> > If figured I could probably make the userID and primaryKey transient
>> then
>> > they would not serialize. I'm not sure if this would have a negative
>> > affect if I go to another page (i.e. current page is out of memory) and
>> > come back - what happens?
>> >
>> > Now my example above is not too bad resource wize - you may only be
>> > talking about a couple of Longs being serialized ten times (not a
>> massive
>> > hit), but what about if the objects in my LoadableDetachableModel are
>> > fairly big?
>> >
>> > Is there a way of destructing and reconstructing the model
>> automatically
>> > so I don't need to worry about this serialization of the model private
>> > data?
>> >
>> > Or... am I panicking about nothing? I may be completely
>> misunderstanding
>> > the whole concept here.
>> >
>> > Any explanation welcome - I appreciate your time reading this post.
>> >
>> > Thanks, Graeme.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/LoadableDetachableModels-with-replicated-data-fed-in-through-constructors.-tp20374062p20374412.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModels-with-replicated-data-fed-in-through-constructors.-tp20374062p20380030.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: LoadableDetachableModels with replicated data fed in through constructors.

2008-11-06 Thread Graeme Knight

Oh - tired! Long hard days working with spaghetti in my day job and lasagna
in my night time... 

I realized this may be a dumb question. Doesn't an object only get
serialized once no matter how many references would be made to it in a
LoadableDetatchableModel? I.e. you wouldn't get 10 userIds serialized, just
1...

Thanks, Graeme. :-)


Graeme Knight wrote:
> 
> Hi.
> 
> I have a number of LoadableDetachableModels that are each designed to
> perform a task of getting data from a database. Each model is dependent on
> a couple of pieces of information (1) an identifier about the current user
> (2) a primary key of a parent data object. I'm trying to work out the
> mechanics and life cycle of the model object...
> 
> So, my class might look like:
> 
> public class GetAccountsModel extends LoadableDetachableModel
> {
> private Long userId;
> private Long parentPrimaryKey;
> 
>public GetAccountsModel( Long userId, Long parentPrimaryKey )
>{
>   this.userId = userId;
>   this.parentPrimaryKey = parentPrimaryKey;
>}
> 
>.. override load here .
> }
> 
> Let's say I have ten similar LoadableDetachableModels all of which take
> the same parameters in the constructor, but all of which return different
> data from the database.
> 
> When I create a LoadableDetachableModel as above and call the super
> constructor of (for example) a ListView, the model is fed into the
> ListView and load is called (with the transient object being detached). 
> 
> The userId and primaryKey get serialized. So if I have ten similar models
> which get different data, I am serializing the same (or very similar) data
> 10 times, specifically the userid.
> 
> If figured I could probably make the userID and primaryKey transient then
> they would not serialize. I'm not sure if this would have a negative
> affect if I go to another page (i.e. current page is out of memory) and
> come back - what happens?
> 
> Now my example above is not too bad resource wize - you may only be
> talking about a couple of Longs being serialized ten times (not a massive
> hit), but what about if the objects in my LoadableDetachableModel are
> fairly big?
> 
> Is there a way of destructing and reconstructing the model automatically
> so I don't need to worry about this serialization of the model private
> data?
> 
> Or... am I panicking about nothing? I may be completely misunderstanding
> the whole concept here.
> 
> Any explanation welcome - I appreciate your time reading this post.
> 
> Thanks, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModels-with-replicated-data-fed-in-through-constructors.-tp20374062p20374412.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



LoadableDetachableModels with replicated data fed in through constructors.

2008-11-06 Thread Graeme Knight

Hi.

I have a number of LoadableDetachableModels that are each designed to
perform a task of getting data from a database. Each model is dependent on a
couple of pieces of information (1) an identifier about the current user (2)
a primary key of a parent data object. I'm trying to work out the mechanics
and life cycle of the model object...

So, my class might look like:

public class GetAccountsModel extends LoadableDetachableModel
{
private Long userId;
private Long parentPrimaryKey;

   public GetAccountsModel( Long userId, Long parentPrimaryKey )
   {
  this.userId = userId;
  this.parentPrimaryKey = parentPrimaryKey;
   }

   .. override load here .
}

Let's say I have ten similar LoadableDetachableModels all of which take the
same parameters in the constructor, but all of which return different data
from the database.

When I create a LoadableDetachableModel as above and call the super
constructor of (for example) a ListView, the model is fed into the ListView
and load is called (with the transient object being detached). 

The userId and primaryKey get serialized. So if I have ten similar models
which get different data, I am serializing the same (or very similar) data
10 times, specifically the userid.

If figured I could probably make the userID and primaryKey transient then
they would not serialize. I'm not sure if this would have a negative affect
if I go to another page (i.e. current page is out of memory) and come back -
what happens?

Now my example above is not too bad resource wize - you may only be talking
about a couple of Longs being serialized ten times (not a massive hit), but
what about if the objects in my LoadableDetachableModel are fairly big?

Is there a way of destructing and reconstructing the model automatically so
I don't need to worry about this serialization of the model private data?

Or... am I panicking about nothing? I may be completely misunderstanding the
whole concept here.

Any explanation welcome.

Regards, Graeme.
-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModels-with-replicated-data-fed-in-through-constructors.-tp20374062p20374062.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Moving from Tapestry to Wicket?

2008-11-04 Thread Graeme Knight

Hey Eelco!

Awesome! Thanks for your answers - they really helped. I appreciate the
time. BTW, Wicket in Action is a really well written book compared to others
in the genre. Thanks to you and Martijn for the hard work! It came at the
right time for me and we have decided to make the move from Tapestry.

Let you know how it goes, and I'll be on the forums plenty I am sure!

Cheers, Graeme.


Eelco Hillenius wrote:
> 
>> Honestly in our application (we have a roadmap for scalability) we are
>> likely to get several hundred concurrent sessions per server with a few
>> kb
>> of state stored in the HTTPSession. Its not that much.
> 
> That's definitively no problem for even a very modest setup.
> 
>> What I was more
>> concerned about was Page storage and storage that I can't control (for
>> example, if I couldn't control IModel storage I would be concerned).
> 
> Well, when using any framework that abstracts stuff for you, you'll
> trade convenience for transparency. I believe Wicket's architecture is
> very open and it is easy enough to customize how it works for what you
> want, but the more you want to deviate from the default, the more work
> it'll be. I think you should just build the darn thing and optimize
> when you have proof (through load testing for instance) that you are
> hitting a bottle neck. :-)
> 
> Do try to work with detachable models (LoadableDetachableModel is my
> favorite) where you can, because that will save considerably
> especially with complex domain models and avoid lazy loading problems
> with frameworks like Hibernate.
> 
>> We are unlikely to have spikes of traffic, but we are more likely to have
>> dribs and drabs of users who potentially keep sessions open for perhaps
>> minutes to hours.
> 
> Not a problem at all.
> 
>> For our initial scaling the client will have an affinity to a specific
>> server. We can control the number of users that we have on a server. We
>> can
>> then scale our servers horizontally if we hit a scaling issue on one of
>> the
>> servers. I'm starting not to worry about it too much.
> 
> Yeah, with just a few hundred users clustering won't be much of a
> problem either. Once you start to hit tens of thousands of concurrent
> sessions you have to take this stuff more seriously, but until then in
> my experience you'll be tweaking your database and business logic etc
> way before Wicket gets to be in the way :-)
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Moving-from-Tapestry-to-Wicket--tp20254394p20328386.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Feedback/Error message.

2008-11-04 Thread Graeme Knight

Hey!

Cool - add a feedback panel then set error - I like that! I didn't get to
that part in the Wicket in Action as yet but I see how it works!

Actually - my authentication method is very similar to the one on the book
(again not got to that part yet), so I'm pretty psyched I'm heading in the
right direction!

I'm assuming if I wanted a panel with an icon and an error message I just
create a component with a feedback panel and an image and populate
accordingly?

Cheers, Graeme.


igor.vaynberg wrote:
> 
> On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
>> 3) onSubmit authenticates against the database through a load on a
>> LoadableDetachableModel, and returns the result as the model's object.
> 
> ^ sounds interesting...paste your code.
> 
> -igor
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


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



Feedback/Error message.

2008-11-03 Thread Graeme Knight

Hi.

Loving Wicket so far! I had a search and had trouble finding the answer to
this one, if anyone can help:

1) I have a simple form with username/password and a submit button.

2) User enters username/password and hits submit.

3) onSubmit authenticates against the database through a load on a
LoadableDetachableModel, and returns the result as the model's object.

Let's say there is an error on authenticating against the database - what is
the easiest way of giving the user feedback that his username/password was
wrong? I naively thought I might be able to do some sort of conditional
insert of a component into the page or form (similar to Tapestry).

My solution was then to add a panel (regular not feedback) to the page which
consists of an error icon and a custom message. I would like to update this
component on the re-render so it doesn't display if there isn't a problem,
but it does if there is a problem (couldn't get isVisible working this way). 

What's the Wicket way?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Feedback-Error-message.-tp20315444p20315444.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How does serialization work?

2008-11-03 Thread Graeme Knight

Thanks Igor! A great help! 

Where on disk are these serialized pages? I remember reading you only cache
the current page in memory. Is that correct? This serializing on disk - what
is the strategy for keeping these files in sync in a clustered environment?

Appreciate the help very much! Graeme.


igor.vaynberg wrote:
> 
> it is cleaned up when the session expires. it used to be that we only
> kept X last pages in the store, but now that we use disc that seems to
> be redundant.
> 
> -igor
> 
> On Mon, Nov 3, 2008 at 4:08 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi.
>>
>> I wondered another thing - how and when are the serialized objects
>> cleaned
>> up? Is there a mechanism for making sure large amounts of memory or disk
>> are
>> not soaked up by long running sessions and lots of user interactions?
>>
>> Thanks again, Graeme.
>>
>>
>> Graeme Knight wrote:
>>>
>>> Timo!
>>>
>>> Thanks for your answers - so you think its better NOT to have the
>>> components as private member variables? I may misunderstand...
>>>
>>> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world
>>> into
>>> the Wicket world...
>>>
>>> Wicket in Action - VERY readable and well written, but perhaps I didn't
>>> get far enough along to get to the serialization parts (I'm just
>>> beginning
>>> Part 2).
>>>
>>> Cheers, Graeme.
>>>
>>> Timo Rantalaiho wrote:
>>>>
>>>> On Mon, 03 Nov 2008, GK1971 wrote:
>>>>> through the forum but couldn't find the answer. Couldn't find the
>>>>> answers
>>>>> from Tapestry in Action (I'm sure they are there if anyone can point
>>>>> me
>>>>> at a
>>>>> page).
>>>>
>>>> You might want to have a look at Wicket in Action :--)
>>>>
>>>>> 1) Exactly WHAT is getting serialized and where and when?
>>>>
>>>> The page, which includes its whole Component tree.
>>>>
>>>>> 2) What are the main classes in the framework responsible for
>>>>> serialization
>>>>> that I can look at (I have the source)? I guess I am after
>>>>> understanding
>>>>> the
>>>>> flow of logic.
>>>>
>>>> I find it easiest to start from Session.requestDetached().
>>>> There you have
>>>>
>>>>   page.getPageMap().put(page);
>>>>
>>>>   =>
>>>>
>>>>   SecondLevelCacheSessionStore.put(Page)
>>>>
>>>>   =>
>>>>
>>>>   DiskPageStore.storePage(String sessionId, Page page)
>>>>
>>>> and there's already stuff about serialisation.
>>>>
>>>> I'm sure that someone can give you a more scientific answer :)
>>>>
>>>>> 3) What happens if I make userIdField and passwordField scoped to the
>>>>> constructor only? Is it common not to have them as member objects and
>>>>> why?
>>>>> (I've not tried this yet, just wondered).
>>>>
>>>> In here
>>>>
>>>>> add( userIdField );
>>>>> add( passwordField );
>>>>
>>>> you add them as children of the constructed component.
>>>> You can always access them for example with a visitor, if
>>>> needed, and holding references to them makes it harder to
>>>> replace them if needed (though it shouldn't be a problem if
>>>> they won't be replaced).
>>>>
>>>> Best wishes,
>>>> Timo
>>>>
>>>> --
>>>> Timo Rantalaiho
>>>> Reaktor Innovations Oyhttp://www.ri.fi/ >
>>>>
>>>> -
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20313794.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How does serialization work?

2008-11-03 Thread Graeme Knight

Hi.

I wondered another thing - how and when are the serialized objects cleaned
up? Is there a mechanism for making sure large amounts of memory or disk are
not soaked up by long running sessions and lots of user interactions?

Thanks again, Graeme.


Graeme Knight wrote:
> 
> Timo!
> 
> Thanks for your answers - so you think its better NOT to have the
> components as private member variables? I may misunderstand...
> 
> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world into
> the Wicket world... 
> 
> Wicket in Action - VERY readable and well written, but perhaps I didn't
> get far enough along to get to the serialization parts (I'm just beginning
> Part 2).
> 
> Cheers, Graeme.
> 
> Timo Rantalaiho wrote:
>> 
>> On Mon, 03 Nov 2008, GK1971 wrote:
>>> through the forum but couldn't find the answer. Couldn't find the
>>> answers
>>> from Tapestry in Action (I'm sure they are there if anyone can point me
>>> at a
>>> page).
>> 
>> You might want to have a look at Wicket in Action :--)
>> 
>>> 1) Exactly WHAT is getting serialized and where and when?
>> 
>> The page, which includes its whole Component tree.
>> 
>>> 2) What are the main classes in the framework responsible for
>>> serialization
>>> that I can look at (I have the source)? I guess I am after understanding
>>> the
>>> flow of logic.
>> 
>> I find it easiest to start from Session.requestDetached().
>> There you have
>> 
>>   page.getPageMap().put(page);
>> 
>>   =>
>> 
>>   SecondLevelCacheSessionStore.put(Page)
>> 
>>   =>
>> 
>>   DiskPageStore.storePage(String sessionId, Page page)
>> 
>> and there's already stuff about serialisation.
>> 
>> I'm sure that someone can give you a more scientific answer :)
>> 
>>> 3) What happens if I make userIdField and passwordField scoped to the
>>> constructor only? Is it common not to have them as member objects and
>>> why?
>>> (I've not tried this yet, just wondered).
>> 
>> In here
>> 
>>> add( userIdField );
>>> add( passwordField );
>> 
>> you add them as children of the constructed component. 
>> You can always access them for example with a visitor, if 
>> needed, and holding references to them makes it harder to 
>> replace them if needed (though it shouldn't be a problem if 
>> they won't be replaced).
>> 
>> Best wishes,
>> Timo
>> 
>> -- 
>> Timo Rantalaiho   
>> Reaktor Innovations Oyhttp://www.ri.fi/ >
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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