Re: Adding css resource available to all component in the application using wicket 9.x

2021-09-07 Thread Francois Meillet
Hi Arunachalam,

Migration From Wicket 7 to 8
setHeaderResponseDecorator(new 
JavaScriptToBodyCustomResponseDecorator("footer"));

Wicket 8
setHeaderResponseDecorator(response -> {
return new ResourceAggregator(new 
JavaScriptFilteredIntoFooterHeaderResponse(response, "footer"));
});

Wicket 9
getHeaderResponseDecorators().add(response -> new CustomResponse(response));

For more details, please see
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=84804436#MigrationtoWicket8.0-WICKET-6498
and
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+9.0#MigrationtoWicket9.0-DeprecateAppliation#setHeaderResponseDecorator()ASFJIRAkey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution5aa69414-a9e9-3523-82ec-879b028fb15bWICKET-6729

François


> Le 8 sept. 2021 à 05:47, Arunachalam Sibisakkaravarthi 
>  a écrit :
> 
> Hi guys,
> I am doing Wicket migration from 7.x to 9.x
> In Wicket7.x I add css resource as below, it was working
> 
> getHeaderResponseDecorators().add(getHeaderResponseDecorator());
> 
> private IHeaderResponseDecorator getHeaderResponseDecorator()
> {
>return response -> {
>response.render(CssHeaderItem.forReference(css1));
> 
>response.render(CssHeaderItem.forReference(css2));
> 
> return new JavaScriptFilteredIntoFooterHeaderResponse(response, "scripts");
> };
> 
> whereas the above one doesn't work in Wicket9.x
> Is there any alternative to css and js in init() method of WebApplication?
> so that css/js will be available to all components.
> 
> 
> 
> *Thanks And RegardsSibi.ArunachalammCruncher*


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



examples9x certificate is expired

2021-08-24 Thread Francois Meillet
Hi, certificate of http://examples9x.wicket.apache.org is expired

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Job opening, Wicket developer, full time remote position

2021-07-27 Thread Francois Meillet
Hi Martin,

Do you want I tweet about your job on Apache Wicket Twitter account 
@apache_wicket ?

If so please give me the link where users can see the job description.
 
Best regards

François



> Le 27 juil. 2021 à 11:44, Martin Terra  a 
> écrit :
> 
> Hi!
> 
> We are looking for a talented Wicket & UI developer for a full time remote
> position.
> 
> You would be working with us on an online work time tracking saas product.
> 
> Heavy focus on real world usability and canonical implementation logic.
> 
> It is an inhouse developed product, not a consulting gig.
> 
> If you are available, please contact me directly.
> 
> 
> Yours sincerely,
> Martin Terra
> martin.te...@koodaripalvelut.com


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: RestartResponseException ajaxbutton

2021-07-21 Thread Francois Meillet
yes page id = null

Thanks Sven,

François



> Le 21 juil. 2021 à 16:32, Sven Meier  a écrit :
> 
> page id



RestartResponseException ajaxbutton

2021-07-20 Thread Francois Meillet
I have two pages (identical) called PageOne and PageTwo, each with a form, 
mounted with an UnVersionedUrlMapper.

When I do a RestartResponseException in the submit (via an AjaxButton) to the 
same page (from pageOne to pageOne),
the PageOne's constructor is called twice. (onInitialize is called once)

But If I throw RestartResponseException (via an AjaxButton) from pageOne to 
pageTwo the PageTwo's constructor is called once or if I throw 
RestartResponseException (via a standard Button) from pageOne to pageOne the 
pageOne's constructor is called once.


Tested with all the 9.x


Here is the test the UnVersionedUrlMapper # mapHandler
if (requestHandler instanceof ListenerRequestHandler || requestHandler 
instanceof BookmarkableListenerRequestHandler) {
return null;
}
else {
return super.mapHandler(requestHandler);
}


Did I miss something or am I misusing RestartResponseException ?
Are the tests in the UnVersionedUrlMapper wrong ?

Thanks for your help.


<>




François



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Re: resources in wicket have problem.

2021-06-08 Thread Francois Meillet
Could you disable JavaScript in your browser and test your page ?
Or in your MetronicAssets, comment all JavaScriptReferenceHeaderItems.

PS: create a quickstart with this tool 
https://wicket.apache.org/start/quickstart.html 


François



> Le 8 juin 2021 à 11:29, vahid ghasemi  a écrit :
> 
> I'll do that but I'm not sure about working.
> i think if you clone the project and test it you can easily know about the
> problem.
> my problem is not just images and also in this status all of my js and css
> working.
> my links don't work and this problem is inconsequential to resources.
> pls clone and just run the project and you can see what is the problem.
> 
> ‫‪Bergmann Manfred‬‏ <‪m...@software-by-mabe.com‬‏> در تاریخ سه‌شنبه ۸ ژوئن
> ۲۰۲۱ ساعت ۱۳:۰۸ نوشت:‬
> 
>> Hi.
>> 
>> Just had a quick look.
>> I find it quite difficult to see through. Too many involved classes.
>> 
>> All the assets you have in your ’java’ source root should actually be in
>> ‚resources‘, that’s what this is for.
>> Some build tools (I believe also IntelliJ by default) don’t even copy
>> resources from the source folders to build output folders without
>> explicitly saying so.
>> 
>> 
>> Manfred
>> 
>> 
>>> Am 08.06.2021 um 10:15 schrieb vahid ghasemi >> :
>>> 
>>> test & ui packages are main packages and others are not important.
>>> ir.iais.test.MyApplication is starting.
>>> an my two pages is:
>>> ir.iais.test.panelTest.LabelPage.java
>>> ir.iais.test.panelTest.PabelPage.java
>>> These Panels are extended from BasicPage which is extended from
>> ir.iais.ui.BasePage.
>>> BasePage.html has () that is implemented in LabelPage and
>> PabelPage and my images are in BasePage.html(you can find with searching
>> "profilePhotoHeader" and "profilePhotoPopUp")
>>> The home page is one of (LabelPage,PabelPage) and my clickable Panel is
>> MetronicLinkPanel and I determine the destination Page in that constructor.
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 



Error 502 for examples8x

2020-12-23 Thread Francois Meillet
There is a 502 for https://examples8x.wicket.apache.org/index.html 



François





Re: Wicket Migration: Where has AjaxPostprocessingCallDecorator gone

2020-09-14 Thread Francois Meillet
Look at 
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-o.a.w.ajax.IAjaxCallDecoratorisreplacedwitho.a.w.ajax.attributes.IAjaxCallListener.

François



> Le 14 sept. 2020 à 10:15, Stefan Lindner  a écrit 
> :
> 
> Or in general: where is IAjaxCallDecorator now in Wicket 9?
> 
> I'm migrating an old Wicket 1.4 project to version 9.
> 
> IAjaxCallDecorator dissapeared between Wicket 5 and 6 but I can't find any 
> hint in the migation documentsa and it was not deprecated in 1.5.
> 
> Mit freundlichen Grüßen
> ---
> Stefan Lindner, Visionet Hard- und Software GmbH, Karolinenstraße 52b, 90763 
> Fürth
> Durchwahl: Tel.: 0911/148894-10, FAX: 0911-148894-11, E-Mail: 
> stefan.lind...@visionet.de
> Zentrale: Tel.: 0911/148894-0, FAX: 0911-148894-99, Internet: 
> http://www.visionet.de
> Registergericht Fürth: HRB 6573, Geschäftsführer: Stefan Lindner
> 
> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Locatable UnsupportedOperationException

2020-05-30 Thread Francois Meillet
Hope that help

During the process of throwing an exception, the Java Virtual Machine abruptly 
completes, one by one, any expressions, statements, method and constructor 
invocations, initializers, and field initialization expressions that have begun 
but not completed execution in the current thread. This process continues until 
a handler is found that indicates that it handles that particular exception by 
naming the class of the exception or a superclass of the class of the exception 
(§11.2 
<https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2>). If 
no such handler is found, then the exception may be handled by one of a 
hierarchy of uncaught exception handlers (§11.3 
<https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3>) - 
thus every effort is made to avoid letting an exception go unhandled. 
 
https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html 
<https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>


François



> Le 30 mai 2020 à 16:52, smallufo  a écrit :
> 
> Francois Meillet  於 2020年5月30日 週六 下午10:48寫道:
> 
>> sompage?67-1.-border-content-border_body-form is the path to your model
>> 
> 
> Yes , but it may contains deep-nested model
> 
> The form contains FormComponentPanel and contains another
> FormComponentPanels and widgets , very deep ...
> The error may lay under very deep model , which is very hard to debug.
> And the error message should be able to pinpoint which model causes the
> problem



Re: Locatable UnsupportedOperationException

2020-05-30 Thread Francois Meillet
b.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
> 
>at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 
>at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 
>at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
> 
>at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
> 
>at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
> 
>at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
> 
>at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
> 
>at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
> 
>at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
> 
>at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
> 
>at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
> 
>at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
> 
>at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
> 
>at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1506)
> 
>at
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
> 
>at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 
>at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 
>at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> 
>at java.base/java.lang.Thread.run(Thread.java:834)
> 
> Francois Meillet  <mailto:francois.meil...@gmail.com>> 於 2020年5月30日 週六 下午10:29寫道:
> 
>> In your stacktrace, look at the line just below
>> org.apache.wicket.model.IModel.setObject(IModel.java:84)
>> You will find the cuprit
>> 
>> Exception in thread "main" java.lang.UnsupportedOperationException:
>> Override this method to support setObject(Object)
>>    at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>at
>> xxx..zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)
>> 
>> François
>> 
>> 
>> 
>>> Le 30 mai 2020 à 16:13, smallufo  a écrit :
>>> 
>>> Yes , I know...
>>> But I hope it will be more informative.
>>> Because in practice , there may be lots of models , nested panels , forms
>>> , even in one page...
>>> Informative error message can make us quickly understand which model
>> needs
>>> to implement setObject.
>>> (just like the un-serializable field error message)
>>> 
>>> Thanks.
>>> 
>>> 
>>> Francois Meillet >> <mailto:francois.meil...@gmail.com> > francois.meil...@gmail.com>> 於 2020年5月30日 週六 下午9:58寫道:
>>> 
>>>> Hi,
>>>> 
>>>> Depending on the model you use, you may need to ovveride the setObject()
>>>> method.
>>>> 
>>>> from the API docs
>>>> 
>>>> default void setObject​(T object)
>>>> 
>>>> Throws:
>>>> UnsupportedOperationException - unless overridden
>>>> 
>>>> 
>>>> 
>>>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>>  
>> <https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)>
>>>> <
>>>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>> <
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>>> 
>>>>> 
>>>> 
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>>> Le 30 mai 2020 à 15:46, smallufo  a écrit :
>>>>> 
>>>>> Hi
>>>>> I am building an app with complicated forms , nested models ...
>>>>> Some times it obsesses me is the UnsupportedOperationException :
>>>>> 
>>>>> java.lang.UnsupportedOperationException: Override this method to
>> support
>>>>> setObject(Object)
>>>>> 
>>>>> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>>>> It doesn't pinpoint me which model , which form , which panel...
>>>>> very hard to debug...
>>>>> For non-serializable exception , it can provide meaning information ,
>>>> even
>>>>> pinpoint which field causes the problem.
>>>>> I hope some day , this UnsupportedOperationException can also be so
>>>>> informative.
>>>>> 
>>>>> Thanks.



Re: Locatable UnsupportedOperationException

2020-05-30 Thread Francois Meillet
In your stacktrace, look at the line just below 
org.apache.wicket.model.IModel.setObject(IModel.java:84)
You will find the cuprit

Exception in thread "main" java.lang.UnsupportedOperationException: Override 
this method to support setObject(Object)
at org.apache.wicket.model.IModel.setObject(IModel.java:84)
at 
xxx..zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)

François



> Le 30 mai 2020 à 16:13, smallufo  a écrit :
> 
> Yes , I know...
> But I hope it will be more informative.
> Because in practice , there may be lots of models , nested panels , forms
> , even in one page...
> Informative error message can make us quickly understand which model needs
> to implement setObject.
> (just like the un-serializable field error message)
> 
> Thanks.
> 
> 
> Francois Meillet  <mailto:francois.meil...@gmail.com>> 於 2020年5月30日 週六 下午9:58寫道:
> 
>> Hi,
>> 
>> Depending on the model you use, you may need to ovveride the setObject()
>> method.
>> 
>> from the API docs
>> 
>> default void setObject​(T object)
>> 
>> Throws:
>> UnsupportedOperationException - unless overridden
>> 
>> 
>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>> <
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>>  
>> <https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)>
>>> 
>> 
>> 
>> François
>> 
>> 
>> 
>>> Le 30 mai 2020 à 15:46, smallufo  a écrit :
>>> 
>>> Hi
>>> I am building an app with complicated forms , nested models ...
>>> Some times it obsesses me is the UnsupportedOperationException :
>>> 
>>> java.lang.UnsupportedOperationException: Override this method to support
>>> setObject(Object)
>>> 
>>> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>> It doesn't pinpoint me which model , which form , which panel...
>>> very hard to debug...
>>> For non-serializable exception , it can provide meaning information ,
>> even
>>> pinpoint which field causes the problem.
>>> I hope some day , this UnsupportedOperationException can also be so
>>> informative.
>>> 
>>> Thanks.



Re: Locatable UnsupportedOperationException

2020-05-30 Thread Francois Meillet
Hi,

Depending on the model you use, you may need to ovveride the setObject() method.

from the API docs

default void setObject​(T object)

Throws:
UnsupportedOperationException - unless overridden


https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
 



François



> Le 30 mai 2020 à 15:46, smallufo  a écrit :
> 
> Hi
> I am building an app with complicated forms , nested models ...
> Some times it obsesses me is the UnsupportedOperationException :
> 
> java.lang.UnsupportedOperationException: Override this method to support
> setObject(Object)
> 
> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> It doesn't pinpoint me which model , which form , which panel...
> very hard to debug...
> For non-serializable exception , it can provide meaning information , even
> pinpoint which field causes the problem.
> I hope some day , this UnsupportedOperationException can also be so
> informative.
> 
> Thanks.



which framework is your favorite ?

2020-05-28 Thread Francois Meillet
Matt Raible (@mraible) made a pool : 

Which framework is your favorite ? (Spring + Thymeleaf, JSF, Wicket , Vaadin)

https://twitter.com/mraible/status/1266039711795081222 




François





reddit : Opinions on using Java for frontend development ?

2020-05-28 Thread Francois Meillet
https://www.reddit.com/r/java/comments/grme3u/opinions_on_using_java_for_frontend_development/
 


François





reddit : Is using a Java framework an outdated approach to web development? If so, why ?

2020-05-28 Thread Francois Meillet
https://www.reddit.com/r/webdev/comments/grmkvx/is_using_a_java_framework_an_outdated_approach_to/
 


François





Re: ClassCastException:JavaURLContext cannot be cast to class org.xx.xxx

2020-02-23 Thread Francois Meillet
There is no formComponents in your form.
So why do you use a form ?

François



> Le 22 févr. 2020 à 02:32, LSomefun  a écrit :
> 
> I have been on this issue for atleast  2 weeks now. Trying to use Wicket with
> EJB. This occurs when I use @EJb for either a stateless  or stateful bean .
> 
> *My code below
> The webpage which has the EJB as a variable*
> 
> public class PartnersZipCode extends PrescientTemplateOriginalPage{
> @EJB(name = "ejb/publishZipCodes")
> transient private  PublishZipCodes partnerInterests;
> @EJB
> transient private  ProspectivePartners marketPlace;
> private String sessionZip="sessionZip";
> private String sessionEmail="sessionEmail";
> private String nameFromSession;
> private String dbKeys="dbKeys";
> private Vector forkeys;
> private Form zipCodeFormOfInterest;
> private Label partnerOne;
> private Label partnerTwo;
> private Label interestedZips;
> private Collection listOfZips;
>public PartnersZipCode() {
>zipCodeFormOfInterest=new Form("zipCodeFormOfInterest");
>partnerOne=new Label("partnerOne");
>partnerTwo=new Label("partnerTwo");
>interestedZips=new Label("interestedZips");
>zipCodeFormOfInterest.add(partnerOne);
>zipCodeFormOfInterest.add(partnerTwo);
>zipCodeFormOfInterest.add(interestedZips);
>add(zipCodeFormOfInterest);
>nameFromSession=(String) getSession().getAttribute(sessionEmail);
> 
>forkeys= (Vector) getSession().getAttribute(dbKeys);
>partnerInterests.publishZip(nameFromSession,listOfZips=(Collection)
> getSession().getAttribute(sessionZip));
> 
> 
>}
> 
> 
> }
> 
> *The EJB Class*
> 
> @ManagedBean
> @JMSConnectionFactoryDefinition(
>name="java:app/jms/ZipCodesConnectionFactory"
> )
> public class PublishZipCodes {
> 
>   Message message;
>   Session session;
>   JMSProducer messageProducer;
>   Collection nextZipCode;
> 
>   //@Resource(lookup = "java:comp/jms/ZipCodesConnectionFactory")
>  // ConnectionFactory connectionFactory;
>   @Resource(lookup = "jms/ZipCodes")
>   Topic topic;
> 
>   @EJB
>   StartUpSingleton bean;
>   @Inject  
>   @JMSConnectionFactory(value ="jms/ZipCodesConnectionFactory")
>   JMSContext connection;
> 
>public PublishZipCodes() {
>}
> 
> 
> 
>   @PostConstruct
>public void publish() {
>   if(connection==null){
> connection=bean.getConnection();
>   } 
> 
>   // messageProducer=connection.createProducer();
>nextZipCode=new ArrayList<>();
>if(nextZipCode.isEmpty()){
> 
>}
> 
>messageProducer=connection.createProducer();
>message= connection.createTextMessage(
> Arrays.deepToString(nextZipCode.toArray()) );
>messageProducer.send(topic,message);
>}
> 
> 
> 
> 
> 
>public void closeConn(){
>connection.close();
>}
> 
>public JMSContext getConnection() {
>return connection;
>}
> 
>public void setConnection(JMSContext connection) {
>this.connection = connection;
>}
> 
> 
> 
> 
>public void publishZip(String toString, Collection arrayList) {
>   nextZipCode=arrayList;
>   if(messageProducer==null){
>messageProducer=connection.createProducer();
>   }
>   HashMap maptoString=new HashMap();
> maptoString.put(toString,nextZipCode.toArray());
>message= connection.createTextMessage((String)
> maptoString.keySet().stream().map(key -> key + "=" +
> maptoString.get(key)).collect(Collectors.joining(", ", "{", "}")));
>messageProducer.send(topic,message);
>}
>}
> 
> 
> 
> 
> *The continuous and frustrating error below*
> 
> java.lang.ClassCastException: class
> com.sun.enterprise.naming.impl.JavaURLContext cannot be cast to class
> org.prescients.prescientdocwicket.PublishZipCodes
> (com.sun.enterprise.naming.impl.JavaURLContext is in unnamed module of
> loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader
> @1ff0c0f8; org.prescients.prescientdocwicket.PublishZipCodes is in unnamed
> module of loader org.glassfish.web.loader.WebappClassLoader @22507381)
> at
> org.prescients.prescientdocwicket.Wicket_Proxy_PublishZipCodes$$FastClassByCGLIB$$2031b0b8.invoke()
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> at
> org.apache.wicket.proxy.LazyInitProxyFactory$AbstractCGLibInterceptor.intercept(LazyInitProxyFactory.java:364)
> at
> org.prescients.prescientdocwicket.Wicket_Proxy_PublishZipCodes$$EnhancerByCGLIB$$4a8b3f18.publishZip()
> at
> org.prescients.prescientdocwicket.PartnersZipCode.(PartnersZipCode.java:56)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constr

Re: ClassCastException:JavaURLContext cannot be cast to class org.xx.xxx

2020-02-23 Thread Francois Meillet
Could you show the PrescientTemplateOriginalPage code ?

François



> Le 22 févr. 2020 à 02:32, LSomefun  a écrit :
> 
> I have been on this issue for atleast  2 weeks now. Trying to use Wicket with
> EJB. This occurs when I use @EJb for either a stateless  or stateful bean .
> 
> *My code below
> The webpage which has the EJB as a variable*
> 
> public class PartnersZipCode extends PrescientTemplateOriginalPage{
> @EJB(name = "ejb/publishZipCodes")
> transient private  PublishZipCodes partnerInterests;
> @EJB
> transient private  ProspectivePartners marketPlace;
> private String sessionZip="sessionZip";
> private String sessionEmail="sessionEmail";
> private String nameFromSession;
> private String dbKeys="dbKeys";
> private Vector forkeys;
> private Form zipCodeFormOfInterest;
> private Label partnerOne;
> private Label partnerTwo;
> private Label interestedZips;
> private Collection listOfZips;
>public PartnersZipCode() {
>zipCodeFormOfInterest=new Form("zipCodeFormOfInterest");
>partnerOne=new Label("partnerOne");
>partnerTwo=new Label("partnerTwo");
>interestedZips=new Label("interestedZips");
>zipCodeFormOfInterest.add(partnerOne);
>zipCodeFormOfInterest.add(partnerTwo);
>zipCodeFormOfInterest.add(interestedZips);
>add(zipCodeFormOfInterest);
>nameFromSession=(String) getSession().getAttribute(sessionEmail);
> 
>forkeys= (Vector) getSession().getAttribute(dbKeys);
>partnerInterests.publishZip(nameFromSession,listOfZips=(Collection)
> getSession().getAttribute(sessionZip));
> 
> 
>}
> 
> 
> }
> 
> *The EJB Class*
> 
> @ManagedBean
> @JMSConnectionFactoryDefinition(
>name="java:app/jms/ZipCodesConnectionFactory"
> )
> public class PublishZipCodes {
> 
>   Message message;
>   Session session;
>   JMSProducer messageProducer;
>   Collection nextZipCode;
> 
>   //@Resource(lookup = "java:comp/jms/ZipCodesConnectionFactory")
>  // ConnectionFactory connectionFactory;
>   @Resource(lookup = "jms/ZipCodes")
>   Topic topic;
> 
>   @EJB
>   StartUpSingleton bean;
>   @Inject  
>   @JMSConnectionFactory(value ="jms/ZipCodesConnectionFactory")
>   JMSContext connection;
> 
>public PublishZipCodes() {
>}
> 
> 
> 
>   @PostConstruct
>public void publish() {
>   if(connection==null){
> connection=bean.getConnection();
>   } 
> 
>   // messageProducer=connection.createProducer();
>nextZipCode=new ArrayList<>();
>if(nextZipCode.isEmpty()){
> 
>}
> 
>messageProducer=connection.createProducer();
>message= connection.createTextMessage(
> Arrays.deepToString(nextZipCode.toArray()) );
>messageProducer.send(topic,message);
>}
> 
> 
> 
> 
> 
>public void closeConn(){
>connection.close();
>}
> 
>public JMSContext getConnection() {
>return connection;
>}
> 
>public void setConnection(JMSContext connection) {
>this.connection = connection;
>}
> 
> 
> 
> 
>public void publishZip(String toString, Collection arrayList) {
>   nextZipCode=arrayList;
>   if(messageProducer==null){
>messageProducer=connection.createProducer();
>   }
>   HashMap maptoString=new HashMap();
> maptoString.put(toString,nextZipCode.toArray());
>message= connection.createTextMessage((String)
> maptoString.keySet().stream().map(key -> key + "=" +
> maptoString.get(key)).collect(Collectors.joining(", ", "{", "}")));
>messageProducer.send(topic,message);
>}
>}
> 
> 
> 
> 
> *The continuous and frustrating error below*
> 
> java.lang.ClassCastException: class
> com.sun.enterprise.naming.impl.JavaURLContext cannot be cast to class
> org.prescients.prescientdocwicket.PublishZipCodes
> (com.sun.enterprise.naming.impl.JavaURLContext is in unnamed module of
> loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader
> @1ff0c0f8; org.prescients.prescientdocwicket.PublishZipCodes is in unnamed
> module of loader org.glassfish.web.loader.WebappClassLoader @22507381)
> at
> org.prescients.prescientdocwicket.Wicket_Proxy_PublishZipCodes$$FastClassByCGLIB$$2031b0b8.invoke()
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> at
> org.apache.wicket.proxy.LazyInitProxyFactory$AbstractCGLibInterceptor.intercept(LazyInitProxyFactory.java:364)
> at
> org.prescients.prescientdocwicket.Wicket_Proxy_PublishZipCodes$$EnhancerByCGLIB$$4a8b3f18.publishZip()
> at
> org.prescients.prescientdocwicket.PartnersZipCode.(PartnersZipCode.java:56)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newIns

Re: WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference

2020-01-17 Thread Francois Meillet
Hi Prasanna,

Could you make a quickstart ?

François



> Le 17 janv. 2020 à 19:29, prasanna bajracharya 
>  a écrit :
> 
> Dear Wicket Community,
> 
> I am a new to wicket. I am trying to run someone else's legacy code in my
> local machine which is currently working in production environment. All my
> MyPanel.java, MyPanel.html and MyPanel.properties are in same package but
> still i'm getting following error in my weblogic console:
> 
> [image: enter image description here] 
> 
> Below is my Project structure for one of the component "sessionId": [image:
> enter image description here] 
> 
> I am using Ant build.xml to create MyApplication.jar and deploy it in my
> local weblogic server. I'm using eclipse as my IDE.
> 
> 
> Best regards,
> 
> Prasanna


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket's error message-> java.lang.IllegalStateException: This container is already dequeing

2019-12-29 Thread francois meillet
you are adding the header and the footer panels in the child page but the html 
tag is in the super class.

François 


> Le 28 déc. 2019 à 22:35, LSomefun  a écrit :
> 
> I do appreciate you looking at this while on holiday. The 2nd constructor of
> PrescientTemplateOriginalPage I have deleted. Truth is it was not needed.
> The HTML code of PrescientHome I initially submitted did not include the
> HeaderPanel and footerPanel, was because of inheritance from
> PrescientTemplateOriginalPage so did not need to include them. 
> The HTML Code from PrescientTemplateOriginalPage is below
> 
>
>Template
>
>
>
> 
>
>  
> 
> 
>
> 
>
> 
> 
> And the HTML code from PrecientHome is below
> 
>
>TODO supply a title
>
>
>
>
> 
>
>
> 
> Doctors : 
> 
>Choose one
>Physician
>Dentist
>Optometrist
>
>. 
> 
>
> 
>
> 
> 
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Wicket's error message-> java.lang.IllegalStateException: This container is already dequeing

2019-12-28 Thread francois meillet
There are few problems I can see (from my mobile, being on hollidays )
First you should not pass component to  PrescientTemplateOriginalPage 
constructor's argument.
Second : in the second constructor you do not add the panels to the page
Third : in the html code the header and footer tags are not presents

Francois

> Le 28 déc. 2019 à 15:19, LSomefun  a écrit :
> 
> Thanks for you reply. Included more codes below.
> 
> Code for PrescientTemplateOriginalPage below
> package org.possible.bug;
> 
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.model.Model;
> 
> /**
> *
> * @author oyeso
> */
> public class PrescientTemplateOriginalPage extends WebPage {
> 
>private final String footerId="footerPanel";
>private final String headerId="headerPanel";
> 
> 
> 
> 
>private FooterPanel footer;
>private HeaderPanel header;
> 
>public PrescientTemplateOriginalPage() {
>   this.header = new HeaderPanel(headerId);
> 
>this.footer = new FooterPanel(footerId);
> 
> add(header);
> add(footer);
>}
> 
> 
> 
> 
> 
>public PrescientTemplateOriginalPage( FooterPanel footer, HeaderPanel
> header) {
> 
>this.footer = footer;
>this.header = header;
> 
>}
> 
> 
> }
> 
> Code for HeaderPanel below
> 
> import org.apache.wicket.Component;
> import org.apache.wicket.MarkupContainer;
> import org.apache.wicket.behavior.Behavior;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.image.Image;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.model.Model;
> 
> public class HeaderPanel extends Panel{
>   private Label header;
>   private Image imgHeader;
>public HeaderPanel(String id) {
>super(id);
>  header=new Label("prescientDoctorsLabel",Model.of("Prescient
> Doctors") );
> 
>add(header);
> 
>}
> 
> 
> 
> 
> 
> 
> }
> 
> Code for FooterPanel Below
> 
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.model.Model;
> 
> public class FooterPanel extends Panel{
> 
>public FooterPanel(String id) {
>super(id);
>add(new Label("footerLabel",Model.of("Footer Label Here")));
>}
> 
> }
> 
> Code for PrecientHome below
> 
> package org.possible.bug;
> 
> import java.io.IOException;
> import java.util.List;
> import java.util.logging.Level;
> import java.util.logging.Logger;
> import org.apache.wicket.markup.html.MarkupUtil;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.form.DropDownChoice;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.markup.html.form.FormComponentUpdatingBehavior;
> import org.apache.wicket.model.Model;
> import org.apache.wicket.model.PropertyModel;
> 
> /**
> *
> * @author oyeso
> */
> 
> 
> public class PrescientHome  extends PrescientTemplateOriginalPage {
> 
>private Model zipManager;
>private Form occForm;
> 
>private WebMarkupContainer tagFrame;
> 
>private Model occupationListModel;
>private List  occupationList;
>private DropDownChoice occupationChoices;
> 
>public PrescientHome() {
> 
>zipManager=Model.of(new ZipManagedBean());
> 
> 
> 
> occupationListModel= new Model<>();
> occupationList=zipManager.getObject().getOccCode();
> occupationChoices=new
> DropDownChoice<>("occupationModel",occupationListModel, occupationList );
> 
>//queue(occForm);
>occForm=new Form("occupationForm"){
>   @Override
>   protected void onSubmit() {
> 
>   //Do the next thing
>   }
> 
>};
>   occForm.add(occupationChoices);
>   add(occForm);
> 
> 
>}
> 
> 
> New Stack Trace below
> java.lang.IllegalStateException: This container is already dequeing: [Page
> class = org.possible.bug.PrescientHome, id = 0, render count = 0]
>at
> org.apache.wicket.MarkupContainer.dequeuePreamble(MarkupContainer.java:1918)
>at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1856)
>at
> org.apache.wicket.MarkupContainer.dequeueChild(MarkupContainer.java:2018)
>at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1983)
>at
> org.apache.wicket.MarkupContainer.dequeuePreamble(MarkupContainer.java:1931)
>at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1856)
>at
> org.apache.wicket.MarkupContainer.onInitialize(MarkupContainer.java:1887)
>at org.apache.wicket.Page.onInitialize(Page.java:298)
>at org.apache.wicket.Component.fireInitialize(Component.java:873)
>at
> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)
>at org.apache.wicket.Page.isPageStateless(Page.java:461)
>at
> org.apache

Re: Wicket's error message-> java.lang.IllegalStateException: This container is already dequeing

2019-12-27 Thread Francois Meillet
Could you show us the new stacktrace and the PrescientTemplateOriginalPage code 
?

François



> Le 27 déc. 2019 à 22:51, LSomefun  a écrit :
> 
> Thanks for your reply Francois, much appreciated. Even when I adjust my code
> and remove the login object from the source code and from the html tag like
> the code below I still get the same error I was encountering. I definitely
> will try version 9 in the near future  as soon as I can solve the current
> problem the framework is showing.
> 
> Java Source below
>> 
>> 
>> 
>> public class PrescientHome extends PrescientTemplateOriginalPage {
>> 
>> private Model zipManager;
>> private Form occForm;
>> 
>> private WebMarkupContainer tagFrame;
>> private Login login;
>> private Model occupationListModel;
>> private List  occupationList;
>> private DropDownChoice occupationChoices;
>> public PrescientHome()
>> 
>> { super(); }
>> @Override
>> protected void onInitialize() {
>> super.onInitialize();
>> zipManager=Model.of(new ZipManagedBean());
>> 
>> 
>> occupationListModel= new Model<>();
>> occupationList=zipManager.getObject().getOccCode();
>> occupationChoices=new
>> DropDownChoice<>("occupationModel",occupationListModel, occupationList );
>> 
>> occForm=new Form("occupationForm"){
>> @Override
>> protected void onSubmit()
>> 
>> { super.onSubmit();  }
>> };
>> occForm.add(occupationChoices);
>> add(occForm);
> 
>> 
>> }
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> }
>> 
>> 
>> HTML Source below
>> 
>> 
>> 
>> 
>> 
>> TODO supply a title
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Doctors :
>> 
>> Choose one
>> Physician
>> Dentist
>> Optometrist
>> 
>> .
>> 
>> 
>> 
>> 
>> 
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Wicket's error message-> java.lang.IllegalStateException: This container is already dequeing

2019-12-27 Thread Francois Meillet
If what you want is redirecting the user to the Login page after the form 
submit,
you need to remove all references to the Login class in the PrescientHome 
class, 
then in the form # onSubmit you can use the code setResponsePage(Login.class).

Have a look at wicket links and wicket forms

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_wicket_links

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_wicket_forms

By the way you should give a try to Wicket 9 !

Hope this help

François



> Le 27 déc. 2019 à 16:05, LSomefun  a écrit :
> 
> I am trying out the Wicket framework using version 8. I have been battling
> this strange error without success. I am using Payara application server on
> Windows 10 The required info is below, any tips or help in finding out where
> the problem is would be appreciated. I looked into stackoverflow, pretty
> much any help sites  for similar questions but did not find any. 
> It seems deque preamble is being called erroneously by wicket.
> 
> Java Source below
> 
> 
> 
> public class PrescientHome extends PrescientTemplateOriginalPage {
> 
> private Model zipManager;
> private Form occForm;
> 
> private WebMarkupContainer tagFrame;
> private Login login;
> private Model occupationListModel;
> private List  occupationList;
> private DropDownChoice occupationChoices;
> public PrescientHome()
> 
> { super(); }
> @Override
> protected void onInitialize() {
> super.onInitialize(); 
> zipManager=Model.of(new ZipManagedBean());
> 
> login=new Login();
> login.setResponsePage(Login.class);
> occupationListModel= new Model<>();
> occupationList=zipManager.getObject().getOccCode();
> occupationChoices=new
> DropDownChoice<>("occupationModel",occupationListModel, occupationList );
> 
> occForm=new Form("occupationForm"){
> @Override
> protected void onSubmit()
> 
> { super.onSubmit();  }
> };
> occForm.add(occupationChoices);
> add(occForm);
> tagFrame=new WebMarkupContainer("TagFrame");
> tagFrame.add(login);
> add(tagFrame);
> 
> }
> 
> 
> 
> 
> 
> 
> 
> }
> 
> 
> HTML Source below
> 
> 
> 
> 
> 
> TODO supply a title
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Doctors : 
> 
> Choose one
> Physician
> Dentist
> Optometrist
> 
> .
> 
> 
> 
> 
> 
> 
> 
> The error displayed below. 
> java.lang.IllegalStateException: This container is already dequeing: [Page
> class = 
> org.prescients.prescientdocwicket.PrescientHome, id = 0, render count = 0]
> at
> org.apache.wicket.MarkupContainer.dequeuePreamble(MarkupContainer.java:1918)
> at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1856)
> at org.apache.wicket.MarkupContainer.dequeueChild(MarkupContainer.java:2018)
> at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1983)
> at
> org.apache.wicket.MarkupContainer.dequeuePreamble(MarkupContainer.java:1931)
> at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1856)
> at org.apache.wicket.MarkupContainer.onInitialize(MarkupContainer.java:1887)
> at org.apache.wicket.Page.onInitialize(Page.java:298)
> atorg.prescients.prescientdocwicket.PrescientTemplateOriginalPage.onInitialize(PrescientTemplateOrigi
>  
> nalPage.java:36)
> at
> org.prescients.prescientdocwicket.PrescientHome.onInitialize(PrescientHome.java:48)
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
WARNING [Catalina-utility-1] 
org.apache.catalina.core.StandardContext.backgroundProcess Exception lors du 
traitement d'arrière plan du gestionnaire de sessions 
[StandardManager[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]]
java.lang.RuntimeException
at 
baz.web.base.app.OfferApplication.sessionUnbound(OfferApplication.java:560)
at 
org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:444)
at 
org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1784)
at 
org.apache.catalina.session.StandardSession.expire(StandardSession.java:856)
at 
org.apache.catalina.session.StandardSession.isValid(StandardSession.java:659)
at 
org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:573)
at 
org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:558)
at 
org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5539)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1353)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1335)
at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at 
java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305)
at 
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

François



> Le 21 nov. 2019 à 17:55, Sven Meier  a écrit :
> 
> Yes, I mean a non-web-request thread, i.e. when the session expires as you've 
> written.
> 
> Sven
> 
> On 21.11.19 17:52, Martin Grigorov wrote:
>> On Thu, Nov 21, 2019 at 6:30 PM Sven Meier  wrote:
>> 
>>> Hi,
>>> 
>>> actually #sessionUnbound() is called *on* the application instance, so
>>> the ExceptionMapper is available.
>>> 
>> oh, right. silly me!
>> 
>> 
>> 
>>> But ExceptionMapper maps an exception to a requestHandler, this doesn't
>>> make sense for an exception happening on a worker thread.
>>> 
>> you meant on *non*-worker thread ?
>> 
>> Francois, please give us the stack trace.
>> 
>> 
>>> Hope this helps
>>> Sven
>>> 
>>> 
>>> On 21.11.19 16:37, Martin Grigorov wrote:
>>>> Hi Francois,
>>>> 
>>>> #sessionUnbound() is called in two contexts:
>>>> 1) the user clicked the Logout button - in this case the call is executed
>>>> in http worker thread where there is a ThreadContext, i.e.
>>>> Application.get(), Session.get() and RequestCycle.get() would work
>>>> here, I think, Wicket should use the ExceptionMapper
>>>> 2) when the user session has timed out - in this case the web container
>>>> (Tomcat/Jetty) will execute this method in non-worker thread and
>>>> Application.get() would be null, so we cannot get a reference to the
>>>> ExceptionMapper
>>>> 
>>>> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <
>>> francois.meil...@gmail.com>
>>>> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> Any RuntimeException thrown in Application # newSession(Request request,
>>>>> Response response) is handled by the DefaultExceptionMapper #
>>>>> mapUnexpectedExceptions(Exception e, final Application application)
>>>>> 
>>>>> but
>>>>> 
>>>>> Any RuntimeException thrown in Application # sessionUnbound(String
>>>>> sessionid) is not handled
>>>>> 
>>>>> Is that normal ?
>>>>> 
>>>>> François
>>>>> 
>>>>&

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
thanks Martin

François



> Le 21 nov. 2019 à 16:37, Martin Grigorov  a écrit :
> 
> Hi Francois,
> 
> #sessionUnbound() is called in two contexts:
> 1) the user clicked the Logout button - in this case the call is executed
> in http worker thread where there is a ThreadContext, i.e.
> Application.get(), Session.get() and RequestCycle.get() would work
> here, I think, Wicket should use the ExceptionMapper
> 2) when the user session has timed out - in this case the web container
> (Tomcat/Jetty) will execute this method in non-worker thread and
> Application.get() would be null, so we cannot get a reference to the
> ExceptionMapper
> 
> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet 
> wrote:
> 
>> Hi,
>> 
>> Any RuntimeException thrown in Application # newSession(Request request,
>> Response response) is handled by the DefaultExceptionMapper #
>> mapUnexpectedExceptions(Exception e, final Application application)
>> 
>> but
>> 
>> Any RuntimeException thrown in Application # sessionUnbound(String
>> sessionid) is not handled
>> 
>> Is that normal ?
>> 
>> François
>> 
>> 
>> 
>> 
>> -
>> 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



Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
Hi,

Any RuntimeException thrown in Application # newSession(Request request, 
Response response) is handled by the DefaultExceptionMapper # 
mapUnexpectedExceptions(Exception e, final Application application)

but

Any RuntimeException thrown in Application # sessionUnbound(String sessionid) 
is not handled

Is that normal ?

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket blog

2019-11-09 Thread Francois Meillet
Hi Roman,

FYI : https://twitter.com/apache_wicket/status/1193233346798723072 


François



> Le 9 nov. 2019 à 18:02, Roman Sery  a écrit :
> 
> Hello,
> I have been working with Wicket for many years now and really love it, and
> I've started a blog focusing on Wicket.
> I'm hoping it could be included in this list of blogs:
> https://wicket.apache.org/learn/blogs.html#get-your-blog-listed
> 
> Thanks!
> My blog is
> https://www.coderdreams.com/



Re: 404 : https://wicket.apache.org/learn/#javadoc JavaDoc 9.x

2019-10-08 Thread Francois Meillet
Thanks Martin

François



> Le 8 oct. 2019 à 05:10, Martin Grigorov  a écrit :
> 
> Fixed!
> 
> On Mon, Oct 7, 2019, 12:11 Martin Grigorov  wrote:
> 
>> Hi Francois,
>> 
>> This is a known issue.
>> 
>> https://markmail.org/message/6owzkxowbsf33jcy
>> https://markmail.org/message/ac65iqbmwjdlugz3
>> 
>> I will try to find a working solution for it this week.
>> 
>> Martin
>> 
>> 
>> On Mon, Oct 7, 2019 at 11:17 AM Francois Meillet <
>> francois.meil...@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>> There is a 404 for
>>> https://ci.apache.org/projects/wicket/apidocs/9.x/index.html <
>>> https://ci.apache.org/projects/wicket/apidocs/9.x/index.html>
>>> 
>>> 
>>> François
>>> 
>>> 
>>> 
>>> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



404 : https://wicket.apache.org/learn/#javadoc JavaDoc 9.x

2019-10-07 Thread Francois Meillet
Hi,

There is a 404 for https://ci.apache.org/projects/wicket/apidocs/9.x/index.html 



François





Re: non-serializable objects to feed a DropDownChoice

2019-08-28 Thread Francois Meillet
Why don't you use a pojo that could be a simplified view of your domain class 
(dto) ?

François



> Le 28 août 2019 à 20:49, René Stolle  a écrit :
> 
> Hello there,
> 
> my domain classes are mostly not serializable. Making use of 
> LoadableDetachableModels I have no problems execpt of one situtation: I 
> couldn't find an easy solution to place a list of domain objects in a 
> DropDownChoice without getting serialization issues. The examples I found 
> ignore this problem and I have only a pretty complicated work around. My 
> domain classes have an id of type long (serializeable), which I use in my 
> solution. This works, but the code confuses me everytime I have to touch it.
> 
> My question now, how is this done the "wicket way" ? Is there an elegant 
> solution out there?
> 
> René
> 
> -
> 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



Instant : Unsupported field: YearOfEra when cookieUtils.cookieToDebugString() is called

2019-06-21 Thread Francois Meillet
https://issues.apache.org/jira/browse/WICKET-6678 



François
François





receiving email from from p.davids@hea.jetzt when posting on users@wicket.apache.org

2019-06-21 Thread Francois Meillet
When I send an email to users@wicket.apache.org 
 I receive this automatic email from 
p.davids@hea.jetzt 

Guten Tag,
die E-Mailadresse des Empfängers hat sich geändert.
Gern leiten wir Ihre E-Mail weiter. 
Bitte ändern Sie für zukünftige Mails die Empfängeradresse von @hea.jetzt in 
@teemer.de.

Freundliche Grüße 
ARZ.dent GmbH


In english with Google Translate : 
the recipient's e-mail address has changed. 
We are happy to forward your e-mail. 
Please change the recipient address of @ hea.now to @ teemer.de for future 
mails.

Wny do I get this ?
Thanks


François





Fast2WicketSerializer StackOverflowError

2019-06-21 Thread Francois Meillet
Hi,

I get a strange StackOverflowError with Fast2WicketSerializer

Env : Wicket version 9.0.0.M2 and previous with Fast2WicketSerializer
quickstart : https://issues.apache.org/jira/browse/WICKET-6679


When Session.get() is called in a non serialized object
and session.getMetaData(MetaDataKey) is in a serialized object
there is a StackOverflowError

Will produce a StackOverflowError
@Override
protected void onInitialize() {
super.onInitialize();

Session session = Session.get();

add(new AjaxLink("link") {

@Override
public void onClick(AjaxRequestTarget target) {

Boolean showgrid = session.getMetaData(KeyGrid);

// 
}
});
}

Will not produce StackOverflowError
@Override
protected void onInitialize() {
super.onInitialize();

add(new AjaxLink("link") {

@Override
public void onClick(AjaxRequestTarget target) {

Boolean showgrid = Session.get().getMetaData(KeyGrid);

// 
}
});
}


Exception in thread "Wicket-AsyncPageStore-PageSavingThread" 
java.lang.StackOverflowError
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectCompatibleRecursive(FSTObjectOutput.java:568)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectCompatible(FSTObjectOutput.java:554)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:450)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
at 
org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
at 
org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
at 
org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:327)
at 
org.nustaq.serialization.serializers.FSTArrayListSerializer.writeObject(FSTArrayListSerializer.java:49)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:476)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
at 
org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
at 
org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:327)
at 
org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:294)
at 
org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:204)
at 
org.wicketstuff.pageserializer.fast2.Fast2WicketSerializer.serialize(Fast2WicketSerializer.java:77)
at 
org.apache.wicket.pageStore.InSessionPageStore$SessionData.writeObject(InSessionPageStore.java:317)



Do I miss something with the MetaData ?

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket 9 migration guide : No such URL

2019-06-20 Thread Francois Meillet
There is no html data for Wicket 9 migration guide

https://s.apache.org/wicket9migration  : 
No such URL


François





Re: Notify Action to the Parent Class

2019-05-26 Thread Francois Meillet
Hi Sibgha,

// here is a simple code

//
// in your Dpanel
//
protected void onUpdate(AjaxRequestTarget target) {
send(getPage(), Broadcast.EXACT, new 
YourEvent(yourDataFromYourDropDownChoice));
}


//
// in your HomePage, you override the onEvent method
//
@Override
public void onEvent(IEvent event) {
super.onEvent(event);

if (event.getPayload() instanceof YourEvent) {

YourEvent yourEvent = (YourEvent) = event.getPayload();
// the data you sent throw your vent
YourData xyz = yourEvent.getData();
// if you don't neeed anymore your event
event.stop();
}
}


// look at the docs
https://ci.apache.org/projects/wicket/guide/8.x/single.html#_wicket_events_infrastructure


François
follow Apache Wicket on twitter : https://twitter.com/apache_wicket 
 !


> Le 26 mai 2019 à 15:33, Sibgha Nazir  a écrit :
> 
> Hi,
> 
> In my application, Home Page creates DPanel and Dpanel has the drop down
> menu.   In the class DPanel at 'onchange' event, I want to do some action
> in the class HomePage.java. How can that be possible?
> 
> 
> *HomePage.java*public HomePage(final PageParameters parameters)
>{
>super(parameters);
> 
>final Panel dropDownPanel = new Dpanel("toReplace");
> 
>dropDownPanel.setOutputMarkupId(true);
>add(dropDownPanel);
>}
> 
> 
> *DPanel.java*public Dpanel(String aId)
>{
>super(aId);
>form = new Form("form");
>form.setOutputMarkupId(true);
> 
>// SelectMenu //
>final DropDownChoice dropdown = new
> DropDownChoice("select", new Model(), new
> ListModel(GENRES));
>dropdown.setRequired(true);
>dropdown.setOutputMarkupId(true);
>dropdown.add(new AjaxFormComponentUpdatingBehavior("change") {
>/**
> *
> */
>private static final long serialVersionUID =
> -6744838136235652577L;
> 
>protected void onUpdate(AjaxRequestTarget target) {
>System.out.println("Changed");
> 
>}
>});
> .
> .
> .
> .
> 
> Quick Start here...
> https://github.com/Sibgha360/dropdownexample.git,



Re: setHeaderResponseDecorator and setGatherExtendedBrowserInfo(true)

2019-04-24 Thread Francois Meillet
In the application.init() add the following line :

getResourceBundles().add(YourApplication.class, new 
JavaScriptResourceReference(BrowserInfoForm.class, "wicket-browser-info.js"));

YourApplication.class is the {@linkplain ResourceReference#getScope() scope} of 
your bundle

François




> Le 24 avr. 2019 à 15:37, Olivier Dutrieux  a 
> écrit :
> 
> Hello,
> 
> I have define on application.init() the setHeaderResponseDecorator (to
> deferred all javascript to the end of the page) and set
> setGatherExtendedBrowserInfo to true to retrieve some informations from
> browser.
> 
> The problem is when the BrowserInfoPage is render no js is add to the page
> because the BrowserInfoPage  doesn't have the component
> HeaderResponseContainer to deferred the js.
> 
> How can I solve this problem ?
> 
> Duto
> 
> -
> Duto
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Model map with enum as a key

2019-02-04 Thread Francois Meillet
you are saving the value and not the key, which is why hibernate complains.

WHy not choose a DropDownBox ?

François



> Le 4 févr. 2019 à 14:03, Zbynek Vavros  a écrit :
> 
> Do you mean to manually iterate through the map and converting the string
> keys
> Wicket binds to enum keys? Even if I try to iterate through the map I get
> the same ClassCastException.
> Somehow Wicket managed to insert String as a key instead of enum.
> 
> Zbynek
> 
> 
> 
> On Mon, Feb 4, 2019 at 1:55 PM Francois Meillet 
> wrote:
> 
>> use MyEnum.valueOf("your string ») before saving the data
>> 
>> François
>> 
>> 
>> 
>>> Le 4 févr. 2019 à 13:51, Zbynek Vavros  a écrit
>> :
>>> 
>>> I got this class that has map with enums as keys:
>>> 
>>> public class MasterClass {
>>> 
>>>   private Map config = Maps.newHashMap();
>>> }
>>> 
>>> enum is classic:
>>> 
>>> public enum MyEnum {
>>>   VALUE1,
>>>   VALUE2
>>> }
>>> 
>>> now I would like to use one entry of this map as a model for TextField:
>>> 
>>> new RequiredTextField<>("componentId", new
>>> PropertyModel<>(modelObject.getConfig(), "VALUE1")))
>>> 
>>> but when saved to DB Hibernate says the key is String and Enum is
>> expected:
>>> java.lang.ClassCastException: java.lang.String cannot be cast to
>>> java.lang.Enum
>>> 
>>> Using ChainingModel or
>>> Model.of(modelObject.getConfig().get(MyEnum.VALUE1))) causes the value
>> not
>>> to be bind at all.
>>> 
>>> I know I can use "side" property and fill this map manually in onSubmit
>>> just before saving to DB but would like to avoid that.
>>> 
>>> Thanks
>> 
>> 
>> -
>> 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: Model map with enum as a key

2019-02-04 Thread Francois Meillet
use MyEnum.valueOf("your string ») before saving the data

François



> Le 4 févr. 2019 à 13:51, Zbynek Vavros  a écrit :
> 
> I got this class that has map with enums as keys:
> 
> public class MasterClass {
> 
>private Map config = Maps.newHashMap();
> }
> 
> enum is classic:
> 
> public enum MyEnum {
>VALUE1,
>VALUE2
> }
> 
> now I would like to use one entry of this map as a model for TextField:
> 
> new RequiredTextField<>("componentId", new
> PropertyModel<>(modelObject.getConfig(), "VALUE1")))
> 
> but when saved to DB Hibernate says the key is String and Enum is expected:
> java.lang.ClassCastException: java.lang.String cannot be cast to
> java.lang.Enum
> 
> Using ChainingModel or
> Model.of(modelObject.getConfig().get(MyEnum.VALUE1))) causes the value not
> to be bind at all.
> 
> I know I can use "side" property and fill this map manually in onSubmit
> just before saving to DB but would like to avoid that.
> 
> Thanks


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: An open source git server written with Wicket

2019-01-07 Thread Francois Meillet
https://twitter.c
https://twitter.com/apache_wicket/status/1052796668012310528 


om/apache_wicket/status/1052796668012310528z
18 Oct 2018



François



> Le 7 janv. 2019 à 13:29, Andrea Del Bene  a écrit :
> 
> Very nice and interesting! Congrats to all develop team! I will explore
> your project deeper as soon as possible.
> 
> On Mon, Jan 7, 2019, 12:25 AM Robin Shen  
>> Dear wicket user,
>> 
>> 
>> I'd like to introduce an open source project - OneDev. It is a self-hosted
>> git server with unique features. The technology stack used is Wicket +
>> JQuery. Welcome any contributions.
>> 
>> 
>> Learn more at https://onedev.io
>> 
>> 
>> Regards
>> 
>> Robin
>> 



Re: Using the summernote rich text editor with Wicket

2018-12-03 Thread Francois Meillet
Hi Dylan,

Have a look at 
https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/wicket-7.x/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/SummernotePage.java
 

and 
https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/wicket-7.x/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/SummernotePage.html
 


François



> Le 3 déc. 2018 à 16:43, dylanbozeman  a écrit :
> 
> I am fairly new to Wicket and attempting to integrate summernote from
> bootstrap seen here:
> 
> http://coding.teliclab.info/wicket-7.x/summernote
> 
> I can't find anywhere on this page where an example java code and html
> markup are shown. I'm pretty much in the dark as far as configuring it. Does
> anyone know where I can find code that demonstrates how to add the
> component?
> 
> Here's what I've got so far but it's not displaying properly:
>final SummernoteEditor summernoteEditor = new
> SummernoteEditor("summernoteEditor", new PropertyModel(this,
> "articleContent"), summernoteConfig);form.add(summernoteEditor);
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



http://examples7x.wicket.apache.org/ is down

2018-11-21 Thread Francois Meillet
http://examples7x.wicket.apache.org/ is down

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindows in a listView

2018-10-31 Thread Francois Meillet
have a look at Component setMarkupId(String markupId)

François



> Le 31 oct. 2018 à 14:01, JavaTraveler  a écrit :
> 
> Ok, so how would you do it ?
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



Re: ModalWindows in a listView

2018-10-31 Thread Francois Meillet
because all yours modakwindow have the same id.

François



> Le 31 oct. 2018 à 09:47, JavaTraveler  a écrit :
> 
> Hello everyone,
> 
> I have a question. Is it possible to add modal windows in a listView. I have
> tried, but it doesn't on wich line I click, the corresponding modal window
> will always concern the last item of my list.
> Here's how I do it :
> 
> 
> lArt = new ListView("articles", new
> LoadableDetachableModel>() {
>@Override
>protected List load() {
>  return BusinessFactory.getArticleEjb().searchDto(ARTICLESEARCH,
> ARTICLELOAD);
>}
>  }) {
>@Override
>protected void populateItem(final ListItem _itemRow) {
>  _itemRow.setOutputMarkupId(true);
>  _itemRow.add(new Label("code",
> _itemRow.getModelObject().getCode()));
> modalWindowLibelle = new ModalWindow("modalWindowLibelle");
>  modalWindowLibelle.setContent(new
> ModifierArticlePanel(modalWindowLibelle.getContentId(),
> _itemRow.getModelObject()));
>  modalWindowLibelle.setTitle("Modifier le libellé d'article ?");
>  modalWindowLibelle.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>@Override
>public void onClose(AjaxRequestTarget target){
>target.add(tabArticles);
>}
>  }); 
>  AjaxLink btnLib = new AjaxLink("btnLib") {
>@Override
>public void onClick(AjaxRequestTarget art) {
>  modalWindowLibelle.show(art);
>}
>  };
>  btnLib.add(new Image("imgLib", new
> PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
> 
>  modalWindowPrix = new ModalWindow("modalWindowPrix");
>  modalWindowPrix.setContent(new
> ModifierPrixArticlePanel(modalWindowPrix.getContentId(),   
> _itemRow.getModelObject()));
>  modalWindowPrix.setTitle("Modifier le libellé d'article ?");
>  modalWindowPrix.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
>@Override
>public void onClose(AjaxRequestTarget target){
>target.add(tabArticles);
>}
>  }); 
>  AjaxLink btnPrix = new AjaxLink("btnPrix") {
>@Override
>public void onClick(AjaxRequestTarget art) {
>  modalWindowPrix.show(art);
>}
>  };
>  btnPrix.add(new Image("imgPrix", new
> PackageResourceReference(TemplatePage.class, "images/magnifier.png")));
> 
>  _itemRow.add(btnLib);
>  _itemRow.add(btnPrix);
>  _itemRow.add(modalWindowLibelle);
>  _itemRow.add(modalWindowPrix);
>};
> 
> 
> Any ideas ?
> 
> Thank you very much in advance.
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Feedback panel not displaying

2018-10-29 Thread Francois Meillet
Could you do a quickstart ?

François



> Le 29 oct. 2018 à 18:42, SeldonCrisis  a écrit :
> 
> Okay, I'm calling form.error() now instead. Unfortunately it didn't solve my
> issue :(
> 
> On the first click this was printed:
> 00af SystemOut O ERROR LandingPage_Cp10 Does the form have
> error:true
> 
> So it recognizes that there is indeed an error, but it's not bring the
> feedback panel along in the ajax response. Only after the second click the
> ajax-response has all the correct feedback code.
> 
> 
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Feedback panel not displaying

2018-10-29 Thread Francois Meillet
also when you call error(), you call it on your component, not on the form.
you should call it like this : 

private boolean activeSessionExist(Form form){
OCPSession session = (OCPSession)WebSession.get();

if(session.getTrackingId() != null){
log.error("Active session found. Cannot have more than one OCP tracking 
number open at a time."); 
String error = "You have an active OCP Tracking Number open 
already. "
+ "This application only allows one active OCP Tracking 
Number. "
+ "Please use the \"Exit\" button to close that 
Tracking Number before 
starting a new " + getTypeCode(); 

form.error(error);
return true;
}
return false;
}


François



> Le 29 oct. 2018 à 16:57, SeldonCrisis  a écrit :
> 
> Oh strange, probably because I put the code in < raw > tags. Thanks for the
> heads up.
> 
> *OK, here's the button code:*
> radioWmc1Step2.add(new AjaxButton("btnNewBegin") { 
>   private static final long serialVersionUID = 1L;
>   @Override
>   public void onSubmit(AjaxRequestTarget target, Form form) {
>   if (activeSessionExist()){
>   target.add(feedback);
>   log.debug("Does the form have error:" + 
> form.hasError());
>   return;
>   }
>   logUserAction(ocpAuthorization.getEmailAddress(), "602", 
> "CP10", "OCP",
> ocpAuthorization.getSecretTrackingNumber());
>   onPageSubmit(target);
>   } 
>   
>   @Override 
>   protected void onError(AjaxRequestTarget target, Form form) {
>   onSaveFormBtnError(target);
> target.add(radioWmc1Step2);
> target.appendJavaScript("trackingNumberMask();");
>   };
> }
> 
> *And the code where I add to feedback panel*
> private boolean activeSessionExist(){
>   OCPSession session = (OCPSession)WebSession.get();
>   
>   if(session.getTrackingId() != null){
>   log.error("Active session found. Cannot have more than one OCP 
> tracking
> number open at a time.");
>   String error = "You have an active OCP Tracking Number open 
> already. "
>   + "This application only allows one active OCP 
> Tracking Number. "
>   + "Please use the \"Exit\" button to close that 
> Tracking Number before
> starting a new " + getTypeCode();
>   
>   error(error);
>   return true;
>   }
>   return false;
> }
> 
> Thanks again
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



Re: Feedback panel not displaying

2018-10-29 Thread Francois Meillet
works great for me.

@Override
protected void onInitialize() {
super.onInitialize();

Form form = new Form("form");
add(form);

FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setOutputMarkupId(true);
form.add(feedback);

form.add(new AjaxButton("AjaxButton") {

private static final long serialVersionUID = 1L;

@Override
public void onSubmit(AjaxRequestTarget target) {
if (activeSessionExist()) {
target.add(feedback);
log.debug("Does the form have error:" + getForm().hasError());
}
}

});
}

private boolean activeSessionExist() {
error("You have an active OCP");
return true;
}



What is printed at the log.debug("Does the form have error:" + 
form.hasError());  at the first click ?


François



> Le 29 oct. 2018 à 16:57, SeldonCrisis  a écrit :
> 
> Oh strange, probably because I put the code in < raw > tags. Thanks for the
> heads up.
> 
> *OK, here's the button code:*
> radioWmc1Step2.add(new AjaxButton("btnNewBegin") { 
>   private static final long serialVersionUID = 1L;
>   @Override
>   public void onSubmit(AjaxRequestTarget target, Form form) {
>   if (activeSessionExist()){
>   target.add(feedback);
>   log.debug("Does the form have error:" + 
> form.hasError());
>   return;
>   }
>   logUserAction(ocpAuthorization.getEmailAddress(), "602", 
> "CP10", "OCP",
> ocpAuthorization.getSecretTrackingNumber());
>   onPageSubmit(target);
>   } 
>   
>   @Override 
>   protected void onError(AjaxRequestTarget target, Form form) {
>   onSaveFormBtnError(target);
> target.add(radioWmc1Step2);
> target.appendJavaScript("trackingNumberMask();");
>   };
> }
> 
> *And the code where I add to feedback panel*
> private boolean activeSessionExist(){
>   OCPSession session = (OCPSession)WebSession.get();
>   
>   if(session.getTrackingId() != null){
>   log.error("Active session found. Cannot have more than one OCP 
> tracking
> number open at a time.");
>   String error = "You have an active OCP Tracking Number open 
> already. "
>   + "This application only allows one active OCP 
> Tracking Number. "
>   + "Please use the \"Exit\" button to close that 
> Tracking Number before
> starting a new " + getTypeCode();
>   
>   error(error);
>   return true;
>   }
>   return false;
> }
> 
> Thanks again
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



Re: Feedback panel not displaying

2018-10-29 Thread Francois Meillet
Hi,

Can’t see your code in your message.

François



> Le 29 oct. 2018 à 15:40, SeldonCrisis  a écrit :
> 
> Hey guys,
> 
> I have an AjaxButton() that is being added to a WebMarkupContainer. 
> 
> Within the onSubmit() of the button, I check to see whether there is already
> an active session ID or not. If there is, I want to discontinue processing,
> and display the feedback panel with an error message.
> 
> This ALMOST works, but the feedback panel won't display until after I click
> the button TWICE.
> 
> So the FIRST time I click the button, it discontinues processing, the SECOND
> time I click the button the feedback panel is added to the page. 
> 
> Here's the button code:
> 
> 
> And here's the code where I'm adding the message to the feedback panel:
> 
> 
> So the message is added to the feedback panel in activeSessionExist() and
> then the feedback panel is added to the target in the onSubmit() of the
> button. 
> 
> I wan't the feedback panel to be added to the page on the first click. Any
> ideas as to whats going on?
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> -
> 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: Problem with DiskDataStore

2018-04-18 Thread Francois Meillet
you can count all open file handles via lsof | wc -l

François



> Le 18 avr. 2018 à 17:42, Francois Meillet  a 
> écrit :
> 
> Hi Claudia,
> 
> you need to update the limits in the linux kernel
> have a look at 
> https://serverfault.com/questions/20387/too-many-open-files-on-debian?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
>  
> <https://serverfault.com/questions/20387/too-many-open-files-on-debian?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa>
> 
> François
> 
> 
> 
>> Le 18 avr. 2018 à 17:24, Claudia Hirt > <mailto:hirt-clau...@gmx.de>> a écrit :
>> 
>> Hi all,
>> 
>> I get the following error when there are a lot of sessions on the system:
>> 
>> [4/18/18 11:49:59:291 CEST] 0080 SystemOut O myapp 18/04/2018 
>> 11:49:59,282 ERROR  (DiskDataStore.java:434) 
>> -/QIBM/UserData/WebSphere/AppServer/V85/Express/profiles/node01/temp/node01/node01/myapp/myapp.war/wicket.wicket-filestore/39/7429/6wE5N0QWVikdMSdO-oSbWCb/data
>>  (Too many open files)
>> java.io.FileNotFoundException: 
>> /QIBM/UserData/WebSphere/AppServer/V85/Express/profiles/node01/temp/node01/node01/myapp/myapp.war/wicket.wicket-filestore/39/7429/6wE5N0QWVikdMSdO-oSbWCb/data
>>  (Too many open files)
>>at java.io.RandomAccessFile.open(Native Method)
>>at java.io.RandomAccessFile.(RandomAccessFile.java:253)
>>at 
>> org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:428)
>>at 
>> org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:346)
>>at 
>> org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:185)
>>at 
>> org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355)
>>at java.lang.Thread.run(Thread.java:798)
>> 
>> This leads to a total breakdown of file system in my case.
>> I saw this already was an issue here: 
>> http://apache-wicket.1842946.n4.nabble.com/DiskDataStore-errors-in-production-td4665842.html
>>  
>> <http://apache-wicket.1842946.n4.nabble.com/DiskDataStore-errors-in-production-td4665842.html>
>>  but there was no solution.
>> 
>> Are there some settings in PageStore or anything to avoid this problem?
>> 
>> Best regards,
>> Claudia Hirt
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
>> <mailto:users-unsubscr...@wicket.apache.org>
>> For additional commands, e-mail: users-h...@wicket.apache.org 
>> <mailto:users-h...@wicket.apache.org>
>> 
> 



Re: Problem with DiskDataStore

2018-04-18 Thread Francois Meillet
Hi Claudia,

you need to update the limits in the linux kernel
have a look at 
https://serverfault.com/questions/20387/too-many-open-files-on-debian?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
 


François



> Le 18 avr. 2018 à 17:24, Claudia Hirt  a écrit :
> 
> Hi all,
> 
> I get the following error when there are a lot of sessions on the system:
> 
> [4/18/18 11:49:59:291 CEST] 0080 SystemOut O myapp 18/04/2018 
> 11:49:59,282 ERROR  (DiskDataStore.java:434) 
> -/QIBM/UserData/WebSphere/AppServer/V85/Express/profiles/node01/temp/node01/node01/myapp/myapp.war/wicket.wicket-filestore/39/7429/6wE5N0QWVikdMSdO-oSbWCb/data
>  (Too many open files)
> java.io.FileNotFoundException: 
> /QIBM/UserData/WebSphere/AppServer/V85/Express/profiles/node01/temp/node01/node01/myapp/myapp.war/wicket.wicket-filestore/39/7429/6wE5N0QWVikdMSdO-oSbWCb/data
>  (Too many open files)
>at java.io.RandomAccessFile.open(Native Method)
>at java.io.RandomAccessFile.(RandomAccessFile.java:253)
>at 
> org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:428)
>at 
> org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:346)
>at 
> org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:185)
>at 
> org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355)
>at java.lang.Thread.run(Thread.java:798)
> 
> This leads to a total breakdown of file system in my case.
> I saw this already was an issue here: 
> http://apache-wicket.1842946.n4.nabble.com/DiskDataStore-errors-in-production-td4665842.html
>  but there was no solution.
> 
> Are there some settings in PageStore or anything to avoid this problem?
> 
> Best regards,
> Claudia Hirt
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



@apache_wicket Twitter account

2018-02-22 Thread Francois Meillet
Today @apache_wicket Twitter account https://twitter.com/apache_wicket 
 has 40 new followers and received 4,361 
impressions over the last 24 hours !

You like your framework ? 
Share the success !

Follow @apache_wicket https://twitter.com/apache_wicket 
 and retweet as much as you can  ! 
 :‑)

François



Re: How to format number in (Number)TextField?

2017-10-24 Thread Francois Meillet
You can use an input with a mask
something like 
Have a look at https://igorescobar.github.io/jQuery-Mask-Plugin/ 


François



> Le 24 oct. 2017 à 14:37, Maxim Solodovnik  a écrit :
> 
> I believe you can override "getTextFormat 
> ()"
>  method and provide your own format
> According to right align: you can use CSS class for that :)
> 
> On Tue, Oct 24, 2017 at 6:52 PM, Kamil Paśko  > wrote:
> Dear Wicket user group,
> 
> 
> I have a TextField (but I can use NumberTextField as well) and when user 
> types a number I want that:
> 
> 1) number is positioned to the right
> 
> 2) thousands are separated by spaces
> 
> 3) floating point character is "."
> 
> 
> 
> How can I "force" that format in a TextField?
> 
> Kind regards,
> 
> Kamil
> 
> 
> 
> -- 
> WBR
> Maxim aka solomax



exemples are down

2017-10-11 Thread Francois Meillet
Hi,

https://examples8x.wicket.apache.org/app 
got 404

https://examples7x.wicket.apache.org/app
connection is not secure

https://examples6x.wicket.apache.org/app
connection is not secure


François


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: After removing history from browser, refresh an unmounted stateful page trigger a NPE in PageProvider

2017-07-25 Thread Francois Meillet
Thanks ! 

Blazing Fast ! 

François



> Le 25 juil. 2017 à 21:36, Martin Grigorov  a écrit :
> 
> https://issues.apache.org/jira/browse/WICKET-6428
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Tue, Jul 25, 2017 at 10:22 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi Martin,
>> 
>> I just clean the browser’s cache
>> 
>> François
>> 
>> 
>> 
>>> Le 25 juil. 2017 à 21:13, Martin Grigorov  a
>> écrit :
>>> 
>>> Hi François,
>>> 
>>> How to reproduce it ?
>>> What I should do to 'remove the history' ?
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Tue, Jul 25, 2017 at 4:12 PM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
>>>> Hi Devs,
>>>> 
>>>> If I perform a refresh on an unmounted stateful page after having
>> cleaned
>>>> the browser history, I get a NPE in PageProvider.
>>>> 
>>>> This not happens on a mounted page.
>>>> 
>>>> Wicket 8.0.0-SNAPSHOT
>>>> 
>>>> Here the quickstart
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -
>>>> 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
>> 
>> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: After removing history from browser, refresh an unmounted stateful page trigger a NPE in PageProvider

2017-07-25 Thread Francois Meillet
Hi Martin,

I just clean the browser’s cache

François



> Le 25 juil. 2017 à 21:13, Martin Grigorov  a écrit :
> 
> Hi François,
> 
> How to reproduce it ?
> What I should do to 'remove the history' ?
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Tue, Jul 25, 2017 at 4:12 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi Devs,
>> 
>> If I perform a refresh on an unmounted stateful page after having cleaned
>> the browser history, I get a NPE in PageProvider.
>> 
>> This not happens on a mounted page.
>> 
>> Wicket 8.0.0-SNAPSHOT
>> 
>> Here the quickstart
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> -
>> 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 reload necessary Panel inside common layout?

2017-05-30 Thread Francois Meillet
Have a look at 
https://ci.apache.org/projects/wicket/guide/8.x/single.html#_working_with_ajax 



François



> Le 30 mai 2017 à 14:32, Sokab  a écrit :
> 
> Hi. I follow this post 
> ( 
> https://stackoverflow.com/questions/24061261/loading-wicket-panels-dynamically-in-a-div
> 
>   
> ) and try display necessary Panel inside layout but I really can't do it.
> 
> I created a sample project:
> 
> public class WicketApplication extends WebApplication{
>@Override
>public Class getHomePage()
>{
>return MainPage.class;
>}
> 
>@Override
>protected void init() {
>super.init();
>}
> }
> 
> ***
> MainPage.html:
> 
> http://wicket.apache.org";>
>  
>
>Main Page
>
> 
>   
> 
>
> 
> 
> 
> MainPage.java:
> 
> public class MainPage extends WebPage{
> 
>@Override
>protected void onInitialize() {
>super.onInitialize(); 
> 
>add(new Panel1("panel1"));  
>}
> }
> 
> ***
> Panel1.html:
> http://wicket.apache.org";>
> 
>
>
>
> 
> 
> 
> 
> Panel1.java:
> public class Panel1 extends Panel{
> 
>public Panel1(String id) {
>super(id);
>}
> 
>@Override
>protected void onInitialize() {
>super.onInitialize(); 
> 
>add(new Panel2("panel2")); 
>}
> }
> 
> ***
> Panel2.html:
> http://wicket.apache.org";>
>
> 
>
> Page1 <#>  
> Page2 <#>  
>
> 
>
> 
> 
> 
> Panel2.java:
> public class Panel2 extends Panel{
> 
>public Panel2(String id) {
>super(id);
>}
> 
>@Override
>protected void onInitialize() {
>super.onInitialize(); 
> 
> 
>add(new AjaxLink("page3") {
>@Override
>public void onClick(AjaxRequestTarget target) {
>   // ??
>}
>});
> 
> 
>add(new AjaxLink("page4") {
>@Override
>public void onClick(AjaxRequestTarget target) {
> //??
>}
>});
> 
>}
> }
> 
> ***
> Panel3.html:
> http://wicket.apache.org";>
>
>
> Panel 3 Content
> 
>
> 
> 
> Panel3.java:
> public class Panel3 extends Panel{
>public Panel3(String id) {
>super(id);
>}
> }
> 
> ***
> Panel4.html:
> http://wicket.apache.org";>
>
>
> Panel 4 Content
> 
>
> 
> 
> Panel4.java:
> public class Panel4 extends Panel{
>public Panel4(String id) {
>super(id);
>}
> }
> **
> After clicked on AjaxLink inside Panel2 I need display panel3 or panel4 in
> MainPage without reload all page. How can I do this?  Can I call
> wicket:id="homePanel" from MainPage.html inside Panel2.java and and replace
> panel3/panel4 after ajax request? Thank You for any hint.
> 
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-reload-necessary-Panel-inside-common-layout-tp4677948.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
> 



Proxy Error 502 for http://examples7x.wicket.apache.org/index.html

2017-05-30 Thread Francois Meillet
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /index.html.
Reason: Error reading from remote server


François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Source code" option on example page returns 500

2017-05-29 Thread Francois Meillet
thanks Martin,

François



> Le 29 mai 2017 à 12:41, Martin Grigorov  a écrit :
> 
> Using Tomcat 7 is not an option because OpenShift starts it with Java 7:
> 
> Caused by: java.lang.UnsupportedClassVersionError:
> com/google/common/base/Function : Unsupported major.minor version 52.0
> (unable to load class com.google.common.base.Function)
> 
> So the next option is Do It Yourself:
> https://blog.openshift.com/how-to-run-apache-tomcat-8-on-openshift/
> 
> But my lunch break is over and for now examples8x is down.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, May 29, 2017 at 12:21 PM, Martin Grigorov 
> wrote:
> 
>> Hi,
>> 
>> It might take a bit longer to fix this.
>> 
>> The exception is:
>> Caused by: java.lang.RuntimeException: An error occurred while getting the
>> model object for Component: [ListView [Component id = file, page =
>> org.apache.wicket.examples.source.SourcesPage, path = filespanel:file,
>> type = org.apache.wicket.markup.html.list.ListView, isVisible = true,
>> isVersioned = true]]
>> at org.apache.wicket.Component.getDefaultModelObject(Component.java:1651)
>> at org.apache.wicket.markup.html.list.ListView.getViewSize(
>> ListView.java:218)
>> at org.apache.wicket.markup.html.list.ListView.onPopulate(
>> ListView.java:472)
>> at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(
>> AbstractRepeater.java:124)
>> at org.apache.wicket.Component.internalBeforeRender(Component.java:948)
>> at org.apache.wicket.Component.beforeRender(Component.java:1016)
>> at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(
>> MarkupContainer.java:1749)
>> ... 62 more
>> Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
>> at java.io.File.(File.java:421)
>> at org.apache.wicket.examples.source.SourcesPage$
>> PackagedResourcesModel.get(SourcesPage.java:209)
>> at org.apache.wicket.examples.source.SourcesPage$
>> PackagedResourcesModel.load(SourcesPage.java:149)
>> at org.apache.wicket.examples.source.SourcesPage$
>> PackagedResourcesModel.load(SourcesPage.java:139)
>> at org.apache.wicket.model.LoadableDetachableModel.getObject(
>> LoadableDetachableModel.java:126)
>> at org.apache.wicket.Component.getDefaultModelObject(Component.java:1644)
>> ... 68 more
>> 
>> Examples 7.x and 6.x use Tomcat 7.x
>> Examples 8.x uses Wildfly 10 because Wicket 8.x needs Servlet 3.1.0 and
>> there is no option of using Tomcat 8.5+ at OpenShift.
>> 
>> Wildfly (and previous versions of JBoss) are famous with their custom
>> modules impl that makes reading of classpath much harder than a normal
>> servlet container...
>> 
>> I think the easiest is to drop the Wildfly usage and use Tomcat 7 for 8.x
>> examples as well.
>> 
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Mon, May 29, 2017 at 10:26 AM, Francois Meillet <
>> francois.meil...@gmail.com> wrote:
>> 
>>> Hi Examples Website Maintainer,
>>> 
>>> "Source code" option on example page returns 500 - any chance for solving
>>> this problem? E.g. here: examples8x.wicket.apache.org/forminput/ <
>>> https://t.co/1gkfLZZZi5>
>>> 
>>> Thanks
>>> 
>>> François
>>> 
>>> 
>>> 
>>> 
>> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Source code" option on example page returns 500

2017-05-29 Thread Francois Meillet
Hi Examples Website Maintainer,

"Source code" option on example page returns 500 - any chance for solving this 
problem? E.g. here: examples8x.wicket.apache.org/forminput/ 


Thanks

François





Re: Unable to retrieve row model in DataTable while running the application in Jetty

2017-04-25 Thread Francois Meillet
Hi James,

Please make a quickstart so I can have a better overview.

François



> Le 25 avr. 2017 à 03:35, James Selvakumar  a écrit :
> 
> Hi Francois,
> 
> Thank you very much for your reply.
> I define my datatable like this:
> 
> StandardDataTable dataTable = new StandardDataTable("dataTable",
> columns, this.getDataProvider());
> 
> And that's the only place I use a data provider.
> 
> I don't override it's model.
> 
> In my data provider I don't call detach.
> 
> 
> On Fri, Apr 21, 2017 at 4:27 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi James,
>> 
>> Do you use the same DataProvider for your DataTable ?
>> Do you use the same model when you override DataTable # IModel model(T
>> object);
>> Do you call detach ?
>> 
>> François
>> 
>> 
>> 
>>> Le 21 avr. 2017 à 09:38, James Selvakumar  a écrit
>> :
>>> 
>>> Hi all,
>>> 
>>> I have a DataTable with some ajax links in the first column. Other
>> columns
>>> are simple property columns. The ajax links are used to edit/delete
>>> associated entities. The ajax links are encapsulated inside a panel.
>>> 
>>> The DataTable itself is rendered fine.
>>> 
>>> The problem I face is that the rowModel.getObject() is null when any of
>> the
>>> ajax link is clicked when running the application in Jetty (Maven jetty
>>> plugin).  However, if the application is deployed on Tomcat, everything
>>> works as expected.
>>> 
>>> Can anyone highlight my mistake, if any here?
>>> 
>>> Here's how my code looks like:
>>> 
>>> List columns = new ArrayList();
>>> columns.add(new AbstractColumn>> String>(Model.of(getString("name")), "name")
>>> {
>>> @Override
>>> public void populateItem(Item> cellItem,
>>> String componentId, final IModel rowModel)
>>> {
>>> cellItem.add(new DataTableActionPanel(componentId,
>>> rowModel.getObject().getName())
>>> {
>>> @Override
>>> protected void onEdit(AjaxRequestTarget target)
>>> {
>>> LOGGER.debug("Editing {}", rowModel.getObject());
>>> 
>>> //proceed to display another panel to edit the entity
>>> 
>>> }
>>> 
>>> @Override
>>> protected void onDelete(AjaxRequestTarget target)
>>> {
>>> LOGGER.debug("Deleting {}", rowModel.getObject());
>>> 
>>> //proceed to delete the entity
>>> 
>>> }
>>> 
>>> });
>>> }
>>> });
>>> 
>>> //add other columns
>>> 
>>> 
>>> //add the columns to a data table
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Thanks & regards
>>> James
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
> 
> 
> -- 
> Thanks & regards
> James


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Unable to retrieve row model in DataTable while running the application in Jetty

2017-04-21 Thread Francois Meillet
Hi James,

Do you use the same DataProvider for your DataTable ?
Do you use the same model when you override DataTable # IModel model(T 
object);
Do you call detach ?

François



> Le 21 avr. 2017 à 09:38, James Selvakumar  a écrit :
> 
> Hi all,
> 
> I have a DataTable with some ajax links in the first column. Other columns
> are simple property columns. The ajax links are used to edit/delete
> associated entities. The ajax links are encapsulated inside a panel.
> 
> The DataTable itself is rendered fine.
> 
> The problem I face is that the rowModel.getObject() is null when any of the
> ajax link is clicked when running the application in Jetty (Maven jetty
> plugin).  However, if the application is deployed on Tomcat, everything
> works as expected.
> 
> Can anyone highlight my mistake, if any here?
> 
> Here's how my code looks like:
> 
> List columns = new ArrayList();
> columns.add(new AbstractColumn String>(Model.of(getString("name")), "name")
> {
>   @Override
>   public void populateItem(Item> cellItem,
> String componentId, final IModel rowModel)
>   {
>   cellItem.add(new DataTableActionPanel(componentId,
> rowModel.getObject().getName())
>   {
>   @Override
>   protected void onEdit(AjaxRequestTarget target)
>   {
>   LOGGER.debug("Editing {}", rowModel.getObject());
> 
>   //proceed to display another panel to edit the entity
> 
>   }
> 
>   @Override
>   protected void onDelete(AjaxRequestTarget target)
>   {
>   LOGGER.debug("Deleting {}", rowModel.getObject());
> 
>   //proceed to delete the entity
> 
>   }
> 
>   });
>   }
> });
> 
> //add other columns
> 
> 
> //add the columns to a data table
> 
> 
> 
> 
> -- 
> Thanks & regards
> James


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



nice tutorial : "Call Apache Wicket from Javascript / Back Button Behavior"

2017-04-14 Thread Francois Meillet
For all those who are interested by this subject, have a look at this very good 
tutorial

https://twitter.com/apache_wicket/status/852786047746322434


François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
found that org.apache.wicket:wicket-core:jar:8.0.0-M4 use com.tdunning:json


com.tdunning
json



de.agilecoders.wicket:wicket-bootstrap-extensions:jar:2.0.0-M2 use 
com.google.javascript:closure-compiler:v20130603


com.google.javascript
closure-compiler
v20130603


which use org.json:json


org.json
json
20090211



Both json projects have the same package structure and the same class naming


François



> Le 13 mars 2017 à 15:43, Martin Grigorov  a écrit :
> 
> On Mon, Mar 13, 2017 at 3:23 PM, Francois Meillet <
> francois.meil...@gmail.com <mailto:francois.meil...@gmail.com>> wrote:
> 
>> AbstractDefaultAjaxBehavior
>> 
>> protected final CharSequence renderAjaxAttributes(final Component
>> component, AjaxRequestAttributes attributes) {
>> 
>>.../...
>> 
>> 
>>List dynamicExtraParameters =
>> attributes.getDynamicExtraParameters();
>>if (dynamicExtraParameters != null)
>>{
>>for (CharSequence dynamicExtraParameter :
>> dynamicExtraParameters)
>>{
>>String func =
>> String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);
>> 
>>---> 8.0.0-SNAPSHOT func =
>> function(attrs){return Wicket.BrowserInfo.collect()}
>> 
>>---> 8.0.0-M4
>> func =  function(attrs){return Wicket.BrowserInfo.collect()}
>> 
>> 
>>JSONFunction function = new
>> JSONFunction(func);
>>attributesJson.append(
>> AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), function);
>> 
>>---> 8.0.0-SNAPSHOT
>> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[function(attrs){return
>> Wicket.BrowserInfo.collect()}]}
>> 
>>---> 8.0.0-M4
>> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["function(attrs){return
>> Wicket.BrowserInfo.collect()}"]}
>> 
> 
> I don't see why this works in -SNAPSHOT ...
> https://github.com/openjson/openjson/blob/master/src/main/java/com/github/openjson/JSONObject.java#L327
>  
> <https://github.com/openjson/openjson/blob/master/src/main/java/com/github/openjson/JSONObject.java#L327>
> doesn't have support for lists/collections yet
> 
> 
>>}
>>}
>> 
>> François
>> 
>> 
>> 
>>> Le 13 mars 2017 à 11:57, Martin Grigorov  a écrit
>> :
>>> 
>>> 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
>>> But AFAIK the problem is not fixed there. If you have time to debug why
>> it
>>> works it would be helpful!
>>> Mikhail is going to implement the missing #put(String, Collection|Map)
>>> methods and make a release. Then we will update all branches!
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
>>>> Hi Martin,
>>>> 
>>>> I do not get any error with the 8.0.0-SNAPSHOT
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>>> Le 13 mars 2017 à 10:14, Martin Grigorov  a
>> écrit
>>>> :
>>>>> 
>>>>> Hi Francois,
>>>>> 
>>>>> It is strange that it fails when built on Mac only.
>>>>> But the issue looks the same as the one reported by Sebastien.
>>>>> 
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>> https://twitter.com/mtgrigorov
>>>>> 
>>>>> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
>>>>> francois.meil...@gmail.com> wrote:
>>>>> 
>>>>>> I forgot to say  : Apache Wicket 8.0.0-M4
>>>>>> 
>>>>>> François
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>>> -
>>>> 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 
>> <mailto:users-unsubscr...@wicket.apache.org>
>> For additional commands, e-mail: users-h...@wicket.apache.org 
>> <mailto:users-h...@wicket.apache.org>


Re: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
AbstractDefaultAjaxBehavior

protected final CharSequence renderAjaxAttributes(final Component component, 
AjaxRequestAttributes attributes) {

.../...


List dynamicExtraParameters = 
attributes.getDynamicExtraParameters();
if (dynamicExtraParameters != null)
{
for (CharSequence dynamicExtraParameter : 
dynamicExtraParameters)
{
String func = 
String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);

---> 8.0.0-SNAPSHOT func =  
function(attrs){return Wicket.BrowserInfo.collect()}

---> 8.0.0-M4   func =  
function(attrs){return Wicket.BrowserInfo.collect()}


JSONFunction function = new 
JSONFunction(func);

attributesJson.append(AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), 
function);

---> 8.0.0-SNAPSHOT 
attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[function(attrs){return 
Wicket.BrowserInfo.collect()}]}

---> 8.0.0-M4   
attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["function(attrs){return 
Wicket.BrowserInfo.collect()}"]}
}
}

François



> Le 13 mars 2017 à 11:57, Martin Grigorov  a écrit :
> 
> 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
> But AFAIK the problem is not fixed there. If you have time to debug why it
> works it would be helpful!
> Mikhail is going to implement the missing #put(String, Collection|Map)
> methods and make a release. Then we will update all branches!
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi Martin,
>> 
>> I do not get any error with the 8.0.0-SNAPSHOT
>> 
>> François
>> 
>> 
>> 
>>> Le 13 mars 2017 à 10:14, Martin Grigorov  a écrit
>> :
>>> 
>>> Hi Francois,
>>> 
>>> It is strange that it fails when built on Mac only.
>>> But the issue looks the same as the one reported by Sebastien.
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
>>>> I forgot to say  : Apache Wicket 8.0.0-M4
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> 
>> -
>> 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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
Hi Martin,

I do not get any error with the 8.0.0-SNAPSHOT

François



> Le 13 mars 2017 à 10:14, Martin Grigorov  a écrit :
> 
> Hi Francois,
> 
> It is strange that it fails when built on Mac only.
> But the issue looks the same as the one reported by Sebastien.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> I forgot to say  : Apache Wicket 8.0.0-M4
>> 
>> François
>> 
>> 
>> 
>> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
I forgot to say  : Apache Wicket 8.0.0-M4

François





AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
Hi,

I add an AjaxClientInfoBehavior to a page.

Sometimes I get an error.
This is very strange and I have no clue.

I have 2 computers, 1 Debian, 1 Osx, within the same network.

If I compile the code on the Osx boxe,
publish the war on a Tomcat instance running on the Osx box or on the Debian box
and I call the page with the AjaxClientInfoBehavior, 
I have the following error (in Wicket Ajax Debug)

ERROR: An error occurred while executing Ajax request:SyntaxError: function 
statement requires a name

The code in the page is

/**/


If I compile the code on the Debian box, 
publish the war on a Tomcat instance running the Debian box
I do not get any error

the code in the page is

/**/


What I see from the javascript generated : when error occurs, double quotes are 
present around the function call.

It's very weird !
Cold it be related to Sebastien'message "8.0.0-M4: org.json has issue with 
List" from Mars the 12 ?

Do you have any advice ?

Thanks
François
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Francois Meillet
When the RemarkForm is instancied, addButtons() is called. 
At this point the modalWindow is null.
So the modalWindow argument given to the AddRemarkButton constructor is null. 

You should modify the RemarkForm constructor to something like 
public RemarkForm(String id, ModalWindow modalWindow) {

François





> Le 22 févr. 2017 à 14:19, Manfred Bergmann  a 
> écrit :
> 
> It it's that line, than only the modalWindow instance variable can be null.
> Can you confirm that by either adding a log line or debug into there.
> 
> If it is indeed null something in the surrounding of the classes you show
> makes it null, or cleans it up. Some concurrency going on maybe?
> 
> 
> Manfred
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677167.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: NullPointerException on submitting a form in a modal window

2017-02-22 Thread Francois Meillet
The AddRemarkButton source code you show is not the one who generated the 
exception.
The exception has been thrown line 32 in the submit method.
The source code you show has only 22 lines

Put a breakpoint in the onSubmit method.

François




> Le 22 févr. 2017 à 11:16, Manfred Bergmann  a 
> écrit :
> 
> Hi.
> 
> What's on line 32 of AddRemarkButton.java?
> 
> 
> Manfred
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/NullPointerException-on-submitting-a-form-in-a-modal-window-tp4677161p4677162.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: Christmas / new year [NON-BIZ]

2016-12-24 Thread Francois Meillet
Joyeux Noel !

François



> Le 24 déc. 2016 à 14:46, Martin Grigorov  a écrit :
> 
> Merry Christmas !
> 
> On Dec 24, 2016 1:33 PM, "Tobias Soloschenko" <
> tobiassolosche...@googlemail.com> wrote:
> 
> Hi all,
> 
> I wish you a merry christmas and happy new year. :-)
> 
> kind regards
> 
> Tobias


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Twitter poll result 2

2016-11-18 Thread Francois Meillet
ng and looking into the
> components.
> 2. How to show case /sample Wicket based web application developed for
> smaller devices? How to make developers look at Wicket show cases?
> 3. Commercial support and marketing it aggressively.
> 
> By no mean I am trying to show/share that we have migrated to other
> framework. Above is just my sharing, by all mean to help such strong
> framework whichever way I can.
> 
> Thanks,
> -Mihir.
> 
> On Tue, Nov 1, 2016 at 11:49 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> I think it is also good to tell that there are a lot of new features like
>> http/2 support to show that Wicket is not a framework at which developers
>> stopped working on new features several years ago.
>> 
>> I wrote an article about that on a blog of Jörn Zaefferer who is
>> responsible for jQuery UI Dev Lead | QUnit | Globalize | Infrastructure.
>> 
>> Maybe the page about models can be integrated into the user guide to
>> improve it.
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 01.11.2016 um 16:31 schrieb Andrea Del Bene :
>>> 
>>> Hi Francois,
>>> 
>>> I'm glad to read such a clear and smart analysis. I agree with you at
>> 100%. Buzz is something we definitely lack of. We should improve our
>> examples and write more articles on Wicket. I've also noted that Vaadin
>> people have increased the amount of the "buzz" lately. For Vaadin it's
>> easier since they have a commercial company behind it, and it seems to m
>> they have joined the forces with other commercial entities (like JRebel and
>> people behind jOOQ), but this is just my impression. After the ApacheCon I
>> hope to find the time to write more on DZone about Wicket.
>>> 
>>> I also think that it's important to work against some misconceptions
>> that Wicket might have in dev community (for example, the idea that it is a
>> stateful-only framework). At least this is what i will try to do at
>> ApacheCon.
>>> 
>>> Andrea.
>>> 
>>> 
>>> 
>>>> On 01/11/2016 11:44, Francois Meillet wrote:
>>>> Hi,
>>>> 
>>>> Following Tobias Soloschenko thread about the Twitter poll result
>>>> 
>>>> I think we should focus on who who don't know Wicket.
>>>> People who don't like Wicket, the unhappy users, will not come back.
>>>> 
>>>> Only 34% of the respondents know what is Apache Wicket.
>>>> Put another way 66% don't ever know what is Wicket.
>>>> 
>>>> 
>>>> A) Apache Wicket's Adoption
>>>> ——
>>>> Adoption (software or any good) has 2 channels : buzz and word of mouth.
>>>> For many authors word of mouth (WOM) influence 50% of the acquisition
>> decision.
>>>> 
>>>> So to increase Wicket Adoption we have 2 choices :
>>>> 
>>>> 1) Wicket buzz)
>>>> The buzz channel is done via articles, conferences (ApacheCon), meetup,
>> social network (twitter).
>>>> The superbe Wicket's website welcome everyone who wants to adopt Wicket.
>>>> 
>>>> How the 50% of the 66% who don't know Wicket could be targeted ?
>>>> 
>>>> By increasing the buzz.
>>>> We can increase the buzz by more articles in which we could give
>> specific examples where Wicket has strong value,
>>>> write beautiful small examples to demonstrate the beauty of our beloved
>> framework (this is what Vaadin has been doing since few months ),
>>>> nice conference's coverage (ApacheCon video on youtube) 
>>>> 
>>>> By improving its impact using redundancy.
>>>> Mentioning Wicket'skills on dev's social network profile (linkedin) !
>> (very few do it) is one example.
>>>> By retweeting, by mentioning Wicket more often, 
>>>> 
>>>> 
>>>> 2) Word of Mouth) (WOM)
>>>> Word of Mouth is the passing of information from person to person by
>> oral communication (Wikipedia)
>>>> WOM is the second channel, with an equal importance for Wicket Adoption.
>>>> 
>>>> Word of Mouth is made of by the developers and project managers
>> feedbacks.
>>>> A lot has been done, through a nice and complete user guide to make the
>> learning curve easier.
>>>> 
>>>> if I think we should focus on who who don't know Wicket, I think we
>> must hava 

Re: Iterate through lines from datatable with editable columns

2016-11-15 Thread Francois Meillet
Looks like some formcomponent (or form) validation fails.
So the model is not updated.

François



> Le 15 nov. 2016 à 15:45, ganea iulia  a écrit :
> 
> Hello,
> I m using wicket 7.5.
> 
> I have a datatable, where some of the columns contain editable components:
> -dropdownchoices
> -checkboxes
> -TextFields
> 
> 
> After I edit some of the editable cells, when hitting a process button, I
> need to iterate through all lines from the datatable and save the changes.
> But I cannot see the changes. The initial values always appear.
> 
> Could you please advise on how I can iterate through a DataTable, and get
> the values of the cells as they are shown?
> 
> Thank you.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: bypass the FormComponent # validateRequired()

2016-11-14 Thread Francois Meillet
Hi Martin,

Thanks, I did not see #onValidateModelObjects() which is perfect.

François



> Le 14 nov. 2016 à 21:01, Martin Grigorov  a écrit :
> 
> Hi François,
> 
> 
> On Thu, Nov 10, 2016 at 6:34 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I have a main form which may contain one to multiple subforms.
>> Subform's models have validations constraints annotations and I can't
>> modify the models source code. (then I can’t remove the constraints
>> annotations)
>> 
>> Each subform has 1 button.
>> When clicked, complete validation is done, which is fine.
>> 
>> The main form has 1 button.
>> When clicked, the main form must validate the data, but in the
>> FormComponent # validate() teh use case is to bypass the FormComponent #
>> validateRequired();
>> 
>> I thought I could override
>> form # process(IFormSubmitter submittingComponent) in order to make all
>> the formcomponents not required before the validation occurs but
>> internalOnValidateModelObjects() is private.
>> 
>> Do you have an idea on how to do it ?
>> 
> 
> Why do you need to use #internalOnValidateModelObjects() ?
> It immediately
> calls org.apache.wicket.markup.html.form.Form#onValidateModelObjects()
> which is OK for extension.
> 
> 
>> 
>> François
>> 
>> 
>> 
>> 
>> -
>> 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: CsrfPreventionRequestCycleListener Link 400

2016-11-14 Thread Francois Meillet
Thanks a lot you very detailed information.

François


> Le 14 nov. 2016 à 09:25, Emond Papegaaij  a écrit 
> :
> 
> Hi François,
> 
> Since 8.0.0-M2 (and 7.5.0) the CsrfPreventionRequestCycleListener will block 
> requests without an Origin and Referer header. The reason for this is that is 
> possible for an attacker to prevent a browser from sending a referer header 
> (for example with rel="noreferrer"). When you open a link in a new tab, your 
> browser probably does not send these headers and Wicket blocks the action-
> request.
> 
> You can configure this behavior in CsrfPreventionRequestCycleListener with 
> setNoOriginAction. As said, the default is 'ABORT'. If you set it to 
> 'SUPPRESS', Wicket will render the page, but not execute Link.onClick. This 
> will open the new tab with the page containing the link. If you set it to 
> 'ALLOW', Wicket will allow the request, but this may undermine the protection 
> offered by CsrfPreventionRequestCycleListener.
> 
> If your link simply points to a different page, I'd recommend to use a 
> BookmarkablePageLink. A request to simply render a page will never be blocked 
> by CsrfPreventionRequestCycleListener, so a BookmarkablePageLink will always 
> work. Naturaly for this to work, your target page needs to be bookmarkable.
> 
> You can also subclass CsrfPreventionRequestCycleListener and override 
> 'protected boolean isChecked(IRequestHandler handler)' to whitelist specific 
> requests. Perhaps you can tag safe links and skip checking those. This 
> solution offers you the most flexibility, but requires more work and you need 
> to be very precise in what requests to allow.
> 
> Best regards,
> Emond
> 
> 
> On zondag 13 november 2016 18:33:52 CET Francois Meillet wrote:
>> Hi,
>> 
>> When I use a CsrfPreventionRequestCycleListener, clicking a Link<> while
>> holding the command key does not open link in new tab. (Wicket 8.0.0-M2 /
>> OSX)
>> 
>> I get this error :
>> 
>> HTTP ERROR 400
>> Problem accessing /. Reason: Origin does not correspond to request
>> 
>> 
>> Clicking a BookmarkablePageLink is ok.
>> 
>> 
>> François
>> 
>> 
>> -
>> 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
> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



CsrfPreventionRequestCycleListener Link 400

2016-11-13 Thread Francois Meillet
Hi,

When I use a CsrfPreventionRequestCycleListener, clicking a Link<> while 
holding the command key does not open link in new tab.
(Wicket 8.0.0-M2 / OSX)

I get this error : 

HTTP ERROR 400
Problem accessing /. Reason: Origin does not correspond to request


Clicking a BookmarkablePageLink is ok.


François


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



bypass the FormComponent # validateRequired()

2016-11-10 Thread Francois Meillet
Hi,

I have a main form which may contain one to multiple subforms.
Subform's models have validations constraints annotations and I can't modify 
the models source code. (then I can’t remove the constraints annotations)

Each subform has 1 button.
When clicked, complete validation is done, which is fine.

The main form has 1 button.
When clicked, the main form must validate the data, but in the FormComponent # 
validate() teh use case is to bypass the FormComponent # validateRequired();

I thought I could override 
form # process(IFormSubmitter submittingComponent) in order to make all the 
formcomponents not required before the validation occurs but 
internalOnValidateModelObjects() is private.

Do you have an idea on how to do it ?

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: public static IModel of(IModel model)

2016-11-01 Thread Francois Meillet
Hi Martin,

Got it !!!
Was IModel.of !

Thanks
François



> Le 1 nov. 2016 à 13:25, Martin Grigorov  a écrit :
> 
> Hi Francois,
> 
> Do you mean
> https://github.com/apache/wicket/commit/4f07ee164627e5d95516e42712b30cb6b72250e3
> ?
> Or
> https://github.com/apache/wicket/commit/533431d7ebda97f5c77a3d8bc1b2445fa5caebfb
> ?
> 
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Tue, Nov 1, 2016 at 1:02 PM, Francois Meillet > wrote:
> 
>> Hi,
>> 
>> Why this helper method public static  IModel of(IModel model) has
>> been removed from Wicket 8 ?
>> Was useful for me !
>> 
>> François
>> 
>> 
>> 
>> 
>> -
>> 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



public static IModel of(IModel model)

2016-11-01 Thread Francois Meillet
Hi,

Why this helper method public static  IModel of(IModel model) has been 
removed from Wicket 8 ?
Was useful for me !

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Twitter poll result 2

2016-11-01 Thread Francois Meillet
Hi,

Following Tobias Soloschenko thread about the Twitter poll result

I think we should focus on who who don't know Wicket.
People who don't like Wicket, the unhappy users, will not come back.

Only 34% of the respondents know what is Apache Wicket.
Put another way 66% don't ever know what is Wicket.


A) Apache Wicket's Adoption
——
Adoption (software or any good) has 2 channels : buzz and word of mouth.
For many authors word of mouth (WOM) influence 50% of the acquisition decision.

So to increase Wicket Adoption we have 2 choices : 

1) Wicket buzz) 
The buzz channel is done via articles, conferences (ApacheCon), meetup, social 
network (twitter).
The superbe Wicket's website welcome everyone who wants to adopt Wicket.

How the 50% of the 66% who don't know Wicket could be targeted ?

By increasing the buzz.
We can increase the buzz by more articles in which we could give specific 
examples where Wicket has strong value, 
write beautiful small examples to demonstrate the beauty of our beloved 
framework (this is what Vaadin has been doing since few months ), 
nice conference's coverage (ApacheCon video on youtube) 

By improving its impact using redundancy.
Mentioning Wicket'skills on dev's social network profile (linkedin) ! (very few 
do it) is one example.
By retweeting, by mentioning Wicket more often, 


2) Word of Mouth) (WOM)
Word of Mouth is the passing of information from person to person by oral 
communication (Wikipedia)
WOM is the second channel, with an equal importance for Wicket Adoption.

Word of Mouth is made of by the developers and project managers feedbacks.
A lot has been done, through a nice and complete user guide to make the 
learning curve easier.

if I think we should focus on who who don't know Wicket, I think we must hava a 
clear understanding why developers don't like Wicket.
Understanding the difficulties and dislikes is very important. And should be 
done without affect.



B) Difficulties and dislikes:
——
In many projects, developers start writing few pages, using the examples.
Most of the time developers have difficulties understanding models, and while 
trying to implement the functionalities that have to be done for yesterday,
they still do not masterise theirs models, and do not pay attention to their 
codes. 
They just do not have time for these 2 tasks. They have to deliver. Bugs will 
be fixed after.

They do copy and paste to implement first functionalities, and after few weeks, 
the code is so messy that you start thinking at the servlet / jsp … !
The style of coding we can find in the Wicket Examples is used to write ugly 
classes.
In many places I have seen pages with more than few thousand lines.

No one wants to read it before lunch time or a friday afternoon !
And as in any corporation, developers attempt to name a culprit. From outside 
the developer's corporation.
Guess what ?
This is the time Wicket starts to receive a bad reputation.
And this is where this bad reputation stops the natural spreading Wicket’ usage 
between developers, between teams in a company, between companies.
Word of mouth adoption channel is closed here.

And needless to say, when new developers arrive on this kind of existing 
project, they are not in a "wicket's loving mood".
Difficult to understand, difficult to maintain.
And you know, the first meeting is important !

We can improve a lot Wicket Examples's value by having more comments or a 
better pedagogical naming convention.
A "test yourself" page where developers can test their Wicket’s skills, with 
the correct answer and with the minimum level score to start using Wicket with 
ease, could be interresting.
But it's not good enough.

The difficulties I have found in many places are : Model, Page, Granularity
Model, Page, Granularity : from my clients, these 3 points are the "dislike's 
culprit"  : 

Models seem to be difficult to masterise, but it’s a core concept. Getting 
Models proficiency is the key.
Writing page (java code) that are well structured, have nice code, are easy to 
read should be highlighted (even if it’s more a Java skill than a Wicket’s one)
How granular should components be organized is a not an "exact science" and 
some best practices, examples could help a lot.


François
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Problems with Wicket 7.5.0 and Wicket Bootstrap 0.10.10 using a custom NotificationPanel

2016-10-27 Thread Francois Meillet
super !

François



> Le 27 oct. 2016 à 15:17, Martin Grigorov  a écrit :
> 
> 0.10.11 should be at Maven Central any time soon!
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Oct 27, 2016 at 3:06 PM, Martin Grigorov 
> wrote:
> 
>> The release script is running...
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Thu, Oct 27, 2016 at 3:03 PM, Francesco Chicchiriccò <
>> ilgro...@apache.org> wrote:
>> 
>>> 
>>> 
>>> On 2016-10-27 14:40 (+0200), Joachim Rohde  wrote:
 Great. Thanks for the fast reply Martin. Do you have already a clue
>>> when a new version of Wicket Bootstrap will be released?
>>> 
>>> ..or an easy way to backport your fix?
>>> 
>>> Regards.
>>> 
>>> 
>>> -
>>> 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



BootstrapPagingNavigator - Wicket-Boostrap 0.10.10 and Wicket 7.5.0

2016-10-27 Thread Francois Meillet
Wicket-Boostrap 0.10.10 and Wicket 7.5.0
When using a BootstrapPagingNavigator, I get this error : 


Last cause: The component(s) below failed to render. Possible reasons could be 
that: 1) you have added a component in code but forgot to reference it in the 
markup (thus the component will never be rendered), 2) if your components were 
added in a parent container then make sure the markup for the child container 
includes them in .

1. [Component id = pageNumber]
The label with id 'pageNumber' that failed to render was constructed
 at 
de.agilecoders.wicket.core.markup.html.bootstrap.navigation.BootstrapPagingNavigator$1.populateItem(BootstrapPagingNavigator.java:106)
 at org.apache.wicket.Page.onBeforeRender(Page.java:801)
 at org.apache.wicket.Page.internalPrepareForRender(Page.java:242)
 at org.apache.wicket.Page.renderPage(Page.java:1018)
 at 
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124)
 at 
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:236)
 at 
org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
 at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
 at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
 at 
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)

With Wicket 7.4.0, all is fine

François

Re: Check Group selected items called from other form loses the checked values

2016-10-20 Thread Francois Meillet
t; protected void populateItem(Item item) {
> 
>  item.add(new Label("itemName", new
> PropertyModel(item.getModel(), "name")));
>  item.add(new Label("itemCode", new
> PropertyModel(item.getModel(), "code")));
>  item.add(new Label("itemId", new PropertyModel(item.getModel(),
> "id")));
>  Check chk = new Check("itemCheck", item.getModel(),
> group);
> 
>  item.add(chk);
> }
>  });
> group.add(itemsContainer);
> add(group);
> }
> 
> @Override
> protected void onSubmit() {
> 
> logger.info <http://logger.info/>("OnSubmit");
> System.out.println("size=" + checkedTestBeans.size());
> 
> }
> }
> 
> 
> =HTML=
> 
>width="100%">
> 
> 
>  title="prints blue tags for selected elements" />
> 
> 
> 
>
> 
> 
>  width="100%">
> 
> 
> Name
> Code
> 
> 
> Id
> 
> 
> 
> 
> 
>   
> 
> 
> 
> 
> 
>  />
> 
> 
>   
>  
> 
> 
>  name="btnSave" value="OK" />
> 
>   
> 
> 
> 
> 
> 
> On Wed, Oct 19, 2016 at 7:24 PM, Francois Meillet <
> francois.meil...@gmail.com <mailto:francois.meil...@gmail.com>> wrote:
> 
>> Have a look at
>> 
>> https://cwiki.apache.org/confluence/display/WICKET/ 
>> <https://cwiki.apache.org/confluence/display/WICKET/>
>> Listview+with+checkboxes <https://cwiki.apache.org/ 
>> <https://cwiki.apache.org/>
>> confluence/display/WICKET/Listview+with+checkboxes>
>> 
>> https://www.mkyong.com/wicket/wicket-multiple-checkboxes-example- 
>> <https://www.mkyong.com/wicket/wicket-multiple-checkboxes-example->
>> checkboxmultiplechoice/ <https://www.mkyong.com/wicket/wicket-multiple- 
>> <https://www.mkyong.com/wicket/wicket-multiple->
>> checkboxes-example-checkboxmultiplechoice/>
>> 
>> 
>> 
>> François
>> 
>> 
>> 
>>> Le 19 oct. 2016 à 16:11, ganea iulia >> <mailto:superbiss...@gmail.com>> a écrit :
>>> 
>>> Hello,
>>> 
>>> I have actually made this to work by adding this behaviour to the
>>> checkgroup:
>>> 
>>> group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>>>   private static final long serialVersionUID =
>>> 1654345477970524731L;
>>> 
>>>   @Override
>>>   protected void onUpdate(AjaxRequestTarget target) {
>>>   target.add(group);
>>>   }
>>> 
>>>   });
>>> 
>>> However, now I face following issue:
>>> If I replace my ListView component, with a RefreshingView, I cannot check
>>> any of the checks from the items. I check it, but then it gets unchecked
>>> right away.
>>> This is because the RefreshingView repaints its model at every roundtrip
>> to
>>> the server.
>>> 
>>> I have tried this:
>>> http://stackoverflow.com/questions/12282492/add-row-to- 
>>> <http://stackoverflow.com/questions/12282492/add-row-to->
>> refreshingview-without-repainting-entire-refreshingview
>>> by setting:
>>> listOfItems.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>>> 
>>> But it did not change a thing for me.
>>> 
>>> Please guide on how to have a Check for every item of the RepeatingView,
>>> that can be checked.
>>> 
>>> Thank you.
>>> 
>>> 
>>> 
>>> On Tue, Oct 18, 2016 at 1:28 PM, ganea iulia >> <mailto:superbiss...@gmail.com>>
>> wrote:
>>> 
>>>> Hi,
>>>> I have 2 forms.
>>>> 
>>>> Bottom form = testForm
>>>> - I have a listview with checkboxes.
>>>> As I needed a checkAll control also, I have uses CheckGroup,
>>>> CheckGroupSelector and Check wicket components.
>>>> 
>>>> Top form = testForm0
>>>> -I have only an link
>>>> 
>>>> The use case is the following:
>>>> I check one item (or all) in bottom form, but then I need to get the
>>>> selected values when click on link in top form.
>>>> 
>>>> The check doesn't do submit so the values are not retained. I alsways
>> get
>>>> the
>>>> size = 0 message.
>>>> 
>>>> Could you tell me how I can manage this?
>>>> 
>>>> Here 

Re: Check Group selected items called from other form loses the checked values

2016-10-19 Thread Francois Meillet
Have a look at 

https://cwiki.apache.org/confluence/display/WICKET/Listview+with+checkboxes 


https://www.mkyong.com/wicket/wicket-multiple-checkboxes-example-checkboxmultiplechoice/
 




François



> Le 19 oct. 2016 à 16:11, ganea iulia  a écrit :
> 
> Hello,
> 
> I have actually made this to work by adding this behaviour to the
> checkgroup:
> 
> group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>private static final long serialVersionUID =
> 1654345477970524731L;
> 
>@Override
>protected void onUpdate(AjaxRequestTarget target) {
>target.add(group);
>}
> 
>});
> 
> However, now I face following issue:
> If I replace my ListView component, with a RefreshingView, I cannot check
> any of the checks from the items. I check it, but then it gets unchecked
> right away.
> This is because the RefreshingView repaints its model at every roundtrip to
> the server.
> 
> I have tried this:
> http://stackoverflow.com/questions/12282492/add-row-to-refreshingview-without-repainting-entire-refreshingview
> by setting:
> listOfItems.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
> 
> But it did not change a thing for me.
> 
> Please guide on how to have a Check for every item of the RepeatingView,
> that can be checked.
> 
> Thank you.
> 
> 
> 
> On Tue, Oct 18, 2016 at 1:28 PM, ganea iulia  wrote:
> 
>> Hi,
>> I have 2 forms.
>> 
>> Bottom form = testForm
>> - I have a listview with checkboxes.
>> As I needed a checkAll control also, I have uses CheckGroup,
>> CheckGroupSelector and Check wicket components.
>> 
>> Top form = testForm0
>> -I have only an link
>> 
>> The use case is the following:
>> I check one item (or all) in bottom form, but then I need to get the
>> selected values when click on link in top form.
>> 
>> The check doesn't do submit so the values are not retained. I alsways get
>> the
>> size = 0 message.
>> 
>> Could you tell me how I can manage this?
>> 
>> Here is the code:
>> =HTML=
>> 
>>   > width="100%">
>> 
>> 
>> > />
>> 
>> 
>> 
>>
>> 
>> 
>> > width="100%">
>> 
>> 
>> Name
>> Code
>> 
>> 
>> Id
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> > />
>> 
>> 
>>   
>>  
>> 
>> 
>> > name="btnSave" value="OK" />
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>> ==JAVA==
>> private static final long serialVersionUID = 311508940740808005L;
>> private static final Logger logger = LogManager.getLogger(TestPage.class);
>> private TestForm tst;
>> 
>> public TestPage(IModel model) {
>> super(model);
>> 
>> TestForm0 tst0 = new TestForm0("testForm0");
>> tst0.setOutputMarkupId(true);
>> add(tst0);
>> tst = new TestForm("testForm", model);
>> tst.setOutputMarkupId(true);
>> add(tst);
>> 
>> }
>> 
>> class TestForm0 extends Form {
>> 
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> public TestForm0(String id) {
>> super(id);
>> 
>> Link print = new Link("print") {
>> private static final long serialVersionUID = 15L;
>> 
>> @Override
>> public void onClick() {
>> System.out.println("size=" + tst.getCheckedTestBeans().size());
>> }
>> };
>> add(print);
>> }
>> }
>> class TestForm extends Form {
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> private List checkedTestBeans;
>> public List getCheckedTestBeans() {
>> return checkedTestBeans;
>> }
>> 
>> public void setCheckedTestBeans(List checkedTestBeans) {
>> this.checkedTestBeans = checkedTestBeans;
>> }
>> 
>> public TestForm(String id, IModel model) {
>> super(id, model);
>> 
>> checkedTestBeans = new ArrayList();
>> TextField txtName = new TextField("txtName", new
>> PropertyModel(getModelObject(), "name"));
>> add(txtName);
>> txtName.setOutputMarkupId(true);
>> txtName.add(new AjaxFormComponentUpdatingBehavior("change") {
>> private static final long serialVersionUID = 1654345477970524731L;
>> 
>> @Override
>> protected void onUpdate(AjaxRequestTarget target) {
>> target.add(txtName);
>> }
>> 
>> });
>> 
>> SubmitLink clearForm = new SubmitLink("clearForm", this){
>> 
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> @Override
>> public void onSubmit() {
>> model.setObject(new TestBean());
>> TestForm.this.clearInput();
>> };
>> };
>> clearForm.setOutputMarkupId(true);
>> add(clearForm);
>> AjaxLink clearLink = new AjaxLink("clearLink", model)
>> {
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> @Override
>> public void onClick(AjaxRequestTarget target) {
>> model.setObject(new TestBean());
>> TestForm.this.clearInput();
>> target.add(TestForm.this);
>> txtName.setConvertedInput("");
>> 
>> }
>> 
>> };
>> clearLink.setOutputMarkupId(true);
>> add(clearLink);
>> ///
>> CheckGroup group = new CheckGroup("group",
>> checkedTestBeans);
>> CheckGroupSelector cgs = new CheckGroupSe

Re: add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration

2016-10-09 Thread Francois Meillet
Thanks Martin

François



> Le 8 oct. 2016 à 22:09, Martin Grigorov  a écrit :
> 
> Hi Francois,
> 
> You will need to
> extend 
> de.agilecoders.wicket.extensions.markup.html.bootstrap.editor.SummernoteConfig
> and add those yourself.
> "callbacks" would extend from de.agilecoders.wicket.jquery.AbstractConfig.
> "onXyz" would be be
> a de.agilecoders.wicket.jquery.function.AbstractFunction. See the default
> impls.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Sat, Oct 8, 2016 at 1:04 PM, Francois Meillet > wrote:
> 
>> Hi,
>> 
>> How can I add some javascript callbacks to Wicket-Bootstrap # Summernote
>> Editor configuration, like the following
>> 
>> 
>> $(document).ready(function () {
>> $('.summernote').summernote({
>> 
>> callbacks: {
>> onKeydown: function (e) {
>> var t = e.currentTarget.innerText;
>> if (t.trim().length >= 400) {
>> //delete key
>> // if (e.keyCode != 8)
>> // e.preventDefault();
>> }
>> },
>> onKeyup: function (e) {
>> var t = e.currentTarget.innerText;
>> $('#maxContentPost').text(400 - t.trim().length);
>> },
>> onPaste: function (e) {
>> var t = e.currentTarget.innerText;
>> var bufferText = ((e.originalEvent || e).clipboardData ||
>> window.clipboardData).getData('Text');
>> e.preventDefault();
>> var all = t + bufferText;
>> document.execCommand('insertText', false,
>> all.trim().substring(0, 400));
>> $('#maxContentPost').text(400 - t.length);
>> }
>> }
>> });
>> });
>> 
>> Thanks for your help
>> François
>> -
>> 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



Wicket-Bootstrap # Summernote Editor : placeHolder and maxlength

2016-10-08 Thread Francois Meillet
Hi,

In Wicket-Bootstrap # Summernote Editor,

How can I add a placeHolder text ?
How can I add some kind of maxlength ? 


Thanks for your help
François 




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration

2016-10-08 Thread Francois Meillet
Hi,
   
How can I add some javascript callbacks to Wicket-Bootstrap # Summernote Editor 
configuration, like the following


$(document).ready(function () {
 $('.summernote').summernote({

 callbacks: {
 onKeydown: function (e) { 
 var t = e.currentTarget.innerText; 
 if (t.trim().length >= 400) {
 //delete key
 // if (e.keyCode != 8)
 // e.preventDefault(); 
 } 
 },
 onKeyup: function (e) {
 var t = e.currentTarget.innerText;
 $('#maxContentPost').text(400 - t.trim().length);
 },
 onPaste: function (e) {
 var t = e.currentTarget.innerText;
 var bufferText = ((e.originalEvent || e).clipboardData || 
window.clipboardData).getData('Text');
 e.preventDefault();
 var all = t + bufferText;
 document.execCommand('insertText', false, 
all.trim().substring(0, 400));
 $('#maxContentPost').text(400 - t.length);
 }
 }
 });
 });

Thanks for your help
François 
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



examples7x.wicket.apache.org --> 502 Proxy Error

2016-10-04 Thread Francois Meillet
Hi,

http://examples7x.wicket.apache.org/index.html 
 is down. 
There is a 502 Proxy Error 

François





examples7x.wicket.apache.org --> 502 Proxy Error

2016-09-04 Thread Francois Meillet
http://examples7x.wicket.apache.org/index.html is down. 
There is a 502 Proxy Error

http://examples6x.wicket.apache.org/index.html is OK.

François




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow.PageCreator()#createPage() is loading login page unexpectedly sometimes

2016-08-31 Thread Francois Meillet
Javadoc from Session # replaceSession() says : Call() upon login to protect 
against session fixation.

Until Wicket version 6.21 the destroy method did not set the session id to null.
In 6.23, Session # destroy() set session#id to null, this is why Login Page is 
loaded.

Hope this helps

François



> Le 31 août 2016 à 16:21, durairaj t  a écrit :
> 
> Thank you for your quick response.
> 
> *Session:* 30 minutes.
> 
> *Html Header:*
> 
>  http://www.w3.org/TR/html4/loose.dtd";>
> http://wicket.apache.org";>
> 
> 
>
> 
>
>
> 
>
> -
>  -
>
>
>
>
>
> href="Calendar/css/border-radius.css" />
> href="Calendar/css/steel/steel.css" />
>
>
> 
> src="javascripts/pageBlocking.js">
> src="javascripts/aim-hrs-autocomplete.js">
>
>
>
>
> src="jspspellcheck/spellcheck-caller.js">
> 
> 
> 
>
>//credit: <a  rel="nofollow" href="http://psacake.com/web/js.asp">http://psacake.com/web/js.asp</a>
>function imposeMaxLength(Object, evt, MaxLen) {
>var e = window.event ? event.keyCode : evt.which
>if (e == 8 || e == 46 || (e >= 37 && e <= 40)) return true;
> //bs, del, arrows
>return (Object.value.length <= MaxLen);
>}
>
> 
>
> 
>
>div.wicket-aa {
>font-family: sans-serif;
>font-size: 12px;
>background-color: white;
>border-width: 2px;
>border-color: gray;
>border-style: solid;
>padding: 2px;
>margin: 1px 0 0 0;
>text-align: left;
>width: 120px;
>}
> 
>div.wicket-aa ul {
>list-style: none;
>padding: 2px;
>margin: 0;
>width: 100px;
>}
> 
>div.wicket-aa ul li.selected {
>background-color: #DEEFF7;
>padding: 2px;
>margin: 0;
>width: 100px;
>}
> 
>div.imxt-vista tr.imxt-grid-row:hover td.imxt-cell,
>div.imxt-vista tr.imxt-grid-row:hover td.imxt-sorted {}
>
> 
> 
> 
> 
> 
> *Java Code:*
> 
> 
> 
> String timeout= "175";
> if(AppSession.getObjAimShell() != null &&
> AppSession.getObjAimShell().getTimeoutLimit() !=null)
> timeout = "" + ((AppSession.getObjAimShell().getTimeoutLimit() * 0.9)*1000);
> final Model sessionTimeoutInterval = new Model(timeout);
> HiddenField sessionTimeoutIntervalField = new
> HiddenField("sessionTimeoutInterval", sessionTimeoutInterval) ;
> sessionTimeoutIntervalField.setOutputMarkupId(true);
> sessionTimeoutIntervalField.setMarkupId("sessionTimeoutInterval");
> add(sessionTimeoutIntervalField);
> 
> 
> *Java Script:*
> var sessionPingTime = 175;
> var sessionTimerId = null;
> 
> function resetSessionTimer() {
> try{
> if(document.getElementById('sessionTimeoutInterval')) {
> sessionPingTime = document.getElementById('sessionTimeoutInterval').value;
> }
> if(parent) {
> parent.clearTimeout(parent.sessionTimerId);
> parent.sessionTimerId = null;
> parent.sessionTimerId = parent.setTimeout("windowCloseSignOff();",
> sessionPingTime);
> }else {
> clearTimeout(parent.sessionTimerId);
> sessionTimerId = null;
> sessionTimerId = setTimeout("windowCloseSignOff();", sessionPingTime);
> }
> }catch(c){showScriptError(c, 'resetSessionTimer');}
> }
> 
> 
> On Wed, Aug 31, 2016 at 10:05 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi,
>> 
>> What is the session-timeout ?
>> Can you show the html page header ? and any java code that modify it.
>> 
>> François
>> 
>> 
>> 
>>> Le 31 août 2016 à 15:49, durairaj t  a écrit :
>>> 
>>> I'm migrating to wicket 6.23, createPage()  is working as expected in
>> many
>>> modules, but not in the below scenario.
>>> 
>>> 
>>> There is a search modal window in the application, which is used to
>> search
>>> data and keep the entire Page in session to retrieve the data back from
>> the
>>> session (for the Back button functionality).
>>> 
>>> *Issue:*
>>> 
>>> The search window is just working for 10 to 15 minutes as expected and
>> then
>>> loading Login Page suddenly.
>>>

Re: ModalWindow.PageCreator()#createPage() is loading login page unexpectedly sometimes

2016-08-31 Thread Francois Meillet
Hi,

What is the session-timeout ?
Can you show the html page header ? and any java code that modify it.

François



> Le 31 août 2016 à 15:49, durairaj t  a écrit :
> 
> I'm migrating to wicket 6.23, createPage()  is working as expected in many
> modules, but not in the below scenario.
> 
> 
> There is a search modal window in the application, which is used to search
> data and keep the entire Page in session to retrieve the data back from the
> session (for the Back button functionality).
> 
> *Issue:*
> 
> The search window is just working for 10 to 15 minutes as expected and then
> loading Login Page suddenly.
> 
> In debug: (I verified the below in the eclipse debugging mode)
> 
>  1. Returning page from session
>  2. Page from session is *NOT *null.
>  3. Session ID is *NOT *modified anywhere in the application.
>  4. It is just happening only in the search window until I'm clearing the
> Search Page object (SrcPage) . But application is not asking me to re-login
> once it happened.
> 
> *Code snippet:*
> 
>  public Page createPage() {
> return AppSession.getObjAppShell().getSrcPage();
> });
> 
> 
> *Reproducing Issue:*
> 
> I can reproduce the issue by replacing the session in the createPage()
> block, but I'm not sure whether the problem is session or something else.
> 
> Example;
> 
> public Page createPage() {
> Session.get().replaceSession();// used to reproduce the issue.
>return
> AppSession.getObjAppShell().getSrcPage();
> });
> 
> 
> *Any help?*
> 
> 
> 
> 
> Thank you.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Style Sheet in page head

2016-07-07 Thread Francois Meillet
If you look at what is sent by Wicket   (open the Wicket Ajax Debug panel or 
use a debugging proxy like Charles Proxy),
you will see 












The id and type with null value are just extrapolated and added by tools 
(firebugs and so on), but are not in the html page.

François



> Le 7 juil. 2016 à 13:12, Peter Henderson  a 
> écrit :
> 
> Thanks François
> 
> 
> 
> On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
> francois.meil...@gmail.com <mailto:francois.meil...@gmail.com>> wrote:
> 
>> You don't define id and type so there are null.
>> 
>> just add id="yourid" type="text/css"
>> 
>> 
>>  
>> 
>> 
>> 
> Although MDN shows examples without an id or type [1].
> The examples shown by the  html5 standards [2] page also don't have type
> and id for style sheets.
> 
> 
> 
> [1]https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples 
> <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples>
> [2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element 
> <https://www.w3.org/TR/html5/document-metadata.html#the-link-element>
> 
> 
> 
> 
>> François
>> 
>> 
>> 
>>> Le 7 juil. 2016 à 12:24, Peter Henderson 
>> a écrit :
>>> 
>>> Hello,
>>> 
>>> 
>>> I might have found a small bug.
>>> 
>>> I have a control which has a style sheet link in its head section.
>>> This control is used within a ListView but is initially hidden.
>>> An ajax action causes the control to become visible.
>>> 
>>> The style sheet link added to the page head looks malformed.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Full page reload corrects the header link.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Am I doing something wrong or is this a bug?
>>> 
>>> 
>>> I've created a quick start which is available
>>> https://github.com/bollinger/wicket-style-bug
>>> 
>>> 
>>> Thanks
>>> 
>>> --
>>> Peter Henderson
>>> 
>>> Director
>>> Starjar Ltd.
>>> www.starjar.com
>>> 0330 088 1662
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
>> <mailto:users-unsubscr...@wicket.apache.org>
>> For additional commands, e-mail: users-h...@wicket.apache.org 
>> <mailto:users-h...@wicket.apache.org>
>> 
>> 
> 
> 
> -- 
> Peter Henderson
> 
> Director
> Starjar Ltd.
> www.starjar.com <http://www.starjar.com/>
> 0330 088 1662



Re: Style Sheet in page head

2016-07-07 Thread Francois Meillet
You don't define id and type so there are null.

just add id="yourid" type="text/css"


  


François



> Le 7 juil. 2016 à 12:24, Peter Henderson  a 
> écrit :
> 
> Hello,
> 
> 
> I might have found a small bug.
> 
> I have a control which has a style sheet link in its head section.
> This control is used within a ListView but is initially hidden.
> An ajax action causes the control to become visible.
> 
> The style sheet link added to the page head looks malformed.
> 
> 
>  
> 
> 
> Full page reload corrects the header link.
> 
> 
>  
> 
> 
> Am I doing something wrong or is this a bug?
> 
> 
> I've created a quick start which is available
> https://github.com/bollinger/wicket-style-bug
> 
> 
> Thanks
> 
> -- 
> Peter Henderson
> 
> Director
> Starjar Ltd.
> www.starjar.com
> 0330 088 1662


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket:head and ajax updates

2016-06-02 Thread Francois Meillet
Hi Ravi,

a stupid question : are you sure the updated value is different from the 
original value ?

François 








> Le 2 juin 2016 à 11:07, Ravi  a écrit :
> 
> @Ernesto
> I added the version to my post.
> 
> @Martin
> It is present in the Ajax response as well as in the page markup.
> The page renders correctly the first time. Only the Ajax update does not
> occur in the head.
> I'll try to strip it down somewhat.
> 
> Usually I don't use wicket:head. So I wasn't sure if I'm missing something.
> 
> You have a point there martin, but since this is a base component for
> multiple applications, we try to keep the applications itself as lean as
> possible.
> 
> Ravi
> 
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/wicket-head-and-ajax-updates-tp4674827p4674830.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: Trouble updating ListEditor with a detachable model

2016-04-11 Thread Francois Meillet
Do you use session.save(object) ?
Should be session.saveOrUpdate(object) or session.update(object)

François 








Le 11 avr. 2016 à 23:34, ChambreNoire  a écrit :

> Hi,
> 
> I'm trying to use the ListEditor component from the Wicket in Action blog
> (). I'm giving it a PropertyModel that points to "parent.children" where
> parent is a LDM that loads a 'parent' from the database. It displays
> properly however when I update the TextFields added to the ListItems and try
> to save the parent, I get the following persistence exception
> "org.hibernate.NonUniqueObjectException: a different object with the same
> identifier value was already associated with the session".
> 
> I get the feeling that this is due to the way the ListEditor handles the
> model update. What would be required to adapt it to my usage?
> 
> Many Thanks,
> 
> CN
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Trouble-updating-ListEditor-with-a-detachable-model-tp4674272.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: Panel.this always giving previous version of the object but not the modified one.

2016-04-11 Thread Francois Meillet
Hi,

In order to help you, you should show us the code you use for the 
MyTextFieldPanel class and the modal window content  (The PageCreator or the 
component you use).

Even better, try to do a quickstart.
https://wicket.apache.org/start/quickstart.html

François









Le 11 avr. 2016 à 22:47, durairaj t  a écrit :

> Class name replaced with the correct name in the code snippet;
> 
> .
> 
> 
> public class *MyTextFieldPanel *extends Panel
> 
> 
> modalShuttleWindow.setWindowClosedCallback(new
> ModalWindow.WindowClosedCallback() {
> 
> public void onClose(AjaxRequestTarget target) {
> 
> target.add(*MyTextFieldPanel.this*);
> 
> onWindowClose(target);
> 
> }
> 
> });
> 
> On Mon, Apr 11, 2016 at 4:42 PM, durairaj t  wrote:
> 
>> Hi,
>> 
>> 
>> 
>> I'm using "*new* ModalWindow.WindowClosedCallback(){}" to update the
>> modified value in a text field box by invoking the * target.add(*
>> *MyTextFieldPanel.this**)*, but it is always giving the old values.
>> 
>> 
>> I'm seeing only old values in *MyTextFieldPanel.this. *
>> 
>> 
>> Code snippet for a clear picture.
>> 
>> 
>> public class AimShuttleTextFieldPanel extends Panel
>> 
>> 
>> modalShuttleWindow.setWindowClosedCallback(new
>> ModalWindow.WindowClosedCallback() {
>> 
>> public void onClose(AjaxRequestTarget target) {
>> 
>> target.add(*MyTextFieldPanel.this*);
>> 
>> onWindowClose(target);
>> 
>> }
>> 
>> });
>> 
>> 
>> Any help?
>> 
>> 
>> 
>> Thanks,
>> 



Re: Is there any pointers to change the markup header of a column or propertyColumn ?

2016-03-09 Thread Francois Meillet
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.



Re: Wicket model problem

2016-02-20 Thread Francois Meillet
Very interesting discussion.
Yes I agree, IDetachListener should only be used as a checker in dev.

François 








Le 20 févr. 2016 à 12:54, Martin Grigorov  a écrit :

> Hi,
> 
> You might be interested in this discussion:
> http://markmail.org/message/qttwc5kunubl6ieo
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Fri, Feb 19, 2016 at 7:19 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> You can also use a IDetachListener to check that no one LDM (field) is
>> attached after the page#detach() has been called.
>> 
>> In the Application#init() you can add
>> 
>> getFrameworkSettings().setDetachListener(
>> 
>>new IDetachListener() {
>> 
>>@Override
>>public void onDetach(Component component) {
>> 
>>for (Field field :
>> component.getClass().getDeclaredFields()) {
>>field.setAccessible(true);
>> 
>>Class theClass = field.getType();
>>if
>> (LoadableDetachableModel.class.isAssignableFrom(theClass)) {
>> 
>>try {
>>if (((LoadableDetachableModel)
>> field.get(component)).isAttached()) {
>>System.err.println("warning:
>> component:" + component.getClass().getName() + " / " + field.getName() + "
>> is attached");
>>}
>>}
>>//
>>catch (IllegalAccessException e) {
>>e.printStackTrace();
>>}
>>}
>>}
>>}
>> 
>>@Override
>>public void onDestroyListener() {
>> 
>>}
>>}
>>);
>> 
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Le 19 févr. 2016 à 16:47, Bas Gooren  a écrit :
>> 
>>> Hi,
>>> 
>>> I think the only way to track this is with custom code (or with aspects
>> for example).
>>> 
>>> Since the contract of IModel only has detach() (and not isDetached()),
>> this cannot be tracked easily.
>>> 
>>> What I would do in such a case is probably to add a requestcyclelistener
>> which walks a page after a request, iterates (/visits) over all the
>> components and checks their models.
>>> Of course this requires the models to expose a way to check their status
>> and origin.
>>> 
>>> Also, what we do to prevent this: we have an abstract base model called
>> a AbstractConversionModel which takes a parent model (S) and converts
>> to a target type (T), caching the conversion.
>>> This model takes a parent model as input (and subclasses of it require a
>> java 8 Function or expose an abstract method for the conversion etc).
>>> This model also takes care of detaching the parent model.
>>> 
>>> In the end it’s all about education I guess: programmer’s should be
>> careful when chaining models and ensure they detach the parent (/chained)
>> model.
>>> 
>>> Met vriendelijke groet,
>>> Kind regards,
>>> 
>>> Bas
>>> 
>>> Op 19 februari 2016 bij 15:41:03, gmparker2000 (greg.par...@brovada.com)
>> schreef:
>>> 
>>> Thanks for the reply. I suspect this is exactly the case we have created
>> for
>>> ourselves. Although we have a good grasp on the detach process I suspect
>>> that there are places where this rule of thumb is not being followed.
>>> Although the example I gave is somewhat fictitious, any of the LDMs we
>> have
>>> in our framework perform a detach on the parent. In the form there are
>>> numerous places where adhoc anonymous models are created and this is
>>> probably where the problems occur. Is there a recommended way to track
>>> these down? I ended up recompiling a version of Wicket with changes to
>>> LoadableDetachableModel that would essentially track every LDM within a
>>> RequestCycle. At the end of a request cycle I was left with a list of the
>>> models that never got detached. I also added a "whereAmI" member variable
>>> to LDM that would capture the stack trace in the constructor so I could
>>> figure out who instantiated the model in the first place.
>>> 
>>> --
>>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-model-problem-tp4673620p4673664.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>> 
>> 



Re: Wicket model problem

2016-02-19 Thread Francois Meillet
You can also use a IDetachListener to check that no one LDM (field) is attached 
after the page#detach() has been called. 

In the Application#init() you can add

getFrameworkSettings().setDetachListener(

new IDetachListener() {

@Override
public void onDetach(Component component) {

for (Field field : 
component.getClass().getDeclaredFields()) {
field.setAccessible(true);

Class theClass = field.getType();
if 
(LoadableDetachableModel.class.isAssignableFrom(theClass)) {

try {
if (((LoadableDetachableModel) 
field.get(component)).isAttached()) {
System.err.println("warning: component:" + 
component.getClass().getName() + " / " + field.getName() + " is attached");
}
}
//
catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}

@Override
public void onDestroyListener() {

}
}
);


François 








Le 19 févr. 2016 à 16:47, Bas Gooren  a écrit :

> Hi,
> 
> I think the only way to track this is with custom code (or with aspects for 
> example).
> 
> Since the contract of IModel only has detach() (and not isDetached()), this 
> cannot be tracked easily.
> 
> What I would do in such a case is probably to add a requestcyclelistener 
> which walks a page after a request, iterates (/visits) over all the 
> components and checks their models.
> Of course this requires the models to expose a way to check their status and 
> origin.
> 
> Also, what we do to prevent this: we have an abstract base model called a 
> AbstractConversionModel which takes a parent model (S) and converts to a 
> target type (T), caching the conversion.
> This model takes a parent model as input (and subclasses of it require a java 
> 8 Function or expose an abstract method for the conversion etc).
> This model also takes care of detaching the parent model.
> 
> In the end it’s all about education I guess: programmer’s should be careful 
> when chaining models and ensure they detach the parent (/chained) model.
> 
> Met vriendelijke groet,
> Kind regards,
> 
> Bas
> 
> Op 19 februari 2016 bij 15:41:03, gmparker2000 (greg.par...@brovada.com) 
> schreef:
> 
> Thanks for the reply. I suspect this is exactly the case we have created for  
> ourselves. Although we have a good grasp on the detach process I suspect  
> that there are places where this rule of thumb is not being followed.  
> Although the example I gave is somewhat fictitious, any of the LDMs we have  
> in our framework perform a detach on the parent. In the form there are  
> numerous places where adhoc anonymous models are created and this is  
> probably where the problems occur. Is there a recommended way to track  
> these down? I ended up recompiling a version of Wicket with changes to  
> LoadableDetachableModel that would essentially track every LDM within a  
> RequestCycle. At the end of a request cycle I was left with a list of the  
> models that never got detached. I also added a "whereAmI" member variable  
> to LDM that would capture the stack trace in the constructor so I could  
> figure out who instantiated the model in the first place.  
> 
> --  
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-model-problem-tp4673620p4673664.html
>   
> Sent from the Users forum mailing list archive at Nabble.com.  
> 
> -  
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  
> For additional commands, e-mail: users-h...@wicket.apache.org  
> 



Re: Wicket model problem

2016-02-19 Thread Francois Meillet
see the LoadableDetachableModel # isAttached() method which return the attached 
status of this model instance 

François 








Le 19 févr. 2016 à 16:47, Bas Gooren  a écrit :

> Hi,
> 
> I think the only way to track this is with custom code (or with aspects for 
> example).
> 
> Since the contract of IModel only has detach() (and not isDetached()), this 
> cannot be tracked easily.
> 
> What I would do in such a case is probably to add a requestcyclelistener 
> which walks a page after a request, iterates (/visits) over all the 
> components and checks their models.
> Of course this requires the models to expose a way to check their status and 
> origin.
> 
> Also, what we do to prevent this: we have an abstract base model called a 
> AbstractConversionModel which takes a parent model (S) and converts to a 
> target type (T), caching the conversion.
> This model takes a parent model as input (and subclasses of it require a java 
> 8 Function or expose an abstract method for the conversion etc).
> This model also takes care of detaching the parent model.
> 
> In the end it’s all about education I guess: programmer’s should be careful 
> when chaining models and ensure they detach the parent (/chained) model.
> 
> Met vriendelijke groet,
> Kind regards,
> 
> Bas
> 
> Op 19 februari 2016 bij 15:41:03, gmparker2000 (greg.par...@brovada.com) 
> schreef:
> 
> Thanks for the reply. I suspect this is exactly the case we have created for  
> ourselves. Although we have a good grasp on the detach process I suspect  
> that there are places where this rule of thumb is not being followed.  
> Although the example I gave is somewhat fictitious, any of the LDMs we have  
> in our framework perform a detach on the parent. In the form there are  
> numerous places where adhoc anonymous models are created and this is  
> probably where the problems occur. Is there a recommended way to track  
> these down? I ended up recompiling a version of Wicket with changes to  
> LoadableDetachableModel that would essentially track every LDM within a  
> RequestCycle. At the end of a request cycle I was left with a list of the  
> models that never got detached. I also added a "whereAmI" member variable  
> to LDM that would capture the stack trace in the constructor so I could  
> figure out who instantiated the model in the first place.  
> 
> --  
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-model-problem-tp4673620p4673664.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: JsonRequestLogger --> JsonMappingException --> StackOverflowError Infinite recursion

2016-02-18 Thread Francois Meillet
sounds good

François 








Le 18 févr. 2016 à 10:43, Martin Grigorov  a écrit :

> I'd suggest to fix it by:
> 1) in Wicket 7.x upgrade Jackson to 2.6.latest and add the second method
> 2) in Wicket 8.x upgrade to 2.7.latest and update the argument.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Feb 18, 2016 at 10:39 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> 
>> Before the 7.0.0 release, wicket-extension used
>> 
>>org.codehaus.jackson
>>jackson-mapper-asl
>>1.8.5
>> 
>> So no change can be done.
>> 
>> 
>> 7.0.0, 7.1.0 and 7.2.0 use
>> 
>>com.fasterxml.jackson.core
>>jackson-databind
>>2.4.1.3
>> 
>> 
>> 
>> JacksonAnnotationIntrospector
>> 
>>/**
>> * @deprecated (since 2.3) Use {@link #findFilterId(Annotated)} instead
>> */
>>@Deprecated
>>@Override
>>public Object findFilterId(AnnotatedClass ac) {
>>return _findFilterId(ac);
>>}
>> 
>>@Override
>>public Object findFilterId(Annotated a) {
>>return _findFilterId(a);
>>}
>> 
>> so the findFilterId(Annotated a) can be used in the JsonRequestLogger #
>> FilteredIntrospector
>> 
>> 
>> findFilterId(AnnotatedClass ac) has been removed from the 2.7 release.
>> 
>> 
>> The sole Wicket' class using Jackson I found is
>> JacksonAnnotationIntrospector,
>> so using Jackson 2.7.1 release can be done.
>> Tested. ok.
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Le 18 févr. 2016 à 09:43, Martin Grigorov  a écrit :
>> 
>>> Good!
>>> 
>>> The question now is how to introduce this change without breaking old
>>> applications.
>>> Having both methods looks like a solution but it may break if the
>>> application uses older version of Jackson.
>>> I think it should work.
>>> Can you try it ?
>>> 
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Thu, Feb 18, 2016 at 9:35 AM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
>>>> Hi Martin,
>>>> 
>>>> Jackson JacksonAnnotationIntrospector # findFilterId() method signature
>>>> has been changed
>>>> 
>>>> from findFilterId(AnnotatedClass ac) to findFilterId(Annotated a)
>>>> 
>>>> 
>>>>   in the JsonRequestLogger, changing this
>>>> 
>>>>   private static final class FilteredIntrospector extends
>>>> JacksonAnnotationIntrospector
>>>>   {
>>>>   @Override
>>>>       public Object findFilterId(AnnotatedClass ac)
>>>>   {
>>>>   return "default";
>>>>   }
>>>>   }
>>>> 
>>>> 
>>>>   to that resolved the problem
>>>> 
>>>>   private static final class FilteredIntrospector extends
>>>> JacksonAnnotationIntrospector
>>>>   {
>>>>   @Override
>>>>   public Object findFilterId(Annotated a)
>>>>   {
>>>>   return "default";
>>>>   }
>>>>   }
>>>> 
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Le 18 févr. 2016 à 08:24, Martin Grigorov  a
>> écrit :
>>>> 
>>>>> Hi,
>>>>> 
>>>>> 
>>>>> On Wed, Feb 17, 2016 at 12:10 PM, Francois Meillet <
>>>>> francois.meil...@gmail.com> wrote:
>>>>> 
>>>>>> Dear Team,
>>>>>> 
>>>>>> The JsonRequestLogger is not working correctly:
>>>>>> 
>>>>>> JsonRequestLogger --> JsonMappingException --> StackOverflowError
>>>> Infinite
>>>>>> recursion
>>>>>> 
>>>>>> Wicket : 7.2.0
>>>>>> Jackson : 2.7.1
>>>>>> 
>>>>>> JsonRequestLogger throw a JsonMappingException when 

Re: JsonRequestLogger --> JsonMappingException --> StackOverflowError Infinite recursion

2016-02-18 Thread Francois Meillet

Before the 7.0.0 release, wicket-extension used 

org.codehaus.jackson
jackson-mapper-asl
1.8.5

So no change can be done.


7.0.0, 7.1.0 and 7.2.0 use

com.fasterxml.jackson.core
jackson-databind
2.4.1.3



JacksonAnnotationIntrospector 

/**
 * @deprecated (since 2.3) Use {@link #findFilterId(Annotated)} instead
 */
@Deprecated
@Override
public Object findFilterId(AnnotatedClass ac) {
return _findFilterId(ac);
}

@Override
public Object findFilterId(Annotated a) {
return _findFilterId(a);
}

so the findFilterId(Annotated a) can be used in the JsonRequestLogger # 
FilteredIntrospector


findFilterId(AnnotatedClass ac) has been removed from the 2.7 release.


The sole Wicket' class using Jackson I found is JacksonAnnotationIntrospector,
so using Jackson 2.7.1 release can be done.
Tested. ok.

François 







Le 18 févr. 2016 à 09:43, Martin Grigorov  a écrit :

> Good!
> 
> The question now is how to introduce this change without breaking old
> applications.
> Having both methods looks like a solution but it may break if the
> application uses older version of Jackson.
> I think it should work.
> Can you try it ?
> 
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Feb 18, 2016 at 9:35 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi Martin,
>> 
>> Jackson JacksonAnnotationIntrospector # findFilterId() method signature
>> has been changed
>> 
>> from findFilterId(AnnotatedClass ac) to findFilterId(Annotated a)
>> 
>> 
>>in the JsonRequestLogger, changing this
>> 
>>private static final class FilteredIntrospector extends
>> JacksonAnnotationIntrospector
>>{
>>@Override
>>public Object findFilterId(AnnotatedClass ac)
>>{
>>return "default";
>>}
>>}
>> 
>> 
>>to that resolved the problem
>> 
>>private static final class FilteredIntrospector extends
>> JacksonAnnotationIntrospector
>>{
>>@Override
>>public Object findFilterId(Annotated a)
>>{
>>    return "default";
>>}
>>}
>> 
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Le 18 févr. 2016 à 08:24, Martin Grigorov  a écrit :
>> 
>>> Hi,
>>> 
>>> 
>>> On Wed, Feb 17, 2016 at 12:10 PM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
>>>> Dear Team,
>>>> 
>>>> The JsonRequestLogger is not working correctly:
>>>> 
>>>> JsonRequestLogger --> JsonMappingException --> StackOverflowError
>> Infinite
>>>> recursion
>>>> 
>>>> Wicket : 7.2.0
>>>> Jackson : 2.7.1
>>>> 
>>>> JsonRequestLogger throw a JsonMappingException when executing
>>>> getMapper().writeValueAsString(new RequestSessionTuple(rd, sd));
>>>> 
>>>> java.lang.RuntimeException:
>>>> com.fasterxml.jackson.databind.JsonMappingException:
>>>> Infinite recursion (StackOverflowError)
>>>> (through reference chain:
>>>> 
>> org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->
>>>> 
>>>> 
>>>> at
>>>> 
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.getLogString(JsonRequestLogger.java:141)
>>>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>>>> at
>>>> 
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.log(JsonRequestLogger.java:125)
>>>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>>>> at
>>>> 
>> org.apache.wicket.protocol.http.AbstractRequestLogger.performLogging(AbstractRequestLogger.java:325)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>> 
>> org.apache.wicket.request.cycle.RequestCycle.onInternalDetach(RequestCycle.java:620)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>> 
>> org.apache.wicke

Re: JsonRequestLogger --> JsonMappingException --> StackOverflowError Infinite recursion

2016-02-18 Thread Francois Meillet
Hi Martin,

Jackson JacksonAnnotationIntrospector # findFilterId() method signature has 
been changed

from findFilterId(AnnotatedClass ac) to findFilterId(Annotated a) 


in the JsonRequestLogger, changing this  

private static final class FilteredIntrospector extends 
JacksonAnnotationIntrospector
{
@Override
public Object findFilterId(AnnotatedClass ac)
{
return "default";
}
}   
   
   
to that resolved the problem

private static final class FilteredIntrospector extends 
JacksonAnnotationIntrospector
{
@Override
public Object findFilterId(Annotated a) 
{
return "default";
}
}
  

François 








Le 18 févr. 2016 à 08:24, Martin Grigorov  a écrit :

> Hi,
> 
> 
> On Wed, Feb 17, 2016 at 12:10 PM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Dear Team,
>> 
>> The JsonRequestLogger is not working correctly:
>> 
>> JsonRequestLogger --> JsonMappingException --> StackOverflowError Infinite
>> recursion
>> 
>> Wicket : 7.2.0
>> Jackson : 2.7.1
>> 
>> JsonRequestLogger throw a JsonMappingException when executing
>> getMapper().writeValueAsString(new RequestSessionTuple(rd, sd));
>> 
>> java.lang.RuntimeException:
>> com.fasterxml.jackson.databind.JsonMappingException:
>> Infinite recursion (StackOverflowError)
>> (through reference chain:
>> org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->
>> 
>> 
>> at
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.getLogString(JsonRequestLogger.java:141)
>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.log(JsonRequestLogger.java:125)
>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.protocol.http.AbstractRequestLogger.performLogging(AbstractRequestLogger.java:325)
>> ~[wicket-core-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.onInternalDetach(RequestCycle.java:620)
>> ~[wicket-core-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:600)
>> ~[wicket-core-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:297)
>> ~[wicket-core-7.2.0.jar:7.2.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
>> ~[wicket-core-7.2.0.jar:7.2.0]
>> at
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:694)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> at
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>> ~[jackson-databind-2.7.1.jar:2.7.1]
>> 
>> 
>> https://issues.apache.org/jira/browse/WICKET-6097
>> 
> 
> I'll debug it when I have some time.
> 
> 
>> 
>> 
>> BTW, is it worth to mainten this logger ?
>> 
> 
> AFAIK Martijn and Emond use it in their application.
> But if it fails always with this then maybe they don't use it anymore. Or
> they use it with an older version of Jackson. I've had some problems with
> Jackson backward compatibility lately.
> 
> 
>> 
>> 
>> François
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 



  1   2   3   4   >