Re: [Wicket-user] RE: TabbedPanel, InputForm and submit

2006-03-31 Thread Eelco Hillenius
We don't (seem to) have a component for this currently. However,
implementing one yourself is pretty straightforward. Take a look at
AjaxCheckBox:

/**
 * Construct.
 *
 * @param id
 * @param model
 */
public AjaxCheckBox(final String id, final IModel model)
{
super(id, model);

setOutputMarkupId(true);

add(new AjaxFormComponentUpdatingBehavior(onchange)
{
private static final long serialVersionUID = 1L;

protected void onUpdate(AjaxRequestTarget target)
{
AjaxCheckBox.this.onUpdate(target);
}
});
}

Adding that AjaxFormComponentUpdatingBehavior is really all there is
to it. You should be able to just do something like:

TextField f = new TextField(field, model);
f.add(new AjaxFormComponentUpdatingBehavior(onblur)
{
protected void onUpdate(AjaxRequestTarget target)
{
log.info(field updated);
}
}));

Eelco


On 3/30/06, Stefan Lindner [EMAIL PROTECTED] wrote:
 Thank you all for your hints,

 an AjaxTabbedPanel together with an AjaxCheckBox does the trick. Works
 really fine!
 BUT: Now I need a text input field with the same functionality.
 As I can't find an AjaxTextField I tried an AjaxEditableLabel. But this
 does not work.

 The HTML part

 input wicket:id=freitext id=freitext type=text/

 And the Java part

 AjaxEditableLabel stringTextField = new
 AjaxEditableLabel(freitext, new PropertyModel(model, freitext)) {
 protected void onUpdate(AjaxRequestTarget target) {
 System.out.println(onUpdate);
 }
 };
 add(stringTextField);

 Resuts in the HTML sequence
 input type=text wicket:id=freitext
 id=seiteninhalt_tabs_panel_inputForm_freitext
 wicket:panel
 span wicket:id=label onClick=var
 wicketAjaxCallMade=wicketAjaxGet('/Visiomedic/VisioPAD?wicket:interface=
 :1:seiteninhalt:tabs:panel:inputForm:freitext:label:-1:IUnversionedBehav
 iorListenerwicket:behaviorId=0');
 id=seiteninhalt_tabs_panel_inputForm_freitext_label/span
 /wicket:panel
 /input


 Stefan Lindner
 
 --
 Visionet GmbH, Am Weichselgarten 7, 91058 Erlangen
 Tel.: (09131)691-230, FAX: (09131)691-111
 E-Mail: mailto:[EMAIL PROTECTED], Internet:
 http://www.visionet.de


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RE: TabbedPanel, InputForm and submit

2006-03-31 Thread Igor Vaynberg
eelco, what the hell are you still doing up?-IgorOn 3/30/06, Eelco Hillenius [EMAIL PROTECTED]
 wrote:We don't (seem to) have a component for this currently. However,implementing one yourself is pretty straightforward. Take a look at
AjaxCheckBox:/** * Construct. * * @param id * @param model */public AjaxCheckBox(final String id, final IModel model){
super(id, model);setOutputMarkupId(true);add(new AjaxFormComponentUpdatingBehavior(onchange){private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target){AjaxCheckBox.this.onUpdate(target);}});
}Adding that AjaxFormComponentUpdatingBehavior is really all there isto it. You should be able to just do something like:TextField f = new TextField(field, model);f.add(new AjaxFormComponentUpdatingBehavior(onblur)
{protected void onUpdate(AjaxRequestTarget target){log.info(field updated);}}));EelcoOn 3/30/06, Stefan Lindner 
[EMAIL PROTECTED] wrote: Thank you all for your hints, an AjaxTabbedPanel together with an AjaxCheckBox does the trick. Works really fine! BUT: Now I need a text input field with the same functionality.
 As I can't find an AjaxTextField I tried an AjaxEditableLabel. But this does not work. The HTML part input wicket:id=freitext id=freitext type=text/
 And the Java part AjaxEditableLabel stringTextField = new AjaxEditableLabel(freitext, new PropertyModel(model, freitext)) { protected void onUpdate(AjaxRequestTarget target) {
 System.out.println(onUpdate); } }; add(stringTextField); Resuts in the HTML sequence
 input type=text wicket:id=freitext id=seiteninhalt_tabs_panel_inputForm_freitext wicket:panel span wicket:id=label 
 wicketAjaxCallMade=wicketAjaxGet('/Visiomedic/VisioPAD?wicket:interface= :1:seiteninhalt:tabs:panel:inputForm:freitext:label:-1:IUnversionedBehav iorListenerwicket:behaviorId=0'); id=seiteninhalt_tabs_panel_inputForm_freitext_label/span
 /wicket:panel /input Stefan Lindner  -- Visionet GmbH, Am Weichselgarten 7, 91058 Erlangen
 Tel.: (09131)691-230, FAX: (09131)691-111 E-Mail: mailto:[EMAIL PROTECTED], Internet: http://www.visionet.de
 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Stefan Lindner
 
Dear Eelco,
 
you wrote 
A different approach is to use ajax enabled fields so that everytime
you leave an input field your changes are immediately applied to the
models. That way it doesn't matter at all which link you click
anywhere.

I try the 1.2beta2examples ajax/Form Example: shows ajax form processing
 
this leads to the folowing error message (JBoss4.0.4RC2, Java 5_6)
 
 
wicket.WicketRuntimeException: Internal error cloning object. Make sure all 
dependent objects implement Serializable. Class: 
wicket.examples.ajax.builtin.FormPage
 wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:132)
 wicket.Session.setAttribute(Session.java:794)
 wicket.Session.update(Session.java:845)
 wicket.protocol.http.WebSession.update(WebSession.java:116)
 wicket.RequestCycle.cleanUp(RequestCycle.java:794)
 wicket.RequestCycle.steps(RequestCycle.java:1028)
 wicket.RequestCycle.request(RequestCycle.java:452)
 wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:210)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

 
winmail.dat

Re: [Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Igor Vaynberg
looks like we are missing Serializable somewhere. I really do wish that exception message was more helpful! can you try trunk and see if the error is still there?-IgorOn 3/30/06, 
Stefan Lindner [EMAIL PROTECTED] wrote:
Dear Eelco,you wroteA different approach is to use ajax enabled fields so that everytimeyou leave an input field your changes are immediately applied to themodels. That way it doesn't matter at all which link you click
anywhere.I try the 1.2beta2examples ajax/Form Example: shows ajax form processingthis leads to the folowing error message (JBoss4.0.4RC2, Java 5_6)wicket.WicketRuntimeException
: Internal error cloning object. Make sure all dependent objects implement Serializable. Class: wicket.examples.ajax.builtin.FormPage wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:132) wicket.Session.setAttribute
(Session.java:794) wicket.Session.update(Session.java:845) wicket.protocol.http.WebSession.update(WebSession.java:116) wicket.RequestCycle.cleanUp(RequestCycle.java:794) wicket.RequestCycle.steps(RequestCycle.java
:1028) wicket.RequestCycle.request(RequestCycle.java:452) wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:210) javax.servlet.http.HttpServlet.service(HttpServlet.java:697) javax.servlet.http.HttpServlet.service
(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


[Wicket-user] RE: TabbedPanel, InputForm and submit

2006-03-30 Thread Stefan Lindner
Thank you all for your hints,

an AjaxTabbedPanel together with an AjaxCheckBox does the trick. Works
really fine!
BUT: Now I need a text input field with the same functionality.
As I can't find an AjaxTextField I tried an AjaxEditableLabel. But this
does not work.

The HTML part

input wicket:id=freitext id=freitext type=text/

And the Java part

AjaxEditableLabel stringTextField = new
AjaxEditableLabel(freitext, new PropertyModel(model, freitext)) {
protected void onUpdate(AjaxRequestTarget target) {
System.out.println(onUpdate);
}
};
add(stringTextField);

Resuts in the HTML sequence
input type=text wicket:id=freitext
id=seiteninhalt_tabs_panel_inputForm_freitext
wicket:panel
span wicket:id=label onClick=var
wicketAjaxCallMade=wicketAjaxGet('/Visiomedic/VisioPAD?wicket:interface=
:1:seiteninhalt:tabs:panel:inputForm:freitext:label:-1:IUnversionedBehav
iorListenerwicket:behaviorId=0');
id=seiteninhalt_tabs_panel_inputForm_freitext_label/span
/wicket:panel
/input


Stefan Lindner

--
Visionet GmbH, Am Weichselgarten 7, 91058 Erlangen
Tel.: (09131)691-230, FAX: (09131)691-111
E-Mail: mailto:[EMAIL PROTECTED], Internet:
http://www.visionet.de


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RE: TabbedPanel, InputForm and submit

2006-03-30 Thread Igor Vaynberg
keep the textbox and add a AjaxFormComponentUpdatingBehavior to the onblur event. that way whenever the focus is lost from the textfield its value will be submitted via ajax-Igor
On 3/30/06, Stefan Lindner [EMAIL PROTECTED] wrote:
Thank you all for your hints,an AjaxTabbedPanel together with an AjaxCheckBox does the trick. Worksreally fine!BUT: Now I need a text input field with the same functionality.As I can't find an AjaxTextField I tried an AjaxEditableLabel. But this
does not work.The HTML partinput wicket:id=freitext id=freitext type=text/And the Java partAjaxEditableLabel stringTextField = new
AjaxEditableLabel(freitext, new PropertyModel(model, freitext)) {protected void onUpdate(AjaxRequestTarget target) {System.out.println(onUpdate);
}};add(stringTextField);Resuts in the HTML sequenceinput type=text wicket:id=freitextid=seiteninhalt_tabs_panel_inputForm_freitext
wicket:panelspan wicket:id=label >wicketAjaxCallMade=wicketAjaxGet('/Visiomedic/VisioPAD?wicket:interface=:1:seiteninhalt:tabs:panel:inputForm:freitext:label:-1:IUnversionedBehav
iorListenerwicket:behaviorId=0');id=seiteninhalt_tabs_panel_inputForm_freitext_label/span/wicket:panel/inputStefan Lindner
--Visionet GmbH, Am Weichselgarten 7, 91058 ErlangenTel.: (09131)691-230, FAX: (09131)691-111E-Mail: mailto:
[EMAIL PROTECTED], Internet:http://www.visionet.de---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Martijn Dashorst
Feel free to contribute! You now know how to do it, write a (small) document about it and put it on our wiki!MartijnOn 3/30/06, Stefan Lindner
 [EMAIL PROTECTED] wrote:Once again thanks for all your help. The problem is solved. Not every
comonent inside of the form must be an ajax component.form.setOutputMarkupId(true);add(form);AjaxFormValidatingBehavior.addToAllFormComponents(form,onblur);
Does it all. It's a pleasure to use wicket. But it would be much muchmore pleasent if the documentation could be improved.Stefan Lindner
--Visionet GmbH, Am Weichselgarten 7, 91058 ErlangenTel.: (09131)691-230, FAX: (09131)691-111E-Mail: mailto:[EMAIL PROTECTED], Internet:
http://www.visionet.de---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org


Re: [Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Vincent Jenks
That'd be awesome, I could use something like this!On 3/30/06, Martijn Dashorst [EMAIL PROTECTED]
 wrote:Feel free to contribute! You now know how to do it, write a (small) document about it and put it on our wiki!
MartijnOn 3/30/06, 
Stefan Lindner
 [EMAIL PROTECTED] wrote:
Once again thanks for all your help. The problem is solved. Not every
comonent inside of the form must be an ajax component.form.setOutputMarkupId(true);add(form);AjaxFormValidatingBehavior.addToAllFormComponents(form,onblur);

Does it all. It's a pleasure to use wicket. But it would be much muchmore pleasent if the documentation could be improved.Stefan Lindner
--Visionet GmbH, Am Weichselgarten 7, 91058 ErlangenTel.: (09131)691-230, FAX: (09131)691-111E-Mail: mailto:
[EMAIL PROTECTED], Internet:
http://www.visionet.de---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user
-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org




Re: [Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Igor Vaynberg
indeed. that or a javadoc patch are more then welcome.-IgorOn 3/30/06, Martijn Dashorst [EMAIL PROTECTED]
 wrote:Feel free to contribute! You now know how to do it, write a (small) document about it and put it on our wiki!
MartijnOn 3/30/06, 
Stefan Lindner
 [EMAIL PROTECTED] wrote:
Once again thanks for all your help. The problem is solved. Not every
comonent inside of the form must be an ajax component.form.setOutputMarkupId(true);add(form);AjaxFormValidatingBehavior.addToAllFormComponents(form,onblur);

Does it all. It's a pleasure to use wicket. But it would be much muchmore pleasent if the documentation could be improved.Stefan Lindner
--Visionet GmbH, Am Weichselgarten 7, 91058 ErlangenTel.: (09131)691-230, FAX: (09131)691-111E-Mail: mailto:
[EMAIL PROTECTED], Internet:
http://www.visionet.de---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user
-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org