Re: Model window issue
I do this in my app. I open a modal window and when you hit save I open another modal window to confirm your save and if you confirm I close both modal windows. modalConfirm.close(target); modalSelectDate.close(target); IndicatingAjaxLink btnConfirmSave = new IndicatingAjaxLink("btnConfirmSave") { @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxPostprocessingCallDecorator(super.getAjaxCallDecorator()) { private static final long serialVersionUID = 1L; @Override public CharSequence postDecorateScript(CharSequence script) { return script + "this.disabled = true; this.style.display = \"none\";"; } @Override public CharSequence postDecorateOnSuccessScript(CharSequence script) { return script + " this.disabled = false;"; } }; } @Override public void onClick(AjaxRequestTarget target) { if (target != null) { for (Positions position : positions) { position.setVolunteersByFkVolunteerScheduled(session.getVolunteers()); positionsDAO.save(position); } // wmc.setVisible(false); target.addComponent(wmc); modalConfirm.close(target); modalSelectDate.close(target); } } }; btnConfirmSave.setOutputMarkupId(true); btnConfirmSave.setMarkupId("buttonConfirmOK"); add(btnConfirmSave); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Model-window-issue-tp3727688p3727987.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: Loading Wicket resources from a background thread
Wow just asked this same question. I didn't see you post (sorry list). Please let me know if you figure it out. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Wicket-resources-from-a-background-thread-tp2319046p2320388.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
quartz job bean access to properties file
I'm struggling with how to get access to the properties file from a quartz job bean. I'm creating a pdf report that will then be emailed. I want to get access to the properties file to tell me where to write the file along with other information. Here is my quartz job code. Thanks in advance. package com.paybridgeusa.jobs; public class SendEmail extends QuartzJobBean { public void executeInternal(JobExecutionContext context) throws JobExecutionException { try { // get all tpas TPAUsersDAO usersDAO = (TPAUsersDAO) getApplicationContext(context).getBean("TPAUsersDAO"); List users = usersDAO.getAll(); for (Tpausers user : users) { String emailAddressTo = user.getEmail(); } } catch (Exception e) { System.out.println(e.getLocalizedMessage()); } } private static final String APPLICATION_CONTEXT_KEY = "applicationContext"; public ApplicationContext getApplicationContext(JobExecutionContext context) throws Exception { ApplicationContext applicationContext = null; applicationContext = (ApplicationContext) context.getScheduler().getContext().get(APPLICATION_CONTEXT_KEY); if (applicationContext == null) { throw new JobExecutionException("No application context available in scheduler context for key \"" + APPLICATION_CONTEXT_KEY + "\""); } return applicationContext; } } application context xml applicationContext -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/quartz-job-bean-access-to-properties-file-tp2320367p2320367.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: The Field 'emailInput' is required
Still not sure I understand your problem. If the field names are the same on many forms, I.E. an email field on several forms, you can put the error message in the application.properties file. If my application is MyApplication.java then create a MyApplication.properties file and put in the validation. PasswordValidator= The Password must contain a number and a letter and be 6 characters long. Or you can create a custom validator and create your own default message. Hope that helps. Whats'Up wrote: > > Sorry, I think I wrote not enough, to tell you the problem. > With the code test.emailInput.Required=The Email address is required: I > have to write for every field the same code, but the wicket code is ok, > and I thought it is perhaps possible only to change the field name. > Normally I get the error code: Field 'emailInput' is required. > I only want to change the field-name and not the completely error-code. > The standart wicket-error code ist ok, and I only want to change the field > name, because I have very much fields. > > > > -- View this message in context: http://old.nabble.com/The-Field-%27emailInput%27-is-required-tp27262234p27263523.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: The Field 'emailInput' is required
Java code: (VendorSignupEntry.java) Form form = new Form("vendorSignupForm", new CompoundPropertyModel(profileModel)) RequiredTextField mainEmail = new RequiredTextField("mainEmail"); HTML: (VendorSignupEntry.html) Properties: (VendorSignupEntry.properties) vendorSignupForm.mainEmail.Required=The Email address is required. vendorSignupForm.mainEmail.StringValidator.maximum=The Email address must between less than ${maximum} letters. vendorSignupForm.mainEmail.EmailAddressValidator=The Email address is not a valid address. Whats'Up wrote: > > Hi rmattler and Wilhelmsen Tor Iver > > thank you both for the fast answers! With "test.emailInput.Required=test" > I changed the completely error code to "test", but how can I change the > error code to this "Field 'email' is required." ? > I also tested it with test.emailInput.RequiredValidator=email, but it > doesn't work > > rmattler wrote: >> >> try: test.emailInput.Required=test >> > > > > -- View this message in context: http://old.nabble.com/The-Field-%27emailInput%27-is-required-tp27262234p27263033.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: The Field 'emailInput' is required
try: test.emailInput.Required=test Whats'Up wrote: > > Hello, > > this is my first post and I hope you could help me. > I have a Form with the id="test" and a Textfield="EMAIL". The Textfield I > added with "add(new RequiredTextField("emailInput"))". > After pressing submit (wihout entering an emali), I get the failure "Field > 'emailInput' is required." I want to change 'emailInput' to email. I > tested in the properties. > > test.EMAIL.Required=test > EMAIL.Required=test > but it doesn't work. The propertie file must work, I can change the submit > text. > Do you have any idea? > -- > Haiti-Nothilfe! Helfen Sie per SMS: Sende UIHAITI an die Nummer 81190. > Von 5 Euro je SMS (zzgl. SMS-Gebühr) gehen 4,83 Euro an UNICEF. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://old.nabble.com/The-Field-%27emailInput%27-is-required-tp27262234p27262676.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: hide pagination
opps forgot the the wmc html rmattler wrote: > > WebMarkupContainer wmcNavHead = new WebMarkupContainer("wmcNavHead"); > WebMarkupContainer wmcNavFoot = new > WebMarkupContainer("wmcNavFoot"); > wmcNavHead.add(new PagingNavigator("navigatorHead", > eachProject)); > if (dp.size() < ROWS_TO_DISPLAY) { > wmcNavHead.setVisible(false); > } > > > > > > > > fachhoch wrote: >> >> Yes please send me the code . >> >> >> Douglas Ferguson-2 wrote: >>> >>> I override the onRender and set visibility conditionally. >>> >>> However, you have to remember to set visible in your page redraws or >>> else wicket won't even bother calling the onRender method >>> >>> If you need, I can send you code. >>> >>> On Oct 8, 2009, at 7:18 PM, tubin gen wrote: >>> >>>> I am using dataview which comes with pagination , if the total >>>> records are >>>> less than records per page is there away I can hide pagination bar ? >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/hide-pagination-tp25813802p25824479.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: hide pagination
WebMarkupContainer wmcNavHead = new WebMarkupContainer("wmcNavHead"); WebMarkupContainer wmcNavFoot = new WebMarkupContainer("wmcNavFoot"); wmcNavHead.add(new PagingNavigator("navigatorHead", eachProject)); if (dp.size() < ROWS_TO_DISPLAY) { wmcNavHead.setVisible(false); } fachhoch wrote: > > Yes please send me the code . > > > Douglas Ferguson-2 wrote: >> >> I override the onRender and set visibility conditionally. >> >> However, you have to remember to set visible in your page redraws or >> else wicket won't even bother calling the onRender method >> >> If you need, I can send you code. >> >> On Oct 8, 2009, at 7:18 PM, tubin gen wrote: >> >>> I am using dataview which comes with pagination , if the total >>> records are >>> less than records per page is there away I can hide pagination bar ? >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- View this message in context: http://www.nabble.com/hide-pagination-tp25813802p25824385.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: AW: How would you realize a "delete"-Link in a datagrid row?
Wrap the dataview in a WebMarkupContainer . 1) Create a WebMarkupContainer 2) Create your data view 3) Add the dataview into the wmc 4) Don't forget to set .setOutputMarkupId(true); on the dataview 5) On the return of the Modal window refresh the target I.E. target.addComponent(wmcDataTable); Or this example will work with an ajax link instead of a modal window. final WebMarkupContainer wmcDataTable = new WebMarkupContainer("wmcDataTable"); wmcDataTable.setOutputMarkupId(true); final DataView eachUser = new DataView("eachUser", dp) { protected void populateItem(final Item item) { final Users user = (Users) item.getModelObject(); item.setModel(new CompoundPropertyModel(user)); item.add(new AjaxLink("deleteLink", item.getModel()) { public void onClick(AjaxRequestTarget target) { modalUsersDelete.setContent(new VendorProfileUsersDeletePanel(modalUsersDelete.getContentId(), (Users) item.getDefaultModelObject())); modalUsersDelete.show(target); } }); // add items }); eachUser.setItemsPerPage(ROWS_TO_DISPLAY); eachUser.setOutputMarkupId(true); wmcDataTable.add(eachUser); form.add(wmcDataTable); modalUsersDelete = new ModalWindow("modalUsersDelete"); modalUsersDelete.setInitialWidth(450); modalUsersDelete.setInitialHeight(230); modalUsersDelete.setOutputMarkupId(true); modalUsersDelete.setTitle("Delete User"); modalUsersDelete.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { target.addComponent(wmcDataTable); } }); form.add(modalUsersDelete); Peter Arnulf Lustig wrote: > > yes I thought it... :) > > How do you achieve that the dataview is refreshed after deletion of a > row? > > > > - Ursprüngliche Mail > Von: rmattler > An: users@wicket.apache.org > Gesendet: Mittwoch, den 30. September 2009, 16:19:11 Uhr > Betreff: Re: How would you realize a "delete"-Link in a datagrid row? > > > Sorry spelling error not model window but modal window. > > > rmattler wrote: >> >> Another approach would be to created a model window to appear when the >> delete link is clicked. With the message "Are you sure you want to >> delete xxx?" If you select yes, the row is deleted then ajax is used to >> refresh the dataview. Let me know if you want to use this approach and I >> will post an example. >> >> >> >> Peter Arnulf Lustig wrote: >>> >>> Hi, >>> >>> I'd like to create a delete link where you can delete a row in a >>> datagrid. But when you click on the delete link, the delete label should >>> change and a warning occurs: "Do you really want to delete xyz". >>> After the second click it finally deletes the content. >>> >>> How can I achieve that? Could you verbalize the procedure? >>> >>> Thanks!! >>> >>> >>> >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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 > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25683095.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: How would you realize a "delete"-Link in a datagrid row?
Sorry spelling error not model window but modal window. rmattler wrote: > > Another approach would be to created a model window to appear when the > delete link is clicked. With the message "Are you sure you want to > delete xxx?" If you select yes, the row is deleted then ajax is used to > refresh the dataview. Let me know if you want to use this approach and I > will post an example. > > > > Peter Arnulf Lustig wrote: >> >> Hi, >> >> I'd like to create a delete link where you can delete a row in a >> datagrid. But when you click on the delete link, the delete label should >> change and a warning occurs: "Do you really want to delete xyz". >> After the second click it finally deletes the content. >> >> How can I achieve that? Could you verbalize the procedure? >> >> Thanks!! >> >> >> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- View this message in context: http://www.nabble.com/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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: How would you realize a "delete"-Link in a datagrid row?
Another approach would be to created a model window to appear when the delete link is clicked. With the message "Are you sure you want to delete xxx?" If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: > > Hi, > > I'd like to create a delete link where you can delete a row in a datagrid. > But when you click on the delete link, the delete label should change and > a warning occurs: "Do you really want to delete xyz". > After the second click it finally deletes the content. > > How can I achieve that? Could you verbalize the procedure? > > Thanks!! > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25680407.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: [kind-of-announce] Swit 0.9.0, wicket library for graphics stuff
Thanks for the reply. Here is my code if it can help anybody else. http://www.w3.org/1999/xhtml"; xmlns:wicket="http://wicket.sourceforge.net/";> a.switButton { color: transparent; } # public class Home extends WebPage { static private ButtonTemplate s_buttonTemplate = new VistafarianButton(); public Home() { Image myImage = ButtonResource.getImage("switButtonImage", s_buttonTemplate, "Swit Button"); Link switTestButton = new Link("switTestButton") { @Override public void onClick() { setResponsePage(new SwitTest("")); } }; switTestButton.add(myImage); add(switTestButton); } } rrmlwt wrote: > > rmattler wrote: > >> It is not clear to me how you add the onClick event to the button since >> the >> ButtonResource is an image. Anybody want to point that out to me. > > You have to use a standard html image or button, and associate it to the > ResourceReference+ValueMap provided by the ButtonResource class. > > For instance, to create an ImageButton: > > Html: > > > Java: > > new ImageButton("submit", > ButtonResource.getReference(), > ButtonResource.getValueMap(buttonTemplate, "SOMETEXT")); > > For an image, it's exactly the same. Just put the image in a link tag >and that's it. > > Rodrigo > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/-kind-of-announce--Swit-0.9.0%2C-wicket-library-for-graphics-stuff-tp24211061p24242471.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: [kind-of-announce] Swit 0.9.0, wicket library for graphics stuff
It does NOT work with 1.35. For anybody else who was wondering. I download 1.4 and it works fine. It is not clear to me how you add the onClick event to the button since the ButtonResource is an image. Anybody want to point that out to me. thanks. rrmlwt wrote: > > Hi Folks, > > I just released Swit 0.9.0, a tiny lib I wrote to help manage the kind > of graphical resources that are boring to create, such as buttons, > borders, and layouts. > It's an early release in the sense that it does not contain everything > I'd like, but at least here it is. > Feedbacks appreciated. It's been developped with Wicket 1.4, not sure it > runs on 1.3 (haven't tested). > The homepage: http://swit.kornr.net > The google code page: http://code.google.com/p/swit/ > > cheers, > Rodrigo > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/-kind-of-announce--Swit-0.9.0%2C-wicket-library-for-graphics-stuff-tp24211061p24227241.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: Apache Tomcat & CSS
Try entering the the css like this: background-image: url(../images/buttons/buttonBackground.gif); It works for me I don't know why but it works :sleep: TradeMark wrote: > > Hi there, > > has anyone ever encountered problem with these two? I have a simple > application and I wanted to add a css file with but after > deploying nothing happens. > > So I copied the CSS in index.html between
Re: Wizard and onSubmit of nested form
Show us your code and I'll see if I can help. Dave Schoorl wrote: > > Hi Robert, thanks for your quick reply. > > I am not sure if I understand what you mean. How is form validation > helping with the trigger of onSubmit() on the correct form? > But I gave it a try and the problem remains: the onSubmit of the next > step is called instead of the current step. I think that first the panel > of the current step is replaced with the panel of the next step and then > the onSubmit is executed. > > Hope someone can help me. > > Regards, > Dave > > > rmattler wrote: >> Use "public void validate(Form form)" >> >> See example below. Hope it helps. >> >> >> private final class Step2 extends WizardStep { >> public Step2() { >> setTitleModel(new Model("Add pictures")); >> >> add(new AbstractFormValidator() { >> public FormComponent[] >> getDependentFormComponents() { >> return null; >> } >> >> public void validate(Form form) { >> >> String dir = >> Constants.ADD_PROJECT_FILE_PIC_PATH + >> getProjects().getTblId(); >> >> File filesDir = new File(dir); >> if (filesDir.canRead() || >> filesDir.isDirectory()) { >> String[] fileNames = >> filesDir.list(); >> if (fileNames.length > 0) { >> >> getProjects().setNumPhotos(fileNames.length); >> } else { >> form.error("Please >> upload some photos"); >> } >> } else { >> form.error("Please upload some >> photos"); >> } >> >> } >> }); >> >> } >> } >> >> Dave Schoorl wrote: >> >>> Hi all, >>> >>> I am building my first Wizard with the wizard from wicket-extensions >>> version 1.3.5. Every step contains a panel with it's own form, so I have >>> a nested form in the wizards form. I was expecting that when I click >>> next, the onSubmit of my current form is called, but it's not. Instead >>> the onSubmit of the form in the next step is called. >>> >>> This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x >>> >>> Am I doing something wrong? >>> >>> Regards, >>> Dave >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >>> >> >> > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22388940.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: Wizard and onSubmit of nested form
Use "public void validate(Form form)" See example below. Hope it helps. private final class Step2 extends WizardStep { public Step2() { setTitleModel(new Model("Add pictures")); add(new AbstractFormValidator() { public FormComponent[] getDependentFormComponents() { return null; } public void validate(Form form) { String dir = Constants.ADD_PROJECT_FILE_PIC_PATH + getProjects().getTblId(); File filesDir = new File(dir); if (filesDir.canRead() || filesDir.isDirectory()) { String[] fileNames = filesDir.list(); if (fileNames.length > 0) { getProjects().setNumPhotos(fileNames.length); } else { form.error("Please upload some photos"); } } else { form.error("Please upload some photos"); } } }); } } Dave Schoorl wrote: > > Hi all, > > I am building my first Wizard with the wizard from wicket-extensions > version 1.3.5. Every step contains a panel with it's own form, so I have > a nested form in the wizards form. I was expecting that when I click > next, the onSubmit of my current form is called, but it's not. Instead > the onSubmit of the form in the next step is called. > > This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x > > Am I doing something wrong? > > Regards, > Dave > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22375366.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: Is this a bug in Wicket?
Don't put the in a . Should be: Search feed by name: Match all conditions> Match any conditions> Match all news rjilani wrote: > > Hi: Gurus, I am trying to render a form and looks like wicket is not > rendering the form elements in right sequence, here is my markup that is > having the issues > > > Search feed by name: > > > > > > Match all > conditions > Match any > conditions > Match all news > > > > > here is the java code > > add(new TextField("feedName", new Model())); > > add(new RadioChoice("conditionChoice", new > Model(),conditionChoices ).setSuffix("")); > > when I run the code I see the radio button choices before the text field; > any suggestions? > > Thanks, > RJ. > -- View this message in context: http://www.nabble.com/Is-this-a-bug-in-Wicket--tp22356116p22356561.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: applet web.xml mapping
It appears I still have some things to learn about servlet mapping. But I still don't understand why changing my url-pattern form /* to /app/* would make my applet not work. Any way if anybody else want to use an applet to upload files here is how I did it. My web.xml file is: WicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName WicketFilter WicketSessionFilter /upload UploadServlet com.moviemakerzone.servlet.UploadServlet UploadServlet /upload Upload html is: Servlet is: public class UploadServlet extends HttpServlet { private static final String FILE_PIC_PATH = "c:\\temp\\picSave\\"; protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { doPost(req, res); // redirect to post } protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { // login page path String loginPagePath = req.getContextPath() + "/login"; try { org.apache.wicket.Session wicketSession = org.apache.wicket.Session.get(); // if not logged in UserSession session = (UserSession) Session.get(); if (session.getUser().getUsername() == null) { res.sendRedirect(loginPagePath); } else { process(req); } System.out.println(wicketSession); } catch (Exception e) { System.out.println(e.getLocalizedMessage()); res.sendRedirect(loginPagePath); } } } -- View this message in context: http://www.nabble.com/applet-web.xml-mapping-tp21689586p21727627.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: Getting data from applet
You are correct the applet was not doing a form submit. The servlet works. Thanks. igor.vaynberg wrote: > > the question is: how does the uploader send the upload? does it send > the data as part of the form submit or in the background independently > of the form data? since it can do things like pause/resume i am going > to assume the latter which is why you are not seeing that data as part > of the form submit. you still need that other servlet to receive the > data. if my assumptions are incorrect feel free to create a quickstart > so that we may investigate further. > > -igor > > On Tue, Jan 27, 2009 at 8:17 AM, rmattler wrote: >> >> List items = upload.parseRequest(request); >> >> items is still empty >> >> >> >> >> try form.setmultipart(true) >> >> -igor >> >> >> -- >> View this message in context: >> http://www.nabble.com/Getting-data-from-applet-tp21686123p21688568.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 >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Getting-data-from-applet-tp21686123p21727416.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: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
NoClassDefFoundError means that netbeans or the server can't find a file. I'm guessing that it can't find the slf4j.jar http://www.slf4j.org/faq.html >From the wicket site: Important note about logging dependencies for 1.3.0 and later. As of Wicket 1.3.0, Wicket uses the SLF4J project for logging. SLF4J is similar to commons-logging, in that it allows libraries/frameworks like Wicket to avoid forcing a choice of logging framework on their users. You cannot use Wicket without adding an SLF4J logging implementation to your classpath. Most people use log4j. If you do, just include slf4j-log4j12.jar on your classpath to get Wicket to use log4j too. If you want to use commons-logging or JDK14 logging or something else, please see the SLF4J site for more information. wadi wrote: > > Hi all!I'm facing some trouble running the wicket stuff examples because > no > one start due to java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory > > exception.I'm using netbeans 6.5 and netbeans. > > Thanks, > > Wadi > > > -- View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-slf4j-LoggerFactory-tp21726877p21727315.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
applet web.xml mapping
Sorry my day to ask questions.:-D If my WicketFilter is setup as: WicketFilter /* My Applet works fine. If I change it to: WicketFilter /app/* I can't seem to figure a way to access the applet. archive="applet/jumploader_z.jar" archive="app/applet/jumploader_z.jar" archive="/app/applet/jumploader_z.jar" don't work. If I leave the WicketFilter as "/*" then I can't call my servlet because it is mapped as: UploadServlet /servlet/* I'm I accessing the applet incorrectly? Thanks in advance. -- View this message in context: http://www.nabble.com/applet-web.xml-mapping-tp21689586p21689586.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: Getting data from applet
List items = upload.parseRequest(request); items is still empty try form.setmultipart(true) -igor -- View this message in context: http://www.nabble.com/Getting-data-from-applet-tp21686123p21688568.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
Getting data from applet
I'm using an applet (http://www.jumploader.com) to upload files. Normally I would use a servlet to parse the data with apache commons fileupload. With Wicket I trying to parse the data in the onSubmit method of the Form with no luck. HttpServletRequest request = ((ServletWebRequest) getRequest()).getHttpServletRequest(); boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (isMultipart) { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); Iterator iter = items.iterator(); while (iter.hasNext()) { FileItem item = (FileItem) iter.next(); if (item.isFormField()) { System.out.println(item.getFieldName() + " " + item.getString()); } else { // process a file String fileName = item.getName(); } "List items = upload.parseRequest(request); " returns an empty list. Am I doing something wrong in my code? Is this the correct approach? I also saw the example of how to make a Wicket session available to a non-wicket servlet. http://wicket.sourceforge.net/apidocs/wicket/protocol/http/servlet/WicketSessionFilter.html Is that the way to do it? I'm using 1.3.5. Thanks in advance. -- View this message in context: http://www.nabble.com/Getting-data-from-applet-tp21686123p21686123.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: Double submit problem
You could do it with javascript. Disable the button and change the button label. function saveForm(btn) { eForm = document.forms[0]; btn.disabled=true; btn.value='Please wait...'; eForm.submit(); return; } -- View this message in context: http://www.nabble.com/Double-submit-problem-tp15957979p15976673.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice getting value into the model
I don't have time to work on this right now, have real work to do. But I now believe I understand my problem. The Vendor bean needs to have the field 'state' be the class of State not String. Now I just need to figure out how to do that with Hibernate. I did buy your book. It is excellent everybody should buy one or two. How is that for a plug? -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p1597.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice getting value into the model
I don't understand. Vendor.state and SelectOption.state are both Strings. I cut down my form to only have state on the form so I can post all the code. The code pulls the correct data from the database and displays it on the form but when I save it is gives me the following error. java.lang.UnsupportedOperationException: Model class com.myprepress.pages.vendor.profile.VendorEntry2$1 does not support setObject(Object) public class VendorEntry2 extends BasePage { @SpringBean VendorDAO vendorDAO; private long tblId; private Integer oldVersionNumber; public VendorEntry2(long id) { tblId = id; // get the version number to ensure that the object hasn't been saved to // the database by another users // -1 is a new object if (id != -1) { Vendor vendor = null; try { vendor = vendorDAO.load(id); oldVersionNumber = vendor.getVersionNumber(); } catch (DataObjectNotFoundException donfe) { getSession().error("Object not found"); throw new RestartResponseException(new ErrorObjectNotFound(new VendorList())); } } // load the object to be displayed to the screen // make it LoadableDetachableModel so it is not stored in the session // -1 is a new object IModel vendorModel = new LoadableDetachableModel() { protected Object load() { if (tblId == -1) { return new Vendor(); } else { return vendorDAO.load(tblId); } } }; // add form Form form = new Form("vendorEntryForm2", new CompoundPropertyModel(vendorModel)) { protected void onSubmit() { Vendor updatedVendor = (Vendor) getModelObject(); try { vendorDAO.save(updatedVendor, oldVersionNumber); setResponsePage(VendorList.class); } catch (DataObjectModifiedException dome) { // try again"); setResponsePage(new VendorEntryError( "Data changed by another user. Please refresh and try again.", tblId)); } } }; add(form); // must add form before adding other components // add state ArrayList states = new ArrayList(); states.add(new SelectOption("AL", "Alabama")); states.add(new SelectOption("OH", "Ohio")); states.add(new SelectOption("NY", "New York")); ChoiceRenderer choiceRenderer = new ChoiceRenderer("display", "state"); DropDownChoice stateFC = new DropDownChoice("state", vendorModel, new Model(states), choiceRenderer); form.add(stateFC); // add submit button form.add(new Button("save")); } } @Entity @Table(name = "vendor", schema = "public") public class Vendor implements java.io.Serializable { private long tblId; private String state; @Column(name = "state", length = 2) public String getState() { return this.state; } public void setState(String state) { this.state = state; } Johan Compagner wrote: > > This has to work yes, the only thing is do build up the new > Model(states) as States so the same type of object as vendor.state > returns. > > On 3/7/08, Kai Mutz <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] <> wrote: >> > It is nice to know I'm not the only one struggling with >> > DropDownChoices. I'm new to Wicket and I'm pretty far with >> > rebuilding an application we are using internally. Has anybody >> > proposed an alternative or a wrapper to DropDownChoices? >> >> Have you tried something like: >> >> Vendor vendor = (Vendor) vendorModel.getObject(); >> >> DropDownChoice stateFC = new DropDownChoice("state", new >> PropertyModel(vendor, "state"), new Model(states), choiceRenderer); >> >> This should work. >> >> Kai >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -
RE: DropDownChoice getting value into the model
Yes @Column(name = "state", length = 2) public String getState() { return this.state; } public void setState(String state) { this.state = state; } Kai Mütz wrote: > > [EMAIL PROTECTED] <> wrote: >> Thanks for trying but I get: >> >> WicketMessage: No get method defined for class: class >> java.lang.String expression: state > > Have you defined a getter/setter for field "state" in your vendor class? > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907944.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice getting value into the model
Thanks for trying but I get: WicketMessage: No get method defined for class: class java.lang.String expression: state Kai Mütz wrote: > > [EMAIL PROTECTED] <> wrote: >> It is nice to know I'm not the only one struggling with >> DropDownChoices. I'm new to Wicket and I'm pretty far with >> rebuilding an application we are using internally. Has anybody >> proposed an alternative or a wrapper to DropDownChoices? > > Have you tried something like: > > Vendor vendor = (Vendor) vendorModel.getObject(); > > DropDownChoice stateFC = new DropDownChoice("state", new > PropertyModel(vendor, "state"), new Model(states), choiceRenderer); > > This should work. > > Kai > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907691.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice getting value into the model
It is nice to know I'm not the only one struggling with DropDownChoices. I'm new to Wicket and I'm pretty far with rebuilding an application we are using internally. Has anybody proposed an alternative or a wrapper to DropDownChoices? Vitaly Tsaplin wrote: > >The DropDownBox component is in fact well designed in theory. But I > think the way it works is a bit inconvenient in practice. Normally the > main purpose of this component in to supply some value or an index for > a model but a label is needed only for to be presented to a user. > Unfortunately we are supposed to use either the same value (a string > representation) for both pupposes or to use some kind of a wrapper and > to pollute the model by some strange "SelectOption" object even though > that the model would normally accept an integer. > >Vitaly > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907346.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice getting value into the model
Thanks for the quick reply. But you answer doesn't make sense to me. Why do loadable models work for a text field but not a drop down? If I have "NY" stored in the database, New York is loaded onto the form but when the form is submitted the selected value of the drop down is not saved into the model. I'm trying to get the selected value stored into the Vendor object and a String not a SelectOption. public class Vendor implements java.io.Serializable { private String state; two problems 1) loadable detachable models do not support the setobject() call, because they are...loadable. so you should use a different kind of model. 2) yes, selectoption object will be put into your model, dropdown choice works like this: DropDownChoice(String id, IModel model, IModel> choices, IChoiceRenrerer renderer) -igor -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907046.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DropDownChoice getting value into the model
I've tried for 1 1/2 days to get this simple Drop Down to work and I'm feeling stupid. My mom tells me I'm smart.:-( Everything works fine until I try to save it. I get the following error. I think it is trying to put the SelectOption object into the Model but I don't know how to tell it to put the state var from SelectOption into my Vendor object. java.lang.UnsupportedOperationException: Model class com.myprepress.pages.vendor.profile.VendorEntry$1 does not support setObject(Object) IModel vendorModel = new LoadableDetachableModel() { protected Object load() { return vendorDAO.load(tblId); } }; // add state ArrayList states = new ArrayList(); states.add(new SelectOption("AL", "Alabama")); states.add(new SelectOption("OH", "Ohio")); states.add(new SelectOption("NY", "New York")); ChoiceRenderer choiceRenderer = new ChoiceRenderer("display", "state"); DropDownChoice stateFC = new DropDownChoice("state", vendorModel, new Model(states), choiceRenderer); public class SelectOption implements Serializable { private String state; private String display; -- View this message in context: http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15905486.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Converter 1.3 beta2 convertToString never called
Writing a custom converter to convert a phone number from the form entry (330) 555-1212 to 3305551212 to be stored in the database. That works, but I'm also trying to convert 3305551212 to (330) 555-1212 to be displayed on the form. That is not working, convertToString is never called. Thanks in advance. public class PhoneConverter implements IConverter { public String convertToString(final Object value, Locale locale) { if (value == null) { return null; } String val = value.toString(); try { if (val.length() == 10) { val = "(" + val.substring(0, 3) + ") " + val.substring(3,7) + "-" + val.substring(7); } } catch (Exception e) { throw new ConversionException("'" + value + "' is not a valid Phone "); } return val.toString(); } public Object convertToObject(String value, Locale arg1) { // TODO Auto-generated method stub String rtnVal = ""; try { int len = value.length(); char c; for (int i = 0; i < len; i++) { c = value.charAt(i); if (Character.isDigit(c)) { rtnVal += c; } } return rtnVal; } catch (Exception e) { throw new ConversionException("'" + value + "' is not a valid Phone "); } } public class VendorEntry extends BasePage { RequiredTextField textPhoneNumber = new RequiredTextField("workPhone", USPhone.class); textPhoneNumber.add(StringValidator.maximumLength(10)); textPhoneNumber.add(new PatternValidator( "^[01]?[- .]?\\(?[2-9]\\d{2}\\)?[- .]?\\d{3}[- .]?\\d{4}$")); textPhoneNumber.add(new DojoBubbleValidationAjaxBehavior("onblur", bubble)); form.add(textPhoneNumber); } public class USPhone { private String phoneNumber; public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } } // my bean used with //Form form = new Form("vendorEntryForm", new CompoundPropertyModel(vendorModel)) // public class Vendor implements java.io.Serializable { private String workPhone; -- View this message in context: http://www.nabble.com/Converter-1.3-beta2-convertToString-never-called-tp15812313p15812313.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
New quy question on converting input data
If a phone number is input as (330) 555-1212 on the form when the form is saved I want the data stored as 3305551212 in the database and when displayed again on the form as (330) 555-1212. As a bonus how do I would like data entered as 3305551212 and converted to (330) 555-1212 on the onBlur event. What is the "Wicket Way" to do this. -- View this message in context: http://www.nabble.com/New-quy-question-on-converting-input-data-tp15738847p15738847.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket database access
I'm new to this whole thing and I've just done this using the book "Enjoying development with Wicket". It is $20 and worth the money to get your feet wet. It has a good example of JDBC only access and what you gain by using Spring and then Hibernate. Hope this helps. Considering I only have 3 weeks experience with Wicket. http://agileskills2.org/EWDW/ wjser wrote: > > Hi all, > > > i have a simple question. > How can i access a database from wicket? > I don't want to use any object-relational mapper like hibernate or ibatis. > I wanna use plain old sql/jdbc. > > thanks in advance. > -- View this message in context: http://www.nabble.com/Wicket-database-access-tp15613515p15613574.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Spring applicationContext.xml error
I'm trying to get a Hibernate Spring Wicket app working and I'm stuck. Don't know where to start. Any help would be appreciated. If this is the wrong forum let me know. Thanks is advance. I'm get the following error: Error creating bean with name 'txManagerBean' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'entMgrFactoryBean' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entMgrFactoryBean' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/MethodVisitor Here is my applicationContext.xml File: -- View this message in context: http://www.nabble.com/Spring-applicationContext.xml-error-tp15510193p15510193.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]