Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Yes, that's what I observed and described below. And that behavior is not appropriate for my use case. So, how can I stop Wicket to "make the url relative to the web root no matter what mount path I use for the page"? I want to *change* that: my designer delivers HTML where the images are *not* relative to the web root, but to one directory below. In our HTML files are URLs like "../images/image.img" and I don't want to change these URLs. Alternatively, how can I tell Wicket that the web root has a different prefix just for rewriting these image URLs? Thanks, Joachim Martin Grigorov wrote: > Hi, > > If your images/css are in the web root then use something like > "images/image.img" in your .html. > Wicket will make the url relative to the web root no matter what mount > path you use for the page. > > On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: >> Hi, >> >> I'm new to Wicket and write my first application in it. I use >> "Wicket in Action" and online resources as documentation. (I >> stumbled already about the 1st few roadblocks owing to changes from >> Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my >> question, don't hesitate to just send it. >> >> My problem: I have a page that's mounted as URL "cat/entry". In the >> page's HTML there are links to images and CSS files that start with >> "..", e.g., "../images/bg_blabla.img". These are no Wicket >> components, just plain HTML. >> >> When Wicket renders the page, it rewrites the image URLs and >> prepends "../", e.g., the image URL now is output as >> "../../images/bg_blabla.img". I suppose it tries to adept to the >> extra path level that I introduced during mount and compensates for it. >> >> How can I stop Wicket from adding this "../" prefix? I searched via >> Google and read through Javadocs, but to no avail. >> >> For background: The URL in the HTML file is right... My HTML >> designers deliver their design files as "cat/entry.html", my mounts >> just follow their lead. I would like to change their files as >> little as possible, it makes files swapping back to/with them much >> easier. >> >> I hope somebody here may help me, thanks in advance. >> >> Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Avoiding XMlPullParser Parse exception
Hmm So there is no other way ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoiding-XMlPullParser-Parse-exception-tp4651210p4651214.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: Avoiding XMlPullParser Parse exception
Hi, You better fix your HTML. This will improve the way it is rendered too. I hope you don't have invalid HTML in all these 1k html files. On Tue, Aug 14, 2012 at 9:09 AM, vinitty wrote: > I am migrating from 1.3.4 to 1.5.7 > No in my Html some places extra quotes are exits but my Html was working > fine in 1.3.4 > Now in 1.5.7 parsing exception is coming > > I can not modified htmls as i am having around 1k htmls > > please suggest what to do and how to solve this > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Avoiding-XMlPullParser-Parse-exception-tp4651210.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem sending email using SSL after upgrading to Wicket 1.5
Hi, I don't think this is anyhow related to Wicket. Here are the GMail SMTP related props I use successfully: mail.server.host=smtp.gmail.com mail.server.port=587 mail.server.username=my.em...@gmail.com mail.server.password=my-passwd mail.server.starttls.enable=true You may also check the docs of SMTPAppender in Logback. There are examples for configuring it with GMail. I believe the problem is in these settings. On Tue, Aug 14, 2012 at 5:34 AM, James Eliyezar wrote: > Greetings to all of you. > > We recently upgraded our application to Wicket 1.5. > However, after upgrading we had problems sending email using SSL from our > application. > This may not be related to wicket at all but I promise we didn't change any > dependencies other than wicket's. > What amuses me is that it works as expected in our older versions which > still use Wicket 1.4.x. > Both the older version and the current version were run using the same JRE. > > Here's the code that sends email: > > > public class MailSenderTask implements Runnable > { > private Properties smtpProperties; > private EmailMessage message; > private static final Logger logger = > LoggerFactory.getLogger(MailSenderTask.class); > > public MailSenderTask(Properties smtpProperties, EmailMessage message) > { > this.smtpProperties = smtpProperties; > this.message = message; > } > > public synchronized void sendMail() throws Exception > { > try { > if (addSSlProvider()) { > logger.info("Adding ssl provider"); > Security.addProvider(new > com.sun.net.ssl.internal.ssl.Provider()); > } else { > logger.info("Using plain text connection as ssl/tls is not > enabled"); > } > Session session = createSession(); > MimeMessage mimeMessage = new MimeMessage(session); > mimeMessage.setSender(new InternetAddress(message.getSender())); > mimeMessage.setSubject(message.getSubject()); > > if (message.getRecipients().indexOf(',') > 0) { > mimeMessage.setRecipients(Message.RecipientType.TO, > InternetAddress.parse(message.getRecipients())); > } else { > mimeMessage.setRecipient(Message.RecipientType.TO, new > InternetAddress(message.getRecipients())); > } > > MimeBodyPart bodyPart = new MimeBodyPart(); > bodyPart.setContent(message.getBody(), "text/html"); > > Multipart multipart = new MimeMultipart(); > multipart.addBodyPart(bodyPart); > > if (message.getAttachments() != null && > message.getAttachments().length > 0) { > for (File file : message.getAttachments()) { > logger.debug("Adding {} as an attachment", file); > MimeBodyPart attachmentPart = new MimeBodyPart(); > attachmentPart.attachFile(file); > multipart.addBodyPart(attachmentPart); > } > } > > mimeMessage.setContent(multipart); > > logger.info("Sending mail..."); > Transport.send(mimeMessage); > logger.info("Mail sent to {}", message.getRecipients()); > } catch (Exception ex) { > throw new EmailException("Error occurred while sending mail", > ex); > } > } > > private boolean addSSlProvider() > { > String sslEnabledProperty = > smtpProperties.getProperty("mail.smtp.starttls.enable"); > if (StringUtils.isNotEmpty(sslEnabledProperty)) { > return Boolean.parseBoolean(sslEnabledProperty); > } > return false; > } > > private Session createSession() > { > Session session = null; > if > (Boolean.parseBoolean(smtpProperties.getProperty("mail.smtp.auth"))) { > logger.info("Creating session with authentication"); > session = createSessionWithAuthentication(smtpProperties); > } else { > logger.info("Creating default session"); > session = createDefaultSession(smtpProperties); > } > return session; > } > > private Session createDefaultSession(final Properties smtpProperties) > { > return Session.getInstance(smtpProperties); > } > > private Session createSessionWithAuthentication(final Properties > smtpProperties) > { > return Session.getInstance(smtpProperties, > new Authenticator() > { > @Override > protected PasswordAuthentication > getPasswordAuthentication() > { > return new > PasswordAuthentication(smtpProperties.getProperty("smtp.username"), > > smtpProperties.getProperty("smtp.password")); > } > }); > } > > public void run() > { > if (smtpProperties != null
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Hi, If your images/css are in the web root then use something like "images/image.img" in your .html. Wicket will make the url relative to the web root no matter what mount path you use for the page. On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: > Hi, > > I'm new to Wicket and write my first application in it. I use > "Wicket in Action" and online resources as documentation. (I > stumbled already about the 1st few roadblocks owing to changes from > Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my > question, don't hesitate to just send it. > > My problem: I have a page that's mounted as URL "cat/entry". In the > page's HTML there are links to images and CSS files that start with > "..", e.g., "../images/bg_blabla.img". These are no Wicket > components, just plain HTML. > > When Wicket renders the page, it rewrites the image URLs and > prepends "../", e.g., the image URL now is output as > "../../images/bg_blabla.img". I suppose it tries to adept to the > extra path level that I introduced during mount and compensates for it. > > How can I stop Wicket from adding this "../" prefix? I searched via > Google and read through Javadocs, but to no avail. > > For background: The URL in the HTML file is right... My HTML > designers deliver their design files as "cat/entry.html", my mounts > just follow their lead. I would like to change their files as > little as possible, it makes files swapping back to/with them much > easier. > > I hope somebody here may help me, thanks in advance. > > Joachim > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > Joachim Schrod, Roedermark, Germany > Email: jsch...@acm.org > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Avoiding XMlPullParser Parse exception
I am migrating from 1.3.4 to 1.5.7 No in my Html some places extra quotes are exits but my Html was working fine in 1.3.4 Now in 1.5.7 parsing exception is coming I can not modified htmls as i am having around 1k htmls please suggest what to do and how to solve this -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoiding-XMlPullParser-Parse-exception-tp4651210.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 a way to search component by its wicket ID ?
You can definitely search by wicket id but you may have to specify the hierarchy as well. Something like this, TextField usernameField = (TextField) get("userForm:username"); > to get the text field component with the wicket id "username" inside the form whose wicket id is "userForm". Hope this helps you. DISCLAIMER: I'm no wicket expert but these are my humble opinions and this is what I do to locate components when they are loosely coupled. On Mon, Aug 13, 2012 at 9:41 PM, arkadyz111 wrote: > Hello, team. > > I am looking for a way to locate component by its wicket id in markup > container. But I see only option to search by "path" is supported. > > Do I miss something ? > > Thank you. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-component-by-its-wicket-ID-tp4651175.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 > > -- Thanks & regards James Selvakumar mcruncher.com
Problem sending email using SSL after upgrading to Wicket 1.5
Greetings to all of you. We recently upgraded our application to Wicket 1.5. However, after upgrading we had problems sending email using SSL from our application. This may not be related to wicket at all but I promise we didn't change any dependencies other than wicket's. What amuses me is that it works as expected in our older versions which still use Wicket 1.4.x. Both the older version and the current version were run using the same JRE. Here's the code that sends email: public class MailSenderTask implements Runnable { private Properties smtpProperties; private EmailMessage message; private static final Logger logger = LoggerFactory.getLogger(MailSenderTask.class); public MailSenderTask(Properties smtpProperties, EmailMessage message) { this.smtpProperties = smtpProperties; this.message = message; } public synchronized void sendMail() throws Exception { try { if (addSSlProvider()) { logger.info("Adding ssl provider"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); } else { logger.info("Using plain text connection as ssl/tls is not enabled"); } Session session = createSession(); MimeMessage mimeMessage = new MimeMessage(session); mimeMessage.setSender(new InternetAddress(message.getSender())); mimeMessage.setSubject(message.getSubject()); if (message.getRecipients().indexOf(',') > 0) { mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(message.getRecipients())); } else { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(message.getRecipients())); } MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message.getBody(), "text/html"); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(bodyPart); if (message.getAttachments() != null && message.getAttachments().length > 0) { for (File file : message.getAttachments()) { logger.debug("Adding {} as an attachment", file); MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(file); multipart.addBodyPart(attachmentPart); } } mimeMessage.setContent(multipart); logger.info("Sending mail..."); Transport.send(mimeMessage); logger.info("Mail sent to {}", message.getRecipients()); } catch (Exception ex) { throw new EmailException("Error occurred while sending mail", ex); } } private boolean addSSlProvider() { String sslEnabledProperty = smtpProperties.getProperty("mail.smtp.starttls.enable"); if (StringUtils.isNotEmpty(sslEnabledProperty)) { return Boolean.parseBoolean(sslEnabledProperty); } return false; } private Session createSession() { Session session = null; if (Boolean.parseBoolean(smtpProperties.getProperty("mail.smtp.auth"))) { logger.info("Creating session with authentication"); session = createSessionWithAuthentication(smtpProperties); } else { logger.info("Creating default session"); session = createDefaultSession(smtpProperties); } return session; } private Session createDefaultSession(final Properties smtpProperties) { return Session.getInstance(smtpProperties); } private Session createSessionWithAuthentication(final Properties smtpProperties) { return Session.getInstance(smtpProperties, new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(smtpProperties.getProperty("smtp.username"), smtpProperties.getProperty("smtp.password")); } }); } public void run() { if (smtpProperties != null && message != null) { try { sendMail(); } catch (Exception ex) { throw new EmailException("Error", ex); } } } } These are the SMTP properties that were set: mail.smtp.socketFactory.fallback:false mail.smtp.socketFactory.class:javax.net.ssl.SSLSocketFactory mail.transport.protocol:smtp mail.smtp.connectiontimeout:1 mail.smtp.host:smtp.gmail.com mail.smtp.timeout:1 mail.smtp.starttls.enable:true mail.smtp.port:465 mail.smtp.auth:true mail.smtp.socketFactory.port:465 mail.smtp.quitwait:false smtp.username:f...@gmail.com smtp.password: bar This is the exception thrown: Caused by: javax.mail.MessagingException: Could
Re: RestartResponseAtInterceptPageException
we are identify the problem in our application.we are properly handle the continueToOriginalDestination() method,our application working fine. Thank you very much for your help
RE: Is there a way to search component by its wicket ID ?
In my unit test code I use: com.googlecode.londonwicket wicket-component-expressions 0.2.0 test org.apache.wicket wicket Or see: http://code.google.com/p/londonwicket/source/browse/repo/com/googlecode/lond onwicket/wicket-component-expressions/?r=61#wicket-component-expressions%2F0 .2.0 They are a group of Wicket users from London and their two static method tool allows you to use regexp in the component path as well as filtering by a component type such as a TextBox and its model such as Model("Hello World"). I don't think the new version of Wicket has this flexibility build in WicketTester, but looking over the code of BaseWicketTester#getComponentFromLastRenderedPage() and BaseWicketTester#debugComponentTrees() you can implement your own method to iterate through the component tree and return a reference to the component you want. ~ Thank you, Paul Bors -Original Message- From: arkadyz111 [mailto:azelek...@gmail.com] Sent: Monday, August 13, 2012 9:41 AM To: users@wicket.apache.org Subject: Is there a way to search component by its wicket ID ? Hello, team. I am looking for a way to locate component by its wicket id in markup container. But I see only option to search by "path" is supported. Do I miss something ? Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-componen t-by-its-wicket-ID-tp4651175.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RestartResponseAtInterceptPageException
Please refer to http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-problem-in-1-5-td4255020.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RestartResponseAtInterceptPageException-tp4651162p4651171.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: Not to validate the Html while rendering in wicket
I was thinking the same thing but it looks like it is not and its throwing an exception -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Not-to-validate-the-Html-while-rendering-in-wicket-tp4651202p4651205.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 get HttpServletRequest in My Application class
wicket user wrote: > > I need to get the HttpServletRequest object in My Application class. In the > WebPage we can get from > > ((HttpServletRequest) ((ServletWebRequest) > getRequest()).getContainerRequest()) > > but its not working in Application class. I'm new to Wicket, but it seems obvious that this is impossible. The application object exists outside of resp. independent of any servlet requests. Only Web pages and their components are concercened with HTTP requests, and thus only they have access. If you want to store or access something from a request in your application object -- which is a singleton that's independent from any request and any session, then there's probably something wrong with your design. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Not to validate the Html while rendering in wicket
That's weird. I thought this was disabled by default when Wicket is in deployment mode... On 13/08/2012 3:36 PM, vinitty wrote: I want to disable the Html validation while rendering in wicket 1.5.7 I am running wicket in deployment mode Please suggest its urgent -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Not-to-validate-the-Html-while-rendering-in-wicket-tp4651202.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Not to validate the Html while rendering in wicket
I want to disable the Html validation while rendering in wicket 1.5.7 I am running wicket in deployment mode Please suggest its urgent -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Not-to-validate-the-Html-while-rendering-in-wicket-tp4651202.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 is the better way to use repeated forms using ajax?
Which part doesn't work in that code? The only ajax part is the cancelButton but this doesn't fit the description from your first email. On 13/08/2012 1:25 PM, Roger Palacios wrote: Thanks for responding. The code I did send before is simplified, and translated to english: The equivalents classes are: Grupo = Group Solicitante = Person here is: public class PanelGrupo extends Panel { private AsignacionModel asignacionModel; private WebMarkupContainer listContainer; private WebMarkupContainer resultadoContainer; private CompoundPropertyModel cpmGrupo; private ListView lvSolicitantes; private Label resultLabel; public PanelGrupo(String id, Grupo g) { super(id); final List listCong = CongregacionOfertante.findAll(null); final Model resultModel = new Model(""); cpmGrupo = new CompoundPropertyModel(g); lvSolicitantes = new ListView("solicitante", g.getSolicitanteList()) { @Override protected IModel getListItemModel(final IModel listViewModel, final int index) { return new CompoundPropertyModel(super.getListItemModel(listViewModel, index)); } @Override protected void populateItem(ListItem item) { final Solicitante s = item.getModelObject(); ChoiceRenderer crCongs = new ChoiceRenderer("nombre", "idCong"); DropDownChoice ddcCongs = new DropDownChoice("congregaciones", new PropertyModel(item.getModel(), "congOfertante"), listCong, crCongs); item.add(new Label("nombre")); item.add(new Label("telefono")); item.add(new Label("edad")); item.add(new Label("sexo")); item.add(new Label("pubPre")); item.add(new Label("parentesco")); item.add(new Label("sordoOyente")); item.add(new Label("equipoDormir")); item.add(ddcCongs); item.add(new TextField("idOferta", Integer.class)); item.add(new TextField("observaciones", String.class)); item.add(new CheckBox("descartado", new PropertyModel(s, "descartado"))); } }; add(new Label("id_grupo", g.getIdGrupo().toString())); add(new Label("nombre_congregacion", new Model(g.getCongregacion().getNombre(; Form f = new Form("formSolicitantes", cpmGrupo) { }; Button deleteButton = new Button("eliminarGrupo") { @Override public void onSubmit() { Grupo g = cpmGrupo.getObject(); EntityManager em = null; try { em = DBManager.getEntityManager(); g = em.find(Grupo.class, g.getIdGrupo()); em.getTransaction().begin(); em.remove(g); em.getTransaction().commit(); } catch (OptimisticLockException e) { Logger.getLogger(PanelGrupo.class).error("Error al eliminar grupo " + g.getIdGrupo(), e); } finally { em.close(); } super.onSubmit(); } }; deleteButton.add(new AttributeModifier( "onclick", new Model("if(!confirm('¿Está seguro de eliminar todo el grupo?')) return false;"))); f.add(deleteButton); f.add(new Label("transporte", g.getTransporte() ? "Sí" : "No")); f.add(new Label("fechaLlegada")); f.add(new Label("fechaSalida")); f.add(new Label("adjunto", new Model(g.getAdjunto().getNombreArchivo(; f.add(new Label("comentarios")); f.add(new Label("mensajeCorreo", new Model(g.getAdjunto().getCorreo().getMensaje(; resultadoContainer = new WebMarkupContainer("resultadoContainer"); resultadoContainer.setOutputMarkupId(true); resultLabel = new Label("resultado", resultModel); resultadoContainer.add(resultLabel); add(resultadoContainer); listContainer = new WebMarkupContainer("solicitantes"); listContainer.setOutputMarkupId(true); listContainer.add(lvSolicitantes); f.add(listContainer); AjaxButton cancelButton = new AjaxButton("cancelar", new Model("Cancelar")) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { Grupo g = Grupo.findById(cpmGrupo.getObject().getIdGrupo()); cpmGrupo.setObject(g); resultModel.setObject(""); target.add(resultadoContainer); target.add(listContainer); super.onSubmit(); } @Override protected void onError(AjaxRequestTarget target, Form form) {
Re: How is the better way to use repeated forms using ajax?
Thanks for responding. The code I did send before is simplified, and translated to english: The equivalents classes are: Grupo = Group Solicitante = Person here is: public class PanelGrupo extends Panel { private AsignacionModel asignacionModel; private WebMarkupContainer listContainer; private WebMarkupContainer resultadoContainer; private CompoundPropertyModel cpmGrupo; private ListView lvSolicitantes; private Label resultLabel; public PanelGrupo(String id, Grupo g) { super(id); final List listCong = CongregacionOfertante.findAll(null); final Model resultModel = new Model(""); cpmGrupo = new CompoundPropertyModel(g); lvSolicitantes = new ListView("solicitante", g.getSolicitanteList()) { @Override protected IModel getListItemModel(final IModel listViewModel, final int index) { return new CompoundPropertyModel(super.getListItemModel(listViewModel, index)); } @Override protected void populateItem(ListItem item) { final Solicitante s = item.getModelObject(); ChoiceRenderer crCongs = new ChoiceRenderer("nombre", "idCong"); DropDownChoice ddcCongs = new DropDownChoice("congregaciones", new PropertyModel(item.getModel(), "congOfertante"), listCong, crCongs); item.add(new Label("nombre")); item.add(new Label("telefono")); item.add(new Label("edad")); item.add(new Label("sexo")); item.add(new Label("pubPre")); item.add(new Label("parentesco")); item.add(new Label("sordoOyente")); item.add(new Label("equipoDormir")); item.add(ddcCongs); item.add(new TextField("idOferta", Integer.class)); item.add(new TextField("observaciones", String.class)); item.add(new CheckBox("descartado", new PropertyModel(s, "descartado"))); } }; add(new Label("id_grupo", g.getIdGrupo().toString())); add(new Label("nombre_congregacion", new Model(g.getCongregacion().getNombre(; Form f = new Form("formSolicitantes", cpmGrupo) { }; Button deleteButton = new Button("eliminarGrupo") { @Override public void onSubmit() { Grupo g = cpmGrupo.getObject(); EntityManager em = null; try { em = DBManager.getEntityManager(); g = em.find(Grupo.class, g.getIdGrupo()); em.getTransaction().begin(); em.remove(g); em.getTransaction().commit(); } catch (OptimisticLockException e) { Logger.getLogger(PanelGrupo.class).error("Error al eliminar grupo " + g.getIdGrupo(), e); } finally { em.close(); } super.onSubmit(); } }; deleteButton.add(new AttributeModifier( "onclick", new Model("if(!confirm('¿Está seguro de eliminar todo el grupo?')) return false;"))); f.add(deleteButton); f.add(new Label("transporte", g.getTransporte() ? "Sí" : "No")); f.add(new Label("fechaLlegada")); f.add(new Label("fechaSalida")); f.add(new Label("adjunto", new Model(g.getAdjunto().getNombreArchivo(; f.add(new Label("comentarios")); f.add(new Label("mensajeCorreo", new Model(g.getAdjunto().getCorreo().getMensaje(; resultadoContainer = new WebMarkupContainer("resultadoContainer"); resultadoContainer.setOutputMarkupId(true); resultLabel = new Label("resultado", resultModel); resultadoContainer.add(resultLabel); add(resultadoContainer); listContainer = new WebMarkupContainer("solicitantes"); listContainer.setOutputMarkupId(true); listContainer.add(lvSolicitantes); f.add(listContainer); AjaxButton cancelButton = new AjaxButton("cancelar", new Model("Cancelar")) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { Grupo g = Grupo.findById(cpmGrupo.getObject().getIdGrupo()); cpmGrupo.setObject(g); resultModel.setObject(""); target.add(resultadoContainer); target.add(listContainer); super.onSubmit(); } @Override protected void onError(AjaxRequestTarget target, Form form) { throw new UnsupportedOperationException("Not supported yet."); } }; Button saveButton = new Button("guardar", new Model("Guardar")) { @Override public void onSubmit() { Grupo g = (Grupo) cpmGrupo.g
RE: how to get HttpServletRequest in My Application class
BTW, if you get a NPE on RequestCycle.get() then you most likely place this code outside a Wicket Component like a Page. Try moving it to a page first and see if you grab a reference to the request object. If you do, then pass it as a parameter to your other method/class. For older version of Wicket < 1.5.x see: https://cwiki.apache.org/WICKET/request-cycle-and-request-cycle-processor.ht ml For newer version see: https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html ~ Thank you, Paul Bors -Original Message- From: Paul Bors [mailto:p...@bors.ws] Sent: Monday, August 13, 2012 1:18 PM To: users@wicket.apache.org Subject: RE: how to get HttpServletRequest in My Application class For your reference also see: https://cwiki.apache.org/WICKET/getting-a-url-for-display.html ~ Thank you, Paul Bors -Original Message- From: wicket user [mailto:samd...@live.com] Sent: Monday, August 13, 2012 1:07 PM To: users@wicket.apache.org Subject: Re: how to get HttpServletRequest in My Application class I am getting java.lang.NullPointerException ((ServletWebRequest)RequestCycle.get().getRequest()).getContainerRequest() . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in- My-Application-class-tp4651189p4651196.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: how to get HttpServletRequest in My Application class
For your reference also see: https://cwiki.apache.org/WICKET/getting-a-url-for-display.html ~ Thank you, Paul Bors -Original Message- From: wicket user [mailto:samd...@live.com] Sent: Monday, August 13, 2012 1:07 PM To: users@wicket.apache.org Subject: Re: how to get HttpServletRequest in My Application class I am getting java.lang.NullPointerException ((ServletWebRequest)RequestCycle.get().getRequest()).getContainerRequest() . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in- My-Application-class-tp4651189p4651196.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Generic search form/panel implementation
We have some proprietary small projects in our product developed in Wicket that matches your request. I had to develop something similar for a form that draws itself on the screen in a tab panel whose meta-data is in XML which in turn is uploaded to the product as a plug-in at run-time. To get this up and running took a good 3-4 weeks of development time. Thus what you're asking for is possible and you don't have to restrict your meta-data to XML, feel free to use annotations if it's all done in Java code. You should keep in mind that Wicket depends a lot on the MVC, your only limitations are really the model object(s), the custom form validation and submission actions (error reporting, localization etc). The model I overcome by using generic objects for each form field in a tree structure with IDs for each element and using this tree as the model of the form which in turn is used by the form submission after validation succeeds to grab the user input. The same tree carries the UI definitions and default values as loaded from the XML file. For the custom form validation, I allowed the developer of the XML file(s) define a validator given the well known wicket classes and their API plus the specific domain ones we have developed in-house and pass primitive arguments to their constructors (ie: maximum character size for this text field is x). Since I'm using this on a single page, I didn't have to worry about the form submission and error but I could have designed this as an interface and have the client code implement it form different forms and pages, I think is doable. ~ Thank you, Paul Bors -Original Message- From: nunofaria11 [mailto:nunofari...@gmail.com] Sent: Monday, August 13, 2012 4:05 AM To: users@wicket.apache.org Subject: Generic search form/panel implementation Hi, I am trying to implement a generic search form/panel in Wicket. The form should allow searches in several fields in an Entity (using the DAO pattern) in order to filter the output of a ListView or a DataView. What is the best way to do this? I've thought of doing this using an extended DataProvider but I haven't really seen any real example. Did anyone implemented such a thing? Some pointers would be nice. Regards Nuno -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generic-search-form-panel-impleme ntation-tp4651164.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to get HttpServletRequest in My Application class
I am getting java.lang.NullPointerException ((ServletWebRequest)RequestCycle.get().getRequest()).getContainerRequest() . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in-My-Application-class-tp4651189p4651196.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 JUnit Test
Also get familiar with the API for the WicketTester that extends BaseWicketTester. There are quite a few useful methods that can aid you during unit testing such as BaseWicketTester#debugComponentTrees() which will output the wicket component tree. In our unit tests we extended from WicketTester and added a dumpPage() method that would give you both the output of BaseWicketTester#debugComponentTrees() and that of BaseWicketTester#getLastResponseAsString() so a developer can see both the Wicket component tree and the HTML or whatever the last response was (Ajax, etc). When I write unit tests I use those two methods extensively as I would need to know both the component path in the tree and the expected output or the last response. There are plenty of other helper methods there as well. ~ Thank you, Paul Bors -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, August 13, 2012 11:53 AM To: users@wicket.apache.org Subject: Re: Basic JUnit Test Hi, Put a breakpoint in the button's onSubmit() method and see whether it is actually called. It could be that you need to call formTester.submit("myForm:myButton"); On Mon, Aug 13, 2012 at 5:18 PM, JCoder wrote: > Hi all, > > Im working at a basic Unit Test that looks like this: > > 1. tester.assertRenderedPage(FirstPage.class); > 2. FormTester formTester = tester.newFormTester("myForm"); 3. > formTester.submit("myButton"); 4. > tester.assertRenderedPage(SecondPage.class); > > All lines work as expected. Only line 4 fails. I just want to verify a click > on a button and after that a certain Page (SecondPage) should be rendered. > > The test fails with: "junit.framework.AssertionFailedError: > expected: but was:" > What did I wrong? > > Cheers & Thanks in advance, > Y > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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
RE: Searching for new experience with wicket
Also read the articles on http://wicket.apache.org from under the Contribute left side section :) ~ Thank you, Paul Bors -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, August 13, 2012 11:52 AM To: users@wicket.apache.org Subject: Re: Searching for new experience with wicket Hi, Check my previous message for the details. Checkout the new code, investigate it for a while, checkout the code for the old wicket-examples (https://github.com/apache/wicket/tree/master/wicket-examples) and start migrating the old examples one by one to the new design. When ready with migrating an example please make a Pull Request (https://help.github.com/categories/63/articles). On Mon, Aug 13, 2012 at 11:11 AM, nunofaria11 wrote: > Hello there, > > I would also be interested in contributing to Wicket. I've recently > started working (recent graduate) and I am now working with > technologies such as Java, Wicket, Hibernate, CSS (messing around with > Twitter Bootstrap) and a little bit of JavaScript and JQuery. > > Also I think it would br a great learning opportunity for me =) I can > initially offer 6 to 8h p. week. > > What would I need to do? > > Best regards. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Searching-for-new-experienc > e-with-wicket-tp465p4651165.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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
Re: How is the better way to use repeated forms using ajax?
Hi, On 13/08/2012 12:13 PM, Roger Palacios wrote: Hi every all. This is my first mail in wicket mailing list. Welcome! I want to update the groups doing ajax submits. I tried using ListView, but, I dont know why, when I click 'save' button the changes are reflected on in the first group panel, if I update any other group and click 'save' the Group object is not updated. I'm a little bit confused... What is the "first group panel" ? Is it the first table row? I also don't understand the relation with the other page you presented with the filtering. Could you show the java side of the panel as well? It would help to understand the problem. Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to get HttpServletRequest in My Application class
Try this: ((ServletWebRequest)RequestCycle.get().getRequest()).getContainerRequest() Hi, I need to get the HttpServletRequest object in My Application class. In the WebPage we can get from ((HttpServletRequest) ((ServletWebRequest) getRequest()).getContainerRequest()) but its not working in Application class. Please suggest any ideas. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in-My-Application-class-tp4651189.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: WicketRuntimeException: "Submit Button ... is not enabled"
Hi, When a form is submitted, it checks whether the submitting component is a Wicket component. If it is (your case), it makes sure that it's enabled and visible. I guess this is to prevent users manipulating with the form submission process. In any case, if any of the 2 conditions is not met, the exception is thrown. This might or might not be caused by a race condition, but it would most likely be caused by disabling buttons (or their parents) in your code. Bertrand On 13/08/2012 10:40 AM, eugenebalt wrote: We have an Ajax button which, when clicked, occasionally produces this WicketRuntimeException: ERROR [WebContainer : 17] (RequestCycle.java:1521) - Submit Button myPanel:editButton (path=myForm:myPanel:editButton) is not enabled org.apache.wicket.WicketRuntimeException: Submit Button myPanel:editButton (path=myForm:myPanel:editButton) is not enabled at org.apache.wicket.markup.html.form.Form$2.component(Form.java:626) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:878) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:602) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:875) at sun.reflect.GeneratedMethodAccessor2603.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182) at Is there a race condition of some kind happening here? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketRuntimeException-Submit-Button-is-not-enabled-tp4651180.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
how to get HttpServletRequest in My Application class
Hi, I need to get the HttpServletRequest object in My Application class. In the WebPage we can get from ((HttpServletRequest) ((ServletWebRequest) getRequest()).getContainerRequest()) but its not working in Application class. Please suggest any ideas. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in-My-Application-class-tp4651189.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: enabling and disabling the components
Thanks, it is working but some wierd thing is happening. I have checked the values in the object also it is getting populated but just one component is visible otherwise none. PriceVO priceVO if(priceVO.getOnSalePrice()!=null) add(new Label("onSalePrice", " " + priceVO.getOnSalePrice())).setVisible(true); else add(new Label("onSalePrice", "")).setVisible(false); if(priceVO.getRegularPrice()!=null) add(new Label("regularPrice", "Reg. Price : " + priceVO.getRegularPrice())).setVisible(true); else add(new Label("regularPrice", "")).setVisible(false); if(priceVO.getSavePrice()!=null) add( new Label("youSave", "You Save :" + priceVO.getSavePrice())).setVisible(true); else add( new Label("youSave", "")).setVisible(false); if(priceVO.getPlanPrice()!=null) add(new Label("planPrice", " " + priceVO.getPlanPrice()+ " per month")).setVisible(true); else add(new Label("planPrice", "")).setVisible(false); if the planPrice is getting populated then everything should be invisible that is working fine but in some scenarios only regular price is getting populated at that time nothing is displayed. Please Advise. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/enabling-and-disabling-the-components-tp4651107p4651188.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: RestartResponseAtInterceptPageException
Hi, Please give more details what actually happens. "It doesn't work" doesn't explain much. On Mon, Aug 13, 2012 at 12:15 PM, Madasamy Sankarapandian wrote: > In our application we are intent to throw the > RestartResponseAtInterceptPageException. > but it is not properly redirect to the LoginPage. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Basic JUnit Test
Hi, Put a breakpoint in the button's onSubmit() method and see whether it is actually called. It could be that you need to call formTester.submit("myForm:myButton"); On Mon, Aug 13, 2012 at 5:18 PM, JCoder wrote: > Hi all, > > Im working at a basic Unit Test that looks like this: > > 1. tester.assertRenderedPage(FirstPage.class); > 2. FormTester formTester = tester.newFormTester("myForm"); > 3. formTester.submit("myButton"); > 4. tester.assertRenderedPage(SecondPage.class); > > All lines work as expected. Only line 4 fails. I just want to verify a click > on a button and after that a certain Page (SecondPage) should be rendered. > > The test fails with: "junit.framework.AssertionFailedError: > expected: but was:" > What did I wrong? > > Cheers & Thanks in advance, > Y > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Checkbox in DataTable is not reflecting its sts in checkbox
Hi, In the constructor of UserActionsPanel, the checkbox is created like so: add(new CheckBox("select", item.getModel())); However, I think item.getModel() returns an IModel> type. This can't work in a CheckBox which requires a Boolean model. On 13/08/2012 8:33 AM, Delange wrote: Hi, in this program i use a datatable with selections. In the column beneath the filtercolum i added a checkbox. The user must select wich records the program must add to another file (at the end) In this example the table is shown correctly, it has a checkbox. But whatever I do I'll never see any status change reflecting the checkbox. (The checkbox is part of the KostenOV record that is shown) I can'figure out what is wrong. I read a lot of articles but none could help. My source is: package com.vdr.logistiek.gui.kosten.regels.opbouw; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable; import org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredAbstractColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.GoAndClearFilter; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.IFilterStateLocator; import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.CheckBox; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.LoadableDetachableModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.spring.injection.annot.SpringBean; import com.vdr.logistiek.bo.view.KostenOV; import com.vdr.logistiek.gui.kosten.header.HeaderPage; import com.vdr.logistiek.gui.kosten.overzicht.KostenfacturenOverzichtPage; import com.vdr.logistiek.gui.template.MyFilterColumn; import com.vdr.logistiek.service.KostenService; import com.vdr.logistiek.service.view.KostenOVService; public class RegelPage extends WebPage{ private RegelInput input; private List kostenOVList = new ArrayList(); @SpringBean(name = "kostenService") private KostenService kostenService; @SpringBean(name = "kostenOVService") private KostenOVService kostenOVService; public RegelPage(){ input = new RegelInput(); setDefaultModel(new CompoundPropertyModel(input)); KostenOVProvider kostenOVProvider = new KostenOVProvider(); FilterForm form = new FilterForm("inputForm", kostenOVProvider); add(form); addTable(form, kostenOVProvider); form.add(getSaveButton()); form.add(getCancelButton()); form.add(new FeedbackPanel("feedback")); } private Form getForm(){ Form form = new Form("inputForm"){ private static final long serialVersionUID = 1L; protected void onSubmit() { info("the form was submitted!"); } }; return form; } private Button getSaveButton(){ Button saveButton = new Button("saveButton"){ public void onSubmit(){ System.out.println("savebutton clicked"); // PageParameters parameters = new PageParameters(); // setResponsePage(OverzichtPage.class,parameters);d for (KostenOV kostenOV:kostenOVList){ System.out.println(kostenOV.isSelect()); } } };
Re: Searching for new experience with wicket
Hi, Check my previous message for the details. Checkout the new code, investigate it for a while, checkout the code for the old wicket-examples (https://github.com/apache/wicket/tree/master/wicket-examples) and start migrating the old examples one by one to the new design. When ready with migrating an example please make a Pull Request (https://help.github.com/categories/63/articles). On Mon, Aug 13, 2012 at 11:11 AM, nunofaria11 wrote: > Hello there, > > I would also be interested in contributing to Wicket. I've recently started > working (recent graduate) and I am now working with technologies such as > Java, Wicket, Hibernate, CSS (messing around with Twitter Bootstrap) and a > little bit of JavaScript and JQuery. > > Also I think it would br a great learning opportunity for me =) > I can initially offer 6 to 8h p. week. > > What would I need to do? > > Best regards. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Searching-for-new-experience-with-wicket-tp465p4651165.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Has anyone an example of a checkbox in a DataTable
http://www.wicket-library.com/inmethod-grid/data-grid/item-selection The code is at https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/inmethod-grid-parent On Mon, Aug 13, 2012 at 6:19 PM, Delange wrote: > I tried everything, I spent a whole day reading comments in this on the > internet. > Please please please, thanks in advance > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Has-anyone-an-example-of-a-checkbox-in-a-DataTable-tp4651182.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Has anyone an example of a checkbox in a DataTable
I tried everything, I spent a whole day reading comments in this on the internet. Please please please, thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Has-anyone-an-example-of-a-checkbox-in-a-DataTable-tp4651182.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 control IMG/CSS URL-Rewriting in mounted pages?
Hi, I'm new to Wicket and write my first application in it. I use "Wicket in Action" and online resources as documentation. (I stumbled already about the 1st few roadblocks owing to changes from Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my question, don't hesitate to just send it. My problem: I have a page that's mounted as URL "cat/entry". In the page's HTML there are links to images and CSS files that start with "..", e.g., "../images/bg_blabla.img". These are no Wicket components, just plain HTML. When Wicket renders the page, it rewrites the image URLs and prepends "../", e.g., the image URL now is output as "../../images/bg_blabla.img". I suppose it tries to adept to the extra path level that I introduced during mount and compensates for it. How can I stop Wicket from adding this "../" prefix? I searched via Google and read through Javadocs, but to no avail. For background: The URL in the HTML file is right... My HTML designers deliver their design files as "cat/entry.html", my mounts just follow their lead. I would like to change their files as little as possible, it makes files swapping back to/with them much easier. I hope somebody here may help me, thanks in advance. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WicketRuntimeException: "Submit Button ... is not enabled"
We have an Ajax button which, when clicked, occasionally produces this WicketRuntimeException: ERROR [WebContainer : 17] (RequestCycle.java:1521) - Submit Button myPanel:editButton (path=myForm:myPanel:editButton) is not enabled org.apache.wicket.WicketRuntimeException: Submit Button myPanel:editButton (path=myForm:myPanel:editButton) is not enabled at org.apache.wicket.markup.html.form.Form$2.component(Form.java:626) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:878) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:602) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:875) at sun.reflect.GeneratedMethodAccessor2603.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182) at Is there a race condition of some kind happening here? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketRuntimeException-Submit-Button-is-not-enabled-tp4651180.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 JUnit Test
Hi all, Im working at a basic Unit Test that looks like this: 1. tester.assertRenderedPage(FirstPage.class); 2. FormTester formTester = tester.newFormTester("myForm"); 3. formTester.submit("myButton"); 4. tester.assertRenderedPage(SecondPage.class); All lines work as expected. Only line 4 fails. I just want to verify a click on a button and after that a certain Page (SecondPage) should be rendered. The test fails with: "junit.framework.AssertionFailedError: expected: but was:" What did I wrong? Cheers & Thanks in advance, Y - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using Jasypt for URL encryption not working (Wicket 1.5.7)
Hi, I tried that, however I'm not familiar enough with the URL encryption procedure to find the error. Also, the Jasypt exception is very general due to security reasons. Here's a link to the FAQ: http://www.jasypt.org/faq.html#i-keep-on-receiving-encryption-operation-not-possible I've uploaded a quick start: http://d.pr/f/vZzv On start you should already see the exceptions, and an error when clicking on the link for the second page. I guess more people will run into this, because Wicket documentation points to Jasypt for a more secure URL encryption, and I followed their directions. Maybe someone is more capable than me in finding the error. It might be a Jasypt problem after all because of the newest 1.5.7 Wicket version, I don't know. But then maybe Wicket shouldn't link to Jasypt for this anymore? Thanks, if anyone finds the time to look into it. :) 2012/8/12 Martin Grigorov > Hi, > > Put breakpoints in CryptoMapper's methods for encrypting and > decrypting and see what's wrong. > > On Sat, Aug 11, 2012 at 11:41 AM, Michael M wrote: > > Hi, short question: I'm trying to use Jasypt to encrypt my non-mounted > > URLs. However, it doesn't seem to work, I get exceptions. > > > > After adding the dependency (jasypt-wicket15) I set up the Jasypt Crypt > > Factory as in the example on their site: > http://www.jasypt.org/wicket.html > > > > (...) > > getSecuritySettings().setCryptFactory(jasyptCryptFactory); > > > > > > The 'Configuring URL encryption' section seems to be outdated though, as > > far as I know this has to be done now by setting putting this in my > > application init-method, instead of using the RequestCycleProcessor: > > > > setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this)); > > > > > > If I use this line alone (without Jasypt) it works using the built-in > > encryption. However with the Jasypt factory I get the rolling errors, and > > my site doesn't work properly anymore: > > > > CryptoMapper: Error decrypting URL > > org.jasypt.exceptions.EncryptionOperationNotPossibleException: null > > > > (See the full exception here: http://pastebin.com/5HgYD2hx) > > > > Am I doing something wrong with the new *setRootRequestMapper*, or is > > Jasypt just not working anymore with 1.5.7? Thanks! > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Checkbox in DataTable is not reflecting its sts in checkbox
Hi, in this program i use a datatable with selections. In the column beneath the filtercolum i added a checkbox. The user must select wich records the program must add to another file (at the end) In this example the table is shown correctly, it has a checkbox. But whatever I do I'll never see any status change reflecting the checkbox. (The checkbox is part of the KostenOV record that is shown) I can'figure out what is wrong. I read a lot of articles but none could help. My source is: package com.vdr.logistiek.gui.kosten.regels.opbouw; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable; import org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterToolbar; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredAbstractColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.GoAndClearFilter; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.IFilterStateLocator; import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.CheckBox; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.LoadableDetachableModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.spring.injection.annot.SpringBean; import com.vdr.logistiek.bo.view.KostenOV; import com.vdr.logistiek.gui.kosten.header.HeaderPage; import com.vdr.logistiek.gui.kosten.overzicht.KostenfacturenOverzichtPage; import com.vdr.logistiek.gui.template.MyFilterColumn; import com.vdr.logistiek.service.KostenService; import com.vdr.logistiek.service.view.KostenOVService; public class RegelPage extends WebPage{ private RegelInput input; private List kostenOVList = new ArrayList(); @SpringBean(name = "kostenService") private KostenService kostenService; @SpringBean(name = "kostenOVService") private KostenOVService kostenOVService; public RegelPage(){ input = new RegelInput(); setDefaultModel(new CompoundPropertyModel(input)); KostenOVProvider kostenOVProvider = new KostenOVProvider(); FilterForm form = new FilterForm("inputForm", kostenOVProvider); add(form); addTable(form, kostenOVProvider); form.add(getSaveButton()); form.add(getCancelButton()); form.add(new FeedbackPanel("feedback")); } private Form getForm(){ Form form = new Form("inputForm"){ private static final long serialVersionUID = 1L; protected void onSubmit() { info("the form was submitted!"); } }; return form; } private Button getSaveButton(){ Button saveButton = new Button("saveButton"){ public void onSubmit(){ System.out.println("savebutton clicked"); // PageParameters parameters = new PageParameters(); // setResponsePage(OverzichtPage.class,parameters);d for (KostenOV kostenOV:kostenOVList){ System.out.println(kostenOV.isSelect()); } } }; return saveButton; } /** * * @return */ private Button getCancelButton(){ Button cancelButton = new Button("cancelButton"){ @Override public void onSubmit(){ setResp
Re: issue refreshing covered panel when modalwindow is open
Try to use the "replaceWith" method on the dataTable component. I'm attaching a piece of code where we use this method in (*another *but similiar) situation where we need to replace the content of a modal window when the selected line (of dataTable) is changed: add(new AjaxLink("details") { /** * */ private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { selectedLine = (Campaign)getParent().getDefaultModelObject(); ZoomCampaign tempZoomCampaign = new ZoomCampaign("zoomCampaign", new PropertyModel(myModel, "selectedLine")); zoomCampaign.replaceWith(tempZoomCampaign); zoomCampaign = tempZoomCampaign; target.add(zoomCampaign); zoomCampaign.show(target); } }); On Fri, Aug 10, 2012 at 7:54 PM, Andrew Geery wrote: > I've run into this issue a couple of times and worked around it, but I > wanted to see if there is a better way of handling it. > > I have a form in a panel in a ModalWindow on top of a datatable in a page. > When a user clicks the Save ajax button in the modal window, a done event > is bubbled up from the modal window. The event contains the > AjaxRequestTarget from the button. > > There are two components that listen for the done event: > > (1) the component that launched the ModalWindow -- this listener closes the > modal window > (2) a component farther up the hierarchy which contains (1) -- this > listener (re) adds the datatable on the page > > I have verified that both listeners are being called and that they are > called in the order above. However, the datatable does not get refreshed > in the browser. > > My question is: why didn't my datatable get re-rendered, even though I did > (re) add it to the containing panel? I think this has something to do with > the datatable not realizing it is visible/active. Or it may have something > to do with the event system :). Or perhaps even the AjaxRequestTarget from > the panel in the modal window :). I'm happy to put in some break points > and walk through the code if you anyone has ideas of where to look. > > The workaround is to have (1) listen for the event and stop the event > propagation. Then, in the ModalWindow.setWindowClosedCallback(), send the > event up to (2). Doing this, the datatable does get properly refreshed. > > My followup question is: is this the pattern that should be followed when > refreshing a panel under a modal window? Namely, don't try to refresh the > page/panel a ModalWindow is on top of until the covering ModalWindow has > closed? > > Thanks > Andrew >
RE: wicket-dnd strange situation
Hi Decebal, Sorry for the late response but I was on holiday. The 2 code snippets below do exactly the same. They look different but they both perform "new wicketdnd.DropTarget(...)" when the dom is loaded and ready. Can you provide a better/bigger example? I checked your other posts and saw a link to a bug report. In this you say you use WiQuery for the modalwindows but WiQuery has no support for them as Wicket already provides this. Regards, Hielke -Original Message- From: Decebal Suiu [mailto:decebal.s...@asf.ro] Sent: donderdag 2 augustus 2012 12:18 To: users@wicket.apache.org Subject: Re: wicket-dnd strange situation Another technical question is who (I suppose wiquery) and why change Wicket.Event.add(window, "domready", function(event) { new wicketdnd.DropTarget(...) }); in $(document).ready(function(event){new wicketdnd.DropTarget(...)}); Best regards, Decebal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-strange-situation-tp4650918p4650951.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RestartResponseAtInterceptPageException
In our application we are intent to throw the RestartResponseAtInterceptPageException. but it is not properly redirect to the LoginPage.
Re: Searching for new experience with wicket
Hello there, I would also be interested in contributing to Wicket. I've recently started working (recent graduate) and I am now working with technologies such as Java, Wicket, Hibernate, CSS (messing around with Twitter Bootstrap) and a little bit of JavaScript and JQuery. Also I think it would br a great learning opportunity for me =) I can initially offer 6 to 8h p. week. What would I need to do? Best regards. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Searching-for-new-experience-with-wicket-tp465p4651165.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
Generic search form/panel implementation
Hi, I am trying to implement a generic search form/panel in Wicket. The form should allow searches in several fields in an Entity (using the DAO pattern) in order to filter the output of a ListView or a DataView. What is the best way to do this? I've thought of doing this using an extended DataProvider but I haven't really seen any real example. Did anyone implemented such a thing? Some pointers would be nice. Regards Nuno -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generic-search-form-panel-implementation-tp4651164.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: RestartResponseAtInterceptPageException
Whoever put that code there wanted it to take a user back to the LoginPage whenever there is no valid session. It makes sense. Do you want it to behave otherwise? Josh. On Mon, Aug 13, 2012 at 10:53 AM, Madasamy Sankarapandian < madas...@mcruncher.com> wrote: > Our application throw this exception when the session is invalidated. > > throw new RestartResponseAtInterceptPageException(LoginPage.class); > > it is working fine on wicket 1.4.x but it is not working on wicket 1.5.7. >
RestartResponseAtInterceptPageException
Our application throw this exception when the session is invalidated. throw new RestartResponseAtInterceptPageException(LoginPage.class); it is working fine on wicket 1.4.x but it is not working on wicket 1.5.7.