Re: Applying jQuery Effects (fadeIn, fadeOut) to Wicket 6 components issue.
Hans, like Martin said, this doesn't work, and I already tried it. When you use those options, it just renders the element tag with no contents. Martin, your solution is amazing. Simple and it just works. Thank you very much. The solution was to and an AttributeModifier to the component and then I use appendJavascript and use jQuery.show with whichever effect I want to apply. Thank you very much, guys! When you come to Brazil, the beer is on me :) On 7 January 2013 13:21, Martin Grigorov mgrigo...@apache.org wrote: On Mon, Jan 7, 2013 at 5:10 PM, Hans Lesmeister 2 hans.lesmeis...@lessy-software.de wrote: Martin Grigorov-4 wrote I.e. at the server side add style='display:none' to the Panel. Wicket JS will replace the old with the new one and then your fadeIn effect will show it. And with: panel.setVisible(false); panel.setOutputMarkupPlaceholderTag(true); the style-attribute is added for you by Wicket No. This way Wicket will render only the Panel's tag without its children stuff. You need to use onComponentTag() or AttributeModifier to just add display:none to the style attribute. - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Applying-jQuery-Effects-fadeIn-fadeOut-to-Wicket-6-components-issue-tp4655187p4655189.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Mastercim Informatica Tel: 3288-7149 www.mastercim.com.br
Problem with IHeaderResponse.renderOnEventJavascript
I searched all over the internet and it seems that no one uses this method. The thing is that I am almost thinking that this is a bug, because it's really not logic to me. What I am trying to do: I am creating a panel that I will use in a lot of forms, and I want to attach some javascript code to my onKeyDown HTML event of this TextField, so my code looks like this: container.getHeaderResponse().renderOnEventJavascript(document.getElementById('+txtCliente.getMarkupId()+'), onKeyDown, if (window.event.altKey){if (window.event.keyCode == 80){document.getElementById(' + link.getMarkupId() + ').onclick();}}); It's basically this: When user press Ctrl+P while TextField focused, it will click on a link, that is another component of my panel. When it renders the Javascript there's a problem: It render on the HEAD section of HTML, referencing the TextField with a variable (with a random name), but BEFORE the TextField was rendered on the HTML. The result of this is that Firefox and Chrome gives an error , saying that the component doesn't exist, and, in fact it doesn't, because the DOM still didn't load! So, probably I am doing this wrong, does anyone can help me with that? And what's the reason of this function renderOnEventJavascript if it renders on the head? It will always give an error message saying the component is null, am I right? I am using the latest release of 1.4 series. Thank you very much guys! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with IHeaderResponse.renderOnEventJavascript
Ok guys, it worked , I used the AttributeModifier. The thing is, why there's is that renderOnEventJavascript? This should be a method attached maybe to the domready event... Do you think that is worth submiting a patch? Or this is the correct behavior? (IMHO this isn't all right). Anyway, problem solved, thank you all! 2010/10/13 Michael O'Cleirigh michael.ocleir...@rivulet.ca: Hello, You can use: textfield.add (new AttributeModifier (onkeydown, true, if (window.event.altKey){if (window.event.keyCode == 80){document.getElementById(' + link.getMarkupId() + ').onclick();}}); If you do this within the Component.onInitialize() you will have the true markupid of the link available. If you wanted to get rid of the link altogether you could just attach an ajax event directly to the text field like: textfield.add (new AjaxEventBehavior (onkeydown) { �...@override protected void onEvent(final AjaxRequestTarget target) { // do your serverside logic } �...@override protected CharSequence getPreconditionScript() { // if this evaluates to true in the browser then the event will be executed. return return window.event.altKey window.event.keyCode == 80;; } }): This is untested but I think it should work, Regards, Mike I searched all over the internet and it seems that no one uses this method. The thing is that I am almost thinking that this is a bug, because it's really not logic to me. What I am trying to do: I am creating a panel that I will use in a lot of forms, and I want to attach some javascript code to my onKeyDown HTML event of this TextField, so my code looks like this: container.getHeaderResponse().renderOnEventJavascript(document.getElementById('+txtCliente.getMarkupId()+'), onKeyDown, if (window.event.altKey){if (window.event.keyCode == 80){document.getElementById(' + link.getMarkupId() + ').onclick();}}); It's basically this: When user press Ctrl+P while TextField focused, it will click on a link, that is another component of my panel. When it renders the Javascript there's a problem: It render on the HEAD section of HTML, referencing the TextField with a variable (with a random name), but BEFORE the TextField was rendered on the HTML. The result of this is that Firefox and Chrome gives an error , saying that the component doesn't exist, and, in fact it doesn't, because the DOM still didn't load! So, probably I am doing this wrong, does anyone can help me with that? And what's the reason of this function renderOnEventJavascript if it renders on the head? It will always give an error message saying the component is null, am I right? I am using the latest release of 1.4 series. Thank you very much guys! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DropDownChoice with ID and Value
Newbie question: I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi I will present to my user the select field with the choices abc, def and ghi. I want that my model updates with 1, 2 and 3. I did not find a way to achieve this (must me a simple thing). best regards, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with ID and Value
Will try it, thanks a lot Scott Swank escreveu: Look at ChoiceRenderer. It's pretty easy to write one that takes a map in it's constructor if your needs are that simple. Scott 2009/7/27 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Newbie question: I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi I will present to my user the select field with the choices abc, def and ghi. I want that my model updates with 1, 2 and 3. I did not find a way to achieve this (must me a simple thing). best regards, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Bypassing form validation
I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bypassing form validation
I already tried using setDefaultFormProcessing, but I want to actually process the form without validating it, on one of these buttons but using this method, I can't update my data, . Let me explain better. I have a master-detail form, supose I have fields M1, M2 and M3 on master-side and D1, D2 on details side. Fields M1 and D1 are required. I have a submit button that will submit all data and another submit button that will submit only detail data (I know it submits all the data, but then I will store the data on memory). When I click the button that submits my detail, I don't want it to do any validation on M1 field, but I want it to validate D1. Currently I am looking for 2 solutions: 1. Validate D1 but not M1 2. Do not validate at all. tx carlson Craig McIlwee escreveu: See http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean) -Original Message- From: carlson weber filho - Master CIM Informática [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31 PM To: users@wicket.apache.org Subject: Bypassing form validation I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bypassing form validation
Isn't invalid to nest forms inside forms? Igor Vaynberg escreveu: you should use embedded forms. make a form for M1 inside it add another form D1 a button in D1 form will only process D1 form, a button in M1 form will process both. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: I already tried using setDefaultFormProcessing, but I want to actually process the form without validating it, on one of these buttons but using this method, I can't update my data, . Let me explain better. I have a master-detail form, supose I have fields M1, M2 and M3 on master-side and D1, D2 on details side. Fields M1 and D1 are required. I have a submit button that will submit all data and another submit button that will submit only detail data (I know it submits all the data, but then I will store the data on memory). When I click the button that submits my detail, I don't want it to do any validation on M1 field, but I want it to validate D1. Currently I am looking for 2 solutions: 1. Validate D1 but not M1 2. Do not validate at all. tx carlson Craig McIlwee escreveu: See http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean) -Original Message- From: carlson weber filho - Master CIM Informática [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31 PM To: users@wicket.apache.org Subject: Bypassing form validation I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bypassing form validation
Well, I almost got what I want, but there's a problem. When I submit the inner form, on the onSubmit I want to check some values of the master form, and the model doesn't get updated... Any hints here? tx carlson Dane Laverty escreveu: This is sounding like a Chuck Norris joke -- Wicket doesn't create invalid code -- it roundhouse kicks the rules until they submit! On Thu, Jul 23, 2009 at 12:48 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Wicket takes care of that for you - you can do it in Wicket. -- Jeremy Thomerson http://www.wickettraining.com 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Isn't invalid to nest forms inside forms? Igor Vaynberg escreveu: you should use embedded forms. make a form for M1 inside it add another form D1 a button in D1 form will only process D1 form, a button in M1 form will process both. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: I already tried using setDefaultFormProcessing, but I want to actually process the form without validating it, on one of these buttons but using this method, I can't update my data, . Let me explain better. I have a master-detail form, supose I have fields M1, M2 and M3 on master-side and D1, D2 on details side. Fields M1 and D1 are required. I have a submit button that will submit all data and another submit button that will submit only detail data (I know it submits all the data, but then I will store the data on memory). When I click the button that submits my detail, I don't want it to do any validation on M1 field, but I want it to validate D1. Currently I am looking for 2 solutions: 1. Validate D1 but not M1 2. Do not validate at all. tx carlson Craig McIlwee escreveu: See http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean)http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29 -Original Message- From: carlson weber filho - Master CIM Informática [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31 PM To: users@wicket.apache.org Subject: Bypassing form validation I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bypassing form validation
Yes, I don't want to process it, but I want to do some processing based on the form values. But I got the point, If I don't validate form, I won't get my model updated. Now my problem goes back when I wanted to validate only parts of my values, so let's supose the folowing scenario Master Form Field M1 - Required Field M2 - Required Field M3 - Required Detail Form Field D1 - Required Field D2 - Required When I submit Field D1, Field M1 must be not blank. I am checking this now on code, not using a validator. I don't care at this time if Field M2 and Field M3 are blank or not. I need the value of M1 because I do some calculations on my detail object based on that. I tried using the getRawInput() but it only returns the value of my select (the M1 field is a select). Well, is there any solution for this case? tx carlson Igor Vaynberg escreveu: you said you do not want to process the outer form. without validation you cannot update the model. eg if you put aa into an integer field how do we push that into an integer model? what you can do is call formcomponent.getinput() to get at the raw values of those components. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Well, I almost got what I want, but there's a problem. When I submit the inner form, on the onSubmit I want to check some values of the master form, and the model doesn't get updated... Any hints here? tx carlson Dane Laverty escreveu: This is sounding like a Chuck Norris joke -- Wicket doesn't create invalid code -- it roundhouse kicks the rules until they submit! On Thu, Jul 23, 2009 at 12:48 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Wicket takes care of that for you - you can do it in Wicket. -- Jeremy Thomerson http://www.wickettraining.com 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Isn't invalid to nest forms inside forms? Igor Vaynberg escreveu: you should use embedded forms. make a form for M1 inside it add another form D1 a button in D1 form will only process D1 form, a button in M1 form will process both. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: I already tried using setDefaultFormProcessing, but I want to actually process the form without validating it, on one of these buttons but using this method, I can't update my data, . Let me explain better. I have a master-detail form, supose I have fields M1, M2 and M3 on master-side and D1, D2 on details side. Fields M1 and D1 are required. I have a submit button that will submit all data and another submit button that will submit only detail data (I know it submits all the data, but then I will store the data on memory). When I click the button that submits my detail, I don't want it to do any validation on M1 field, but I want it to validate D1. Currently I am looking for 2 solutions: 1. Validate D1 but not M1 2. Do not validate at all. tx carlson Craig McIlwee escreveu: See http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean)http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29 -Original Message- From: carlson weber filho - Master CIM Informática [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31 PM To: users@wicket.apache.org Subject: Bypassing form validation I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
Re: Bypassing form validation
you're the man! tx a lot carlson Igor Vaynberg escreveu: M1.processInput(); if (M1.isValid()) { value=M1.getModelObject(); } else { handleerrror } -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Yes, I don't want to process it, but I want to do some processing based on the form values. But I got the point, If I don't validate form, I won't get my model updated. Now my problem goes back when I wanted to validate only parts of my values, so let's supose the folowing scenario Master Form Field M1 - Required Field M2 - Required Field M3 - Required Detail Form Field D1 - Required Field D2 - Required When I submit Field D1, Field M1 must be not blank. I am checking this now on code, not using a validator. I don't care at this time if Field M2 and Field M3 are blank or not. I need the value of M1 because I do some calculations on my detail object based on that. I tried using the getRawInput() but it only returns the value of my select (the M1 field is a select). Well, is there any solution for this case? tx carlson Igor Vaynberg escreveu: you said you do not want to process the outer form. without validation you cannot update the model. eg if you put aa into an integer field how do we push that into an integer model? what you can do is call formcomponent.getinput() to get at the raw values of those components. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Well, I almost got what I want, but there's a problem. When I submit the inner form, on the onSubmit I want to check some values of the master form, and the model doesn't get updated... Any hints here? tx carlson Dane Laverty escreveu: This is sounding like a Chuck Norris joke -- Wicket doesn't create invalid code -- it roundhouse kicks the rules until they submit! On Thu, Jul 23, 2009 at 12:48 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Wicket takes care of that for you - you can do it in Wicket. -- Jeremy Thomerson http://www.wickettraining.com 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Isn't invalid to nest forms inside forms? Igor Vaynberg escreveu: you should use embedded forms. make a form for M1 inside it add another form D1 a button in D1 form will only process D1 form, a button in M1 form will process both. -igor 2009/7/23 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: I already tried using setDefaultFormProcessing, but I want to actually process the form without validating it, on one of these buttons but using this method, I can't update my data, . Let me explain better. I have a master-detail form, supose I have fields M1, M2 and M3 on master-side and D1, D2 on details side. Fields M1 and D1 are required. I have a submit button that will submit all data and another submit button that will submit only detail data (I know it submits all the data, but then I will store the data on memory). When I click the button that submits my detail, I don't want it to do any validation on M1 field, but I want it to validate D1. Currently I am looking for 2 solutions: 1. Validate D1 but not M1 2. Do not validate at all. tx carlson Craig McIlwee escreveu: See http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean)http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29 -Original Message- From: carlson weber filho - Master CIM Informática [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31 PM To: users@wicket.apache.org Subject: Bypassing form validation I have a form with two submit buttons. Is there any way to selectivelly bypass some validation on one of these buttons? I want to validate just two fields if I click on the button1 and I want to validate all fields when I click on button2 tx, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org