Re: Animate ajax DOM manipulation smoothly
This is my code: private void accordion(AjaxRequestTarget target, WebMarkupContainer descriptionContainer, WebMarkupContainer listContainer){ boolean flag = descriptionContainer.isVisible(); if(this.selectedDescriptionContainer != null && this.selectedDescriptionContainer.isVisible()){ this.selectedDescriptionContainer.add(new DisplayNoneBehavior()); target.prependJavaScript("notify|$('#"+this.selectedDescriptionContainer.getMarkupId()+"').slideUp(1000, notify);"); this.selectedDescriptionContainer.setVisible(false); this.selectedlistContainer.add(new AttributeModifier("class", "tableRowGreyBgOnly")); target.add(this.selectedlistContainer); target.add(this.selectedDescriptionContainer); } if(!flag){ this.selectedDescriptionContainer = descriptionContainer; this.selectedlistContainer= listContainer; descriptionContainer.add(new DisplayNoneBehavior()); descriptionContainer.setVisible(true); listContainer.add(new AttributeModifier("class", "infoOrangeLight")); target.add(listContainer); target.add(descriptionContainer); target.appendJavaScript("$('#"+descriptionContainer.getMarkupId()+"').slideDown(1000);"); } } While component initialisation i have user setVisible(false) along with setOutputMarkupPlaceholderTag(true). Tried this, but doesn't give the animation effect. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Animate-ajax-DOM-manipulation-smoothly-tp4670132p4670136.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
Re: onchange control visibility according to multiple controls values
Hi, Maybe you need to look at the Event Bus, This will ease the communication between components and you will be able to supply a payload with your desired info/value/object... https://wicket.apache.org/guide/guide/single.html#advanced_2 (Wicket events infrastructure) Hope this helps, Sebastien.
Handle form with multiple dynamic lines of the same input
Hi all, I have a form currently only consisting of one "line" of inputs, like the following: > label1 input1 label2 input2 > label3 input3 label4 input4 > label5 input5 All those three lines form one logical line of input from the form's perspective. What I would like to add is the ability for the user to add and remove lines on demand with simple JS just cloning a current line. The result should be something like the following: > label1 input1 label2 input2 > label3 input3 label4 input4 > label5 input5 > label1.2 input1.2 label2.2 input2.2 > label3.2 input3.2 label4.2 input4.2 > label5.2 input5.2 > label1.3 input1.3 label2.3 input2.3 > label3.3 input3.3 label4.3 input4.3 > label5.3 input5.3 The interesting part now is with Wicket, because the form submitted may 1. have an unknown amount of lines and 2. the lines may change during submits because during validation Wicket may find input errors, shows the form again and a user decides to resolve such errors by just removing some lines of input and such. Do you have any hints an what would be the best approach implementing this in Wicket? I obviously need some buttons or such for the user to add and remove lines, so I thought of adding some Ajax behavior to send the fact of the added/removed line with some sort of ID or index to Wicket, which will then create/remove corresponding models and components in a map or list of the current form instance. Is there any approach without such an Ajax call by just parsing the request fields into some list or such? All my inputs follow a known naming convention. Something like getInputAsArray on a global form level instead of per component? And last, how would I need to render the form in case of validation errors? The form always starts with only one input line but may need to be rendered with 3 or 10 or whatever in case of errors. Thanks for your valuable input! Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Improve Support for placeholder label option for DropDownChoice?
Hi all, I got the following error during validation of one of my forms today: > The first child option element of a select element with a required > attribute, and without a multiple attribute, and without a size > attribute whose value is greater than 1, must have either an empty > value attribute, or must have no text content. Consider either > adding a placeholder option label, or adding a size attribute with a > value equal to the number of option elements. The message is about the following spec: http://dev.w3.org/html5/spec-preview/the-select-element.html#placeholder-label-option The reason for the error seems simple: I use a DropDownChoice with a default selected value and null disallowed, so I always need a value. In that case AbstractSingleSelectChoice.getDefaultChoice doesn't provide any content, because there's already one value selected and this is not null. That results in the select gets only rendered with the choices provided, missing a default option with value "" and so violating the HTML5 spec... The default option doesn't necessarily needs to be selected, it just needs to exist if the select is required. To resolve this issue I extended DropDownChoice and implemented my own getDefaultChoice, which simply always returns an option with value "" if the base implementation returns an empty string. Is this worth creating an issue in JIRA, either as bug or enhancement? Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Improve Support for placeholder label option for DropDownChoice?
Hi, why don't you allow null (i.e. #isNullValid() returning true), while setting the DropDownChoice required? That should give you the required placeholder option, doesn't it? Regards Sven Am 01.04.2015 um 20:24 schrieb Thorsten Schöning: Hi all, I got the following error during validation of one of my forms today: The first child option element of a select element with a required attribute, and without a multiple attribute, and without a size attribute whose value is greater than 1, must have either an empty value attribute, or must have no text content. Consider either adding a placeholder option label, or adding a size attribute with a value equal to the number of option elements. The message is about the following spec: http://dev.w3.org/html5/spec-preview/the-select-element.html#placeholder-label-option The reason for the error seems simple: I use a DropDownChoice with a default selected value and null disallowed, so I always need a value. In that case AbstractSingleSelectChoice.getDefaultChoice doesn't provide any content, because there's already one value selected and this is not null. That results in the select gets only rendered with the choices provided, missing a default option with value "" and so violating the HTML5 spec... The default option doesn't necessarily needs to be selected, it just needs to exist if the select is required. To resolve this issue I extended DropDownChoice and implemented my own getDefaultChoice, which simply always returns an option with value "" if the base implementation returns an empty string. Is this worth creating an issue in JIRA, either as bug or enhancement? Mit freundlichen Grüßen, Thorsten Schöning - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org