RE: What does this syntax say?

2011-07-29 Thread Wilhelmsen Tor Iver
public W IWrapModelW wrapOnInheritance(Component component,ClassW type) The ClassW parameter is only needed if you intend to do new W(); or the like in the method (the Class is then something the compiler can grab hold of for calling the constructor). For just passing the type parameter to

RE: getInput and getDefaultModelObject and validation

2011-07-29 Thread Wilhelmsen Tor Iver
If I am using some form validator, I notice that getDefaultModelObject does not have the value from the getInput. I am assume this intentional. Is there a way to force wicket to update the modelObject? Yes, form component models are not updated until they pass validation, that is very

show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
Hi all, I have a page with an AjaxLink which shows a modal window. This modal window contains a form and when we submit the form, modal window disappear, my page is reloaded and a second ajaxLink is created. When we click on this second ajaxLink, another modal window appears. This part works

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Sven Meier
Hi, setResponsePage(QuestionnairesPage.class, new PageParameters(p=3)); you're leaving the current page before it can open the new modal window. Try this instread: firstPage.getModalModule().close(target); ... qPage.getModalModule().show(target); Hope this helps Sven -- View this message

RE: getInput and getDefaultModelObject and validation

2011-07-29 Thread Brown, Berlin [GCG-PFS]
I guess there are cases where you want to use an AbstractFormValidator and run validation on a form before it is submitted and want to address those fields before they are submitted. It would be nice if the modelobject were updated. Let's say you have 100 textfields attached to a form, you want

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
Hi Mathilde, why not simply substitute modal window content instead of reloading page and creating a brand new modal window? Your code doesn't work because setResponsePage create a new instance of QuestionnairesPage different from the one referenced by qPage variable. Hi all, I have a

RE: getInput and getDefaultModelObject and validation

2011-07-29 Thread Wilhelmsen Tor Iver
Is there a way to force a modelobject update on each individual field and then do my form validation. It seems you want to use getConvertedInput(). Going via the model to get the converted value is just a detour when you are in a validator. If you push data to the model and then decide it is

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
Thanks a lot for your answer. The solution of Sven Meier works well. Sometimes I wonder why I always try complex solutions instead of simplest one...

RE: getInput and getDefaultModelObject and validation

2011-07-29 Thread Brown, Berlin [GCG-PFS]
then your model will have invalid data, and if that is acceptable, what role does the validator fill then? You might as well do your checks in onSubmit() at that point... I guess it depends, I normally haven't had a need to validate every individual component. But I like having all of my model

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
Well, I talked too fast. In fact, with Sven's solution : membreCourant = serviceMembre.enregistrerReponses(membreCourant, questionnaireCourant); SessionE4N.get().setMembre(membreCourant); //setResponsePage(QuestionnairesPage.class, new

Re: Ajax broken in IE 8

2011-07-29 Thread Martin Grigorov
1.4.17 is in use by many people and you're the only one having this problem. 1.5.x and 1.4.x are the same related to WICKET-3887. AjaxLink/AjaxFallbackLink cannot do POST request unless you override parts of them. On Fri, Jul 29, 2011 at 7:54 AM, T P D li...@diffenbach.org wrote: Wicket

Re: AjaxFormComponentUpdatingBehavior target.addComponent(component) causes to lose focus

2011-07-29 Thread Jack Berg
It seems, that cause was, that I was adding all the components to the AjaxRequestTarget in my AjaxRequestTarget.IListener. Is it a bug, that it does not return focus to the replaced component? -- View this message in context:

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
Try to use just one modal window and switch content panels. I.e: -Create modal window with questionnaireContentPanel as initial content: modalQuestionnaireModule = new ModalWindowE4N(modalQuestionnaireModule,); questionnaireContentPanel = new

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
I tried your solution Andrea : - just one modal window : modalWindow = new ModalWindowE4N(modalQuestionnaire, ); questionnaireContentPanel = new QuestionnaireContentPanel(modalWindow.getContentId(), this); modalWindow.setContent(questionnaireContentPanel);

Re: Scala DSL for Wicket

2011-07-29 Thread Martin Grigorov
Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borges bruno.bor...@gmail.com wrote: Just wanted to share my experience playing

Re: Repeating form on a page

2011-07-29 Thread heikki
hello, despite searching around I haven't found a good working example/explanation of how to create a page where a form is repeated for each element in a collection. (I found some info on using repeaters inside forms, but that is a reverse situation). Earlier in this thread there's the advice to

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
Sorry, you are right. Under wicket 1.5 works calling replaceWith on old content. In your code should be something like : moduleContentPanel = questionnaireContentPanel.replaceWith(moduleContentPanel); target.addComponent(moduleContentPanel); I didn't tested it with 1.4.x version. I

Re: wicketstuff tinymce development

2011-07-29 Thread jbrookover
Michal Letynski wrote: Ok i solved the problem. I used wrong version (1.4.17.3 - its buggy). I get exceptions: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1937) at

Re: Ajax broken in IE 8

2011-07-29 Thread T P D
OK, so since I'm having this problem and no one else is -- what am I doing wrong? And why is it working in Firefox? In Firefox, with javascript disabled, I get a normal POST; with javascript enabled, I get ajax. In IE 8, using Wicket 1.4.9, even with javascript enabled, I get a POST (the

Re: How to Integrate Wicket with Apache POI

2011-07-29 Thread eugenebalt
It's very easy. 1) In your HTML: # Export to Spreadsheet 2) In your Java: add(new DownloadLink(link, generateExcelFile()); The DownloadLink is a provided Wicket class. Note that generateExcelFile() must return a File object. If the file already exists, you just read it. If you need to

Re: How to Integrate Wicket with Apache POI

2011-07-29 Thread eugenebalt
Sorry; in the previous post, the HTML got rendered. I meant to write, 1) In HTML: a wicket:id=link href=# (just create the standard HTML link) 2) In Java, use add(new DownloadLink(link, file)); -- View this message in context:

Re: Repeating form on a page

2011-07-29 Thread Sven Meier
Hi, it really doesn't matter which repeater, but ListView is probably the most easy to use. protected void populateItem(ListItem item) { add(new AForm(...); } Typical error each of us has done wrong when using repeaters for the first time. It has to be:

Re: Ajax broken in IE 8

2011-07-29 Thread Dan Retzlaff
I'll help you test it if you boil it down to a quickstart application you can share. On Fri, Jul 29, 2011 at 8:12 AM, T P D li...@diffenbach.org wrote: OK, so since I'm having this problem and no one else is -- what am I doing wrong? And why is it working in Firefox? In Firefox, with

Advanced Mounting Markup Location

2011-07-29 Thread Arjun Dhar
When Locating the Markup for a Page, I want to know the corresponding class (associated with the page/markup). Currently Im directing Wicket to my Custom Markup location with the following code in Application: ... final IResourceStreamLocator defaultLocator =

Re: resource problem..

2011-07-29 Thread mlabs
can you elaborate on that quick solution ? i'm getting errors about not finding the wicket:id .. the stylesheet link was in the HEAD section .. do I need to move that? if not, how do I add the link on the java side? TIA -- View this message in context:

Re: Scala DSL for Wicket

2011-07-29 Thread Bruno Borges
I thought about this yesterday but maybe overloading the method is better. Because this way the function must have to be passed as of expecting an id argument, even if the id argument for ldm() is optional. I just haven't added yet because of lack of usecase. :-) But thanks!! This DSL is

Manually Rendering a DataGridView

2011-07-29 Thread Matt Schmidt
Is there any way to access the HTML of each cell that would be rendered in a DataGridView without adding it to the page and actually rendering it? Ultimately, I am trying to add all of the inner HTML of the cells of the DataGridView to a JavaScript array.

Re: Scala DSL for Wicket

2011-07-29 Thread Ben Tilford
For LDM class Ldm[T](provider:()= T) extends LoadableDetachable... { def load():T { provider() } } object Ldm { def apply(provider:()=T) = new Ldm[T](provider) } could be used as ... val id = 1 val model = Ldm(()={dao.get(id)}) or val id = 1 def provider = dao.get(id) val model =

Non-Submit Button Not Getting Called from Form

2011-07-29 Thread eugenebalt
It's something simple that I'm forgetting, but my non-Submit button (e.g. Cancel) is not getting called from my Form. The button is a simple Button, not Ajax. My HTML (using [] to avoid rendering here): [form wicket:id=.. ] [input wicket:id=btnReturn type=button value=Return to Home Page

Re: resource problem..

2011-07-29 Thread eugenebalt
In the HTML, it would like this: html head titleLog In/title wicket:link link wicket:id=stylesheet/ /wicket:link /head body So the WicketID CSS placeholder is where you would normally put a static CSS declaration. Note the wicket:link around it. Second, in Java,

Re: What does this syntax say?

2011-07-29 Thread Scott Swank
This is called a generic method, and you're just giving the type signature of the method. Here's an example from our code. public static T extends Number ComparableT NumberFieldT withMinimum(String id, T min) { NumberFieldT f = new NumberFieldT(id);

Re: Non-Submit Button Not Getting Called from Form

2011-07-29 Thread hariharansrc
Actually what you will do when clicking cancel override onSubmit event similarly like other buttons https://cwiki.apache.org/WICKET/multiple-submit-buttons.html -- View this message in context:

Re: Advanced Mounting Markup Location

2011-07-29 Thread Arjun Dhar
ok its embarassing to have to post the answers to your questions, heh but this is one is for less fortunate: In my application I could pass the Class of the MarkupContainer (rather than the class that loads the markup) /** * The {@link