Problem loading DatePicker inside Panel through AjaxLink

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Problem loading DatePicker inside Panel through AjaxLink

Bruno Borges
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
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
Reply | Threaded
Open this post in threaded view
|

Re: Problem loading DatePicker inside Panel through AjaxLink

Bruno Borges
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 <[hidden email]> 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
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4



--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
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 <[hidden email] > 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 <[hidden email]> 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
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4



--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Bruno Borges
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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4



--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
right, and that is the main problem to solve. is a <script tag legal in the middle of html? because maybe we can capture the head output and just insert it into html

-Igor


On 5/4/06, Bruno Borges <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4



--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4




--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Timo Stamm
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> > > > [hidden email]
>> > > > Sun Certified Java Programmer for 1.4
>> > > > Sun Certified Web Component Developer for 1.4
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Bruno Borges
>> > > [hidden email]
>> > > Sun Certified Java Programmer for 1.4
>> > > Sun Certified Web Component Developer for 1.4
>> > >
>> >
>> >
>>
>>
>> --
>> Bruno Borges
>> [hidden email]
>> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Rüdiger Schulz (SkyGate)
In reply to this post by Igor Vaynberg-2
> right, and that is the main problem to solve. is a <script tag
> legal in the middle of html? because maybe we can capture the head
> output and just insert it into html

<script> Tags in the middle of HTML are working in all browsers I ever
had to use this. I'm not 100% sure if it's legal, but I think the main
reason for putting JavaScript in the head is, that it is definitly
loaded before any markup is using it.


> -Igor


> On 5/4/06, Bruno Borges <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
> Sun Certified Java Programmer for 1.4
> Sun Certified Web Component Developer for 1.4






> --
> Bruno Borges
> [hidden email]
> 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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
In reply to this post by Timo Stamm
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> > > > [hidden email]
>> > > > Sun Certified Java Programmer for 1.4
>> > > > Sun Certified Web Component Developer for 1.4
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Bruno Borges
>> > > [hidden email]
>> > > Sun Certified Java Programmer for 1.4
>> > > Sun Certified Web Component Developer for 1.4
>> > >
>> >
>> >
>>
>>
>> --
>> Bruno Borges
>> [hidden email]
>> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
In reply to this post by Rüdiger Schulz (SkyGate)
i guess in this case we need to capture the head output of the component during ajax render and dump it into the markup before the component.

Juergen are you reading with us? do you think this is feasible?

-Igor


On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
> right, and that is the main problem to solve. is a <script tag
> legal in the middle of html? because maybe we can capture the head
> output and just insert it into html

<script> Tags in the middle of HTML are working in all browsers I ever
had to use this. I'm not 100% sure if it's legal, but I think the main
reason for putting JavaScript in the head is, that it is definitly
loaded before any markup is using it.


> -Igor


> On 5/4/06, Bruno Borges < [hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
> Sun Certified Java Programmer for 1.4
> Sun Certified Web Component Developer for 1.4






> --
> Bruno Borges
> [hidden email]
> 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
<a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid0709&amp;bid&amp;3057&amp;dat1642">http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Rüdiger Schulz (SkyGate)
In reply to this post by Igor Vaynberg-2
> in that case i dont see how you can ever make this work in xhtml
> unless you refresh the entire page.

A twisted "solution" using an invisible frame loading only JS comes to
mind ;-)

- Rüdiger



-------------------------------------------------------
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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
i guess there can be a hidden iframe, but then the loaded js will not be part of the page because frames are isolated, no?

-Igor


On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
> in that case i dont see how you can ever make this work in xhtml
> unless you refresh the entire page.

A twisted "solution" using an invisible frame loading only JS comes to
mind ;-)

- Rüdiger



-------------------------------------------------------
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
<a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid0709&amp;bid&amp;3057&amp;dat1642">http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Timo Stamm
In reply to this post by Igor Vaynberg-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> >> > > > [hidden email]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [hidden email]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [hidden email]
>> >> 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
>> [hidden email]
>> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Bruno Borges
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> >> > > > [hidden email]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >

>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [hidden email]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [hidden email]
>> >> 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
>> [hidden email]
>> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
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 <[hidden email]> wrote:
I found some links that might be of great interest!

dynamic load javascript from javascript
<a href="http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html

Dojo Package System
<a href="http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem

Javascript Includes
<a href="http://www.phpied.com/javascript-include/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.phpied.com/javascript-include/

On-Demand Javascript
<a href="http://ajaxpatterns.org/On-Demand_Javascript" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://ajaxpatterns.org/On-Demand_Javascript

Hope this help!

Regards

On 5/4/06, Timo Stamm <[hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> >> > > > [hidden email]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >

>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [hidden email]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [hidden email]
>> >> 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
>> <a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> [hidden email]
>> <a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[hidden email]
<a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> https://lists.sourceforge.net/lists/listinfo/wicket-user



--

Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

jdonnerstag
In reply to this post by Igor Vaynberg-2
Not sure I understand what needs to be done. I guess I'll wait until
tomorrow until the "that is how the output must look like" question is
solved.

Juergen

On 5/4/06, Igor Vaynberg <[hidden email]> wrote:

> i guess in this case we need to capture the head output of the component
> during ajax render and dump it into the markup before the component.
>
> Juergen are you reading with us? do you think this is feasible?
>
> -Igor
>
>
>
> On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
> > > right, and that is the main problem to solve. is a <script tag
> > > legal in the middle of html? because maybe we can capture the head
> > > output and just insert it into html
> >
> > <script> Tags in the middle of HTML are working in all browsers I ever
> > had to use this. I'm not 100% sure if it's legal, but I think the main
> > reason for putting JavaScript in the head is, that it is definitly
> > loaded before any markup is using it.
> >
> >
> > > -Igor
> >
> >
> > > On 5/4/06, Bruno Borges < [hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 < [hidden email]> 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
> > > [hidden email]
> > > Sun Certified Java Programmer for 1.4
> > > Sun Certified Web Component Developer for 1.4
> >
> >
> >
> >
> >
> >
> > > --
> > > Bruno Borges
> > > [hidden email]
> > > 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
> >
> <a href="http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > [hidden email]
> > 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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Johan Compagner
In reply to this post by Igor Vaynberg-2
cool..

var script document. createElement('script');
script.type 'text/javascript' ;
script.src 'snip.js';
document.getElementsByTagName('head' )[0].appendChild(script); 



if that works.. that should be doable.

johan

On 5/4/06, Igor Vaynberg <[hidden email]> wrote:
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 <[hidden email]> wrote:
I found some links that might be of great interest!

dynamic load javascript from javascript
<a href="http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html

Dojo Package System
<a href="http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem

Javascript Includes
<a href="http://www.phpied.com/javascript-include/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.phpied.com/javascript-include/

On-Demand Javascript
<a href="http://ajaxpatterns.org/On-Demand_Javascript" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://ajaxpatterns.org/On-Demand_Javascript

Hope this help!

Regards

On 5/4/06, Timo Stamm <[hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> >> > > > [hidden email]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >

>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [hidden email]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [hidden email]
>> >> 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
>> <a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> [hidden email]
>> <a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[hidden email]
<a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> https://lists.sourceforge.net/lists/listinfo/wicket-user



--

Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4


Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
i dont think this is cool at all because it requires components to provide an alternate output unless we parse the <script> and <link> tags ourselves.

-Igor


On 5/4/06, Johan Compagner <[hidden email]> wrote:
cool..

var script document. createElement('script');
script.type 'text/javascript' ;
script.src 'snip.js';
document.getElementsByTagName('head' )[0].appendChild(script); 



if that works.. that should be doable.

johan


On 5/4/06, Igor Vaynberg <[hidden email]> wrote:
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 <[hidden email]> wrote:
I found some links that might be of great interest!

dynamic load javascript from javascript
<a href="http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html

Dojo Package System
<a href="http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://dojo.jot.com/WikiHome/Documents/DojoPackageSystem

Javascript Includes
<a href="http://www.phpied.com/javascript-include/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.phpied.com/javascript-include/

On-Demand Javascript
<a href="http://ajaxpatterns.org/On-Demand_Javascript" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://ajaxpatterns.org/On-Demand_Javascript

Hope this help!

Regards

On 5/4/06, Timo Stamm <[hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email] > 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 <[hidden email]> 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
>> >> > > > [hidden email]
>> >> > > > Sun Certified Java Programmer for 1.4
>> >> > > > Sun Certified Web Component Developer for 1.4
>> >> > > >
>> >> > >

>> >> > >
>> >> > >
>> >> > > --
>> >> > > Bruno Borges
>> >> > > [hidden email]
>> >> > > Sun Certified Java Programmer for 1.4
>> >> > > Sun Certified Web Component Developer for 1.4
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Bruno Borges
>> >> [hidden email]
>> >> 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
>> <a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> [hidden email]
>> <a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[hidden email]
<a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> https://lists.sourceforge.net/lists/listinfo/wicket-user



--

Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4



Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Igor Vaynberg-2
In reply to this post by jdonnerstag
basically what we are talking about is somehow capturing the componnet's header contribution and writing it out.

so take datepicker, datepicker.html has a <wicket:head> section. what we need to do is to somehow get that portion as a charsequence so that the ajax request target can dump it as part of component's markup. we also need to capture the head output from behaviors. i dont know how feasible it all is.

this might solve javascript, but what about <link tags for css? are those legal outside the head? and will browsers pick them up if we write them out via outerhtml?

-Igor




On 5/4/06, Juergen Donnerstag <[hidden email]> wrote:
Not sure I understand what needs to be done. I guess I'll wait until
tomorrow until the "that is how the output must look like" question is
solved.

Juergen

On 5/4/06, Igor Vaynberg <[hidden email]> wrote:

> i guess in this case we need to capture the head output of the component
> during ajax render and dump it into the markup before the component.
>
> Juergen are you reading with us? do you think this is feasible?
>
> -Igor
>
>
>
> On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
> > > right, and that is the main problem to solve. is a <script tag
> > > legal in the middle of html? because maybe we can capture the head
> > > output and just insert it into html
> >
> > <script> Tags in the middle of HTML are working in all browsers I ever
> > had to use this. I'm not 100% sure if it's legal, but I think the main
> > reason for putting JavaScript in the head is, that it is definitly
> > loaded before any markup is using it.
> >
> >
> > > -Igor
> >
> >
> > > On 5/4/06, Bruno Borges < [hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 < [hidden email]> 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
> > > [hidden email]
> > > Sun Certified Java Programmer for 1.4
> > > Sun Certified Web Component Developer for 1.4
> >
> >
> >
> >
> >
> >
> > > --
> > > Bruno Borges
> > > [hidden email]
> > > 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
> >
> <a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid0709&amp;bid&amp;3057&amp;dat1642">http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > [hidden email]
> > 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
<a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid0709&amp;bid&amp;3057&amp;dat1642"> http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Bruno Borges
Looks like there's no problem adding styles.

http://www.dynamicdrive.com/forums/archive/index.php/t-3459.html

This URL is not quite what it should be for, but demonstrates how CSS's can be changed without reloading a page. And I'm sure the same way new .js files can be added to a Head section dynamically, css can be either. :)


On 5/4/06, Igor Vaynberg <[hidden email]> wrote:
basically what we are talking about is somehow capturing the componnet's header contribution and writing it out.

so take datepicker, datepicker.html has a <wicket:head> section. what we need to do is to somehow get that portion as a charsequence so that the ajax request target can dump it as part of component's markup. we also need to capture the head output from behaviors. i dont know how feasible it all is.

this might solve javascript, but what about <link tags for css? are those legal outside the head? and will browsers pick them up if we write them out via outerhtml?

-Igor





On 5/4/06, Juergen Donnerstag <[hidden email]> wrote:
Not sure I understand what needs to be done. I guess I'll wait until
tomorrow until the "that is how the output must look like" question is
solved.

Juergen

On 5/4/06, Igor Vaynberg <[hidden email]> wrote:

> i guess in this case we need to capture the head output of the component
> during ajax render and dump it into the markup before the component.
>
> Juergen are you reading with us? do you think this is feasible?
>
> -Igor
>
>
>
> On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
> > > right, and that is the main problem to solve. is a <script tag
> > > legal in the middle of html? because maybe we can capture the head
> > > output and just insert it into html
> >
> > <script> Tags in the middle of HTML are working in all browsers I ever
> > had to use this. I'm not 100% sure if it's legal, but I think the main
> > reason for putting JavaScript in the head is, that it is definitly
> > loaded before any markup is using it.
> >
> >
> > > -Igor
> >
> >
> > > On 5/4/06, Bruno Borges < [hidden email]> 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 < [hidden email]> 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 <[hidden email]> 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 < [hidden email]> 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
> > > [hidden email]
> > > Sun Certified Java Programmer for 1.4
> > > Sun Certified Web Component Developer for 1.4
> >
> >
> >
> >
> >
> >
> > > --
> > > Bruno Borges
> > > [hidden email]
> > > 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
> >
> <a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid%120709&amp;bid&amp;3057&amp;dat%121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > [hidden email]
> > <a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 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
<a href="http://sel.as-us.falkag.net/sel?cmdlnk&amp;kid%120709&amp;bid&amp;3057&amp;dat%121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
<a href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Bruno Borges
[hidden email]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem loading DatePicker inside Panel through AjaxLink

Rüdiger Schulz (SkyGate)
In reply to this post by Igor Vaynberg-2
Hello Igor

not sure how iframes behave here, but it is possible to call
javascript functions in one frame, which is defined in another frame,
which then again can do anything with the calling frame. Done this a
couple of years ago (when frames where still en vogue ;), but as it
turned out, nothing like that will be necessary to solve our problem
here :-)

--
greetings from Berlin,

Rüdiger Schulz


Igor Vaynberg wrote on 04.05.2006 at 19:28:

> i guess there can be a hidden iframe, but then the loaded js will
> not be part of the page because frames are isolated, no?

> -Igor


> On 5/4/06, Rüdiger Schulz <[hidden email]> wrote:
>> in that case i dont see how you can ever make this work in xhtml
>> unless you refresh the entire page.

> A twisted "solution" using an invisible frame loading only JS comes to
> mind ;-)

> - Rüdiger



> -------------------------------------------------------
> 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?cmdlnk kid0709 bid 3057 dat1642
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> 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
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
12