You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by taygolf <ta...@gmail.com> on 2008/05/05 16:51:46 UTC

AjaxLazyLoadPanel question

Hey guys,

I have a question about the lazyloadpanel. I have a modal window. in that
modal window I have a form with a ListChoice and an ajaxbutton. What I want
to do is have the entire modal window or the entire form lazyload. the
ListChoice can be very large sometime and I want do not want the page to
load until I have the executed the quesry that populates the listchoice and
saved the values in it.

I tried to create a div for the ajaxlazyloadpanel and simply put all the
code for the page in the allp but this did not work.

What do I need to do to make this happen? I don't know if I am just confused
about how this works or what. I have looked at the example on wicket stuff
but I am still confused

Here is the code I want to wrap in an ajaxlazyloadpanel:

final ListChoice list = createList();
		
Form form = new Form("form");
form.add(list);
final AjaxButton ajx = new AjaxButton("asubmit",form) {
    protected void onSubmit(AjaxRequestTarget target, Form form) {
            window.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback(){
            	public void onClose(AjaxRequestTarget target) {
                    targetField.setModelObject(list.getValue());
            	    target.addComponent(targetField);
            	} 
            });
            window.close(target);
    }
};
form.add(ajx);
add(form);

<html>
<body>
  <center>
    <div wicket:id="lazy">
	<form wicket:id="form">
	  <select wicket:id="pickList">
   		<option>option 1</option>
   		<option>option 2</option>
   	  </select>
   	  <br /><br />
   	  <input wicket:id="asubmit" type="button" value="Submit"></input>
	</form>
	</div>
  </center>
</body>
</html>

Thanks for the help

T
-- 
View this message in context: http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17063419.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: AjaxLazyLoadPanel question

Posted by taygolf <ta...@gmail.com>.
got ya. yeah I eventually figure that is what had to happen to make it work
correctly. I was trying to make it do something that it was not meant to do.
When I put everything in a panel it all worked prefectly.

Thanks

T


Johan Compagner wrote:
> 
> just to make it more clear to you
> 
> AjaxLazyLoadPanel == a Panel == Own markup
> 
> so what you have is not possible
> 
> you can have that code just fine in lazy load panel but the panel must
> have
> its own markup
> that is this:
> 
> <form wicket:id="form">
>          <select wicket:id="pickList">
>                <option>option 1</option>
>                <option>option 2</option>
>          </select>
>          <br /><br />
>          <input wicket:id="asubmit" type="button" value="Submit"></input>
>        </form>
> 
> 
> 
> On Mon, May 5, 2008 at 4:51 PM, taygolf <ta...@gmail.com> wrote:
> 
>>
>> Hey guys,
>>
>> I have a question about the lazyloadpanel. I have a modal window. in that
>> modal window I have a form with a ListChoice and an ajaxbutton. What I
>> want
>> to do is have the entire modal window or the entire form lazyload. the
>> ListChoice can be very large sometime and I want do not want the page to
>> load until I have the executed the quesry that populates the listchoice
>> and
>> saved the values in it.
>>
>> I tried to create a div for the ajaxlazyloadpanel and simply put all the
>> code for the page in the allp but this did not work.
>>
>> What do I need to do to make this happen? I don't know if I am just
>> confused
>> about how this works or what. I have looked at the example on wicket
>> stuff
>> but I am still confused
>>
>> Here is the code I want to wrap in an ajaxlazyloadpanel:
>>
>> final ListChoice list = createList();
>>
>> Form form = new Form("form");
>> form.add(list);
>> final AjaxButton ajx = new AjaxButton("asubmit",form) {
>>    protected void onSubmit(AjaxRequestTarget target, Form form) {
>>            window.setWindowClosedCallback(new
>> ModalWindow.WindowClosedCallback(){
>>                public void onClose(AjaxRequestTarget target) {
>>                    targetField.setModelObject(list.getValue());
>>                    target.addComponent(targetField);
>>                }
>>            });
>>            window.close(target);
>>    }
>> };
>> form.add(ajx);
>> add(form);
>>
>> <html>
>> <body>
>>  <center>
>>    <div wicket:id="lazy">
>>        <form wicket:id="form">
>>          <select wicket:id="pickList">
>>                <option>option 1</option>
>>                <option>option 2</option>
>>          </select>
>>          <br /><br />
>>          <input wicket:id="asubmit" type="button" value="Submit"></input>
>>        </form>
>>        </div>
>>  </center>
>> </body>
>> </html>
>>
>> Thanks for the help
>>
>> T
>> --
>> View this message in context:
>> http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17063419.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17186908.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: AjaxLazyLoadPanel question

Posted by Johan Compagner <jc...@gmail.com>.
just to make it more clear to you

AjaxLazyLoadPanel == a Panel == Own markup

so what you have is not possible

you can have that code just fine in lazy load panel but the panel must have
its own markup
that is this:

<form wicket:id="form">
         <select wicket:id="pickList">
               <option>option 1</option>
               <option>option 2</option>
         </select>
         <br /><br />
         <input wicket:id="asubmit" type="button" value="Submit"></input>
       </form>



On Mon, May 5, 2008 at 4:51 PM, taygolf <ta...@gmail.com> wrote:

>
> Hey guys,
>
> I have a question about the lazyloadpanel. I have a modal window. in that
> modal window I have a form with a ListChoice and an ajaxbutton. What I want
> to do is have the entire modal window or the entire form lazyload. the
> ListChoice can be very large sometime and I want do not want the page to
> load until I have the executed the quesry that populates the listchoice and
> saved the values in it.
>
> I tried to create a div for the ajaxlazyloadpanel and simply put all the
> code for the page in the allp but this did not work.
>
> What do I need to do to make this happen? I don't know if I am just
> confused
> about how this works or what. I have looked at the example on wicket stuff
> but I am still confused
>
> Here is the code I want to wrap in an ajaxlazyloadpanel:
>
> final ListChoice list = createList();
>
> Form form = new Form("form");
> form.add(list);
> final AjaxButton ajx = new AjaxButton("asubmit",form) {
>    protected void onSubmit(AjaxRequestTarget target, Form form) {
>            window.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback(){
>                public void onClose(AjaxRequestTarget target) {
>                    targetField.setModelObject(list.getValue());
>                    target.addComponent(targetField);
>                }
>            });
>            window.close(target);
>    }
> };
> form.add(ajx);
> add(form);
>
> <html>
> <body>
>  <center>
>    <div wicket:id="lazy">
>        <form wicket:id="form">
>          <select wicket:id="pickList">
>                <option>option 1</option>
>                <option>option 2</option>
>          </select>
>          <br /><br />
>          <input wicket:id="asubmit" type="button" value="Submit"></input>
>        </form>
>        </div>
>  </center>
> </body>
> </html>
>
> Thanks for the help
>
> T
> --
> View this message in context:
> http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17063419.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: AjaxLazyLoadPanel question

Posted by taygolf <ta...@gmail.com>.
ok I guess you can say that i fixed this myself since noone else offered any
advice. I could not figure out the error that I was getting about not being
able to find the div closing tag so I decided to put all of my code that was
for the form in an actual panel and then just make the call from lazyload.
This worked prefectly. I would like to suggest that you make some type of
lazyload that will work on any type of popup such as a webpage or a modal. I
know you can just put the webpage and modal in a panel and it will work but
it seems like extra code that may not be necessary. Just a thought though

Hope this helps someone in the future

T

taygolf wrote:
> 
> ok I have this working with IndicatingAjaxFallbackLink for my link instead
> of a normal AjaxFallbackLink but I would still rather have the
> lazyloadingpanel. Everytime I try to wrap my form in a div for the allp I
> get an error saying that I do not have a closing tag for my div but I do.
> Any help would be appreciated
> 
> Thanks
> 
> T
> 
> 
> taygolf wrote:
>> 
>> no one?
>> 
>> 
>> 
>> taygolf wrote:
>>> 
>>> Hey guys,
>>> 
>>> I have a question about the lazyloadpanel. I have a modal window. in
>>> that modal window I have a form with a ListChoice and an ajaxbutton.
>>> What I want to do is have the entire modal window or the entire form
>>> lazyload. the ListChoice can be very large sometime and I want do not
>>> want the page to load until I have the executed the quesry that
>>> populates the listchoice and saved the values in it.
>>> 
>>> I tried to create a div for the ajaxlazyloadpanel and simply put all the
>>> code for the page in the allp but this did not work.
>>> 
>>> What do I need to do to make this happen? I don't know if I am just
>>> confused about how this works or what. I have looked at the example on
>>> wicket stuff but I am still confused
>>> 
>>> Here is the code I want to wrap in an ajaxlazyloadpanel:
>>> 
>>> final ListChoice list = createList();
>>> 		
>>> Form form = new Form("form");
>>> form.add(list);
>>> final AjaxButton ajx = new AjaxButton("asubmit",form) {
>>>     protected void onSubmit(AjaxRequestTarget target, Form form) {
>>>             window.setWindowClosedCallback(new
>>> ModalWindow.WindowClosedCallback(){
>>>             	public void onClose(AjaxRequestTarget target) {
>>>                     targetField.setModelObject(list.getValue());
>>>             	    target.addComponent(targetField);
>>>             	} 
>>>             });
>>>             window.close(target);
>>>     }
>>> };
>>> form.add(ajx);
>>> add(form);
>>> 
>>> <html>
>>> <body>
>>>   <center>
>>>     <div wicket:id="lazy">
>>> 	<form wicket:id="form">
>>> 	  <select wicket:id="pickList">
>>>    		<option>option 1</option>
>>>    		<option>option 2</option>
>>>    	  </select>
>>>    	  <br /><br />
>>>    	  <input wicket:id="asubmit" type="button" value="Submit"></input>
>>> 	</form>
>>> 	</div>
>>>   </center>
>>> </body>
>>> </html>
>>> 
>>> Thanks for the help
>>> 
>>> T
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17106431.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: AjaxLazyLoadPanel question

Posted by taygolf <ta...@gmail.com>.
ok I have this working with IndicatingAjaxFallbackLink for my link instead of
a normal AjaxFallbackLink but I would still rather have the
lazyloadingpanel. Everytime I try to wrap my form in a div for the allp I
get an error saying that I do not have a closing tag for my div but I do.
Any help would be appreciated

Thanks

T


taygolf wrote:
> 
> no one?
> 
> 
> 
> taygolf wrote:
>> 
>> Hey guys,
>> 
>> I have a question about the lazyloadpanel. I have a modal window. in that
>> modal window I have a form with a ListChoice and an ajaxbutton. What I
>> want to do is have the entire modal window or the entire form lazyload.
>> the ListChoice can be very large sometime and I want do not want the page
>> to load until I have the executed the quesry that populates the
>> listchoice and saved the values in it.
>> 
>> I tried to create a div for the ajaxlazyloadpanel and simply put all the
>> code for the page in the allp but this did not work.
>> 
>> What do I need to do to make this happen? I don't know if I am just
>> confused about how this works or what. I have looked at the example on
>> wicket stuff but I am still confused
>> 
>> Here is the code I want to wrap in an ajaxlazyloadpanel:
>> 
>> final ListChoice list = createList();
>> 		
>> Form form = new Form("form");
>> form.add(list);
>> final AjaxButton ajx = new AjaxButton("asubmit",form) {
>>     protected void onSubmit(AjaxRequestTarget target, Form form) {
>>             window.setWindowClosedCallback(new
>> ModalWindow.WindowClosedCallback(){
>>             	public void onClose(AjaxRequestTarget target) {
>>                     targetField.setModelObject(list.getValue());
>>             	    target.addComponent(targetField);
>>             	} 
>>             });
>>             window.close(target);
>>     }
>> };
>> form.add(ajx);
>> add(form);
>> 
>> <html>
>> <body>
>>   <center>
>>     <div wicket:id="lazy">
>> 	<form wicket:id="form">
>> 	  <select wicket:id="pickList">
>>    		<option>option 1</option>
>>    		<option>option 2</option>
>>    	  </select>
>>    	  <br /><br />
>>    	  <input wicket:id="asubmit" type="button" value="Submit"></input>
>> 	</form>
>> 	</div>
>>   </center>
>> </body>
>> </html>
>> 
>> Thanks for the help
>> 
>> T
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17083176.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: AjaxLazyLoadPanel question

Posted by taygolf <ta...@gmail.com>.
no one?



taygolf wrote:
> 
> Hey guys,
> 
> I have a question about the lazyloadpanel. I have a modal window. in that
> modal window I have a form with a ListChoice and an ajaxbutton. What I
> want to do is have the entire modal window or the entire form lazyload.
> the ListChoice can be very large sometime and I want do not want the page
> to load until I have the executed the quesry that populates the listchoice
> and saved the values in it.
> 
> I tried to create a div for the ajaxlazyloadpanel and simply put all the
> code for the page in the allp but this did not work.
> 
> What do I need to do to make this happen? I don't know if I am just
> confused about how this works or what. I have looked at the example on
> wicket stuff but I am still confused
> 
> Here is the code I want to wrap in an ajaxlazyloadpanel:
> 
> final ListChoice list = createList();
> 		
> Form form = new Form("form");
> form.add(list);
> final AjaxButton ajx = new AjaxButton("asubmit",form) {
>     protected void onSubmit(AjaxRequestTarget target, Form form) {
>             window.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback(){
>             	public void onClose(AjaxRequestTarget target) {
>                     targetField.setModelObject(list.getValue());
>             	    target.addComponent(targetField);
>             	} 
>             });
>             window.close(target);
>     }
> };
> form.add(ajx);
> add(form);
> 
> <html>
> <body>
>   <center>
>     <div wicket:id="lazy">
> 	<form wicket:id="form">
> 	  <select wicket:id="pickList">
>    		<option>option 1</option>
>    		<option>option 2</option>
>    	  </select>
>    	  <br /><br />
>    	  <input wicket:id="asubmit" type="button" value="Submit"></input>
> 	</form>
> 	</div>
>   </center>
> </body>
> </html>
> 
> Thanks for the help
> 
> T
> 

-- 
View this message in context: http://www.nabble.com/AjaxLazyLoadPanel-question-tp17063419p17082485.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