You can use a behavior to set whether a component is visible or enabled
based on a model.
The wicketstuff-minis project has two behaviors that do just this:
https://javadoc.io/doc/org.wicketstuff/wicketstuff-minis/latest/org/wicketstuff/minis/behavior/EnabledModelBehavior.html
You have to use the TextField constructor that specifies the type of the
model:
https://ci.apache.org/projects/wicket/apidocs/8.x/org/apache/wicket/markup/html/form/TextField.html#TextField-java.lang.String-org.apache.wicket.model.IModel-java.lang.Class-
It should be:
add(new
How about using an IConverter since the issue is not about the data itself
but the representation of it?
For example, you could create a Label class that overrides the
getConverter() and return a BigDecimalConverter object that overrides
the getNumberFormat method to return something like
It sounds like that, in addition to the behavior, you also need a wicket
validator.
Since the validation condition involves two fields, you'll need to
implement an IFormValidator and add it to the containing form [1].
The #getDependentComponents() method should return the two textfields.
In the
Yes, you can do that: simply change the components that you are adding to
the AjaxRequestTarget object to be the form components rather than the
entire form.
You'll need to use something like an AjaxButton so you have access to the
AjaxRequestTarget:
FormComponent c1 = ...
FormComponent c2 = ...
1. Create a Wicket Behavior that encapsulates your requirement. Maybe
something like this:
public class DisableWhenFilledBehavior extends Behavior {
@Override
public void onConfigure(Component component) {
component.setEnabled(component.getDefaultModel() == null);
}
}
2. Add the behavior to
Hi Marc
That's cool!
I made a Wicket + Spring Boot "Getting Started"-style guide a couple of
months ago: https://github.com/ageery/getting-started-guides/tree/wicket.
The code is on the wicket branch in the complete directory.
It's a filterable data table with ajax CRUD functionality, built on
See
http://apache-wicket.1842946.n4.nabble.com/DataTable-how-to-make-a-column-showing-the-row-number-td1855450.html
:
public void populateItem(Item cell, String compId, IModel rowModel) {
item.getindex() is cell, ((item)item.getparent()).getindex() is row
On Tue, Apr 21, 2015 at 2:35 PM, Stefan
In AjaxLazyLoadPanel#getLazyComponent(String), you should be using the id
parameter, not pList, when creating the PListPanel.
Andrew
@Override
public Component getLazyLoadComponent(String id) {
return new PListPanel(pList, pModel); // change
the first param from pList to
I have a top-level form.
The top-level form contains two nested forms.
The nested forms are inside of a TabbedPanel so only one is visible at a
time.
The save button for the top-level form is always visible. The save button
submits the top-level form and submitting the top-level form also has
/mtgrigorov
On Thu, Jan 22, 2015 at 1:51 PM, Andrew Geery andrew.ge...@gmail.com
wrote:
I have a top-level form.
The top-level form contains two nested forms.
The nested forms are inside of a TabbedPanel so only one is visible at
a
time.
The save button for the top-level
As a sanity check, is the property file with the property
UploadProgressBar.starting
in the jar file? Perhaps it didn't get copied over by the Maven build
process into the jar but the IDE was properly copying it over...
Andrew
On Wed, Oct 1, 2014 at 11:38 AM, Garret Wilson
I created a Wicket quickstart (from
http://wicket.apache.org/start/quickstart.html) [this is Wicket 6.16.0] and
made two simple changes:
1) I created a HomePage.properties file, encoded as ISO-8859-1, with a
single line as per the example above: copyright=© 2014 Example, Inc.
2) I added a line
The easiest way to do that is to use
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/IAjaxIndicatorAware.html
See
http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/
for
an example.
Andrew
On Thu, Jan 9, 2014 at 7:07 AM, Martin Grigorov
The first thing I would check is that the ModalWindow is wrapped in a
Wicket Form (see the end of the class-level Javadoc for ModalWindow: If
you want to use form in modal window component make sure that you put the
modal window itself in another form). If it's not, the date picker
doesn't work
at 9:20 AM, Andrew Geery andrew.ge...@gmail.comwrote:
I'm using the fantastic select2 component in my Wicket 6.7 application via
the Wicket-select2 integration package [
https://github.com/ivaynberg/wicket-select2/], version 2.2.2.
It works great on a regular page. On a page, clicking outside
I'm using the fantastic select2 component in my Wicket 6.7 application via
the Wicket-select2 integration package [
https://github.com/ivaynberg/wicket-select2/], version 2.2.2.
It works great on a regular page. On a page, clicking outside of the
select2 component causes the component to close.
.
The solution is to keep the ajax indicator on the button but to remove it
from the form fields.
Thanks
Andrew
On Wed, Jul 24, 2013 at 2:47 AM, Martin Grigorov mgrigo...@apache.orgwrote:
On Tue, Jul 23, 2013 at 6:44 PM, Andrew Geery andrew.ge...@gmail.com
wrote:
Just to make sure I'm
not
experience this behavior.
It should work exactly as you expect it.
Try to put some debug statements with an AjaxCallListener - print to
console in onBefore() and onBeforeSend(). Add this listener to both
components - the field and the button.
On Tue, Jul 23, 2013 at 5:03 AM, Andrew
, Jul 23, 2013 at 11:44 AM, Andrew Geery andrew.ge...@gmail.comwrote:
Just to make sure I'm understanding this correctly, it should be enough to
simply override updateAjaxAttributes on AjaxButton and specify a channel
that does not have ACTIVE behavior, like this:
@Override
I have a form that is submitted with an AjaxButton. One of the fields in
the form uses an AjaxFormComponentUpdatingBehavior to update the
server-side state when a value in the field changes (i.e., it fires
onchange). If the user changes the field with
the AjaxFormComponentUpdatingBehavior
The wiki says (https://cwiki.apache.org/WICKET/working-with-wicket-models.html):
Compound models allow containers to share models with their children.
This saves memory, but more importantly, it makes replication of
models much cheaper in a clustered environment.
I think what we're saying in
Previous to 6.7, when clicking on an AjaxLink which was contained within a
div that had an onclick handler, the onclick did not propagate to the
containing div. Starting in 6.7, clicking the AjaxLink does propagate the
onclick event up the DOM. Was this intentional? I couldn't find a change
log
Using the DatePicker in a ModalWindow, I get the error below after
using the calendar widget and closing the modal. The widget works
fine for me; it's simply throwing a JS error in IE8 (displayed in the
lower lefthand corner of the browser). I don't see the error in other
browsers.
The
Done -- https://issues.apache.org/jira/browse/WICKET-5125
Andrew
On Fri, Mar 29, 2013 at 6:13 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
Please report this in a new issue so that proper action can be taken.
On Fri, Mar 29, 2013 at 7:06 PM, Andrew Geery andrew.ge
Done: https://issues.apache.org/jira/browse/WICKET-5121
Thanks
Andrew
On Thu, Mar 28, 2013 at 4:09 AM, Martin Grigorov mgrigo...@apache.org wrote:
Hi,
On Thu, Mar 28, 2013 at 3:54 AM, Andrew Geery andrew.ge...@gmail.comwrote:
I just wanted to confirm that add(Component
I just wanted to confirm that add(Component...) in AjaxRequestHandler
will only work with (i.e., refresh) components that are on the same
page as the page associated with the AjaxRequestHandler.
I had a case where the content of a ModalWindow was a WebPage. In the
modal window, there was an
Yes, it is possible. See https://github.com/ivaynberg/wicket-select2
(http://ivaynberg.github.com/select2/ is the standalone UI piece, if
you're interested). And it is available via Maven.
Andrew
On Mon, Jan 14, 2013 at 9:17 PM, kshitiz k.agarw...@gmail.com wrote:
Actually ListMultipleChoice
models
I think the best solution is 3 -- I created a JIRA issue with
quickstart for it: https://issues.apache.org/jira/browse/WICKET-4941
Thanks
Andrew
On Wed, Dec 19, 2012 at 10:48 AM, Andrew Geery andrew.ge...@gmail.com wrote:
I'm dealing with the issue around a nested CompoundPropertyModel
, but always with option 1).
Sven
On 01/04/2013 01:12 PM, Andrew Geery wrote:
I wanted to follow up about this. The nested CompoundPropertyModel
address example in the original email does not work, not because of
the visitor in onConfigure(), but because child models are
(potentially) created
Meier s...@meiers.net wrote:
Hi,
correct me if I'm wrong, but if B and C are not interested in their model
(e.g. Panels) then their models will never be accessed.
Sven
On 01/04/2013 02:47 PM, Andrew Geery wrote:
Thanks for the answer, Sven: I'm not a huge CPM fan either; I find
them hard
I'm dealing with the issue around a nested CompoundPropertyModel not
resolving its properties against the correct object.
class Person {
Address address;
...
}
class Address {
String street1;
...
}
class PersonPanel extends Panel {
PersonPanel(String id) {
super(id); // use cpm of
I have a Person Hibernate/JPA entity with an @Embedded address object in it:
@Entity
public class Person {
...
@Embedded
private Address address;
...
}
I have a Panel with a Form for editing the Address
(EditAddressFormPanel) and a panel for editing the Person which uses
the Panel for
The problem with doing that is that Hibernate detects that as a change
(a null object is not the same as an empty object) and does a database
update (see some of the comments on this:
https://issues.jboss.org/browse/HIBERNATE-50).
Andrew
On Fri, Nov 30, 2012 at 5:59 PM, Sven Meier
));
zoomCampaign.replaceWith(tempZoomCampaign);
zoomCampaign = tempZoomCampaign;
target.add(zoomCampaign);
zoomCampaign.show(target);
}
});
On Fri, Aug 10, 2012 at 7:54 PM, Andrew Geery
and saves its stacktrace as
String in the Component's meta data. This stacktrace is used to find
when and where the problem happened.
These stacktraces are printed only if
org.apache.wicket.settings.IDebugSettings#getComponentUseCheck()
returns true.
On Fri, Aug 10, 2012 at 4:16 AM, Andrew Geery
I've run into this issue a couple of times and worked around it, but I
wanted to see if there is a better way of handling it.
I have a form in a panel in a ModalWindow on top of a datatable in a page.
When a user clicks the Save ajax button in the modal window, a done event
is bubbled up from
Use the Wicket servlet, not the filter:
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-Websphere-6-1-td2309401.html
https://cwiki.apache.org/WICKET/websphere.html
Andrew
On Wed, Jun 27, 2012 at 8:40 AM, Jörn Gersdorf jo...@gersdorf.info wrote:
Hi all,
I have an application
I've recently run across a couple of issues where a proxy'ed class (using
Javassist from Hibernate) has messed up Wicket. When a class is proxy'ed
by Javassist, the class you have (say, Person) isn't really a Person class
but something like Person_$$_Javassist_48.
I had registered a converter
Another great resource is _Apache Wicket Cookbook_ by Igor:
http://www.amazon.com/Apache-Wicket-Cookbook-Igor-Vaynberg/dp/1849511608.
Chapter three has a good discussion around what you're trying to do.
Andrew
On Tue, Jun 12, 2012 at 3:23 PM, srinash avisrid...@gmail.com wrote:
Thank you both
An issue I ran into with having Wicket reload the html files in development
mode is that it doesn't seem to work if the path to the html files has
spaces in it. For example, running under Eclipse with the workspace in
c:\Documents and Settings\... html reloading did not work. Taking the
exact
In the Javadoc for the Component#onConfigure() method, it states (in a
paragraph dealing with setting whether a component is visible and/or
enabled): It is a better practice to push changes to state rather than
pull. [
If you have a number of JSON end-points, the best architecture would
probably be to use Spring MVC to do the JSON handling, and then map the
Spring MVC paths into your web app using the Wicket filter ignore paths
option (
Wicket 1.5 requires servlet 2.5 [
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-%2528RC1%2529UpgradedtoServletAPI2.5
],
but WAS 6.1 only supports J2EE 1.4 (servlet 2.4) [
http://en.wikipedia.org/wiki/IBM_WebSphere_Application_Server#Version_6.1 ],
so I wouldn't
, Mar 30, 2012 at 5:03 AM, Andrew Geery andrew.ge...@gmail.com
wrote:
I have a ListMultipleChoice component (Wicket 1.5.4) with a Behavior
added
to it to enable the use of the Chosen (
http://harvesthq.github.com/chosen/ )
JS library. Everything works fine until I attempt to add
I have a ListMultipleChoice component (Wicket 1.5.4) with a Behavior added
to it to enable the use of the Chosen ( http://harvesthq.github.com/chosen/ )
JS library. Everything works fine until I attempt to add() the component
to a page in an AjaxRequestTarget. Rather than replacing the component
14, 2012 at 4:34 PM, Andrew Geery andrew.ge...@gmail.comwrote:
I'm using the jQuery Multiselector (
http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ ) with
Wicket 1.4.19 (via jqWicket 0.6). The multi-selector was straightforward
to integrate with Wicket and use on a regular page
I've had a very similar problem with WAS 6.1 (basic functionality would
work but AJAX functionality did not). The solution was simply to use the
Wicket servlet instead of the filter -- see
https://cwiki.apache.org/WICKET/websphere.html. What made it hard to debug
was the fact that the Wicket
See this:
http://apache-wicket.1842946.n4.nabble.com/Acegi-and-Wicket-auth-roles-td1846051.html
I would be willing to bet the problem is the order of your filter-mappings
in the web.xml -- Spring Security has to be first.
Andrew
On Tue, Nov 8, 2011 at 8:05 PM, James Carman
49 matches
Mail list logo