2nd try: stateless AJAX behaviors in stateful page without its serialization

2010-04-19 Thread Martin Schayna
I have pretty stateful page with plenty of AJAX components. Most of these components have behaviors, which renders JavaScript code for calling AJAX requests to Java code. Because page isn't stateless, each request causes serialization of page. So far so good. But some of these AJAX requests

Re: 2nd try: stateless AJAX behaviors in stateful page without its serialization

2010-04-19 Thread Johan Compagner
so for that ajax request you do want to create a new page every time the ajax request hits? 2010/4/19 Martin Schayna martin.scha...@abra.eu I have pretty stateful page with plenty of AJAX components. Most of these components have behaviors, which renders JavaScript code for calling AJAX

Re: 2nd try: stateless AJAX behaviors in stateful page without its serialization

2010-04-19 Thread Martin Schayna
No, I want to process these requests in context of existing original page instance, but without page serialization. Standard processing of ajax requests is implemented in WebRequestCycleProcessor class, in method resolve(). This method is called with RequestParameters instance which is only

how to handle clear input for custom FormComponents

2010-04-19 Thread Dan Haywood
Hi all, I've developed a custom FormComponent (by subclassing FormComponentPanel) to act as a reference from one object to another (eg a Customer to an Address), but am having problems figuring out how to handle clear input (ie, if the user hits the cancel button on the form). To explain a

RE: how to handle clear input for custom FormComponents

2010-04-19 Thread Jeremy Thomerson
You shouldn't be committing your changes to the actual domain object until the form is submitted (your ok button). Jeremy Thomerson http://www.wickettraining.com -- sent from a wireless device -Original Message- From: Dan Haywood dkhayw...@gmail.com Sent: Monday, April 19, 2010 5:53

DropDownList

2010-04-19 Thread Josh Kamau
Hello guys, I am using a dropdownlist that am using to display a list of objects. however i want to replace the Choose one text with the first element in the list. how do i do this. Kind regards Josh

Re: DropDownList

2010-04-19 Thread Martin Makundi
Preselect? dropdown.setModelObject(default); Or default in your model. ** Martin 2010/4/19 Josh Kamau joshnet2...@gmail.com: Hello guys, I am using a dropdownlist that am using to display a list of objects. however i want to replace the Choose one text with the first element in the list. how

Re: DropDownList

2010-04-19 Thread MattyDE
just override protected CharSequence getDefaultChoice(Object selected) { and return this.getChoices.get(0).toString ... but be sure what you do! -- View this message in context: http://n4.nabble.com/DropDownList-tp2015827p2015837.html Sent from the Wicket - User mailing list archive at

Re: DropDownList

2010-04-19 Thread Josh Kamau
Thanks alot Martin and MattyDE, Martin's solution is exactly what i wanted. Regards. On Mon, Apr 19, 2010 at 3:42 PM, MattyDE ufer.mar...@gmail.com wrote: just override protected CharSequence getDefaultChoice(Object selected) { and return this.getChoices.get(0).toString ... but be sure

Re: DropDownList

2010-04-19 Thread James Carman
Josh, This seems to be one of the hardest things for new Wicketeers, understanding how models work. Basically, when you tell the DropDownChoice to use a model, you're saying when you want to know/update what's selected, go here. The funny thing about models is that they really are quite simple;

Re: DropDownList

2010-04-19 Thread Martin Makundi
God bless hollywood. ** Martin 2010/4/19 James Carman jcar...@carmanconsulting.com: Josh, This seems to be one of the hardest things for new Wicketeers, understanding how models work.  Basically, when you tell the DropDownChoice to use a model, you're saying when you want to know/update

Re: DropDownList

2010-04-19 Thread Josh Kamau
Thanks James. I think its slowly sinking into my Medulla Oblongata. On Mon, Apr 19, 2010 at 3:56 PM, James Carman jcar...@carmanconsulting.comwrote: Josh, This seems to be one of the hardest things for new Wicketeers, understanding how models work. Basically, when you tell the

Re: how to handle clear input for custom FormComponents

2010-04-19 Thread Dan Haywood
I found a way to make this work (though I worry the solution might be a little fragile). Basically, I'm overriding getInputAsArray() in my wrapper EntityLink, delegating to a hidden text field; then, in onBeforeRender() I check if there is input, and if not then infer that clearInput must've

What is the best way to use LoadableDetachableModel with a WebPage and DataView?

2010-04-19 Thread Steve Hiller
Hi All, I need help with a Wicket architecture design issue that I am having. In previous Wicket applications, I have used the LoadableDetachableModel in 2 separate ways: 1) In the constructor of a WebPage, an LDM is instantiated and then used as the model for a component such as a ListView.

Shutting down wicketstuff jira and confluence (temporarily)

2010-04-19 Thread Martijn Dashorst
In the light of the current JIRA XSS attacks I've shut down JIRA and Confluence, pending an investigation and upgrade of both products. Martijn -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now:

Date components

2010-04-19 Thread Ray Weidner
Hi All, Does anyone have any good suggestions for date/time entry components? Does Wicket offer a standard solution for this common case? Thanks, Ray Weidner

Re: Date components

2010-04-19 Thread moèz ben rhouma
You just add the following code to your java page: *add(dateTimeField = new DateTimeField(dateEnvoi, new PropertyModel(this, date)) {});* Which dateEnvoi defined in the markup file (the key of the component). And date defined in java like : private Date date = new Date(); 2010/4/19 Ray Weidner

Re: Date components

2010-04-19 Thread Ray Weidner
Thanks, I'll give that one a try. On Mon, Apr 19, 2010 at 10:59 AM, moèz ben rhouma benrhouma.m...@gmail.comwrote: You just add the following code to your java page: *add(dateTimeField = new DateTimeField(dateEnvoi, new PropertyModel(this, date)) {});* Which dateEnvoi defined in the markup

problem populating ListMultipleChoice selection model

2010-04-19 Thread Ray Weidner
Hi All, I'm trying to do something pretty simple: create a choice list with multi-select, which I iterate through upon clicking a button. Unfortunately, it looks like my selections aren't being recorded in the model that's supposed to receive them. Here's what the pertinent code looks like: -

Re: problem populating ListMultipleChoice selection model

2010-04-19 Thread moèz ben rhouma
Try to change the type of selectedParties from set to List selectedParties = new ArrayList(); 2010/4/19 Ray Weidner ray.weidner.wic...@gmail.com Hi All, I'm trying to do something pretty simple: create a choice list with multi-select, which I iterate through upon clicking a button.

Re: problem populating ListMultipleChoice selection model

2010-04-19 Thread Ray Weidner
Hi Moez, I'll give that a try when I have the code in front of me. But I'd be surprised if that works, because I am doing precisely the same thing on another page, including using a Set for the selected item model. In that instance, there's no problem. On Mon, Apr 19, 2010 at 11:55 AM, moèz

Re: Wicket Branding with setStyle - question about static images in src/webapp/*

2010-04-19 Thread Igor Vaynberg
see ContextImage, create your own version that is style-aware. alternatively you can create tag handlers just like wicket:link that will add your own version of ContextImage for you. -igor On Sun, Apr 18, 2010 at 11:16 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! I am

Re: Javascript template as linked header contribution?

2010-04-19 Thread Igor Vaynberg
you will have to create a TextTemplateResource to serve such resources and a TextTemplateResourceReference to create urls for them. -igor On Sun, Apr 18, 2010 at 8:25 PM, Ralf Eichinger ralf.eichin...@pixotec.de wrote: How to change

Re: What is the best way to use LoadableDetachableModel with a WebPage and DataView?

2010-04-19 Thread Igor Vaynberg
why all the complexity of ldm inside idataprovider, why not just: class mydataprovider implements idataprovider { private long applicantid; private transient applicant applicant; private applicant getapplicant() { if (applicant==null) { applicant=dao.get(applicantid); }} private

how to make a BookmarkablePageLink enabled when its parent component is disabled?

2010-04-19 Thread Dan Haywood
I have a FormComponentPanel (called EntityLink) that holds an image, a hyperlink (a BookmarkablePageLink) and a hidden text field holding the serializable value of the reference. Initially I want the form is in read-only mode and so I have disabled all of its form components. However, I'd

How to validate an entire object in a form (rather than a particular property of that object)

2010-04-19 Thread Dan Haywood
Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the

Re: What is the best way to use LoadableDetachableModel with a WebPage and DataView?

2010-04-19 Thread shetc
So the Sorting DataView Example at wicket-library.com is overkill? It uses an LDM, and that's what I based my own implementations on before. -- View this message in context:

Re: Shutting down wicketstuff jira and confluence (temporarily)

2010-04-19 Thread nino martinez wael
Great news :) 2010/4/19 Martijn Dashorst martijn.dasho...@gmail.com: In the light of the current JIRA XSS attacks I've shut down JIRA and Confluence, pending an investigation and upgrade of both products. Martijn -- Become a Wicket expert, learn from the best: http://wicketinaction.com

Re: Shutting down wicketstuff jira and confluence (temporarily)

2010-04-19 Thread Apple Grew
Shame real shame. Why ppl have to exercise their intellectual evilness on community sites like these. Regards, Apple Grew my blog @ http://blog.applegrew.com/ On Mon, Apr 19, 2010 at 11:02 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: Great news :) 2010/4/19 Martijn Dashorst

Re: Exception propagation

2010-04-19 Thread DmitryM
Okay, eventually I figured that out myself: - so, as per the wiki, the web.xml should have the following for the wicket filter: filter-mapping filter-namewicket/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher

Re: How to validate an entire object in a form (rather than a particular property of that object)

2010-04-19 Thread Pedro Santos
Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com wrote: Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be

Re: how to make a BookmarkablePageLink enabled when its parent component is disabled?

2010-04-19 Thread Pedro Santos
Hi, you can override the isEnable method and implement your rule, like: new BookmarkablePageLink { boolean isEnabled() { return form.getState() == allowedState; } } or you can add the link higher in the component hierarchy, don't as an form child. On Mon, Apr 19, 2010

Another beginner localization question

2010-04-19 Thread Alexandros Karypidis
Hi, I'm using a wicket:message tags, property files and a ChoiceRenderer to allow users to switch the Locale. My ChoiceRenderer overrides wantOnSelectionChangedNotifications() to have the browser send a Locale change event to the server and when this call returns, all wicket:message content

Re: Another beginner localization question

2010-04-19 Thread Pedro Santos
Your ChoiceRenderer can implement IHeaderContributor and add your javascript to IHeaderResponse object, since when the user change the value on the selection component, the page will to be re-rendered On Mon, Apr 19, 2010 at 4:54 PM, Alexandros Karypidis akary...@yahoo.grwrote: Hi, I'm using

Re: Another beginner localization question

2010-04-19 Thread Alexandros Karypidis
Aha! ...the joys of learning Wicket! :-) On 19/4/2010 10:58 μμ, Pedro Santos wrote: Your ChoiceRenderer can implement IHeaderContributor and add your javascript to IHeaderResponse object, since when the user change the value on the selection component, the page will to be re-rendered On Mon,

What can I do to speed up wicket initialization?

2010-04-19 Thread Esteban Ignacio Masoero
Hi there: I know it's not THAT slow, and every presentation framework has it's loading time, but in my case this is affecting me in a much worse way and there's no other solution for now. Can any wicket expert tell me what can I do (anything: pre-compile something, do something lazily, avoid

Re: mountBookmarkablePage() and ajaxlink problem.

2010-04-19 Thread Mathias Nilsson
Does Product implements Serializable? -- View this message in context: http://n4.nabble.com/mountBookmarkablePage-and-ajaxlink-problem-tp2014767p2016617.html Sent from the Wicket - User mailing list archive at Nabble.com. - To

Re: What can I do to speed up wicket initialization?

2010-04-19 Thread Jeremy Thomerson
This is typically not Wicket initialization. The quickstart starts up in less than two seconds. You need to look at your domain / service / data layers. It's typically Spring / Hibernate loading / initializing that takes a long time (I've seen apps that take many *minutes* to start up). --

Re: What can I do to speed up wicket initialization?

2010-04-19 Thread Zilvinas Vilutis
Spring / hibernate usually loads *before* seeing the message Started Wicket in deployment mode. Although i,n my project ( wicket / spring / hibernate ) it takes less than a second to finish the app loading after this message has appeared. It might be eh-cache, which usually takes a few secods to

String Resource Loading from DB

2010-04-19 Thread Zilvinas Vilutis
Has anybody had implemented smth like that ( @see topic ) and / or had any practice with this? I'm looking for a resource loading solution for quite a big web-site project which would be localized to many languages and may need to require update at runtime using some administration panel. Or is

Re: Javascript template as linked header contribution?

2010-04-19 Thread Ralf Eichinger
Am Montag, den 19.04.2010, 09:08 -0700 schrieb Igor Vaynberg: you will have to create a TextTemplateResource to serve such resources and a TextTemplateResourceReference to create urls for them. -igor as there are no TextTemplateResource and TextTemplateResourceReference classes in Wicket

Re: how to make a BookmarkablePageLink enabled when its parent component is disabled?

2010-04-19 Thread Dan Haywood
Hi Pedro, That was my first instinct, to override isEnabled(), but it turns out that it is isLinkEnabled() that gets called, in the onComponentTag() method (ie when rendering). So, no joy there. Any other suggestions, anyone? Dan On 19/04/2010 20:41, Pedro Santos wrote: Hi, you can

Re: How to validate an entire object in a form (rather than a particular property of that object)

2010-04-19 Thread Dan Haywood
Hi Pedro, but my problem is that there is no form component to represent the form itself, is there? Any other thoughts? Dan On 19/04/2010 20:27, Pedro Santos wrote: Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com mailto:dkhayw...@gmail.com wrote: Another

Re: Javascript template as linked header contribution?

2010-04-19 Thread Igor Vaynberg
i meant you have to create the classes... -igor On Mon, Apr 19, 2010 at 4:10 PM, Ralf Eichinger ralf.eichin...@pixotec.de wrote: Am Montag, den 19.04.2010, 09:08 -0700 schrieb Igor Vaynberg: you will have to create a TextTemplateResource to serve such resources and a

Re: How to validate an entire object in a form (rather than a particular property of that object)

2010-04-19 Thread Igor Vaynberg
you can override form.onvalidate() and do your validation there -igor On Mon, Apr 19, 2010 at 4:51 PM, Dan Haywood dkhayw...@gmail.com wrote: Hi Pedro, but my problem is that there is no form component to represent the form itself, is there? Any other thoughts? Dan On 19/04/2010