Issue with french accent
Hi, I have created a xxx_fr.properties file to translate labels from English to French. During the display, the french accents are removed the html page. I have tried to use in the properties file the following syntax : table.repertory = Répertoire but that does not help too Regards, Charles M. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Issue-with-french-accent-tp3744402p3744402.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: onClick on Image
Thx for the remark. That works now. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744332.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: onClick on Image
Here is the code which was missing from my topic post --> " # " Regards, Charles Иванов Дмитрий wrote: > > And what is your markup? > > 15 Август 2011 г. 16:28:00, Charles Moulliard писал: >> >> Hi, >> >> I would like to change the Locale setting when we click on a Image (flag >> corresponding to the Locale - France, UK, ...). >> >> So in my HTML page, I have defined the following HTML >> >> # >> >> and in the corresponding Wicket Class, the following code : >> >> Link link = new Link("goFrench") { >> @Override >> public void onClick() { >> getSession().setLocale(Locale.FRANCE); >> } >> }; >> >> >> add(link).add(new Image("frenchFlag", new >> ResourceReference(BasePage.class, "images/karaf-logo.png"))); >> >> But when I open the page in my browser, I get this error : >> >> WicketMessage: Unable to find component with id 'frenchFlag' in >> [MarkupContainer [Component id = goFrench]]. This means that you declared >> wicket:id=frenchFlag in your markup, but that you either did not add the >> component to your page at all, or that the hierarchy does not match. >> >> Any help is welcome. >> >> Regards, >> >> Charles M. - Apache Committer >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.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 > Иванов Дмитрий wrote: > > And what is your markup? > > 15 Август 2011 г. 16:28:00, Charles Moulliard писал: >> >> Hi, >> >> I would like to change the Locale setting when we click on a Image (flag >> corresponding to the Locale - France, UK, ...). >> >> So in my HTML page, I have defined the following HTML >> >> # >> >> and in the corresponding Wicket Class, the following code : >> >> Link link = new Link("goFrench") { >> @Override >> public void onClick() { >> getSession().setLocale(Locale.FRANCE); >> } >> }; >> >> >> add(link).add(new Image("frenchFlag", new >> ResourceReference(BasePage.class, "images/karaf-logo.png"))); >> >> But when I open the page in my browser, I get this error : >> >> WicketMessage: Unable to find component with id 'frenchFlag' in >> [MarkupContainer [Component id = goFrench]]. This means that you declared >> wicket:id=frenchFlag in your markup, but that you either did not add the >> component to your page at all, or that the hierarchy does not match. >> >> Any help is welcome. >> >> Regards, >> >> Charles M. - Apache Committer >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.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 > Иванов Дмитрий wrote: > > And what is your markup? > > 15 Август 2011 г. 16:28:00, Charles Moulliard писал: >> >> Hi, >> >> I would like to change the Locale setting when we click on a Image (flag >> corresponding to the Locale - France, UK, ...). >> >> So in my HTML page, I have defined the following HTML >> >> # >> >> and in the corresponding Wicket Class, the following code : >> >> Link link = new Link("goFrench") { >> @Override >> public void onClick() { >> getSession().setLocale(Locale.FRANCE); >> } >> }; >> >> >> add(link).add(new Image("frenchFlag", new >> ResourceReference(BasePage.class, "images
onClick on Image
Hi, I would like to change the Locale setting when we click on a Image (flag corresponding to the Locale - France, UK, ...). So in my HTML page, I have defined the following HTML # and in the corresponding Wicket Class, the following code : Link link = new Link("goFrench") { @Override public void onClick() { getSession().setLocale(Locale.FRANCE); } }; add(link).add(new Image("frenchFlag", new ResourceReference(BasePage.class, "images/karaf-logo.png"))); But when I open the page in my browser, I get this error : WicketMessage: Unable to find component with id 'frenchFlag' in [MarkupContainer [Component id = goFrench]]. This means that you declared wicket:id=frenchFlag in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match. Any help is welcome. Regards, Charles M. - Apache Committer -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onClick-on-Image-tp3744299p3744299.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 can we display by example the format to be used to input Date in DateTextField ?
I use a DateTextField to check if a user encode date according to the Date pattern format defined. DateTextField textfieldFromDate = new DateTextField("fromDate", "MMdd" ); Question 1 : Is it possible in the message displayed by Wicket after the validation in the feedbackPanel to show the correct format to be used ? Question 2 . Can we define the format to be used (in the case of a date) as setLenient() to verify if the date encoded is correct unlike as the following date "20090230" ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Best way to work with the iterator of IDataProvider
Hi, I would like to know what is the best way to work with the method iterator of DataProvider. I have created a class implementing IDataProvider. Depending of a parameter, the DAO service called is not the same inside in the iterator method. For some DAO services, a list is returned but for one service, an object is returned instead of a list. If I try to create a ArrayList inside the iterator, the following error is generated : org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: java.util.AbstractList$Itr Field hierarchy is: 0 [class=com.xpectis.x3s.fundbox.web.RequestPage, path=0] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] java.lang.Object org.apache.wicket.Component.data[3] [class=com.xpectis.x3s.fundbox.web.RequestPage$1, path=0:requestList] private final org.apache.wicket.markup.repeater.data.IDataProvider org.apache.wicket.markup.repeater.data.DataViewBase.dataProvider [class=com.xpectis.x3s.fundbox.web.data.RequestProvider] private java.util.Iterator com.xpectis.x3s.fundbox.web.data.RequestProvider.it [class=java.util.AbstractList$Itr] <- field that is not serializable at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346) How can I avoid this issue ? Here is my code : public class RequestProvider implements IDataProvider { ... public Iterator iterator(int first, int count) { result = new ArrayList(); if (requestFormModel != null) { if (requestFormModel.getId() != null) { request = requestService.getRequest(requestFormModel.getId()); result.add(request); it = result.iterator(); } else if (requestFormModel.getFileName() != null) { it = requestService.findRequestByFileName(requestFormModel.getFileName()).iterator(); } Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Display or not an image dynamically
How can I dynamically display or not an image (= a link) in a html table page using wicket ? It means that depending on a condition, the button link will be displayed or not at all. Is it possible to create a buttonLink in Wicket ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Date validation in a form / Javascriupt generation at the client side
I would like to know How I can validate the string date inputted by a user in a textfield of my form ? e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/ So I would like to check that the user has well introduced its date using this format in the html field. Is it possible to this validation inside the Wicket Form ? Does Wicket generates javascript to validate this at the client side like it is possible in JSP (Struts) ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Date validation in a form
I would like to know How I can validate the string date inputted by a user in a textfield of my form ? e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/ So I would like to check that the user has well introduced its date using this format Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Date validation in a form
I would like to know How I can validate the string date inputted by a user in a textfield of my form ? e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/ So I would like to check that the user has well introduced its date using this format Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
this.getForm().getModelObject() returns the model of another form page
I have created a form class which is used by a class extending webpage. When I call the following method in the onSubmit method of the form button I receive the model attached to another form page (= requestFormModel) and not (= requestMessageFormModel). Is there any restrictions/limitations using this method call : this.getForm().getModelObject() Here is the code of my RequestMessageForm() public class RequestMessageForm extends Form { private static final long serialVersionUID = 1L; public RequestMessageForm(String name) { super(name, new CompoundPropertyModel(new RequestMessageFormModel())); // Add textFields add(textfieldRequestMessageId); add(textfieldFromDate); add(textfieldToDate); // Add drop down choice add(dropDownChoiceStatus); add(dropDownChoiceType); // Add buttons add(new Button("bSearchCriteriaRequestMessage") { @Override public void onSubmit() { Log.info("Model received RM : " + this.getForm().getModelObject()); // Here I receive the model requestFormModel and not requestMessageFormModel setResponsePage(new RequestMessagePage((RequestMessageFormModel) this.getForm().getModelObject())); } }); } Remark : The class RequestMessageFormModel is a simple POJO extending the class CommonFormModel (which is also a POJO). The class RequestFormModel used by the other page extends CommonFormModel ) Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Is it the best way to code a Link depending on a condition
Hi, I would like to know if there is a better way to code this case : What I would like to do is to enable/disable a link depending on a condition. If the condition is true, than we create the link otherwise we disable it. In both case, a label must be defined for the Link. I mean, is it possible to avoid to double the creation of the link = new Link() Here is my code 1) HTML 2) JAVA // Set link for requestId Link link; if (audit.getRequest() != null) { final RequestFormModel requestFormModel = new RequestFormModel(); requestFormModel.setRequestId( (int) audit.getRequest().getId() ); link = new Link("linkRequest") { @Override public void onClick() { setResponsePage(new RequestPage(requestFormModel)); } }; link.add(new Label("linkRequestTxt",String.valueOf(audit.getRequest().getId(; item.add(link); } else { link = new Link("linkRequest") { @Override public void onClick() { this.setEnabled(false); } }; Label label = new Label("linkRequestTxt",""); link.add(label); item.add(link); Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DropDownChoice with Java Enum
Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType { NEW ("NEW", "New"), ACCEPTED ("ACCPT", "Accepted"), VALIDATED ("VALID", "Validated"), TRANSFORMED("TRFRM", "Transformed"), TRANSFERRED("TRFRD", "Transferred"), REJECTED("REJEC", "Rejected"), FAILED("FAIL", "Failed"); private final String value; private final String description; ProcessingStatusType( String value, String description ) { this.value = value; this.description = description; } Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
How to hide html sections
Hi, In JSP pages, it is quite simple to change HTML rendering as it is possible to test java properties and depending on the value we can display or hide html code. How is it possible to do this in Wicket ? Is there a wicket tag that we can use for that ? E.g. Depending of the value returned by a property, I would like to display in a table a red button instead of a green Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
@SpringBean and IDataProvider
Hi, I have a strange problem that I can't explain. I don't know if this is a bug or a limitation. When I inject Spring dependency of a service inside a Wicket web page, everything works fine but when I inject this dependency in a separate class (in the following code example, the class RequestProvider is not longer defined as internal class and moved to another package), I have a null pointer exception at the following line : 09:48:07,432 | ERROR | 3811...@qtp1-1 | RequestCycle | org.apache.wicket.RequestCycle 1521 | Error attaching this container for rendering: [Page class = com.xpectis.x3s.fundbox.web.RequestPage, id = 0, version = 0] org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [Page class = com.xpectis.x3s.fundbox.web.RequestPage, id = 0, version = 0] at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1763) at org.apache.wicket.Component.onBeforeRender(Component.java:3863) at org.apache.wicket.Page.onBeforeRender(Page.java:1501) at org.apache.wicket.Component.internalBeforeRender(Component.java:1061) ... Caused by: java.lang.NullPointerException at com.xpectis.x3s.fundbox.web.data.RequestProvider.size(RequestProvider.java:63) at org.apache.wicket.markup.repeater.data.DataViewBase.internalGetItemCount(DataViewBase.java:140) at org.apache.wicket.markup.repeater.AbstractPageableView.getItemCount(AbstractPageableView.java:252) Line 63 corresponds to : size = requestService.findRequest().size(); It seems that the requestService is not longer available when size method is called Code which is working : public class RequestPage extends WebPage { @SpringBean private RequestService requestService; private class RequestProvider implements IDataProvider { private List result = new ArrayList(); private RequestFormModel requestFormModel; private Request request; public RequestProvider() {} public RequestProvider(RequestFormModel requestFormModel) { this.requestFormModel = requestFormModel; } public Iterator iterator(int first, int count) { if (requestFormModel != null) { if (requestFormModel.getRequestId() != null) { request = requestService.getRequest(requestFormModel.getRequestId()); result.add(request); } else if (requestFormModel.getFileName() != null) { result = requestService.findRequestByFileName(requestFormModel.getFileName()); } else { result = requestService.findRequest(first, count); } } else { result = requestService.findRequest(first, count); } return result.iterator(); } public int size() { int size = 0 ; if (requestFormModel != null) { if (requestFormModel.getRequestId() != null) { request = requestService.getRequest(requestFormModel.getRequestId()); result.add(request); size = result.size(); } else if (requestFormModel.getFileName() != null) { size = requestService.findRequestByFileName(requestFormModel.getFileName()).size(); } else { size = requestService.findRequest().size(); } } else { size = requestService.findRequest().size(); } return size; } public IModel model(Object object) { return new Model((Request) object); } Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
Form and PageParameters
Hi, I have created a "RequestPage" html page containing a form (= search criteria) and a list (= Data View where the result set of data retrieved in a DB according to search criteria is displayed). When the user clicks on the "search criteria" button of this page, the request is redirected to the RequestPage where we extract the search criteria values and pass them to the service in charge to retrieve the data. In the java class accompagning this page, I have overrided the onSubmit method of the "submit button" to pass the value of the form fields public RequestPage(final PageParameters parameters) { ... Form form = new Form("searchCriteriaRequest"); // Add fields fRequestId = new TextField("fRequestId", new Model("")); fFileName = new TextField("fFileName", new Model("")); form.add(fRequestId); form.add(fFileName); // Add buttons button = new Button("button") { @Override public void onSubmit() { parameters.add("requestId", fRequestId.getValue()); parameters.add("fileName", fFileName.getValue()); setResponsePage(RequestPage.class, parameters); } }; form.add(button); add(form); In the constructor of this RequestPage, I call a populate method with PageParameters // Populate list with search criteria values populateList(parameters.getKey("requestId"), parameters.getKey("fileName")); Questions : 1) Is it the good way to handle PageParameters and Form in Wicket ? If this is not the case, can someone point me to a good example ? 2) The fields filled in the previous post of my page are not removed when I repost a new request on my page. How can I reset these fields from the request of the new post ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com
java.lang.IllegalArgumentException: bundle context should be set before refreshing the application context
Hi, When I start my Apache Wicket bundle using Apache Service Mix (based on Felix and Spring DM), I receive the following error : Quote: 16:35:58,415 | DEBUG | localShell | jetty | .service.internal.util.JCLLogger 85 | started org.ops4j.pax.web.service.internal.model.ServletMo del-66 16:35:58,415 | INFO | localShell | HttpServiceProxy | ervice.internal.HttpServiceProxy 129 | Registering event listener [org.springframework.web.context.ContextLoaderListe n...@196dc61] 16:35:58,415 | DEBUG | localShell | HttpServiceStarted | vice.internal.HttpServiceStarted 324 | Using context [ContextModel{id=org.ops4j.pax.web.service.internal .model.ContextModel-64,name=reportincident,httpContext=org.ops4j.pax.w eb.extender.war.internal.webapphttpcont...@fe404a, contextParams={webapp.context=reportincident, contextClass=org.springframework.osgi.web.context. support.OsgiBundleXmlWebApplicationContext}}] 16:35:58,415 | INFO | localShell | /reportincident | .service.internal.util.JCLLogger 102 | Initializing Spring root WebApplicationContext 16:35:58,415 | INFO | localShell | ContextLoader | mework.web.context.ContextLoader 189 | Root WebApplicationContext: initialization started 16:35:58,415 | ERROR | localShell | ContextLoader | mework.web.context.ContextLoader 215 | Context initialization failed java.lang.IllegalArgumentException: bundle context should be set before refreshing the application context at org.springframework.util.Assert.notNull(Assert.jav a:112) at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.normalRefresh( AbstractDelegatedExecutionApplicationContext.java: 179) at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext$NoDependencies WaitRefreshExecutor.refresh(AbstractDelegatedExecu tionApplicationContext.java:89) at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.refresh(Abstra ctDelegatedExecutionApplicationContext.java:175) at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 45) Here is the config of my web.xml file : Quote: http://java.sun.com/xml/ns/j2ee"; xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> reportincident.web contextClass org.springframework.osgi.web.context.support .OsgiBundleXmlWebApplicationContext org.springframework.web.context.ContextLoade rListener wicket.reportincident.web org.apache.wicket.protocol.http.WicketFilter applicationClassName org.apache.camel.example.WicketApplication wicket.reportincident.web /* Any idea to solve this problem is welcome ? Regards, Charles __ SOA Architect