You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeremy Colton <js...@gmail.com> on 2009/06/06 22:07:12 UTC

How to set a form's target to an iframe?

Hi,

I am creating a form that performs a file upload.  Rather than have the
form's page update once the onSubmit() ends, I want the form's target
attribute to specify an iframe and have the iframe update instead.

How do i do this?

Many thanks
Jeremy C.

Re: How to set a form's target to an iframe?

Posted by Igor Vaynberg <ig...@gmail.com>.
oncomponenttagbody is called for every render, just like
oncomponenttag and onbeforerender.

-igor


On Sat, Jun 6, 2009 at 10:58 PM, Jeremy2009<js...@gmail.com> wrote:
>
> Thanks for letting me know about this class - never came across it before.
>
> But, I realised I can just call SetResponsePage() at the end of my
> onSubmit() to load the IFrame again.  This then calls a javascript method in
> the parent panel to cause an Ajax request so I can update various UI
> components.  I am adding a WebComponent in my Iframe which adds the
> Javascript method call.
>
> I noticed that this web component's onComponentTagBody() is always called
> twice ie there are 2 requests from the browser to render this iframe.  Have
> you seen this before?
>
> Many thanks for your super-fast responses yesterday.
> Jeremy
>
>
> igor.vaynberg wrote:
>>
>> form onsubmit() { setrequesttarget(new emptyrequesttarget()); }
>>
>> -igor
>>
>> On Sat, Jun 6, 2009 at 4:13 PM, Jeremy2009<js...@gmail.com> wrote:
>>>
>>> thanks...
>>>
>>>
>>> But I have realised that this approach is flawed since Wicket is
>>> attemtping
>>> to render the parent panel's page in the Iframe which is not my
>>> intention.
>>>
>>> I just wanted the empty iframe to be re-rendered on its own.  Any idea
>>> how i
>>> can do this?
>>>
>>> Thanks
>>> Jeremy
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> at the same place where you are instntiating the form...
>>>>
>>>> -igor
>>>>
>>>> On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>
>>>>> I instantiate my Iframe in the panel's onBeforeRender() to ensure
>>>>> there's
>>>>> a
>>>>> page to attach the iFrame to.
>>>>>
>>>>> I think the oncomponenttag() happens before the onBeforeRender() which
>>>>> means
>>>>> that if i do:
>>>>>
>>>>> tag.put("target", myIFrame.getMarkupId());
>>>>>
>>>>> myIFrame is null.
>>>>>
>>>>> So, where can I instantiate my Iframe to ensure I can pass it's ref. to
>>>>> the
>>>>> panel's oncomponenttag method?
>>>>>
>>>>> Sorry if i'm missing something obvious...
>>>>> Thanks
>>>>> Jeremy
>>>>>
>>>>>
>>>>>
>>>>> igor.vaynberg wrote:
>>>>>>
>>>>>> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
>>>>>> }});
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>>>
>>>>>>> I am trying to simulate an ajax file upload by having my form's
>>>>>>> target
>>>>>>> specify an iframe.  So that once the form's onsubmit() ends, the
>>>>>>> iframe
>>>>>>> will
>>>>>>> re-render instead of the panel that contains the upload form.  On
>>>>>>> being
>>>>>>> re-rendered it will contain some javascript that will call another
>>>>>>> piece
>>>>>>> of
>>>>>>> javascript in the parent panel that will send an ajax request to the
>>>>>>> server
>>>>>>> therefore allowing me to simulate an ajax upload.
>>>>>>>
>>>>>>> So, I want to instantiate an iframe, add it to the parent panel and
>>>>>>> then
>>>>>>> have the form's target in the parent panel point to the iframe.  How
>>>>>>> do
>>>>>>> i
>>>>>>> know what value to put in the target?
>>>>>>>
>>>>>>> Eg in my HTML i have:
>>>>>>>
>>>>>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>>>>>> name="myIFrame"></iframe>
>>>>>>>
>>>>>>> <form .... target="myIFrame">
>>>>>>> .
>>>>>>> .
>>>>>>> </form>
>>>>>>>
>>>>>>> Wicket will be ok with this?
>>>>>>>
>>>>>>> Many thanks
>>>>>>> J
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> igor.vaynberg wrote:
>>>>>>>>
>>>>>>>> what exactly do you want to know? how to add a target tag to the
>>>>>>>> form?
>>>>>>>>
>>>>>>>> <form wicket:id="form" target="foo"></form>
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I am creating a form that performs a file upload.  Rather than have
>>>>>>>>> the
>>>>>>>>> form's page update once the onSubmit() ends, I want the form's
>>>>>>>>> target
>>>>>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>>>>>
>>>>>>>>> How do i do this?
>>>>>>>>>
>>>>>>>>> Many thanks
>>>>>>>>> Jeremy C.
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906487.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23907952.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to set a form's target to an iframe?

Posted by Jeremy2009 <js...@gmail.com>.
 I checkd the http requests and it seems that there are 2 coming from the
browser to Wicket for the iframe.  This results in the iframe's
oncomponenttagbody() being called twice.

Any idea why there are 2 requests being generated??

Many thanks
J


Jeremy2009 wrote:
> 
> Thanks for letting me know about this class - never came across it before.
> 
> But, I realised I can just call SetResponsePage() at the end of my
> onSubmit() to load the IFrame again.  This then calls a javascript method
> in the parent panel to cause an Ajax request so I can update various UI
> components.  I am adding a WebComponent in my Iframe which adds the
> Javascript method call.
> 
> I noticed that this web component's onComponentTagBody() is always called
> twice ie there are 2 requests from the browser to render this iframe. 
> Have you seen this before?
> 
> Many thanks for your super-fast responses yesterday.
> Jeremy
> 
> 
> igor.vaynberg wrote:
>> 
>> form onsubmit() { setrequesttarget(new emptyrequesttarget()); }
>> 
>> -igor
>> 
>> On Sat, Jun 6, 2009 at 4:13 PM, Jeremy2009<js...@gmail.com> wrote:
>>>
>>> thanks...
>>>
>>>
>>> But I have realised that this approach is flawed since Wicket is
>>> attemtping
>>> to render the parent panel's page in the Iframe which is not my
>>> intention.
>>>
>>> I just wanted the empty iframe to be re-rendered on its own.  Any idea
>>> how i
>>> can do this?
>>>
>>> Thanks
>>> Jeremy
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> at the same place where you are instntiating the form...
>>>>
>>>> -igor
>>>>
>>>> On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>
>>>>> I instantiate my Iframe in the panel's onBeforeRender() to ensure
>>>>> there's
>>>>> a
>>>>> page to attach the iFrame to.
>>>>>
>>>>> I think the oncomponenttag() happens before the onBeforeRender() which
>>>>> means
>>>>> that if i do:
>>>>>
>>>>> tag.put("target", myIFrame.getMarkupId());
>>>>>
>>>>> myIFrame is null.
>>>>>
>>>>> So, where can I instantiate my Iframe to ensure I can pass it's ref.
>>>>> to
>>>>> the
>>>>> panel's oncomponenttag method?
>>>>>
>>>>> Sorry if i'm missing something obvious...
>>>>> Thanks
>>>>> Jeremy
>>>>>
>>>>>
>>>>>
>>>>> igor.vaynberg wrote:
>>>>>>
>>>>>> add(new form(..) { oncomponenttag(tag) {
>>>>>> tag.put("target","whatever");
>>>>>> }});
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>>>
>>>>>>> I am trying to simulate an ajax file upload by having my form's
>>>>>>> target
>>>>>>> specify an iframe.  So that once the form's onsubmit() ends, the
>>>>>>> iframe
>>>>>>> will
>>>>>>> re-render instead of the panel that contains the upload form.  On
>>>>>>> being
>>>>>>> re-rendered it will contain some javascript that will call another
>>>>>>> piece
>>>>>>> of
>>>>>>> javascript in the parent panel that will send an ajax request to the
>>>>>>> server
>>>>>>> therefore allowing me to simulate an ajax upload.
>>>>>>>
>>>>>>> So, I want to instantiate an iframe, add it to the parent panel and
>>>>>>> then
>>>>>>> have the form's target in the parent panel point to the iframe.  How
>>>>>>> do
>>>>>>> i
>>>>>>> know what value to put in the target?
>>>>>>>
>>>>>>> Eg in my HTML i have:
>>>>>>>
>>>>>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>>>>>> name="myIFrame"></iframe>
>>>>>>>
>>>>>>> <form .... target="myIFrame">
>>>>>>> .
>>>>>>> .
>>>>>>> </form>
>>>>>>>
>>>>>>> Wicket will be ok with this?
>>>>>>>
>>>>>>> Many thanks
>>>>>>> J
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> igor.vaynberg wrote:
>>>>>>>>
>>>>>>>> what exactly do you want to know? how to add a target tag to the
>>>>>>>> form?
>>>>>>>>
>>>>>>>> <form wicket:id="form" target="foo"></form>
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I am creating a form that performs a file upload.  Rather than
>>>>>>>>> have
>>>>>>>>> the
>>>>>>>>> form's page update once the onSubmit() ends, I want the form's
>>>>>>>>> target
>>>>>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>>>>>
>>>>>>>>> How do i do this?
>>>>>>>>>
>>>>>>>>> Many thanks
>>>>>>>>> Jeremy C.
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906487.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23908061.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to set a form's target to an iframe?

Posted by Jeremy2009 <js...@gmail.com>.
Thanks for letting me know about this class - never came across it before.

But, I realised I can just call SetResponsePage() at the end of my
onSubmit() to load the IFrame again.  This then calls a javascript method in
the parent panel to cause an Ajax request so I can update various UI
components.  I am adding a WebComponent in my Iframe which adds the
Javascript method call.

I noticed that this web component's onComponentTagBody() is always called
twice ie there are 2 requests from the browser to render this iframe.  Have
you seen this before?

Many thanks for your super-fast responses yesterday.
Jeremy


igor.vaynberg wrote:
> 
> form onsubmit() { setrequesttarget(new emptyrequesttarget()); }
> 
> -igor
> 
> On Sat, Jun 6, 2009 at 4:13 PM, Jeremy2009<js...@gmail.com> wrote:
>>
>> thanks...
>>
>>
>> But I have realised that this approach is flawed since Wicket is
>> attemtping
>> to render the parent panel's page in the Iframe which is not my
>> intention.
>>
>> I just wanted the empty iframe to be re-rendered on its own.  Any idea
>> how i
>> can do this?
>>
>> Thanks
>> Jeremy
>>
>> igor.vaynberg wrote:
>>>
>>> at the same place where you are instntiating the form...
>>>
>>> -igor
>>>
>>> On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>
>>>> I instantiate my Iframe in the panel's onBeforeRender() to ensure
>>>> there's
>>>> a
>>>> page to attach the iFrame to.
>>>>
>>>> I think the oncomponenttag() happens before the onBeforeRender() which
>>>> means
>>>> that if i do:
>>>>
>>>> tag.put("target", myIFrame.getMarkupId());
>>>>
>>>> myIFrame is null.
>>>>
>>>> So, where can I instantiate my Iframe to ensure I can pass it's ref. to
>>>> the
>>>> panel's oncomponenttag method?
>>>>
>>>> Sorry if i'm missing something obvious...
>>>> Thanks
>>>> Jeremy
>>>>
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>>
>>>>> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
>>>>> }});
>>>>>
>>>>> -igor
>>>>>
>>>>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>>
>>>>>> I am trying to simulate an ajax file upload by having my form's
>>>>>> target
>>>>>> specify an iframe.  So that once the form's onsubmit() ends, the
>>>>>> iframe
>>>>>> will
>>>>>> re-render instead of the panel that contains the upload form.  On
>>>>>> being
>>>>>> re-rendered it will contain some javascript that will call another
>>>>>> piece
>>>>>> of
>>>>>> javascript in the parent panel that will send an ajax request to the
>>>>>> server
>>>>>> therefore allowing me to simulate an ajax upload.
>>>>>>
>>>>>> So, I want to instantiate an iframe, add it to the parent panel and
>>>>>> then
>>>>>> have the form's target in the parent panel point to the iframe.  How
>>>>>> do
>>>>>> i
>>>>>> know what value to put in the target?
>>>>>>
>>>>>> Eg in my HTML i have:
>>>>>>
>>>>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>>>>> name="myIFrame"></iframe>
>>>>>>
>>>>>> <form .... target="myIFrame">
>>>>>> .
>>>>>> .
>>>>>> </form>
>>>>>>
>>>>>> Wicket will be ok with this?
>>>>>>
>>>>>> Many thanks
>>>>>> J
>>>>>>
>>>>>>
>>>>>>
>>>>>> igor.vaynberg wrote:
>>>>>>>
>>>>>>> what exactly do you want to know? how to add a target tag to the
>>>>>>> form?
>>>>>>>
>>>>>>> <form wicket:id="form" target="foo"></form>
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com>
>>>>>>> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am creating a form that performs a file upload.  Rather than have
>>>>>>>> the
>>>>>>>> form's page update once the onSubmit() ends, I want the form's
>>>>>>>> target
>>>>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>>>>
>>>>>>>> How do i do this?
>>>>>>>>
>>>>>>>> Many thanks
>>>>>>>> Jeremy C.
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906487.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23907952.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to set a form's target to an iframe?

Posted by Igor Vaynberg <ig...@gmail.com>.
form onsubmit() { setrequesttarget(new emptyrequesttarget()); }

-igor

On Sat, Jun 6, 2009 at 4:13 PM, Jeremy2009<js...@gmail.com> wrote:
>
> thanks...
>
>
> But I have realised that this approach is flawed since Wicket is attemtping
> to render the parent panel's page in the Iframe which is not my intention.
>
> I just wanted the empty iframe to be re-rendered on its own.  Any idea how i
> can do this?
>
> Thanks
> Jeremy
>
> igor.vaynberg wrote:
>>
>> at the same place where you are instntiating the form...
>>
>> -igor
>>
>> On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>>>
>>> I instantiate my Iframe in the panel's onBeforeRender() to ensure there's
>>> a
>>> page to attach the iFrame to.
>>>
>>> I think the oncomponenttag() happens before the onBeforeRender() which
>>> means
>>> that if i do:
>>>
>>> tag.put("target", myIFrame.getMarkupId());
>>>
>>> myIFrame is null.
>>>
>>> So, where can I instantiate my Iframe to ensure I can pass it's ref. to
>>> the
>>> panel's oncomponenttag method?
>>>
>>> Sorry if i'm missing something obvious...
>>> Thanks
>>> Jeremy
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
>>>> }});
>>>>
>>>> -igor
>>>>
>>>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>>
>>>>> I am trying to simulate an ajax file upload by having my form's target
>>>>> specify an iframe.  So that once the form's onsubmit() ends, the iframe
>>>>> will
>>>>> re-render instead of the panel that contains the upload form.  On being
>>>>> re-rendered it will contain some javascript that will call another
>>>>> piece
>>>>> of
>>>>> javascript in the parent panel that will send an ajax request to the
>>>>> server
>>>>> therefore allowing me to simulate an ajax upload.
>>>>>
>>>>> So, I want to instantiate an iframe, add it to the parent panel and
>>>>> then
>>>>> have the form's target in the parent panel point to the iframe.  How do
>>>>> i
>>>>> know what value to put in the target?
>>>>>
>>>>> Eg in my HTML i have:
>>>>>
>>>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>>>> name="myIFrame"></iframe>
>>>>>
>>>>> <form .... target="myIFrame">
>>>>> .
>>>>> .
>>>>> </form>
>>>>>
>>>>> Wicket will be ok with this?
>>>>>
>>>>> Many thanks
>>>>> J
>>>>>
>>>>>
>>>>>
>>>>> igor.vaynberg wrote:
>>>>>>
>>>>>> what exactly do you want to know? how to add a target tag to the form?
>>>>>>
>>>>>> <form wicket:id="form" target="foo"></form>
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com>
>>>>>> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am creating a form that performs a file upload.  Rather than have
>>>>>>> the
>>>>>>> form's page update once the onSubmit() ends, I want the form's target
>>>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>>>
>>>>>>> How do i do this?
>>>>>>>
>>>>>>> Many thanks
>>>>>>> Jeremy C.
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906487.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to set a form's target to an iframe?

Posted by Jeremy2009 <js...@gmail.com>.
thanks...


But I have realised that this approach is flawed since Wicket is attemtping
to render the parent panel's page in the Iframe which is not my intention.

I just wanted the empty iframe to be re-rendered on its own.  Any idea how i
can do this?

Thanks
Jeremy

igor.vaynberg wrote:
> 
> at the same place where you are instntiating the form...
> 
> -igor
> 
> On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>>
>> I instantiate my Iframe in the panel's onBeforeRender() to ensure there's
>> a
>> page to attach the iFrame to.
>>
>> I think the oncomponenttag() happens before the onBeforeRender() which
>> means
>> that if i do:
>>
>> tag.put("target", myIFrame.getMarkupId());
>>
>> myIFrame is null.
>>
>> So, where can I instantiate my Iframe to ensure I can pass it's ref. to
>> the
>> panel's oncomponenttag method?
>>
>> Sorry if i'm missing something obvious...
>> Thanks
>> Jeremy
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
>>> }});
>>>
>>> -igor
>>>
>>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>>
>>>> I am trying to simulate an ajax file upload by having my form's target
>>>> specify an iframe.  So that once the form's onsubmit() ends, the iframe
>>>> will
>>>> re-render instead of the panel that contains the upload form.  On being
>>>> re-rendered it will contain some javascript that will call another
>>>> piece
>>>> of
>>>> javascript in the parent panel that will send an ajax request to the
>>>> server
>>>> therefore allowing me to simulate an ajax upload.
>>>>
>>>> So, I want to instantiate an iframe, add it to the parent panel and
>>>> then
>>>> have the form's target in the parent panel point to the iframe.  How do
>>>> i
>>>> know what value to put in the target?
>>>>
>>>> Eg in my HTML i have:
>>>>
>>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>>> name="myIFrame"></iframe>
>>>>
>>>> <form .... target="myIFrame">
>>>> .
>>>> .
>>>> </form>
>>>>
>>>> Wicket will be ok with this?
>>>>
>>>> Many thanks
>>>> J
>>>>
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>>
>>>>> what exactly do you want to know? how to add a target tag to the form?
>>>>>
>>>>> <form wicket:id="form" target="foo"></form>
>>>>>
>>>>> -igor
>>>>>
>>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com>
>>>>> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am creating a form that performs a file upload.  Rather than have
>>>>>> the
>>>>>> form's page update once the onSubmit() ends, I want the form's target
>>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>>
>>>>>> How do i do this?
>>>>>>
>>>>>> Many thanks
>>>>>> Jeremy C.
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906487.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to set a form's target to an iframe?

Posted by Igor Vaynberg <ig...@gmail.com>.
at the same place where you are instntiating the form...

-igor

On Sat, Jun 6, 2009 at 3:20 PM, Jeremy2009<js...@gmail.com> wrote:
>
> I instantiate my Iframe in the panel's onBeforeRender() to ensure there's a
> page to attach the iFrame to.
>
> I think the oncomponenttag() happens before the onBeforeRender() which means
> that if i do:
>
> tag.put("target", myIFrame.getMarkupId());
>
> myIFrame is null.
>
> So, where can I instantiate my Iframe to ensure I can pass it's ref. to the
> panel's oncomponenttag method?
>
> Sorry if i'm missing something obvious...
> Thanks
> Jeremy
>
>
>
> igor.vaynberg wrote:
>>
>> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
>> }});
>>
>> -igor
>>
>> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>>
>>> I am trying to simulate an ajax file upload by having my form's target
>>> specify an iframe.  So that once the form's onsubmit() ends, the iframe
>>> will
>>> re-render instead of the panel that contains the upload form.  On being
>>> re-rendered it will contain some javascript that will call another piece
>>> of
>>> javascript in the parent panel that will send an ajax request to the
>>> server
>>> therefore allowing me to simulate an ajax upload.
>>>
>>> So, I want to instantiate an iframe, add it to the parent panel and then
>>> have the form's target in the parent panel point to the iframe.  How do i
>>> know what value to put in the target?
>>>
>>> Eg in my HTML i have:
>>>
>>> <iframe wicket:id="upload" frameborder="0" height="100"
>>> name="myIFrame"></iframe>
>>>
>>> <form .... target="myIFrame">
>>> .
>>> .
>>> </form>
>>>
>>> Wicket will be ok with this?
>>>
>>> Many thanks
>>> J
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> what exactly do you want to know? how to add a target tag to the form?
>>>>
>>>> <form wicket:id="form" target="foo"></form>
>>>>
>>>> -igor
>>>>
>>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> I am creating a form that performs a file upload.  Rather than have the
>>>>> form's page update once the onSubmit() ends, I want the form's target
>>>>> attribute to specify an iframe and have the iframe update instead.
>>>>>
>>>>> How do i do this?
>>>>>
>>>>> Many thanks
>>>>> Jeremy C.
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to set a form's target to an iframe?

Posted by Jeremy2009 <js...@gmail.com>.
I instantiate my Iframe in the panel's onBeforeRender() to ensure there's a
page to attach the iFrame to.

I think the oncomponenttag() happens before the onBeforeRender() which means
that if i do:

tag.put("target", myIFrame.getMarkupId());

myIFrame is null.

So, where can I instantiate my Iframe to ensure I can pass it's ref. to the
panel's oncomponenttag method?

Sorry if i'm missing something obvious...
Thanks
Jeremy



igor.vaynberg wrote:
> 
> add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever");
> }});
> 
> -igor
> 
> On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>>
>> I am trying to simulate an ajax file upload by having my form's target
>> specify an iframe.  So that once the form's onsubmit() ends, the iframe
>> will
>> re-render instead of the panel that contains the upload form.  On being
>> re-rendered it will contain some javascript that will call another piece
>> of
>> javascript in the parent panel that will send an ajax request to the
>> server
>> therefore allowing me to simulate an ajax upload.
>>
>> So, I want to instantiate an iframe, add it to the parent panel and then
>> have the form's target in the parent panel point to the iframe.  How do i
>> know what value to put in the target?
>>
>> Eg in my HTML i have:
>>
>> <iframe wicket:id="upload" frameborder="0" height="100"
>> name="myIFrame"></iframe>
>>
>> <form .... target="myIFrame">
>> .
>> .
>> </form>
>>
>> Wicket will be ok with this?
>>
>> Many thanks
>> J
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> what exactly do you want to know? how to add a target tag to the form?
>>>
>>> <form wicket:id="form" target="foo"></form>
>>>
>>> -igor
>>>
>>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I am creating a form that performs a file upload.  Rather than have the
>>>> form's page update once the onSubmit() ends, I want the form's target
>>>> attribute to specify an iframe and have the iframe update instead.
>>>>
>>>> How do i do this?
>>>>
>>>> Many thanks
>>>> Jeremy C.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23906116.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to set a form's target to an iframe?

Posted by Igor Vaynberg <ig...@gmail.com>.
add(new form(..) { oncomponenttag(tag) { tag.put("target","whatever"); }});

-igor

On Sat, Jun 6, 2009 at 1:26 PM, Jeremy2009<js...@gmail.com> wrote:
>
> I am trying to simulate an ajax file upload by having my form's target
> specify an iframe.  So that once the form's onsubmit() ends, the iframe will
> re-render instead of the panel that contains the upload form.  On being
> re-rendered it will contain some javascript that will call another piece of
> javascript in the parent panel that will send an ajax request to the server
> therefore allowing me to simulate an ajax upload.
>
> So, I want to instantiate an iframe, add it to the parent panel and then
> have the form's target in the parent panel point to the iframe.  How do i
> know what value to put in the target?
>
> Eg in my HTML i have:
>
> <iframe wicket:id="upload" frameborder="0" height="100"
> name="myIFrame"></iframe>
>
> <form .... target="myIFrame">
> .
> .
> </form>
>
> Wicket will be ok with this?
>
> Many thanks
> J
>
>
>
> igor.vaynberg wrote:
>>
>> what exactly do you want to know? how to add a target tag to the form?
>>
>> <form wicket:id="form" target="foo"></form>
>>
>> -igor
>>
>> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com> wrote:
>>> Hi,
>>>
>>> I am creating a form that performs a file upload.  Rather than have the
>>> form's page update once the onSubmit() ends, I want the form's target
>>> attribute to specify an iframe and have the iframe update instead.
>>>
>>> How do i do this?
>>>
>>> Many thanks
>>> Jeremy C.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: How to set a form's target to an iframe?

Posted by Jeremy2009 <js...@gmail.com>.
I am trying to simulate an ajax file upload by having my form's target
specify an iframe.  So that once the form's onsubmit() ends, the iframe will
re-render instead of the panel that contains the upload form.  On being
re-rendered it will contain some javascript that will call another piece of
javascript in the parent panel that will send an ajax request to the server
therefore allowing me to simulate an ajax upload.

So, I want to instantiate an iframe, add it to the parent panel and then
have the form's target in the parent panel point to the iframe.  How do i
know what value to put in the target?

Eg in my HTML i have:

<iframe wicket:id="upload" frameborder="0" height="100"
name="myIFrame"></iframe>

<form .... target="myIFrame">
.
.
</form>

Wicket will be ok with this?

Many thanks
J



igor.vaynberg wrote:
> 
> what exactly do you want to know? how to add a target tag to the form?
> 
> <form wicket:id="form" target="foo"></form>
> 
> -igor
> 
> On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com> wrote:
>> Hi,
>>
>> I am creating a form that performs a file upload.  Rather than have the
>> form's page update once the onSubmit() ends, I want the form's target
>> attribute to specify an iframe and have the iframe update instead.
>>
>> How do i do this?
>>
>> Many thanks
>> Jeremy C.
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-a-form%27s-target-to-an-iframe--tp23905147p23905277.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How to set a form's target to an iframe?

Posted by Igor Vaynberg <ig...@gmail.com>.
what exactly do you want to know? how to add a target tag to the form?

<form wicket:id="form" target="foo"></form>

-igor

On Sat, Jun 6, 2009 at 1:07 PM, Jeremy Colton<js...@gmail.com> wrote:
> Hi,
>
> I am creating a form that performs a file upload.  Rather than have the
> form's page update once the onSubmit() ends, I want the form's target
> attribute to specify an iframe and have the iframe update instead.
>
> How do i do this?
>
> Many thanks
> Jeremy C.
>

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