Re: WicketTester, FormTester, and AjaxSubmitLink
* James McLaughlin: > Hi, > Hacking away at some tests, I figured the proper way to test an > AjaxSubmitLink would have been as follows: > > Panel p = tester.startPanel(EventPanel.class); > FormTester ft = tester.newFormTester(p.getId() + ":eventForm"); > ft.setValue("messageField", ALARM_MESSAGE); > tester.clickLink(p.getId() + ":eventFormSubmitLink", true); > > However, the values set in the FormTester don't get submitted for some > reason. It works if I change it to: > > Panel p = tester.startPanel(EventPanel.class); > tester.setParameterForNextRequest(p.getId() + > ":eventForm:messageField", ALARM_MESSAGE); > tester.clickLink(p.getId() + ":eventFormSubmitLink", true); > > which while 1 line briefer, didn't seem intuitive (to me at least). Is > it possible to make it work like the former, or is it better left as > it is? Is it WICKET-932? -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Experiences with ReloadingWicketFilter
* Peter Thomas: > Soto confirmmy understanding,when usingthe > ReloadingWicketFilter, when you make a change to a Page you have > to re-trace navigation to a point prior to where the Page is > loaded. Is that correct? You have to make sure you're not using an instance of a page loaded in a previous classloader, ie make sure not to keep an instance of a page across reloads. > I'm justhoping that something canbe done (or > un-done) to improve the developer experience when using > ReloadingWicketFilter. To be honest ReloadingWicketFilter is a hack to work around how the JVM loads classes, and it is bootstrapped during the Wicket application initialization. If ReloadingWicketFilter is causing more problems than it is meant to solve, we might simply want to remove it from Wicket, especially if it proves to be unreliable in complex setups. Unless you're willing to turn your hope into contribution? Have you seen my suggestion to clear your session cookie before reloading the page BTW? All this is very complicated I realize, but there's not much we can do to simplify reloading. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Experiences with ReloadingWicketFilter
* Peter Thomas: > Just curious to know if others have problems with the > ReloadingWicketFilter when you make minor changes to a page with > markup inheritance, you may want to look at the issue history. FYI the problem described in the JIRA issue is not related to markup inheritance. The exception is thrown because the class TestPage is loaded from two different classloaders, thus TestPage(classloader1) != TestPage(classloader2). -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Download invoice without DownloadLink
* Oleg Taranenko: > > use case: if user select from dropdownlist "retrieve invoice", > > the predefined invoice file (pdf, or doc) should be downloaded to the >client as response. > > How is it possible? some play with RequestCycle? Examples for serving static data is shown at http://wicketstuff.org/wicket13/staticpages/ Please provide some feedback if you find it useful... or not. This is a frequently asked question, and we need to make very obvious examples available to everyone. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Checking behaviour in testcase
* Emanuele Gesuato: > I'm trying to check the presence of a behaviour in a testcase. > > I have a page with a checkbox and a button, if a user click on > the button without selecting the checkbox, an alert box show a > message. If i access to the page through a browser (firefox) the > page runs fine and the alert box is correctly displayed. So, i > would like to retrieve the behaviour from the form component > after submitting the form itself, but i can't find any behaviour > (the list is empty!). > > Why ? Is there something wrong with the testcase ? > > > > public class Alert extends AbstractBehavior { > private static final long serialVersionUID = > 3346789663630395006L; > private String msg; > > public Alert(String msg) { > this.msg=msg; > } > > @Override > public boolean isTemporary() { > return true; > } WicketTester has not the exact same request lifecycle as in a real webapp. Can it be because of isTemporary() returns true? -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester, testing Form and SubmitLink
You may want to paste the exception BTW, it is missing. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester, testing Form and SubmitLink
* wicket user: > I've raised the issue, https://issues.apache.org/jira/browse/WICKET-932 Thanks! > Jean, please excuse my ignorance but when you request a quickstart project > do you mean you want the whole quickstart project with the problem > illustrated zipped into my file. Anything that helps us to go straight to the problem can be helpful. This can be: * A Java project with pom.xml, jetty launcher and relevant sources. This is probably not really the best thing to do for the problem at hand * Unit tests, this is especially useful if the problem is about WicketTester itself It is preferrable to submit the unit tests as a patch to the existing Wicket test classes, but if you file whole classes, that will do it as well. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get HTML source code from a wicket page
* Oliver Henlich: > > Here is the jira entry > https://issues.apache.org/jira/browse/WICKET-929 This is fixed now, please take the latest snapshot of Wicket core, and try again. If there is still a problem, please reopen the issue. Cheers, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Regarding Modification file Watcher
* Edi: > I have one server path folder. It contains .xls files. I want to > check what are the current updated xls file. and insert that xls > file name into db. > > for eg. i have a folder FOLDER1, It contains sales.xls, > report.xls. If I change and save this file. Our program(file > watcher) have to know immediately and insert that file and > updated time. Is it possible in wicket? > > I saw wicket api, wicket.util.watch.ModificationWatcher, > > Is it useful to me? Yes it can be used for this, I used it in ReloadingClassLoader, and Wicket uses it internally for markup files. You could also use FAM in Commons JCI I believe. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Palette and FormTester
* mperham: > > It's hackish but this modified selectMultiple works for me: > > public void selectMultiple(String formComponentId, int[] indexes) > { > checkClosed(); > > // This is a hack to get Palette selection working with > FormTester. > // Note we can't reference the palette class directly since > FormTester > // is in wicket and Palette is in wicket-extensions so we need > to do > // some acrobatics to deal with this. > Component c = (Component) workingForm.get(formComponentId); > if (!(c instanceof FormComponent)) { > // Palette is not a FormComponent > FormComponent recorder = (FormComponent) > workingForm.get(formComponentId > + ":recorder"); > String recorderValue = recorder.getValue(); > IChoiceRenderer renderer = > (IChoiceRenderer)callGetter(c, > "getChoiceRenderer"); > Collection choices = (Collection)callGetter(c, > "getChoices"); > List choiceList = new ArrayList(choices); > for (int i = 0; i < indexes.length; i++) > { > int j = indexes[i]; > Object value = choiceList.get(j); > String val = renderer.getIdValue(value, j); > recorderValue += val; > if (i + 1 < indexes.length) { > recorderValue += ","; > } > } > setFormComponentValue(recorder, recorderValue); > return; > } > FormComponent fc = (FormComponent) c; > ChoiceSelector choiceSelector = > choiceSelectorFactory.createForMultiple(fc); > > for (int i = 0; i < indexes.length; i++) > { > choiceSelector.doSelect(indexes[i]); > } > } > > private Object callGetter(Object self, String method) { > try > { > Method m = self.getClass().getMethod(method, null); > return m.invoke(self, null); > } > catch (Exception e) > { > throw new RuntimeException(e); > } > } Dear Mike, If FormTester is missing a feature to work with the Palette, why not submitting a patch in JIRA? Thanks in advance, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get HTML source code from a wicket page
* oliver.henlich: > > Hi Jean-Baptiste, just wondering if you got a chance to look at this? Hi Oliver, I have identified the bug thanks to your stacktrace, and it would be great if you could file an issue on JIRA. Something like: ExceptionErrorPage only works with WebResponse Thanks in advance, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Aspectj loadtime weaving and reloading servlet
* Carlos Pita: > That is the customary message the reloading servlet shows after > reloading any changes. What is new is the output from the weaver > above it. I guess the reloading classloader has to reinstantiate > itself in order to load new versions of the same old classes, > and this is notified to the weaver java agent so that it can > take consecutive actions. But it's just a supposition. Maybe > Jean Baptiste would be able to throw some light on the question? Indeed everytime a monitored class changes, the application is initialized and the ReloadingClassLoader is instantiated. There is no other solution as there is no way to remove a previously loaded class definition from the JVM's URLClassLoader, the whole ClassLoader needs to be created anew. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester, testing Form and SubmitLink
* wicket user: > > I'm trying to test a form submission with SubmitLink, test code below: > > tester.setParameterForNextRequest("numberChangeForm:numberToChangeTo", > numberToChangeTo); > > reset(smsServiceMock); > smsServiceMock.sendActivationSms(isA(Subscriber.class)); > replay(smsServiceMock); > > // submit the form > //tester.clickLink("numberChangeForm:numberChangeSubmitLink"); > tester.submitForm("numberChangeForm"); > > - trying to call the link directly but I just get the below exception which > I'm not really surpised about > > java.lang.IllegalArgumentException: The component class doesn't seem to > implement any of the known *Listener interfaces: class > com.yeigo.view.wicket.register.RegistrationCheckPage$2 This is a bug in WicketTester (BaseWicketTester actually). Like Igor suggests, please create a JIRA issue at https://issues.apache.org/jira/browse/WICKET If you could provide a "quickstart" project, that would be great too. Thanks, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicketstuff-dojo questions and answers
* Kirk Israel: > Q. a. Why isn't this stuff documented in more depth? b. And why don't > people answer every stupid little question I have. > A. a. Wicketstuff-Dojo is still a fairly young project with people who > are currently more into coding it for more functionality than > documenting. You're certainly welcome to contribute. b. These > volunteers aren't interested in doing your work for you! And they're > busy. And your questions are sometimes dumb. Hi Kirk, Your questions and answers about the Java components are valuable, feel free to improve the Wiki documentation for WicketStuff Dojo: http://wicketstuff.org/confluence/display/STUFFWIKI/WicketStuff+Dojo Why didn't we reply earlier to your message: because August is holidays for most of WicketStuff Dojo developers. And there is another reason: Vincent Demay who is the most active developer has not yet subscribed to the Apache mailing-list. So bear with us, and keep up with your feedback, it's appreciated. Note that like all other OSS (Open Source Software) developers, we have very limited time to work on those projects. Our main job is *not* about polishing WicketStuff Dojo, nor even working with Wicket most of the time. Cheers, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using pickwick
* Tauren Mills: > Can someone explain how to use pickwick from wicketstuff? > > I checked out pickwick from wicketstuff trunk and did a mvn install > eclipse:eclipse. Had to turn off tests as they were failing. And I > had to download and install wicketstuff-dojo-1.3.0-SNAPSHOT manually > as mvn didn't find it. But once done, the eclipse project looked good > with no errors. Hey sorry I'm catching up from nearly one month of holidays. Still got 700 messages to read in this list :-( I just fixed the tests, thanks for reporting. > So I started PickwickLauncher in debug mode as a Java Application, > then went to http://localhost:8080/. This gives an NPE: > >1. Unexpected RuntimeException >2. >3. Root cause: >4. >5. java.lang.NullPointerException >6. at java.io.File.(Unknown Source) >7. at > org.wicketstuff.pickwick.backend.ImageUtils.toFile(ImageUtils.java:237) This should not happen if your build of Wicket core is fresh-enough. Cheers, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: creating RSS feeds with Wicket
* Ryan Sonnek: > I'm not familiar with IResourceStream and using a WebPage approach has > allowed for me to have great control over several aspects including: > * url mount points > * url parameter strategies > * possibly configuring the response Expires/Cache headers? > > Do you have any examples of how this would work as a resource stream? Igor will hate me, but here it is: http://wicketstuff.org/wicket13/staticpages/ -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: creating RSS feeds with Wicket
* Ryan Sonnek: > I'd really need to see this to believe it. Can you really use > this kind of component without it being a page? Using a page > allows for bookmarkable URLS, mount points, easy page parameter > passing, all of which I use *extensively* to create my rss > feeds. someone will have to prove me wrong if this can be all > done without using a page. > > If you have an idea for a way to have the exisiting API work and > make it more extensible, I'm all ears. You're right, there's a misunderstanding. I thought of a RSS aggregator where you display a feed converted to HTML in a Component. But your example is about *serving* the feed... Then I'm a bit puzzled! What is the advantage of using a Wicket WebPage for this? Why don't you just stream it as an IResourceStream? IMO WebPage and the whole great Wicket component hierarchy is about user interaction, not about streaming machine-to-machine resources. WDYT? -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: creating RSS feeds with Wicket
* Ryan Sonnek: > http://www.jroller.com/wireframe/entry/wicket_and_rss_feeds > > Just wanted to post an announcement that there's a new wicket stuff project > (wicketstuff-rome) to allow for creation of RSS (or Atom) feeds from within > Wicket. I've been using it for the past several weeks and it's allowed me > to integrate RSS feeds into my Wicket app *very* quickly. > > This new project is a definite step up from the existing wicket wiki article > for Rss pages, but I'm not sure what to do about that info. Please let me > know if anyone has suggestions or issues with the project. Now that it's on > wicketstuff, feel free to tweak or add features! Actually to make it really reusable I would have put protected abstract SyndFeed getFeed(); in FeedOutputComponent. So that we can have the feed output in a component of a page instead of a full page. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: keyboard shortcuts in wicket ?
* Nino Saturnino Martinez Vazquez Wael: > I once started a wicket stuff contrib, called wicket input > events. Which were gonna be all about input events like mouse > events and key events. It never got that far because I didnt > really needed it. Some of the basic infra structure in the > project should be ready I think but its not in any usable state > right now. > > Feel free to contine the work, as I currently only will have > time to do it when I need it, although I'll be happy to assist. Dear Nino, I believe that you may be out of time to finish the work on wicket-contrib-input-events/, but at least could you provide a decent README? Currently the README is a copy of the gmap2 one... This kind of rudimentary polishing would help to jump in maybe. We probably don't want to end-up with too many unfinished and undocumented projects, otherwise the users will be disappointed. Also it would be a plus if the tests were successful. Thanks, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DownloadLink hanging
* Igor Vaynberg: > yep, DownloadLinks will block because requests to the same page > are serialized. Igor, that's a good point. Thomas, did you try to follow the approach shown in the static pages examples? See http://wicketstuff.org/wicket13/staticpages/ -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changes made for http://www.wicketstuff.org/bamboo/browse/issue/WICKET-702
I just checked a fix in, can you see if it works better for you? See http://svn.apache.org/viewvc?view=rev&revision=568960 -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]