Re: [8.3] Nested Forms within a table?

2019-04-25 Thread nino martinez wael
until next version comes out, this lump of code seems to be working:

Form actionForm=new Form<>("actionForm"){
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.setName("tr");
}
}
;


On Wed, Apr 24, 2019 at 10:28 AM Sven Meier  wrote:

>
>
> Hi Nino,
>
>
>
> I've taken the liberty of improving this with WICKET-6658:
>
> No need to let Form enforce a  -tag when it's changed into a div
> afterwards (in case of nested forms).
>
>
>
> Have fun
>
> Sven
>
>
>
>
>
>
>
>
>
>
>
>
> >
> > On 24.04.2019 at 08:45,wrote:
> >
> >
> >  normally I would agree.. But when our designer gives us the html, and
> there are tables in it we need to change that stuff.. I do not like the
> idea that the web framework forces you to change markup so that it can
> work.. One thing are to teach the devs that there are some quirks with the
> web framework (thats completely expected). But to have to teach the
> designer about a web framework so they can avoid the quirky parts seems
> wrong. Its not part of Wickets statement anyhow.  >  Just Java  &  HTML  >
>  >  Leverage what you know about Java or your favourite HTML editor to
> write  >  Wicket applications. With pure Java code and HTML markup Wicket
> is the  >  go-to web framework for purists.  >  /rant off :) On Wed, Apr
> 24, 2019 at 8:24 AM Maxim Solodovnik wrote:  >  if something "look like a
> duck, walk like a duck and sound like a duck" -  >  it is duck :)  >  CSS
> table are tables, but with no HTML '' tags :)  >   >  On Wed, 24 Apr 2019
> at 13:22, nino martinez wael  <   >  nino.martinez.
> w...@gmail.com>  wrote:  >   >   >  if its CSS its not a table right?  >
>  >   >   >   >   >   >   >  On Wed, Apr 24, 2019 at 7:25 AM Maxim
> Solodovnik  >   >  wrote:  >   >   >   >   >  Actually you can :)  >   >
>  >  But you need CSS tables for this :)  >   >   >   >   >   >  On Wed, 24
> Apr 2019 at 11:53, nino martinez wael  <   >   >   >
> nino.martinez.w...@gmail.com>  wrote:  >   >   >   >   >   >   >  I agree
> with Maxim, but I do not know the side effects, im going to  >  try  >   >
>  >   >  it.. As it is now (out of the box), we cannot have nested forms in
> >   >  tables  >   >   >   >  (for example on form per ) without breaking
> html.  >   >   >   >   >   >   >   >  -Nino  >   >   >   >   >   >   >   >
> On Wed, Apr 24, 2019 at 3:24 AM Maxim Solodovnik  <   >
> solomax...@gmail.com  >   >   >   >   >   >   >  wrote:  >   >   >   >
>  >   >   >   >   >  I would say we can create overridable method so users
> can specify  >   >  which  >   >   >   >  tag  >   >   >   >   >  to use  >
>   >   >   >   >  it will help with ``  >   >   >   >   >   >   >   >   >
>  >  On Wed, 24 Apr 2019 at 01:39, Sven Meier wrote:  >   >   >   >   >   >
>  >   >   >   >   >  Hi,  >   >   >   >   >   >   >   >   >   >   >   >  I
> think we could improve nested Forms so that only
> >
> >  tags  >  are  >   >   >   >   >   >  turned into a
> >
> > , but anything else stays as it is.  >   >   >   >   >   >   >   >   >
>  >   >   >  WDYT?  >   >   >   >   >   >  Sven  >   >   >   >   >   >   >
>  >   >   >   >   >  Am 23.04.19 um 10:01 schrieb nino martinez wael:  >
>  >   >   >   >   >   >  Hi  >   >   >   >   >   >   >   >   >   >   >   >
>  >   >  When nesting forms, the form tag are changed to an div and it  >
> is  >   >   >  hard  >   >   >   >   >   >  coded:  >   >   >   >   >   >
>  >  org/apache/wicket/markup/html/form/Form.java:1597  >   >   >   >   >
>  >   >  ...  >   >   >   >   >   >   >   >   >   >   >   >   >   >
> tag.setName("div");  >   >   >   >   >   >   >   >   >   >   >   >   >   >
> ...  >   >   >   >   >   >   >   >   >   >   >   >   >   >  If only I could
> change the tag to be tr, it would produce valid  >   >   >  html.  >   >
>  >   >   >  Are  >   >   >   >   >   >   >  it deliberate to be hardcoded?
> >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
>  >   >  -
>   >   >   >   >   >   >  To
> unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  >   >   >   >
>  >   >  For additional commands, e-mail: users-h...@wicket.apache.org  >
>  >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
>  >   >  --  >   >   >   >   >  WBR  >   >   >   >   >  Maxim aka solomax
> >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >  --  >
>  >   >   >  Best regards / Med venlig hilsen  >   >   >   >  Nino Martinez
> >   >   >   >   >   >   >   >   >   >   >   >   >  --  >   >   >  WBR  >
>  >   >  Maxim aka solomax  >   >   >   >   >   >   >   >   >  --  >   >
> Best regards / Med venlig hilsen  >   >  Nino Martinez  >   >   >   >   >
> --  >  WBR  >  Maxim aka solomax  >  -- Best regards / Med venlig hilsen
> Nino Martinez
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>



-- 
Best regards / Med venlig hilsen
Nino Martinez


LambdaModel does not implements IPropertyReflectionAwareModel

2019-04-25 Thread Gabriel Landon
Hi,

I'm moving projects from wicket 7.0 to wicket 8.0 that use the
wicket-bean-validation module for automatic validation of form (@NotNull,
@Size, ...).

I'm now using the LambdaModel instead of PropertyModel, but unfortunately,
LambdaModel does not implement IPropertyReflectionAwareModel, so I cannot
use the wicket-validation module anymore as the ValidationModelResolver
class is based on IPropertyReflectionAwareModel.

Is there another way to do validation with LambdaModel?
Or is it possible to add the interface IPropertyReflectionAwareModel to
LambdaModel?

Regards,
Gabriel.

--
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: HttpSessionDataStore in Wicket 9

2019-04-25 Thread Sven Meier
 
 
Good question.
 

 
I'll have to check this and the untouch-feature next weekend.
 

 
Many thanks
 
Sven
 
 
 

 
 
 
 
 
>  
> On 23.04.2019 at 22:37,wrote:
>  
>  
>  Or was the original version of `GaePageManagerProvider` with 2 sessions 
> stores actually correct with the first one acting as a non-serialized cache? 
> Best, Thomas On Tue, Apr 23, 2019 at 9:57 PM Thomas Heigl wrote:  >  Hi Sven, 
>  >   >  This works, but now we do not have any in-memory caching layer 
> anymore and  >  the page has to be deserialized on *every* ajax request.  >   
> >  The API does not "feel" just right as well. It is very hard to understand  
> >  what's going on and why we are overriding the `newSessionStore` method,  > 
>  without looking at the whole implementation of `DefaultPageManagerProvider`. 
>  >   >  What I'd really like to do is approximate the pre-Wicket 9 behavior 
> of my  >  provider implementation:  >   >  setPageManagerProvider(new 
> DefaultPageManagerProvider(this) {  >>  @Override  >>  protected IDataStore 
> newDataStore() {  >>  return new 
> HttpSessionDataStore(getPageManagerContext(), new  >>  
> PageNumberEvictionStrategy(10));  >>  }  >>  });  >   >   >  If I understan
d the previous implementation correctly, the store chain in  >  Wicket 8 with 
my configuration would have looked something like this:  >   >  RequestStore -> 
 *SessionCache* (in PageStoreManager) ->  InSessionStore  >   >  After every 
request, touched pages are stored in the session cache and do  >  not have to 
be deserialized on the next request to the same page.  >   >  This setup works 
very well for us and since we have an application with a  >  ton of concurrent 
users, I want to keep the configuration as close to the  >  Wicket 8 
implementation as possible when upgrading to Wicket 9.  >   >  I guess we can 
get close to the Wicket 8 setup by using the following  >  chain, but I'm not 
sure if it will behave the same and have the same memory  >  requirements:  >   
>  RequestStore ->  *InMemoryStore* (size per session = 1) ->  InSessionStore  
>   >  Do you have any other ideas on this?  >   >  If we find the right 
configuration, you could also add other default  >  implementations of
 `IPageManagerProvider` that make it easier for users  >  with custom setups to 
migrate to the new version without the strange noop  >  method overrides.  >   
>  Best,  >   >  Thomas  >   >   >   >  On Tue, Apr 23, 2019 at 8:39 PM Sven 
Meier wrote:  >   >>  Hi Thomas,  >>   >>  you're right, I've changed it to 
single InSessionStore.  >>   >>  Have fun  >>  Sven  >>   >>  Am 23.04.19 um 
09:06 schrieb Thomas Heigl:  >>   >  Hi Sven,  >>   >   >>   >  Thanks a lot 
for the quick reply!  >>   >   >>   >  Are you sure the code in 
GaePageManagerProvider is correct? Don't we  >>  end up  >>   >  with two 
instances of InSessionPageStore in this case? Once as  >>   >  
`newSessionStore` and once as `newPersistentStore`?  >>   >   >>   >  The 
resulting chain looks like this: RequestSore ->  *InSessionStore* ->   >>   >  
AsynchronousStore ->  SerializingStore ->  CryptingStore ->   >>  
*InSessionStore*  >>   >   >>   >  Best,  >>   >   >>   >  Thomas  >>   >   >>  
 >   >>   >  On Mon, Apr 22, 201
9 at 10:57 PM Sven Meier wrote:  >>   >   >>   >>  Hi Thomas,  >>   >>   >>   
>>  many thanks for testing so early!  >>   >>   >>   >>  Set a custom provider 
of the page manager, see wicketstuff's  >>   >>  gae-initializer as an example: 
 >>   >>   >>   >>  application.setPageManagerProvider(new  >>   >>  
GaePageManagerProvider(application, maxPages));  >>   >>   >>   >>   >>   >>   
>>  
https://github.com/wicketstuff/core/blob/master/gae-initializer-parent/gae-initializer/src/main/java/org/wicketstuff/gae/GaePageManagerProvider.java
  >>   >>   >>   >>  Have fun  >>   >>  Sven  >>   >>   >>   >>   >>   >>  Am 
22.04.19 um 18:47 schrieb Thomas Heigl:  >>   >>>  Hi all,  >>   >>>   >>   >>> 
 I just experimentally upgraded my application to 9.0.0-M1. Most things  >>   
>>  are  >>   >>>  straight forward, but I'm struggling with replicating my 
current page  >>   >>>  manager configuration using the new API.  >>   >>>   >> 
  >>>  My current configuration for Wicket 8 looks like this:  >>   
>>>   >>   >>>  setPageManagerProvider(new DefaultPageManagerProvider(this) {  
>>> >>     @Override  >>     protected IDataStore newDataStore() {  >>  
>>>    return new HttpSessionDataStore(getPageManagerContext(), new  >>   
>>>   PageNumberEvictionStrategy(10));  >>     }  >>     });  >>   
>>> >>>  What is the Wicket 9 equivalent of this?  >>   >>>   >>   >>>  Thanks, 
>>>  >>   >>>   >>   >>>  Thomas  >>   >>>   >>   >>  
>>> -  >>  
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  >>  For 
>>> additional commands, e-mail: users-h...@wicket.apache.org  >>   >>  
>  
 

Re: Some Wicket components freeze app when URL rewrite

2019-04-25 Thread Sven Meier
 
 
By adding the link your page becomes stateful.
 

 
So Wicket will issue a redirect to a second url with a number attached, e.g. ?1
 

 
You'll have to check what your url rewrite is doing to that redirect url.
 

 
Hope this helps
 
Sven
 

 
 

 
 
 
 
 
>  
> On 25.04.2019 at 14:03,wrote:
>  
>  
>  Hi, I am migrating an application using wicket and a network configuration a 
> bit weird, and i'm facing a unexpected behaviour. The network configuration: 
> outside | IIS URL rewrite | Weblogic with Wicket app The snippet : I have 
> simplified the app, so i reproduce the code on a quickstart-based app. 
> --html-- 
>
>   John Doe--code-- public class HomePage extends WebPage { public 
> HomePage(final PageParameters parameters) { super(parameters); add(new 
> Label("testname", "Me")); // add(new Link("changetonl"){ // @Override // 
> public void onClick() { // this.getSession().setLocale(new Locale("nl")); // 
> } // }); } } The problem : The page as stated just higher works, but if i 
> uncomment the tag  and the add(Link), the IIS server says "http code 400" and 
> i have 503 message instead of the page. Environment : -was Weblogic 10.3 with 
> wicket 1.5.10 ->  was OK -now Weblogic 12.2 with wicket 7.11 (for now) : All 
> works when using URL directly on the WL server works when using the URL from 
> outside (through IIS url rewrite) if only Label BUT gives the problem when 
> using the URL from outside (through IIS url rewrite) if Link uncommented Do 
> you have an idea what could be the problem ? Thanks Gaston_L 
> - To 
> unsubscribe, e-mail: users-unsubscri
b...@wicket.apache.org For additional commands, e-mail: 
users-h...@wicket.apache.org   
>  
 

Some Wicket components freeze app when URL rewrite

2019-04-25 Thread gaston_l
Hi,

I am migrating an application using wicket and a network configuration a bit 
weird, and i'm facing a unexpected behaviour.

The network configuration:
outside
|
IIS URL rewrite
|
Weblogic with Wicket app


The snippet :
I have simplified the app, so i reproduce the code on a quickstart-based app.

--html--

http://wicket.apache.org";>
 
 
 
 
 John Doe
 
 


--code--
public class HomePage extends WebPage {
 public HomePage(final PageParameters parameters) {
 super(parameters);
 add(new Label("testname", "Me"));
// add(new Link("changetonl"){
// @Override
// public void onClick() {
// this.getSession().setLocale(new Locale("nl"));
// }
// });
 }
}

The problem :
The page as stated just higher works, but if i uncomment the tag  and the 
add(Link), the IIS server says "http code 400" and i have 503 message instead 
of the page.

Environment :
-was Weblogic 10.3 with wicket 1.5.10 -> was OK
-now Weblogic 12.2 with wicket 7.11 (for now) :
 All works when using URL directly on the WL server
 works when using the URL from outside (through IIS url rewrite) if only Label
 BUT gives the problem when using the URL from outside (through IIS url 
rewrite) if Link uncommented
 
Do you have an idea what could be the problem ?


Thanks

Gaston_L

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



Re: Partial

2019-04-25 Thread Martin Grigorov
Hi,

On Wed, Apr 24, 2019 at 8:14 PM Sibgha Nazir  wrote:

> I make the call like this
>
> @Override
>
> *public* *void* renderHead(IHeaderResponse response)
>
> {
>
> *super*.renderHead(response);
>
>
>
> Optional target = RequestCycle.*get*
> ().find(AjaxRequestTarget.*class*);
>
>
> *if* (!target.equals(Optional.*empty*()))
>

You can use target.isPresent()


>
> renderChart(target.get());
>
> }
>

You are trying to update a component after the rendering process has been
started.
As the exception message tries to explain this is not allowed.

Wicket request cycle is split in two phases - the action phase and the
render phase.
The action phase is when a callback method like onClick, onUpdate, onXyz is
called. Here you can manipulate the component tree in any ways.
Once the action phase is finished Wicket starts rendering - the complete
page for non-Ajax requests or only the components added to
AjaxRequestTarget for the Ajax ones.
It works fine in the first request because it is a non-Ajax one and
RequestCycle.find(AjaxRequestTarget) returns an empty Optional, so nothing
is being done there.

You need to move this code either to the action phase or to onConfigure()


>
> On Wed, Apr 24, 2019 at 7:00 PM Martin Grigorov 
> wrote:
>
> > Hi,
> >
> > On Wed, Apr 24, 2019 at 5:08 PM Sibgha Nazir 
> wrote:
> >
> > > Hello wicket developer,
> > >
> > > I am facing the following exception on re-rendering a wicket panel
> using
> > > the code
> > >
> > >
> > >
> > >   iPartialPageRequestHandler.add(chartPanel);
> > >
> >
> > In which method of your code do you make that call ?
> > How do you get a reference to iPartialPageRequestHandler? Is it passed
> as a
> > parameter to the method by Wicket or do you look it up by using
> > RequestCycle.find(Class) ?
> >
> >
> > >
> > > java.lang.IllegalStateException: A partial update of the page is being
> > > rendered, component [ChartPanel [Component id = chart-container]] can
> no
> > > longer be added
> > >
> > > It renders it perfectly the first time. But I want to call this again
> and
> > > again when user clicks refresh button. What does this mean?
> > >
> > > Best Regards,
> > > Sibgha Nazir
> > >
> >
>