Running a local process using Wicket
We want to replace our fat client application (developed using C#) with a web application. Wicket is one of the technology options we are considering. Our question: Is it possible, and if so, how, to run a local process on the users machine (normally run from the command line) from Wicket. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Running-a-local-process-using-Wicket-tp4670070.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Button component not enabled in FireFox
Wicket: 1.4.16 FireFox:3.5.4 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Button-component-not-enabled-in-FireFox-tp3675168p3677363.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Button component not enabled in FireFox
We are using the standard ModalWindow in our base page. To our modal we add a panel with one button, used to close the window. >From our base page, we instantiate a wizard. Works great, on all browsers, apart from the following issue: In FireFox, when the modal is opened in the last step in the wizard, the button in the panel does not work. We recieve the following console error: WARN BehaviourRequestTarget - component not enabled or visible; ignoring call ... and a reference is given to the button Cannot see anywhere in the code where the button is being disabled or made invisible, and in IE it works fine. Does anyone have any ideas, thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Button-component-not-enabled-in-FireFox-tp3675168p3675168.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow - CSS problem in IE
Found the problem: The
ModalWindow - CSS problem in IE
We are using the standard Wicket ModalWindow. To this we add our own Panel. In order to override the CSS which is used by ModalWindow (defined in the file model.js) , we are taking the existing CSS (which we grab using Firebug), add it to the
AutoCompleteTextField which uses an Object, not a String
I have a model which backs a form. One of the fields in the model is a custom object type, City. In the form I have a field defined as AutoCompleteTextField. This is populated with a list of City objects, and because City.toString() is overriden, everything displays nicely in the list. However, when a city is chosen, the model does not appear to be getting updated. I cannot find another way to access the City object which was selected. Can anyone help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-which-uses-an-Object-not-a-String-tp3596762p3596762.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Basic TextField question
Still does not work -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Basic-TextField-question-tp3579272p3579294.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Basic TextField question
When I create a TextField as follows: TextField postCode = new TextField( new Model("xxx")); the object is created and shows the correct value. However, once the object is created, I do not seem to be able to change the value. postCode.setModelObject("zzz"); and postCode.setModet(new Model("zzz")); both do not appear to work, even with all the Ajax stuff setup correctly. What would be the correct code, thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Basic-TextField-question-tp3579272p3579272.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AutoCompleteTextField
Which method has to be implemented in order to place code to execute when a value is selected in an AutoCompleteTextField? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-tp3562675p3562675.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting Parameters from URL
We have code in our session object as follows: public class OurSession extends WebSession { public OurSession(Request request)}{ super(request) // GET PARAMETERS FROM REQUEST userId = request.getParameter("userId"); } } This works the first time, so if the url has a parameter of userId=JOHN then this can be picked up in the above code. However, if the application is again requested from the browser (and the session already exists), this code will not get called. What is then the best way to pick up the parameters on the url? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Parameters-from-URL-tp3517499p3517499.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Running Wicket under WebSphere
I should add that we are using Spring 3, which uses ContextLoaderListener, not ContextLoaderServlet -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Running-Wicket-under-WebSphere-tp3487476p3487531.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Websphere 6.1
This uses Spring 2 and ContextLoaderServlet Does anyone have an example of a web.xml defined using Spring3 - ContextLoaderListener - and Wicket -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-in-Websphere-6-1-tp1886967p3487523.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Running Wicket under WebSphere
We are using WebSphere 6.1, front ended by Apache (IBM HTTP Server) Our Wicket application uses WicketFilter When moving our war file from our Eclipse/Jetty environment to Websphere, WebShpere is not finding the url of the project. However, if we put a static resource, eg an html file, under the application context root, then WebSphere WILL find it. If anyone has any ideas how to resolve the issue, thanks very much. Our web.xml is defined as follows: http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> pki org.springframework.web.context.ContextLoaderListener contextConfigLocation classpath:applicationContext.xml wicket.pki org.apache.wicket.protocol.http.WicketFilter applicationClassName com.drf.hapoalim.gui.application.HapoalimApplication wicket.pki /* -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Running-Wicket-under-WebSphere-tp3487476p3487476.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxButton wont work with PasswordTextField in IE7
what is the best way to get the error within onError() ? form.getFeedbackMessage() returns null thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxButton-wont-work-with-PasswordTextField-in-IE7-tp3447260p3447335.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxButton wont work with PasswordTextField in IE7
I have a form with an AjaxButton, and it works fine. When the button is clicked, the onSubmit() method defined for the button is called. However, after adding a PasswordTextField to the form, the button ceases to work, meaning the onSubmit() method is no longer called. The browser is IE7 - the application has to support this browser. Any help greatly appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxButton-wont-work-with-PasswordTextField-in-IE7-tp3447260p3447260.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AttributeModifier question
Looks like I've found the answer - AttributeAppendor -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-question-tp3429987p3429998.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AttibuteModifier question
Just as one can use component.add(new AttributeModifier("class", new Model(""))); to modify the css class for a component, is there a way to either 1. get the existing class value, 2. or alternativly to append a class to the existing css classes set for that component, rather than replacing the existing ones. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AttibuteModifier-question-tp3429987p3429987.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Redirecting to another page in a WebPage constructor
In the constructor of a class which extends WebPage, is there a way to redirect to another page? setResponsePage() apparently will not work in a constructor. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirecting-to-another-page-in-a-WebPage-constructor-tp3345688p3345688.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEventBehaviour on page onload
I wonder if anyone can help with the following: I've added this code to a the constructor of a WebPage: this.add(new AjaxEventBehavior("onload") { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(" IN on-LOAD"); } }); Am expecting the event to be called when the page loads, but it is not. Here is the snippet for the page head: VCF Any ideas are appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehaviour-on-page-onload-tp618p618.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to automate clicking of a link or button
I've got some code now which does what I want - different from what you suggested with London-Paint - still need to return to that as once I have it working it will be probably be better. I can click on a link/button, and run a piece of code which runs a javascript function and returns the value to the java code. My particular use case is to call an activeX function to see if a security minikey is attatched, configured, and so on. I think what I have is a bit of a hack right now, but it works, and now I want to package it up better so it can be used as a component, kind of like this: Object obj = new JSFunctionCaller("function-name").getReturnValue(); This is what I am thinking: put the functionality I have in a seperate panel (JSFunctionCaller), instantiate the panel and then, within the constructor, automatically call the ajax ink which, right now, I have to manually click on to get this thing to work. I am also thinking now that I may be able to just add an AjaxEventListener to the onload of the page - that would also work as it would give me an AjaxRequestTarget which I could then use for appendJavascript() On Thu, Mar 3, 2011 at 2:23 PM, Martin Grigorov-4 [via Apache Wicket] < ml-node+227-1044453854-65...@n4.nabble.com> wrote: > What do you want to do exactly ? > > There is no need to click a button in Wicket. > E.g.: > btn = new Button(...) { >public void onClick() { > myService.doSomething(); >} > } > > so you can just call: myService.doSomething() instead. > > In javascript you can do: Wicket.$("myButtonId").click() > > On Thu, Mar 3, 2011 at 2:16 PM, drf <[hidden > email]<http://user/SendEmail.jtp?type=node&node=227&i=0&by-user=t>> > wrote: > > > Is there any way to automate the clicking of a link or button, similar to > > > WicketTester, but within a running Wicket WebApplication ? > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/How-to-automate-clicking-of-a-link-or-button-tp220p220.html<http://apache-wicket.1842946.n4.nabble.com/How-to-automate-clicking-of-a-link-or-button-tp220p220.html?by-user=t> > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=227&i=1&by-user=t> > > For additional commands, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=227&i=2&by-user=t> > > > > > > > -- > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/How-to-automate-clicking-of-a-link-or-button-tp220p227.html > To unsubscribe from How to automate clicking of a link or button, click > here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=220&code=ZGF2aWRyZmllbGRAZ21haWwuY29tfDMzMzMyMjB8MTQ2MjgwNTU1MQ==>. > > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-automate-clicking-of-a-link-or-button-tp220p358.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to automate clicking of a link or button
Is there any way to automate the clicking of a link or button, similar to WicketTester, but within a running Wicket WebApplication ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-automate-clicking-of-a-link-or-button-tp220p220.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting an AjaxRequestTarget from within a Form.onSubmit
The form is being submitted by including this line in the javascript function: document.forms[0].submit() -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-an-AjaxRequestTarget-from-within-a-Form-onSubmit-tp3331336p3331346.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting an AjaxRequestTarget from within a Form.onSubmit
Wicket extensions contains a ModalWindow object. In order to open it, you call the show(AjaxRequestTarget) method. We want to call this from within Form.onSubmit(), the problem is, how do we get hold of a AjaxRequestTarget object? What can we add to the form that will give us this capability? Here is the use case: Wicket adds javascript to the page which calls a function which calls an activeX object and places the return value from the activeX call in a field. The function then does a form submit. From the onSumit we can pick up the value in the field, therefore we know what the actveX returned. Great. But under some circumstances we then want to open the dialog. For that we need a AjaxRequestTarget. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-an-AjaxRequestTarget-from-within-a-Form-onSubmit-tp3331336p3331336.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Just want to add that the call to the class which would encapsulate the code to call the javascript function and get the result would not be in the constructor, rather in the onclick() of a button or the applyState() of the wizard. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3329641.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Thanks a lot, but there are no comments or notes in the code and we cannot see how to apply the example provided to our use case. Let's say we create a class like this (notes are my understanding of what each method is doing): public class JSTest extends AbstractDefaultAjaxBehavior { // Used to add Javacript to page @Override public void renderHead(IHeaderResponse response) { response.renderOnDomReadyJavascript( "function test() {return 'abcd' };"); } // Used to call javascript and then return result @Override public final CharSequence getCallbackUrl(final boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + "&x='test()'"; } // Used to get return value from request @Override protected void respond(AjaxRequestTarget target) { Request request = RequestCycle.get().getRequest(); String x = request.getParameter("x"); System.out.println("value:"+x); } } How would we then instantiate and call this class ??? Adding this in the constructor: add( new JSTest()) Does nothing - would expect the print statement in respond() to be called. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3329321.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Looked at the pdf - but there is no documentation or text and cannot see how the code addresses the problem of how to retrieve the return value from a javascript function within Wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327979.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Thanks, but what we are looking for is a fully working example of how to call a javascript function and retrieve the return value on the Java side. The examples provided are not full or clear to any of us. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327906.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting Javascript function return value in Wicket
Does anyone have any simple and clear examples as to how to call a javascript function within Wicket AND to then retrieve the output of the function? I see a few people trying to do the same thing but cannot find and clear examples. Any help is truly appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327794.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard
My problem was simply that I was calling setActiveStep() from the next button, so the next code was always getting called after setActiveStep() -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-is-there-a-way-to-skip-a-step-tp3322610p3327585.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard
When I do this, it's always going to a step beyond the one I want. I am using the getWizardModel().stepIterator() method to iterate through the steps to get the one I want. I then pass that step to setActiveStep(), but the active step will then be one beyond the step passed in. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-is-there-a-way-to-skip-a-step-tp3322610p3326621.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wizard
Using the Wizard from the wizard-extensions project, is there a way to move to a specific step, rather than simply navigating with say next() and previous() - for example, if the user is on step 4 and certain validation fails, is there a way of going straight back to step 2 ? Thanks a lot -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-tp3322610p3322610.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problems with Ajax update of part of a table
I have the following issue doing an Ajax update on the headers in a table. In my application, clicking on the headers will dynamically change the icon associated with each column. If I do an update on a Panel object which contains the entire table then this works well. However, I specifically don't want to do that, as I don't want server side changes to other rows to be visible in the browser. So, I wrap just the header row in a WebMarkupContainer. When clicking on the headers to trigger the Ajax update only on this container, this happens: 1) The header row is getting redrawn again outside the table (in Firefox, above the original table, in Safari by the side) 2) Clicking again on the original header row inside the table, the server side code is being executed and the 'shadow headers' get updated, but not the original header row itself 3) Clicking on the headers in the 'shadow row' also triggers the server side code Here is the html: Date Type reference Debit Credit Balance // MORE COLUMNS // MORE STUFF I should point out that the columns themselves are Panel objects. As always, help is greatly appreciated ! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problems-with-Ajax-update-of-part-of-a-table-tp3232828p3232828.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to retrieve ListItem objects from a ListView
I have the following use case : Having built a page using a standard ListView and implementing populateItem(), I then want to pass the ListView to a method, extract the contents, and use those contents to build a spreadsheet, cvs file, etc. This way, there will be no need to repeat the same logic (i.e. the logic used in populateItem()), in more than one place. What is the best way to extract this information? In the debugger I can see that the 'children' variable of the ListView has the info I want, but it is not clear to me how, using the API, to get the ListView objects from the ListView. As always, help is greatly appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-retrieve-ListItem-objects-from-a-ListView-tp3085988p3085988.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Saving an Excel file using WebResource
This worked: @Override public IResourceStream getResourceStream() { HSSFWorkbook workbook = getExcelWorkbook(new HSSFWorkbook()); byte[] bai = workbook.getBytes(); ByteArrayResource bar = new ByteArrayResource("application/vnd.ms-excel", bai); return bar.getResourceStream(); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Saving-an-Excel-file-using-WebResource-tp3083581p3083657.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WebMarkupContainer issue
issue solved - I found another place in the code I was referencing the panel from the page itself directly, not via the WebMarkupContainer. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-issue-tp3063886p3067980.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WebMarkupContainer update affecting scrollbar which is outside container
I have an issue whereby an ajax update on a WebMarkupContainer is having unexpected effect on content outside the container. The page in question consists of two parts: 1. on the left hand side, a menu, composed of a list of AjaxFallbackLink objects. This is contained in a . 2. on the right hand side, a panel, which itself is contained in a WebMarkupContainer. Here is standard behavior: When a link is clicked, it's color changes to indicate it is selected (achieved by using AttributeModifier to change the css class). Also, the content of the panel changes. Works fine. Here is the issue: when the list is long, a scrollbar appears in the DIV surrounding it (which is correct). I want to avoid the scrollbar moving back to the top of the list when an item is clicked, so rather than doing an update on the whole page, I use ajax to update just: 1. The selected link 2. The previously selected link 3. The WebMarkupContainer containing the panel (which will now have new content). If I just do an update on the two AjaxFallbackLink objects, there is no problem, and the DIV does not scroll back to the top. However, when I do an update on the WebMarkupContainer, the DIV does scroll back to the top - even though the is outside the WebMarkupContainer. Here is the snippet from the html: # # # (I have removed most of the list items for the sake of brevity). Here is a snippet from the java: Panel mainPage = new SimplePage("mainPage"); mainPageContainer = new WebMarkupContainer("pageContainer"); mainPageContainer.setOutputMarkupId(true); add(mainPageContainer); mainPageContainer.add(mainPage); The list items are then added as AjaxFallbackLink objects. As always, help greatly appreciated ! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-update-affecting-scrollbar-which-is-outside-container-tp3067035p3067035.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WebMarkupContainer issue
That was a just typo in the question It is Do you have any other ideas ? Thank you very much ! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-issue-tp3063886p3063922.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WebMarkupContainer issue
sorry - can you point out exactly the difference in the html ? It's not clear to me. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-issue-tp3063886p3063905.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WebMarkupContainer issue
I wonder if someone can help. In my code, I have a java class which extends Panel and associated html. This contains, among other things, a Panel object "mainPanel". Everything works fine. I now want to enclose the mainPanel object in a WebMarkupContainer. To do so, I declare an instance variable protected WebMarkupContainer mainPageContainer; and in the constructor: mainPageContainer = new WebMarkupContainer("pageContainer"); add(mainPageContainer); mainPageContainer.add(mainPage); In the html page, the line: is replaced with: Wicket throws the following error: WicketMessage: The component(s) below failed to render: A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [MarkupContainer[Component id= mainPage]] 2. [MarkupContainer[Component id= pageTitle]] I cannot see an obvious error and would really appreciate help! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-issue-tp3063886p3063886.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DropDownChoice
I wonder if anyone can help with the following bug in my code. It relates to a Panel which contains a DropDownChoice. This is the exception: java.lang.IllegalArgumentException: Cannot format given Object as a Number at java.text.DecimalFormat.format(DecimalFormat.java:487) at java.text.Format.format(Format.java:140) at org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111) at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85) at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1110) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:588) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169) at com.drf.hapoalim.gui.components.AccountDropDownChoice$4.onUpdate(AccountDropDownChoice.java:108) Line 108 relates to the following line of code: model.setObject(accountsMap.get(accountNumber)); What I cannot understand is what Decimal conversion is going on here: The 'model' variable is declared as IModel model, and the value returned by the map is indeed an Account object. Here is the code (trimmed down): public class AccountDropDownChoice extends Panel { private static final long serialVersionUID = 530407612837913746L; @SpringBean private AccountService accountService; private List accountsList = new ArrayList(); private Map accountsMap = new HashMap(); private Long selectedAccount; private DropDownChoice dropDown = null; public AccountDropDownChoice(String id, final IModel model) { super(id); selectedAccount = 0L; model.setObject(null); dropDown = new DropDownChoice("accountsDropDown", new Model(selectedAccount), accountsList, new AccountChoiceRenderer()){ @Override protected boolean wantOnSelectionChangedNotifications() { return true; } // Set default to 'all accounts' when used with this constructor @Override protected CharSequence getDefaultChoice(Object selected) { return super.getDefaultChoice(0); } }; dropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { if (selectedAccount!=null){ Long accountNumber = (Long) accountsList.get(Integer.parseInt(dropDown.getModelValue())); // EXCEPTION OCCURS HERE model.setObject(accountsMap.get(accountNumber)); } } }); add(dropDown); } Whoever can help - thank you very much!!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-tp3022770p3022770.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery Dialog when used with Ajax
Ernesto , thank you very much, this is great. It should not be too difficult to change the content (in your example, a Label) to a Panel with buttons for ok, cancel etc. Is it possible with WiQuery to add jQuery code which is to be run before the dialog opens, and to use the return value from this code to determine whether or not the dialog opens at all? I have such code working already with plain javascript, it runs when an AjaxLink is clicked. I would like to get this working with WiQuery so as to use the look and feel of the dialog. The alternative presumably is to extend one of the jQuery dialog plugins. Running the javascript first enables me to bring up a confirmation dialog if a link is clicked when a wizard is in progress. The wizard creates a hidden field in a panel, and the javascript can check for the existence and style of this field to determine if the user is in the middle of a wizard. This is better than storing a flag in the session, as the back-button could cause the Wicket session and the page dispalyed to get out of synch. Here is the code I have now: @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()) { private static final long serialVersionUID = 1L; @Override public CharSequence preDecorateScript(CharSequence script) { String leaveWizardConfirmationMessage = new ResourceModel (WIZARD_CANCEL_CONFIRMATION_MESSAGE_TEXT_RESOURCE).getObject(); String javascript = "if (document.getElementById('"+WIZARD_CANCEL_CONFIRMATION_HIDDEN_FIELD_NAME+"') "+ "&& document.getElementById('"+WIZARD_CANCEL_CONFIRMATION_HIDDEN_FIELD_NAME+"').style.display!='none')"+ " {if (!confirm('"+leaveWizardConfirmationMessage+"')) return false;}"; return javascript + script; } }; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WiQuery-Dialog-when-used-with-Ajax-tp3009441p3009910.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery Dialog when used with Ajax
I'd like to make the question a little more specific: the dialog box has to the truly modal - nothing else in the browser can be accessed, ideally the rest of the window will be slightly grayed to indicate that only the modal window is enabled. Trying some of the examples on the web brings up a dialog window - but it is not modal. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WiQuery-Dialog-when-used-with-Ajax-tp3009441p3009495.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WiQuery Dialog when used with Ajax
The WiQuery home page gives a simple example of opening a jQuery dialog, where the content already resides in the page. I wonder if anyone can provide code which shows how to use WiQuery to open a JQuery dialog with dynamic content, presumably using Ajax. For instance, you want to show an error message, but the error message cannot be known when the page is built. From what I have seen on the forum, people have tried to do this without success - but there must be a way. Any code/links/help is really appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WiQuery-Dialog-when-used-with-Ajax-tp3009441p3009441.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
back-button causes Wicket state and page displayed to be out of synch
I have encountered the following serious issue: My application consists of one WebPage which has an AjaxTabbedPanel. Each tab has an associated panel which includes several menu items (links) which can be selected. This works well. However, if the user selects the back-button (once back, then once forward) they can come back to the page with a different tab displayed than the one selected before the back-button was used. If a menu link is then clicked on, an exception is thrown. This appears to be because the Wicket on the server is now out of synch with the html displayed. Wicket thinks a different panel is selected than the one the user sees now. This appears to be a fundamental Wicket problem/issue - apart from disabling the back button, what are the available approaches? Here is the stacktrace: WicketMessage: org.apache.wicket.WicketRuntimeException: component tabs:panel:subItem_account_balance_summary not found on page com.drf.hapoalim.gui.menus.TabsDefinitionPage[id = 8], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] Root cause: org.apache.wicket.WicketRuntimeException: component tabs:panel:subItem_account_balance_summary not found on page com.drf.hapoalim.gui.menus.TabsDefinitionPage[id = 8], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:60) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:637) Complete stack: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: component tabs:panel:subItem_account_balance_summary not found on page com.drf.hapoalim.gui.menus.TabsDefinitionPage[id = 8], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/back-button-causes-Wicket-state-and-page-displayed-to-be-out-of-synch-tp3006971p3006971.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Using JavaScript to check a field by id, when Wicket will change the id
In our application, we want to do the following: 1) Keep a hidden field in a form with a specified id 2) At a certain point in the app, change the value of the field (or hide it completely using setVisible(false)). 3) In the onClick javascript event of a link, check either the existence of the field or it's value using document.getElementById(). This way, we can determine whether or not to bring up a dialog box. But how? 1) We cannot use the id to get the hidden field, because if the field is controlled by Wicket, the id will change. 2) If the hidden field is not controlled by Wicket, we cannot change anything about it (like say setVisible(), or changing it's class attribute using AttributeModifier). What is the best way to do this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-JavaScript-to-check-a-field-by-id-when-Wicket-will-change-the-id-tp3004266p3004266.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Confirmation dialog
Do not know what my mistake is in the previous example, but this works: return "if (test) {if (!confirm('TEXT')) return false;}" + script; -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Confirmation-dialog-tp1844404p3003762.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Confirmation dialog
I am having a problem when using IAjaxDecorator as described. In the predecorate method, I have: return "if(test-variable) return confirm('text');" + script; The confirm button appears, but even on clicking 'OK', it looks as if false is getting returned every time, because the code in onClick(AjaxRequestTarget) is not getting called. Perhaps there is something wrong with my basic synatx, because normal processing does not continue even after the following: return "if (1==1) {return true;} else {return true;}" + script; Help is truly appreciated !!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Confirmation-dialog-tp1844404p3003697.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery and AjaxFallbackLink
Ernesto Thanks - but that is really my question - is it actually possible to add a WiQuery dialog to an AjaxFallbackLink? I ask as it is not possible to add JavaScript to an AjaxLink (at least not simply using SimpleAttributeModifier) , and as jQuery is built upon JavaScript, am asking if that would work. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WiQuery-and-AjaxFallbackLink-tp3002079p3002108.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WiQuery and AjaxFallbackLink
When adding javascript to an AjaxFallbackLink, it is not possible to simply do: link.add(new SimpleAttributeModifier(...)), rather one has to use IAjaxCallDecorator http://apache-wicket.1842946.n4.nabble.com/Confirmation-dialog-td1844404.html Does anyone know if there is a similar issue when using WiQuery to add a jQuery confirm modal window to an Ajax link? The example given in the WiQuery QuickStart adds the jQuery to a simple Button object. http://code.google.com/p/wiquery/wiki/QuickStart -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WiQuery-and-AjaxFallbackLink-tp3002079p3002079.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow question
Neither of the suggested solutions will work: 1) The Cookie idea relies on session timeout - or some timeout - which is not relevant here. The user could click the back button and then straight away select a menu item. 2) Clearing the value in the Wicket Session from the constructor of the page the user returns to with the back button also will not work. The page is stored in the cache and will be rendered by the browser without any Wicket intervention - no java will be invoked. There must be a Wicket-y way of doing this. Can anyone else help or advise - thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-question-tp2999304p3001005.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ModalWindow question
Does anyone have ideas on how to handle the following issue: During processing of a wizard, I store a boolean flag in the Session object to indicate that the wizard has not completed. If, during the course of the wizard, the user clicks on another menu item, the flag in the session is checked, and accordingly a modal window will appear asking the user to confirm that they do indeed wish to exit the wizard. This works well. The problem is, if the user clicks the back button and in effect exits the wizard that way, the flag in the session is still set, and later when the user clicks on a menu link the modal will appear - not good. What is a better way to do this? I thought about disabling the back button, but that seems to be bad practice (correct?), certainly not what the user expects. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-question-tp2999304p2999304.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Backbutton support
Does anyone have any resources on BackButton support with Wicket? My application, although complex, is all one WebPage, it uses Ajax to switch panels dynamically. What would be the best way to handle the back button in this case? Ideally, I would like a way to disable it completely. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Backbutton-support-tp2997052p2997052.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?
in which class are call calling setOutputMarkupId(true) on the wizard ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow-tp1876283p2545937.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Weird Error
This evening I started getting a strange error which does not appear to be connected with anything that has changed in my application code. The exception I am getting related to the wicket-extensions jar: WicketMessage: Unable to find component with id 'panel' in [MarkupContainer [Component id = tabs]]. This means that you declared wicket:id=panel in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match. [markup = jar:file:/Users/davidfield/springsource/tc-server-6.0.20.C/webapps/hapoalim-0.0.1-SNAPSHOT/WEB-INF/lib/wicket-extensions-1.4.9.jar!/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html Futrher on in the exception, it's again clearly stated that the problem is in the jar: The problem is in "jar:file:/Users/davidfield/springsource/tc-server-6.0.20.C/webapps/hapoalim-0.0.1-SNAPSHOT/WEB-INF/lib/wicket-extensions-1.4.9.jar!/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html": Why would this suddenly start happening - this is a jar I have been using for months. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Weird-Error-tp2541144p2541144.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice - how to select default item
have a breakpoint on that line - getDefaultAccount returns what I expect On Wed, Sep 1, 2010 at 5:21 PM, Sven Meier [via Apache Wicket] wrote: > Hi, > > your dropdown accesses the selected account via a model, so it should > work regardless when you initialize the selectedAccount variable. > > Put a breakpoint on that line and check the return value of > getDefaultAccount(). > > BTW using Model and IChoiceRenderer gives you some advantages > (always up-to-date account list, don't keep selected account in session, > ...). > > Sven > > On 09/01/2010 04:02 PM, drf wrote: >> Mike >> >> Thanks - not sure if the problem is with the fact that the code is in the >> constructor: >> 1) the In Action book seems to setup dropdowns ect in the constructor - >> where else would I define the drop down? >> 2) the debugger and syout both show that selectedAccount has the correct >> value prior to constructing the dropdown. >> >> Re IChoseRenderer, the dropdown is displaying the correct values and also >> updating selectedAccount correctly. So what does IChoseRenderer apart from >> saving the effort to extract the raw account numbers - are you brining in >> IChoseRenderer as good advice or are you saying that the fact I am not >> using >> it is part of the issue? >> >> I need to understand Models better, but I am wondering - do I have to >> write >> another class to wrap Account with a Model implementation just to do this >> simple thing? Also, if the selectedAccount is correctly set before calling >> the constructor, will this still help? >> >> David >> >> > > - > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > > > > View message @ > http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2403250.html > To unsubscribe from DropDownChoice - how to select default item, click here. > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2403304.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: DropDownChoice - how to select default item
Mike Thanks - not sure if the problem is with the fact that the code is in the constructor: 1) the In Action book seems to setup dropdowns ect in the constructor - where else would I define the drop down? 2) the debugger and syout both show that selectedAccount has the correct value prior to constructing the dropdown. Re IChoseRenderer, the dropdown is displaying the correct values and also updating selectedAccount correctly. So what does IChoseRenderer apart from saving the effort to extract the raw account numbers - are you brining in IChoseRenderer as good advice or are you saying that the fact I am not using it is part of the issue? I need to understand Models better, but I am wondering - do I have to write another class to wrap Account with a Model implementation just to do this simple thing? Also, if the selectedAccount is correctly set before calling the constructor, will this still help? David -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2403224.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice - how to select default item
Thanks No, it does not appear to be working I have an Account object, but for the dropdown display I am just extracting a list of Long values. Is that the correct thing to do? The accountList v accountsList is just a typing error in the email On Wed, Sep 1, 2010 at 2:26 PM, Sven Meier [via Apache Wicket] wrote: > Should be working fine. > > Are you sure you're showing the actual code, i.e. accountList vs > accountsList ? > > BTW are you accounts really just represented as Longs? > > Regards > > Sven > > On 09/01/2010 01:15 PM, drf wrote: >> I am having a problem that my DropDownChoice is not selecting the item I >> expect, only "Choose one". Here is the code: >> ... >> private List accountList = new ArrayList(); >> private Long selectedAccount; >> >> public AccountsDropDownChoice(String id, final Component component) { >> super(id); >> initializeAccounts(); >> selectedAccount = getDefaultAccount(); >> >> final DropDownChoice dropDown = new >> DropDownChoice("accountsDropDown", >> >> new PropertyModel(this, "selectedAccount"), >> >> accountsList) { >> >> } >> >> The value selectedAccount is being updated correctly when an item in the >> dropdown is selected, but the dropdown is not defaulting to the value in >> that field to begin with. If anyone can help it is very appreciated. >> > > - > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > > > > View message @ > http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2402968.html > To unsubscribe from DropDownChoice - how to select default item, click here. > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2402993.html Sent from the Wicket - User mailing list archive at Nabble.com.
DropDownChoice - how to select default item
I am having a problem that my DropDownChoice is not selecting the item I expect, only "Choose one". Here is the code: ... private List accountList = new ArrayList(); private Long selectedAccount; public AccountsDropDownChoice(String id, final Component component) { super(id); initializeAccounts(); selectedAccount = getDefaultAccount(); final DropDownChoice dropDown = new DropDownChoice("accountsDropDown", new PropertyModel(this, "selectedAccount"), accountsList) { } The value selectedAccount is being updated correctly when an item in the dropdown is selected, but the dropdown is not defaulting to the value in that field to begin with. If anyone can help it is very appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2402960.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form in a Wizard is not showing state of the Model
Thanks a lot. You are right that I did not need the Form, but it turned out the problem was something else: - I was using a TextArea instead of TextField, which did work. Now I need to understand why a TextArea did not display the data. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-in-a-Wizard-is-not-showing-state-of-the-Model-tp2292627p2293546.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Form in a Wizard is not showing state of the Model
Can anyone help Am using the Wicket wizard from the extensions package. Have extended Wizard and WizardStep - nothing fancy, and the wizard flow is working. Problem is this: I have a Model which is passed into the constructor of each step. The first page of the wizard displays one of the fields of the Model in a Form. When I move to Step 2 and then back to Step1, the field is empty. The debugger reveals the following: The Model is getting updated correctly, and remains correct in Step 2. When going back to Step1, the Model is also correct in onBeforeRender(). However, the new value the field is set to in the Model does not appear in the form. Here are the Wizard and WizardStep (1) classes - any help is much appreciated! public class TransferMoneyWizard extends AbstractWizard { private static final long serialVersionUID = 6808247888274682077L; public TransferMoneyWizard(String id) { super(id); // Create model CompoundPropertyModel model = new CompoundPropertyModel(new AccountTransferModel()); // Create wizard steps WizardModel wizardModel = new WizardModel(); wizardModel.add(new TransferMoneyStep1("one", "first", model)); wizardModel.add(new TransferMoneyStep2("two", "second", model)); wizardModel.add(new TransferMoneyStep3("three", "third", model)); // Initialize model init(wizardModel); } @Override public void onCancel(){ setResponsePage(getApplication().getHomePage()); } @Override public void onFinish(){ setResponsePage(getApplication().getHomePage()); } } public class TransferMoneyStep1 extends BHPWizardStep{ private static final long serialVersionUID = -3964976234505273151L; private Form form; private CompoundPropertyModel model; public TransferMoneyStep1(String title, String summary, CompoundPropertyModel model) { super(title, summary, model); this.model = model; form = new Form("form", model); form.add(new TextArea("comments", new PropertyModel(model, "comments"))); add(form); } @Override protected void onBeforeRender() { super.onBeforeRender(); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-in-a-Wizard-is-not-showing-state-of-the-Model-tp2292627p2292627.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org