thanks bruno! i will try to take a look tonight and see if we can adapt these ideas.

-Igor


On 5/4/06, Bruno Borges < [EMAIL PROTECTED]> wrote:
I found some links that might be of great interest!

dynamic load _javascript_ from _javascript_
http://www.activewidgets.com/_javascript_.forum.6114.15/dynamic-load-_javascript_-from-_javascript_.html

Dojo Package System
http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem

_javascript_ Includes
http://www.phpied.com/_javascript_-include/

On-Demand _javascript_
http://ajaxpatterns.org/On-Demand_Javascript

Hope this help!

Regards

On 5/4/06, Timo Stamm < [EMAIL PROTECTED]> wrote:
Ooops. I was wrong.

I just checked some stubs with the w3 validator, and they pass without a
hitch. Both XHTML 1.0 strict and transitional. XHTML 1.1 and 2.0 seem to
be fine as well.

Sorry.

Timo

Igor Vaynberg schrieb:
> in that case i dont see how you can ever make this work in xhtml unless you
> refresh the entire page.
>
> -Igor
>
>
> On 5/4/06, Timo Stamm < [EMAIL PROTECTED]> wrote:
>>
>> Igor Vaynberg schrieb:
>> > right, and that is the main problem to solve. is a <script tag legal in
>> the
>> > middle of html?
>>
>> Not in XHTML :(
>>
>> >
>> > -Igor
>> >
>> >
>> > On 5/4/06, Bruno Borges < [EMAIL PROTECTED] > wrote:
>> >>
>> >> Igor, I'm not sure if browsers support the "update head" thing
>> (probably
>> >> not), but one "first step" solution is to notify the component that it
>> is
>> >> been added through Ajax, so the component must generate a "load"
>> function
>> >> and return that function name to the Ajax call, so the Ajax JS can
>> >> call that
>> >> function "postprocessing".
>> >>
>> >> Of course, the main problem still continues: how to add the .js
>> file of
>> >> DatePicker/anything else, to the html page dynamically.
>> >>
>> >>
>> >> On 5/4/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
>> >> >
>> >> > yes, there is a problem indeed with components that need head
>> >> > contribution and are added via ajax. the problem is that when the
>> >> component
>> >> > is added via ajax its header contribution is ingored because the
>> head
>> >> > section is not updated. so in case of the datepicker the js it needs
>> is
>> >> > never added to the page.
>> >> >
>> >> > im not really sure what the good solution for this is. maybe we can
>> >> > update the head, but do browsers take that into account? will a
>> >> <script tag
>> >> > added to head via outerhtml replacement be processed by the browser?
>> >> can you
>> >> > even use outer/innerHtml on elements in the head region of the page?
>> >> >
>> >> > any thoughts/ideas are welcome.
>> >> >
>> >> > -igor
>> >> >
>> >> >
>> >> >
>> >> > On 5/3/06, Bruno Borges < [EMAIL PROTECTED] > wrote:
>> >> > >
>> >> > > Oh, one mistake in the code I sent.
>> >> > >
>> >> > > - The id for newUserLink I'm using is "newUser";
>> >> > >
>> >> > > Everything works: AjaxLink replacing the div, the panel, submit,
>> etc.
>> >> > > Only the datePicker JS isn't working!
>> >> > >
>> >> > > Regards,
>> >> > >
>> >> > >
>> >> > >
>> >> > > On 5/4/06, Bruno Borges < [EMAIL PROTECTED]> wrote:
>> >> > > >
>> >> > > > I'm trying to load a Form Panel's child, and this panel is been
>> >> > > > loaded through an AjaxLink.
>> >> > > >
>> >> > > > The DatePicker icon doesn't work. The calendar doesn't shows up.
>> Is
>> >> > > > there any incompatibility between loading panels with Ajax and
>> >> DatePicker
>> >> > > > within?
>> >> > > >
>> >> > > > My code looks like this:
>> >> > > >
>> >> > > > class Index extends WebPage {
>> >> > > > <constructor> {
>> >> > > > final Label welcome = new Label("bodyPanel", "Welcome");
>> >> > > > add(welcome);
>> >> > > >
>> >> > > > AjaxLink goHome = new AjaxLink("home") {
>> >> > > > ... {
>> >> > > > getPage().replace(welcome);
>> >> > > > target.addComponent(welcome);
>> >> > > > }
>> >> > > > };
>> >> > > >
>> >> > > > AjaxLink newUserLink = AjaxLink("home") {
>> >> > > > ... {
>> >> > > > UserFormPanel panel = new UserFormPanel("bodyPanel");
>> >> > > > getPage().replace(panel);
>> >> > > >   target.addComponent(panel);
>> >> > > >  }
>> >> > > >  };
>> >> > > >
>> >> > > > add(newUserLink);
>> >> > > > add(goHome);
>> >> > > > }
>> >> > > > }
>> >> > > >
>> >> > > > class UserFormPanel extends Panel {
>> >> > > > <constructor> {
>> >> > > > add(new UserForm("userForm"));
>> >> > > > }
>> >> > > > }
>> >> > > >
>> >> > > > class UserForm extends Form {
>> >> > > > <constructor> {
>> >> > > > ... // other basic fields like 'username', 'email', 'password'
>> >> > > >
>> >> > > > // Date field "fieldBirthday"
>> >> > > > RequiredTextField fieldBirthday = new
>> RequiredTextField("birthday",
>> >> > > > Date.class);
>> >> > > > fieldBirthday .add( DateValidator.maximum(Calendar.getInstance
>> >> > > > ().getTime()));
>> >> > > > add(fieldBirthday);
>> >> > > >
>> >> > > > // DatePicker for "fieldBirthday"
>> >> > > > DatePickerSettings settings = new DatePickerSettings();
>> >> > > > settings.setIfFormat("%d/%m/%Y");
>> >> > > > settings.setWeekNumbers (false);
>> >> > > > DatePicker datePicker = new DatePicker("datePicker",
>> >> fieldBirthday ,
>> >> > > > settings);
>> >> > > > add(datePicker);
>> >> > > > }
>> >> > > > }
>> >> > > >
>> >> > > > I can say for sure: the datepicker component was working
>> perfectly
>> >> > > > before opening the panel through AjaxLink (actually,
>> UserFormPanel
>> >> > > > was UserFormPage before this).
>> >> > > > Am I missing something here?
>> >> > > >
>> >> > > > Regards,
>> >> > > > --
>> >> > > > Bruno Borges
>> >> > > > [EMAIL PROTECTED]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [EMAIL PROTECTED]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [EMAIL PROTECTED]
>> >> Sun Certified Java Programmer for 1.4
>> >> Sun Certified Web Component Developer for 1.4
>> >>
>> >
>>
>>
>>
>> -------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--

Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply via email to