That would be the easiest yes.
Maurice
On Thu, May 22, 2008 at 7:45 AM, Eyal Golan [EMAIL PROTECTED] wrote:
Hi,
If I want a centralized properties file for localization, where should I put
it and how should I call it?
Is it supposed to be in the same folder as my WebApplication class?
Is is
Yeah, it could even be in its separate utility class:
interface IModelT {}
class Component {
private IModel? model;
public IModel? getModel() {
return model;
}
}
public class Unsafe {
public static T IModelT cast(IModel? model) {
return (IModelT) model;
}
}
See http://cwiki.apache.org/WICKET/i18n-and-resource-bundles.html for
more options
On Thu, May 22, 2008 at 8:05 AM, Maurice Marrink [EMAIL PROTECTED] wrote:
That would be the easiest yes.
Maurice
On Thu, May 22, 2008 at 7:45 AM, Eyal Golan [EMAIL PROTECTED] wrote:
Hi,
If I want a
It isnt all or nothing.. i never said that
I just say if you dont want Component but you do want IModel
then you will get a warning at getModel()
we as a framework shouldnt hide the warning at that call.
But i am also curious how many people get really the model back from a
component (not
thanks :)
On Thu, May 22, 2008 at 10:25 AM, Gwyn Evans [EMAIL PROTECTED] wrote:
See http://cwiki.apache.org/WICKET/i18n-and-resource-bundles.html for
more options
On Thu, May 22, 2008 at 8:05 AM, Maurice Marrink [EMAIL PROTECTED]
wrote:
That would be the easiest yes.
Maurice
On
I would all be easier if getModel() and getModelObject() weren't
final. (I know there's a reason why they are, I'm not questioning it).
Then in your component subclass you coud do IModelInteger getModel()
{ return (IModelInteger)super.getModel() }, similiar with
getmodelobject so you wouldn't
Although I'm not sure how many people call getModel/getModelObject
anyway. I think it's mostly about ListItems etc an i doubt anyone
would subclass it just because of getModel/getModelObject...
-Matej
On Thu, May 22, 2008 at 10:04 AM, Matej Knopp [EMAIL PROTECTED] wrote:
I would all be easier
I have found ie to be rubbish it comes to javascript, any error in any file
can stop all the javascript on the page working. make sure you dont have
other javascript on the page which causes problems.
Also open up the wicket ajax debug window and see you anything happens in
there when you click
You could implement your own dynamic web resource. eg for a kml page on our
site:
public class KMLResource extends DynamicWebResource
{
Document kml;
public KMLResource(Document kml)
{
this.kml = kml;
}
@Override
But if you are willing to subclass it and make that extra method
Then why not subclass the component itself and for example:
IntegerTextFieldInteger
thats the same thing 1 subclass, no extra generics in your code...
johan
On Thu, May 22, 2008 at 10:04 AM, Matej Knopp [EMAIL PROTECTED] wrote:
I often do the following:
populateItem(ListItem item) {
add(new Link(edit, item.getModel()) {
public void onClick() {
setResponsePage(new EditPage(getModelObject()));
}
});
}
So both are used often, but mostly to pass things around.
Martijn
On Thu, May 22,
getModel() i agree, but getModelObject() is something that is used the most
if i have to guess.
Because in an onSubmit() of a form or a onClick of a Link what do most of
you do?
onSubmit()
{
dao.save(getModelObject())
}
onClick()
{
dao.delete(getModelObject())
}
johan
On Thu, May 22, 2008 at
Overriding newLink() was the key. However, rather than using a
SubmitLink, I decided to bypass the whole issue entirely by simply
disabling the currently selected link. In my page's constructor, I
added the following code:
TabbedPanel tabbedPanel = new TabbedPanel(tabs, tabs) {
Hi Johan,
I thing that the example below is exactly the thing that generics are pretty
good:
populateItem(ListItemPerson item) {
add(new LinkPerson(edit, item.getModel()) {
public void onClick() {
setResponsePage(new EditPage(getModelObject()));
}
});
(and
exactly Repeaters is very nice that the populateItem is generified.. I think
that is really handy..
And if the EditPage now wanted a specific type then you need now to cast at
that place..
I thing that the example below is exactly the thing that generics are pretty
good:
Yeah that is the problem with Generics
You cant say take the T from the model you get in the constructor
Then everything would be perfect.
But i really dont think that Person in link is redundant why is it?
You call later on getModelObject() on it.. so you use the model/modelobject
of Link
so
+1 for finishing generics (no matter how ugly it gets), then
refactoring / removing the things that suck
Am 22.05.2008 um 11:37 schrieb Johan Compagner:
exactly Repeaters is very nice that the populateItem is generified..
I think
that is really handy..
And if the EditPage now wanted a
Johan Compagner wrote:
is there a jira issue for this patch?
Hello Johan
i added an issue for this here
https://issues.apache.org/jira/browse/WICKET-1653 WICKET-1653
I have the same error with my ie 6. Will it be fixed in an 1.3 or only in an
1.4 version?
Thanks
Per
--
View this
Hi Johan,
But i really dont think that Person in link is redundant why is it?
the point was, that in this case Link simply doesn't need to have given a model
at all, since you can access the surrounding final vars (you can access the item
in onClick):
populateItem(final ListItemPerson
Hi Johan,
ahh yes thats true i overlooked your changes..
then yes currently you have to do new LinkVoid (to get rid of the
warnings)
there are quite annoying many cases of this kind, where you really just don't
need to add models to components and have to boilerplate these with Void or
I had this exact problem, but it was because the text inside my a
tag was inside a label tag (at least I think that's what was causing
it). For some reason, IE didn't like that. I had to tell the label
to just spit out its contents.
On Wed, May 21, 2008 at 5:31 PM, Michael Mehrle [EMAIL
ahh yes thats true i overlooked your changes..
then yes currently you have to do new LinkVoid (to get rid of the
warnings)
johan
On Thu, May 22, 2008 at 11:54 AM, Jan Kriesten [EMAIL PROTECTED]
wrote:
Hi Johan,
But i really dont think that Person in link is redundant why is it?
the
Sure I could, but since the StringRequestTarget constructor takes a
content-type argument, I find it strange that this isn't sent to the
browser. Sure enough, StringRequestTarget#respond, creates as
StringBufferResourcesStream with the contentType field set correctly,
but then it just copies
All,
Ok, folks, so where are we on this? There has been some desire to
reorganize things a bit. There are at least 3 options that I have
heard:
1. Leave everything the way it is.
2. Set everything up the way I suggested (the projects can still have
a common parent that's a sibling of theirs
Jan Kriesten wrote:
Hi Johan,
ahh yes thats true i overlooked your changes..
then yes currently you have to do new LinkVoid (to get rid of the
warnings)
there are quite annoying many cases of this kind, where you really just
don't need to add models to components and have to boilerplate
Hi,
I have a webdesigner who keeps harassing me with the way Wicket does
JavaScript, attaching behaviour to onclick events etc. instead of doing
it the jquery way of picking up the components and attaching the
events afterwards, thus keeping all the nasty bits away from the actual
markup.
But if you have a lot of LinkVoid for you cases
then make 1 simple subclass of Link
johan
On Thu, May 22, 2008 at 12:41 PM, Jan Kriesten [EMAIL PROTECTED]
wrote:
Hi Johan,
ahh yes thats true i overlooked your changes..
then yes currently you have to do new LinkVoid (to get rid of the
hi sebastiaan,
I'm very much against using generics to do something other from what
generics where meant to do (i.e., type safety).
i'm all in when you're talking about type safety. having compile-time checks on
the types is a time-saver during development.
with wicket generics it's just
hi johan,
But if you have a lot of LinkVoid for you cases
then make 1 simple subclass of Link
so anyone make your own wrapper to get readable sources again? let me think: how
many webmarkupcontainer, link, page etc. classes do i use with void?
i don't think that's a serious option.
---
Jan Kriesten wrote:
hi johan,
But if you have a lot of LinkVoid for you cases
then make 1 simple subclass of Link
so anyone make your own wrapper to get readable sources again? let me
think: how many webmarkupcontainer, link, page etc. classes do i use
with void?
i don't think that's a
James Carman wrote:
All,
Ok, folks, so where are we on this? There has been some desire to
reorganize things a bit. There are at least 3 options that I have
heard:
1. Leave everything the way it is.
2. Set everything up the way I suggested (the projects can still have
a common parent
Update: overriding respond and setting the contentType directly works
great :)
-- Edvin
Edvin Syse skrev:
Sure I could, but since the StringRequestTarget constructor takes a
content-type argument, I find it strange that this isn't sent to the
browser. Sure enough,
harder to comprehend??
come on, you must be kidding!
Link is many times uses (you did give an example your self 2 emails back) as
a model object holder
So if developers use it sometimes as just a link and sometimes just as an
object.
I think if we made Link default Object that many people would
harder to comprehend??
come on, you must be kidding!
Link is many times uses (you did give an example your self 2 emails back) as
a model object holder
So if developers use it sometimes as just a link and sometimes just as an
object.
I think if we made Link default Object that many people would
hmm that is a bug then of StringRequestTarget
It should set that header if the content type is specified.
I will fix that
On Thu, May 22, 2008 at 2:02 PM, Edvin Syse [EMAIL PROTECTED] wrote:
Update: overriding respond and setting the contentType directly works great
:)
-- Edvin
Edvin
how can use refreshingview with textfield items that use validatior? when i use
and validator fails all textfield values reset. i want reset every request, but
not when validator fails.
-
To unsubscribe, e-mail: [EMAIL
Hi,
I want to create a small UnitTest for my login page:
public void testLoginPageRender() {
tester.startPage(Login.class);
// Just to ensure that the request has not been
// intercepted or redirected
tester.assertRenderedPage(Login.class);
// A page
WicketTester tester = new WicketTester(new MyApplication());
should do it
Eyal Golan wrote:
Hi,
I want to create a small UnitTest for my login page:
public void testLoginPageRender() {
tester.startPage(Login.class);
// Just to ensure that the request has not been
done: https://issues.apache.org/jira/browse/WICKET-1654
-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 21, 2008 8:10 PM
To: users@wicket.apache.org
Subject: Re: Providing IModel to Validators
ah, i see. so the model for the validator overrides the
Thanks.
I actually tried but got an error that it could not find the application
context (we use Spring).
java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
Instead this is what I did:
tester = new WicketTester(new WebApplication() {
Hi everybody,
In my web application, I want to display a Image.
I try to use Image and ResourceReference but I have some problemes
My image is in a folder stock in my context of my web aplication :
/stock/domaine/sdoimaine/projet/logo. I try to load it with the real path,
or the context
Hi,
thanks a lot for the detailed explanation, it works
I needed some time for the implementation, because I'm a wicket beginner and
had first to find out, how a DropDownChoice works (not so easy to understand
that model concept at the first time :))
Only one point regarding to the
Hi Edvin,
I am an advocate of JQuery :). I even won their icon design contest, and
I've been using it for years! I think it should be used in all projects
that require effects or cool DOM manipulation.
I love the unobtrusive way and xhtml strict!
That being said, when it comes to wicket AJAX
See the testing section here
http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach
For testing spring.
Basically you make a context, and add it to the app. You can load it up
with whatever real/mock beans you need.
Rgds
Ned
Eyal Golan wrote:
Thanks.
I actually
Why not do:
final Image logoImg = new Image(logoimg);
logoImg.add(new SimpleAttributeModifier(src, chemin));
or:
final Image logoImg = new Image(logoimg);
logoImg.add(new AttributeModifier(src, true, new
AbstractReadOnlyModel() {
public final Object getObject() {
// TODO
Hi Ned,
thanks for your reply. I agree with your point of view. Today, however,
we got bitten because the designer wanted to change all buttons by
hiding them with jquery, and adding an anchor right after it in the
dom-tree, so he could style them the way he wanted it (not possible with
I haven't said anything up to this point, but we really don't seem to be
getting anywhere with what is turning into a religious war. I, for one,
have already started using 1.4, and love the generics, despite the extra
verbosity. It gives me extra type safety and code self-documentation. I
would
I forgot to mention... when I said code self-documentation, I meant that
there are places where I have a component or page that takes two models.
Which is which? I document it by the parameter name (i.e.
MyComponent(IModel fooModel, IModel barModel), but it is much better (and
the compiler checks
Hi,
I've been using the DefaultDataTable component in Wicket which allow me to
paginate through a few pages worth of multi column data.
I believe the general approach is to load all data from the database into
the session first (as a List of Domain Objects ?), then as navigation links
are
Jeremy Thomerson wrote:
I haven't said anything up to this point, but we really don't seem to be
getting anywhere with what is turning into a religious war. I, for one,
have already started using 1.4, and love the generics, despite the extra
verbosity. It gives me extra type safety and code
I hope I'm getting your point right ...
I think the solution for your problem is to mount the resource. E.g. in your
application class (if it's a logo that's reused often in the app ... and
also comes with the app)
final String name = foo.jpg;
getSharedResources().add(name,
Hi Nate, I think you have to create/override the factor method in DateTextField
and set it from there:
protected DateTextField newDateTextField(String id, PropertyModel
dateFieldModel)
{
return new DateTextField(id, dateFieldModel, new
Why can't you just query for the objects that should be on the page?
On Thu, May 22, 2008 at 9:51 AM, wfroud [EMAIL PROTECTED] wrote:
Hi,
I've been using the DefaultDataTable component in Wicket which allow me to
paginate through a few pages worth of multi column data.
I believe the
Well, perhaps if we documented our specific usecases, it might help
the case for change (that's assuming there aren't already a million
other people doing the same thing ;). I think creating the Wiki is a
good idea. It will help us identify the growing pains we're facing
and perhaps let folks
I am looking to unit test the following:
form.add(new AjaxSubmitLink(submitLink){
private static final long serialVersionUID =
3239568065916265026L;
@Override
protected void onSubmit(AjaxRequestTarget
You could use the bookmarkable version of setResponsePage(). That
just says what type of page to instantiate.
On Thu, May 22, 2008 at 10:51 AM, nitinkc [EMAIL PROTECTED] wrote:
I am looking to unit test the following:
form.add(new AjaxSubmitLink(submitLink){
Yes. I think trying to fix this problem is really trying to fix Java, which
is pretty far outside our scope. Sun Microsystems should be trying to fix
such use cases not us. If people are leaving the Java platform because of
verbosity my guess is such people left when they saw their first
Thank you for your help, I will try your solution :)
--
View this message in context:
http://www.nabble.com/How-can-i-load-Image---tp17403872p17406121.html
Sent from the Wicket - User mailing list archive at Nabble.com.
-
To
I'll chime in again. I really like generics. When I first upgraded to 1.4,
I did a bit of grumbling, but I came to realize some great benefits,
especially with components. I'd hate to lose that (almost as much as I'd
hate to go through my whole code base and remove that work).
I did a couple
see setitemreusestrategy, there is also an example in
wicketstuff.org/wicket13/repeater
-igor
On Thu, May 22, 2008 at 5:43 AM, i ii [EMAIL PROTECTED] wrote:
how can use refreshingview with textfield items that use validatior? when i
use and validator fails all textfield values reset. i want
That won't work for me b'cos I am also passing constructor arguments to the
response Page.
So new Page() is actually new Page(x,y).
jwcarman wrote:
You could use the bookmarkable version of setResponsePage(). That
just says what type of page to instantiate.
On Thu, May 22, 2008 at
Can those arguments be put into PageParameters?
On Thu, May 22, 2008 at 11:24 AM, nitinkc [EMAIL PROTECTED] wrote:
That won't work for me b'cos I am also passing constructor arguments to the
response Page.
So new Page() is actually new Page(x,y).
jwcarman wrote:
You could use the
actually, if implemented properly EditPage should take IModelPerson
and not Person itself. so unless you typed Link you have IModel?
that you have to cast to IModelPerson
-igor
On Thu, May 22, 2008 at 2:45 AM, Jan Kriesten [EMAIL PROTECTED] wrote:
Hi Johan,
I thing that the example below is
I have an issue with DropDownChoice components with an attached
AjaxFormComponentUpdatingBehavior. After the ajax is processed the focus
doesn't properly get reset so when the user tabs, the focus jumps back to
the top of the page. It doesn't happen all the time, but most of the time
(the issue
I am not sure, but would rather not. I believe this is a standard way to
create pages in Wicket(passing required arguments in constructors) and there
should be a mechanism to test this.
On a side note, when I change my code to:
form.add(new AjaxSubmitLink(submitLink){
The following statement
if (!component.isAuto() getFlag(FLAG_RENDERING))
in Component- checkHierarchyChange()
returns false when a Behavior is added to the Component.onBeforeRender()
phase, but returns true if
a Behavior is added by another Behavior as part of it's beforeRender()
phase.
thank you for help, but all i find is
org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy and
org.apache.wicket.markup.repeater.DefaultItemReuseStrategy. neither work, need
to implement org.apache.wicket.markup.repeater.IItemReuseStrategy?
Date: Thu, 22 May 2008 08:22:41 -0700
Hi Doug,
The bottom line was that the work didn't take that long and in the end I
feel my code is more readable and type-safe.
I have tried 4 times to convert my 1.3 codebase to 1.4 - and failed 4 times. All
in all I spent 3 days and just reverted it.
There are API changes thru generics,
Timo,
I am trying to achieve something similar. How did you manage to assign the
TestingWebApplication to your WicketTester?? Thanks!
mclev wrote:
mclev wrote:
4. Can I test that the response page is what I expect when when I first
render and when i submit my form
So, call me
Seems like bookmarkable setResponsePage will not work either. Check:
http://www.nabble.com/How-to-test-setResponsePage-td16802302.html
nitinkc wrote:
I am not sure, but would rather not. I believe this is a standard way to
create pages in Wicket(passing required arguments in constructors)
I use standard Wicket ajax progress bar. The Wicket version is 1.3.3.
It works excellent with IE6/7, Fox, Opera (little conflict with Date
picker), but doesn’t work with Safari (3.1.1). I can see title ‘upload
starting…’ only. No bar from left to right, no percentage...
I checked the example
Since I like to have the last word in all discussions, let's close
this one down and move it to our development list. I have started a
[discuss] thread over there with an outline of a process. See you
there!
Martijn
-
To
I ran into the same problem:
http://www.nabble.com/UploadProgress-in-1.3.3---does-it-work--to17372890.html
Martijn
On Thu, May 22, 2008 at 6:11 PM, Steamus [EMAIL PROTECTED] wrote:
I use standard Wicket ajax progress bar. The Wicket version is 1.3.3.
It works excellent with IE6/7, Fox, Opera
p.s. Sorry to be such a stickler, but I'm one of those folks who has
to have order. I can't work until I clean my desk up first! :)
Haha. You must be popular with girls (at least the ones I know would
love a guy like that)! ;-)
+1 for doing a vote.
Eelco
Please keep these types of discussion on the dev@ list. It is hardly a
user question (perhaps the confusing bit)
So if you go for a vote, do it on dev@
Martijn
PS. My boss would *love* you... my desk is a huge pile of paper,
cables, cd's, used mugs and cans.
you should be performing the query inside iterator() and size()
methods. that way you only retrieve the data you are going to display.
-igor
On Thu, May 22, 2008 at 6:51 AM, wfroud [EMAIL PROTECTED] wrote:
Hi,
I've been using the DefaultDataTable component in Wicket which allow me to
i cannot get to work :(
From: [EMAIL PROTECTED]
To: users@wicket.apache.org
Subject: RE: refreshingview with textfield items that use validatior
Date: Thu, 22 May 2008 15:47:52 +
thank you for help, but all i find is
org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy and
if you use reuseifmodelequalsstrategy then you need to implement
equals/hashcode on the models you give to refreshingview
-igor
On Thu, May 22, 2008 at 11:40 AM, i ii [EMAIL PROTECTED] wrote:
i cannot get to work :(
From: [EMAIL PROTECTED]
To: users@wicket.apache.org
Subject: RE:
I am not sure i follow you.
According to the log the user does not have the datapermission for the dropdown.
I tried to set the permissions like in the explanation below, but that didn't
work:
// Welcome page
permission ${ComponentPermission} ${front}.Welcome, inherit, render,
global;
Short version of my question:
Why wouldn't redrawing a surrounding span for an AjaxCheckBox (all
embedded inside a ListView) be enough to get it to check its
underlying PropertyModel, and then reflect that new value?
(and is it broken for an underlying PropertyModel's hashmap to return
null for
LOL - sorry - I saw tons of messages regarding generics and wanted to
make sure it didn't fall through the cracks.
Yes, you spoil us! :-P
M.
-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 21, 2008 6:50 PM
To: users@wicket.apache.org
Subject: Re:
Nothing happens in the AJAX debug - checked that first thing. It just
behaves as if the link doesn't exist.
Michael
-Original Message-
From: richardwilko [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 22, 2008 1:54 AM
To: users@wicket.apache.org
Subject: Re: AjaxLink not clickable in IE
maybe there is a div overlaying your anchor
-igor
On Thu, May 22, 2008 at 3:28 PM, Michael Mehrle [EMAIL PROTECTED] wrote:
Nothing happens in the AJAX debug - checked that first thing. It just
behaves as if the link doesn't exist.
Michael
-Original Message-
From: richardwilko
To answer my own question, what's needed is to override
DatePickerSettings.toScript(...) and specify %y where it specifies %Y.
On Thu, May 22, 2008 at 10:39 AM, nate roe [EMAIL PROTECTED] wrote:
Hrm, I think that StyleDateConverter is new to Wicket 1.3, as is the
forDatePattern method,
I can't give you a fix off the top of my head... that being said..
Your designer should forage into usability.
You can style buttons - in a limited fashion and its not consistent across
browser types - its a PITA! Don't do it!
The last thing we need is buttons that don't look like buttons.
On Thu, 22 May 2008, nitinkc wrote:
I am trying to achieve something similar. How did you manage to assign the
TestingWebApplication to your WicketTester?? Thanks!
WicketTester wicket = new WicketTester(new TestingWebApplication());
wicket.startComponent/Panel/Page(...
Best wishes,
Timo
--
86 matches
Mail list logo