Re: Wicket Bootstrap & wicket 7.2
Yes. I use latest version of both in my project. On Mar 10, 2016 12:09 AM, "nino martinez wael" wrote: > I've added an issue here: > > https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/590 > > Cant remenber if theres actually an example for it in the wicket > bootstrap tests, have you tried wicket 7.2 with bootstrap? > > On Thu, Mar 10, 2016 at 12:01 AM, Martin Grigorov > wrote: > > On Mar 9, 2016 11:59 PM, "nino martinez wael" < > nino.martinez.w...@gmail.com> > > wrote: > >> > >> Have anyone used this in conjuction with wicket 7.2.. I had to upgrade > >> to wicket 7.2 because of problems with [WICKET-6002].. > >> > >> But wicket bootstrap throws strange exceptions about missing fields > >> that it did not do in 7.1. > > > > Example would be helpful ! > > > >> > >> > >> -- > >> Best regards / Med venlig hilsen > >> Nino Martinez > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > > > > -- > Best regards / Med venlig hilsen > Nino Martinez > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Wicket Bootstrap & wicket 7.2
I've added an issue here: https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/590 Cant remenber if theres actually an example for it in the wicket bootstrap tests, have you tried wicket 7.2 with bootstrap? On Thu, Mar 10, 2016 at 12:01 AM, Martin Grigorov wrote: > On Mar 9, 2016 11:59 PM, "nino martinez wael" > wrote: >> >> Have anyone used this in conjuction with wicket 7.2.. I had to upgrade >> to wicket 7.2 because of problems with [WICKET-6002].. >> >> But wicket bootstrap throws strange exceptions about missing fields >> that it did not do in 7.1. > > Example would be helpful ! > >> >> >> -- >> Best regards / Med venlig hilsen >> Nino Martinez >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> -- Best regards / Med venlig hilsen Nino Martinez - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Bootstrap & wicket 7.2
On Mar 9, 2016 11:59 PM, "nino martinez wael" wrote: > > Have anyone used this in conjuction with wicket 7.2.. I had to upgrade > to wicket 7.2 because of problems with [WICKET-6002].. > > But wicket bootstrap throws strange exceptions about missing fields > that it did not do in 7.1. Example would be helpful ! > > > -- > Best regards / Med venlig hilsen > Nino Martinez > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org >
Wicket Bootstrap & wicket 7.2
Have anyone used this in conjuction with wicket 7.2.. I had to upgrade to wicket 7.2 because of problems with [WICKET-6002].. But wicket bootstrap throws strange exceptions about missing fields that it did not do in 7.1. -- Best regards / Med venlig hilsen Nino Martinez - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is there any pointers to change the markup header of a column or propertyColumn ?
Hi, I think the question was how to modify the *header* of the column and not the cell’s content. Therefore you only need to do the following: @Override Component getHeader(String componentId) { return new MyFancyHeaderPanel(componentId); } … in your PropertyColumn (anonymous) subclass. Cheers, Tom > On 09.03.2016, at 19:09, Francois Meillet wrote: > > If you want to your own html, you need to create an object that extends > PropertyColumn > > Let's say that XXXPropertyColumn extend PropertyColumn > > You need to override the populateItem(Item> item, String > componentId, IModel rowModel) method > > for example > > @Override > public void populateItem(Item> item, String componentId, > IModel rowModel) { > item.add(new YYYPanel(item, componentId, rowModel)); > } > > Then you create the YYYPanel.java and the html file > XXXPropertyColumn$YYYPanel.html with your own design. > > > François > > > > > Le 9 mars 2016 à 18:41, andre seame a écrit : > >> >> Hello, >> >> >> In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn> String> ... >> >> >> I would like to modify the content of the header of this column. >> >> >> Must I do "replace the header component of the header of column" ? But how >> to do that? >> >> >> Must i my own column objects? I imlagine that the header (th) is defined by >> the column. But how to do that? >> >> >> Thanks, >> >> PHL. > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is there any pointers to change the markup header of a column or propertyColumn ?
If you want to your own html, you need to create an object that extends PropertyColumn Let's say that XXXPropertyColumn extend PropertyColumn You need to override the populateItem(Item> item, String componentId, IModel rowModel) method for example @Override public void populateItem(Item> item, String componentId, IModel rowModel) { item.add(new YYYPanel(item, componentId, rowModel)); } Then you create the YYYPanel.java and the html file XXXPropertyColumn$YYYPanel.html with your own design. François Le 9 mars 2016 à 18:41, andre seame a écrit : > > Hello, > > > In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn String> ... > > > I would like to modify the content of the header of this column. > > > Must I do "replace the header component of the header of column" ? But how to > do that? > > > Must i my own column objects? I imlagine that the header (th) is defined by > the column. But how to do that? > > > Thanks, > > PHL.
Is there any pointers to change the markup header of a column or propertyColumn ?
Hello, In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn ... I would like to modify the content of the header of this column. Must I do "replace the header component of the header of column" ? But how to do that? Must i my own column objects? I imlagine that the header (th) is defined by the column. But how to do that? Thanks, PHL.
RE: Bug in example ? repeater.DataTableFilterToolbarPage
You have right, the "size" was broken. Thanks PHL. De : Martin Grigorov Envoyé : vendredi 4 mars 2016 07:26 À : users@wicket.apache.org Objet : Re: Bug in example ? repeater.DataTableFilterToolbarPage Hi, On Fri, Mar 4, 2016 at 1:44 AM, andre seame wrote: > Hello, > > > I try to understand the DataTableFilterToolbarPage. In Versin 6.21 and > 6.22. I have 2 problems : > > * If I use the date filter to get 2 anwsers, I got exception. > * If I suppress the exception (see the following paragraph), the > "Pager" is not updated. So I have the 2 answer on the first page, but the > "pager" says : Value from 1 to 8 / 50 and of course there are 7 links. Of > course, goto page 2 will throw an exception. > > > How to suppress the exception ? > > public Iterator iterator(long first, long count) > { > List contactsFound = getContactsDB().getIndex(getSort()); > > return filterContacts(contactsFound). > subList((int)first, (int)(first + count)). > iterator(); > } > > > If the sublist is < 8, then there is an exception on the first page. In > fact the first page is not send because there is an exception. > > > So, I replace the size of the sublist by; > > x = filterContacts(contactsFound) ; > > return x.subList((int)first, Math.min((int)(first + > count),x.size()).iterator(); > > > if size of filterContacts(contactsFound) is 4, it is not possible to > return a sublist form 1 to 8. > > > Questions > > = > > * Why does the on line example working ? > When there just 2 results the value of 'count' parameter is 2. > * Is my correction good or do I miss something ? > Usually it is a safe bet. So keep it! > * How to update the "pager" information, that is how to replace the > initial list of 50 items, by a list of 2 items (or 0 items). > It seems your impl of org.apache.wicket.markup.repeater.data.IDataProvider#size() is broken. Set a breakpoint at org.apache.wicket.examples.repeater.SortableContactDataProvider#filterContacts() and see how it works, i.e. what are the values and what are the callers. > > Thanks, > > PHL; > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Exception Handling (ajax)
Yes, indeed. Sven On 09.03.2016 15:43, Lars Törner wrote: Hi Sven and thanks for your answer! Ok I see! That's a better solution. I guess it means that I don't have to set: getExceptionSettings().setAjaxErrorHandlingStrategy( AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); Because we'll never get to the DefaultExceptionMapper (in the case of an expected unexpected exception). Cheers Lars 2016-03-09 10:56 GMT+01:00 Sven Meier : Hi Lars, if this is a good or bad way to handle exceptions during ajax requests I'd keep your IRequestCycleListener and just return new ErrorCodeRequestHandler(500, message) from there. No need to fiddle with IExceptionMapper and/or DefaultExceptionMapper. Have fun Sven On 09.03.2016 09:33, Lars Törner wrote: About exception handling I would like a fallback for unexcpected exceptions that are thrown during ajax-calls. I don't want to redirect to a new page so in my application#init I do: getExceptionSettings().setAjaxErrorHandlingStrategy(AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); For the moment I have a request cycle listener for exceptions (added also in application#init). Which implements #onException but for now does nothing if an ajax-request is running: !((WebRequest) requestCycle.getRequest()).isAjax()) -> return null AjaxErrorStrategy.INVOKE_FAILURE_HANDLER leads to org.apache.wicket.DefaultExceptionMapper.internalMap(Exception) returns ErrorCodeRequestHandler(500) What I would like is to register a global failure handler that via java script shows a nice toaster with a user friendly message: Wicket.Event.subscribe('/ajax/call/failure', function (jqEvent, attributes, jqXHR, errorThrown, textStatus) { //TODO Show a fancy toaster with a nice localized user error message }); ErrorCodeRequestHandler above has also a constructor that takes a message: ErrorCodeRequestHandler(final int errorCode, final String message) I guess this can be used to get the nice message to the browser? So when I write this an do some more thinking my conclusion is that I must implement my own IExceptionMapper (extending DefaultExceptionMapper?). I will then create my new ExceptionMapper in MyApplication#init and override Application#getExceptionMapperProvider() to return it. In my exception mapper I can check all types of unexpected exeptions my application might throw and get the corresponding user message to supply it to ErrorCodeRequestHandler(final int errorCode, final String message) and then let failure handler show it in the toaster. Ok, so now I guess it would be easier to just test this, but the mail is written so I hope I don´t waste to much of your time by asking if this is a good or bad way to handle exceptions during ajax requests. Cheers Lasse - 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: Exception Handling (ajax)
Hi Sven and thanks for your answer! Ok I see! That's a better solution. I guess it means that I don't have to set: getExceptionSettings().setAjaxErrorHandlingStrategy( AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); Because we'll never get to the DefaultExceptionMapper (in the case of an expected unexpected exception). Cheers Lars 2016-03-09 10:56 GMT+01:00 Sven Meier : > Hi Lars, > > > if this is a good or bad way to handle exceptions during ajax requests > > I'd keep your IRequestCycleListener and just return new > ErrorCodeRequestHandler(500, message) from there. > No need to fiddle with IExceptionMapper and/or DefaultExceptionMapper. > > Have fun > Sven > > > > > On 09.03.2016 09:33, Lars Törner wrote: > >> About exception handling >> >> I would like a fallback for unexcpected exceptions that are thrown during >> ajax-calls. >> >> I don't want to redirect to a new page so in my application#init I do: >> >> >> getExceptionSettings().setAjaxErrorHandlingStrategy(AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); >> >> For the moment I have a request cycle listener for exceptions (added also >> in application#init). Which implements #onException but for now does >> nothing if an ajax-request is running: >> !((WebRequest) requestCycle.getRequest()).isAjax()) -> return null >> >> AjaxErrorStrategy.INVOKE_FAILURE_HANDLER leads to >> org.apache.wicket.DefaultExceptionMapper.internalMap(Exception) returns >> ErrorCodeRequestHandler(500) >> >> What I would like is to register a global failure handler that via java >> script shows a nice toaster with a user friendly message: >> >> Wicket.Event.subscribe('/ajax/call/failure', >> function (jqEvent, attributes, jqXHR, errorThrown, textStatus) >> { >>//TODO Show a fancy toaster with a nice localized user error message >> }); >> >> ErrorCodeRequestHandler above has also a constructor that takes a message: >> ErrorCodeRequestHandler(final int errorCode, final String message) >> >> I guess this can be used to get the nice message to the browser? >> >> So when I write this an do some more thinking my conclusion is that I must >> implement my own IExceptionMapper (extending DefaultExceptionMapper?). >> >> I will then create my new ExceptionMapper in MyApplication#init and >> override Application#getExceptionMapperProvider() to return it. In my >> exception mapper I can check all types of unexpected exeptions my >> application might throw and get the corresponding user message to supply >> it >> to ErrorCodeRequestHandler(final int errorCode, final String message) and >> then let failure handler show it in the toaster. >> >> Ok, so now I guess it would be easier to just test this, but the mail is >> written so I hope I don´t waste to much of your time by asking if this is >> a >> good or bad way to handle exceptions during ajax requests. >> >> Cheers >> Lasse >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Exception Handling (ajax)
Hi Lars, > if this is a good or bad way to handle exceptions during ajax requests I'd keep your IRequestCycleListener and just return new ErrorCodeRequestHandler(500, message) from there. No need to fiddle with IExceptionMapper and/or DefaultExceptionMapper. Have fun Sven On 09.03.2016 09:33, Lars Törner wrote: About exception handling I would like a fallback for unexcpected exceptions that are thrown during ajax-calls. I don't want to redirect to a new page so in my application#init I do: getExceptionSettings().setAjaxErrorHandlingStrategy(AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); For the moment I have a request cycle listener for exceptions (added also in application#init). Which implements #onException but for now does nothing if an ajax-request is running: !((WebRequest) requestCycle.getRequest()).isAjax()) -> return null AjaxErrorStrategy.INVOKE_FAILURE_HANDLER leads to org.apache.wicket.DefaultExceptionMapper.internalMap(Exception) returns ErrorCodeRequestHandler(500) What I would like is to register a global failure handler that via java script shows a nice toaster with a user friendly message: Wicket.Event.subscribe('/ajax/call/failure', function (jqEvent, attributes, jqXHR, errorThrown, textStatus) { //TODO Show a fancy toaster with a nice localized user error message }); ErrorCodeRequestHandler above has also a constructor that takes a message: ErrorCodeRequestHandler(final int errorCode, final String message) I guess this can be used to get the nice message to the browser? So when I write this an do some more thinking my conclusion is that I must implement my own IExceptionMapper (extending DefaultExceptionMapper?). I will then create my new ExceptionMapper in MyApplication#init and override Application#getExceptionMapperProvider() to return it. In my exception mapper I can check all types of unexpected exeptions my application might throw and get the corresponding user message to supply it to ErrorCodeRequestHandler(final int errorCode, final String message) and then let failure handler show it in the toaster. Ok, so now I guess it would be easier to just test this, but the mail is written so I hope I don´t waste to much of your time by asking if this is a good or bad way to handle exceptions during ajax requests. Cheers Lasse - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax Editable Label -> Request Entity Too Large
Thanks Matrin for your quick reply. Changing to POST seems to work fine, thanks! On Tue, Mar 8, 2016 at 1:20 PM, Martin Grigorov wrote: > Hi, > > You can use #updateAjaxAttributes() ( > > https://github.com/apache/wicket/blob/fa83afe98a91d384737e0cc05395348242cdd8e8/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java#L189 > ) > to set POST as a request method. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Tue, Mar 8, 2016 at 12:52 PM, Rob Audenaerde > wrote: > > > Hi all, > > > > I'm testing my application on unexpected user-input, and I am now facing > > this error: > > > > "Wicket.Ajax: Wicket.Ajax.Call.failure: Error while parsing response: > > Request Entity Too Large" > > > > I triggered this by pasting 10 paragaphs of "Lorem Ipsum" into an > > AjaxEditableLabel. Is this expected behavior? > > > > What would be a good work-around/method of limiting this length? > > > > Thx! > > -Rob > > >
Exception Handling (ajax)
About exception handling I would like a fallback for unexcpected exceptions that are thrown during ajax-calls. I don't want to redirect to a new page so in my application#init I do: getExceptionSettings().setAjaxErrorHandlingStrategy(AjaxErrorStrategy.INVOKE_FAILURE_HANDLER); For the moment I have a request cycle listener for exceptions (added also in application#init). Which implements #onException but for now does nothing if an ajax-request is running: !((WebRequest) requestCycle.getRequest()).isAjax()) -> return null AjaxErrorStrategy.INVOKE_FAILURE_HANDLER leads to org.apache.wicket.DefaultExceptionMapper.internalMap(Exception) returns ErrorCodeRequestHandler(500) What I would like is to register a global failure handler that via java script shows a nice toaster with a user friendly message: Wicket.Event.subscribe('/ajax/call/failure', function (jqEvent, attributes, jqXHR, errorThrown, textStatus) { //TODO Show a fancy toaster with a nice localized user error message }); ErrorCodeRequestHandler above has also a constructor that takes a message: ErrorCodeRequestHandler(final int errorCode, final String message) I guess this can be used to get the nice message to the browser? So when I write this an do some more thinking my conclusion is that I must implement my own IExceptionMapper (extending DefaultExceptionMapper?). I will then create my new ExceptionMapper in MyApplication#init and override Application#getExceptionMapperProvider() to return it. In my exception mapper I can check all types of unexpected exeptions my application might throw and get the corresponding user message to supply it to ErrorCodeRequestHandler(final int errorCode, final String message) and then let failure handler show it in the toaster. Ok, so now I guess it would be easier to just test this, but the mail is written so I hope I don´t waste to much of your time by asking if this is a good or bad way to handle exceptions during ajax requests. Cheers Lasse