Re: Feature Request: Please add postConstruct() method

2016-08-18 Thread Martin Grigorov
Hi,

Wicket is not managed framework, i.e. it doesn't instantiate the components
for you.
You can use IComponentInstantiationListener in your application though!
If your component implements some custom interface then call its
#postConstruct().
I'm not convinced that each and every application needs this.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Aug 19, 2016 at 8:29 AM, Илья Нарыжный  wrote:

> Hello,
>
> There is a pain: components sometimes have a bunch of constructors, but
> very often it's needed to configure something for that component in common.
> And there are 2 ways to do that today:
>
> 1) Either explicitly call some single method from every constructor.
> 2) Or use onInitialize() method.
>
> But both of them have disadvantages:
>
> If first one has been used: it's pretty easy to forgot about necesity to
> invoke some other method in some new constructor if you will need to add
> that.
>
> And second is not good because it's not possible to use constructions like
> that in parent component:
>
> add(new MyChildComponent("id", ).setSomething(XXX));
>
> because if "something" was set in onInitialize() - that will override
> setting that param in code above.
>
>
> Thanks,
>
> Ilya
>
> -
> Orienteer(http://orienteer.org) - open source Business Application
> Platform
>


Feature Request: Please add postConstruct() method

2016-08-18 Thread Илья Нарыжный
Hello,

There is a pain: components sometimes have a bunch of constructors, but
very often it's needed to configure something for that component in common.
And there are 2 ways to do that today:

1) Either explicitly call some single method from every constructor.
2) Or use onInitialize() method.

But both of them have disadvantages:

If first one has been used: it's pretty easy to forgot about necesity to
invoke some other method in some new constructor if you will need to add
that.

And second is not good because it's not possible to use constructions like
that in parent component:

add(new MyChildComponent("id", ).setSomething(XXX));

because if "something" was set in onInitialize() - that will override
setting that param in code above.


Thanks,

Ilya

-
Orienteer(http://orienteer.org) - open source Business Application Platform


Re: wicketstuff-htmlvalidator problem

2016-08-18 Thread Dirk Forchel
You can find the markup below (home.html). The validator itself complains
about the meta tags (line 6 to 14) and after that quits with the mentioned
exception.

home.html
  

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicketstuff-htmlvalidator-problem-tp4675331p4675336.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: Component level cache

2016-08-18 Thread Matt Pavlovich
+1 agreed.  Caching the data (models) coming from data providers and/or 
services is the best approach



On 8/17/16 3:50 AM, Martin Grigorov wrote:

Hi,

I am not aware of such component.
Usually the caching is done in the service layer, not in the UI.
But if you prefer to do it with Wicket then do it in a Model that caches
the DB results.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Aug 16, 2016 at 6:03 PM, Marcel Barbosa Pinto <
marcel.po...@gmail.com> wrote:


Hi,

I was just wondering if there is some component to instead of let the a
given component to render itself, check if there is a cache and display its
rendered markup, thus avoiding unnecessary rendering, this could be useful
for stateless components that need to display some list of categories from
the database etc.

Something like this:

class Header extends Panel{
 add(new ExpensiveCategoryListView());
}

class Home extends Page{
 add(new CachedComponent("headerContainer", Header.class))
}

The CachedComponent would first check if there is an already rendered
Header instance (could check in an in-memory store like, infinispan or
hezelcast)

What do you guys think?




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



Re: wicketstuff-htmlvalidator problem

2016-08-18 Thread Martijn Dashorst
Without the actual markup there's little we can help you with. What is
the markup that generates these error reports?

Martijn


On Thu, Aug 18, 2016 at 12:00 PM, Dirk Forchel  wrote:
> Hi,
> we're trying to use the Wicketstuff Html Validator (see
> https://github.com/dashorst/wicket-stuff-markup-validator.) with our Wicket7
> project. We've built our application with the lates release of Wicket 7
> (7.4.0) and with the latest release of wicketstuff-htmlvalidator (1.11).
> By the way, our generated Html markup is not valid, but we get all the time
> if we're using the validator the following IllegalStateException. Any idea
> how to solve the problem?
>
> ERROR [ValidationReport] Line 6 contains error at 81: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 7 contains error at 73: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 8 contains error at 50: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 9 contains error at 45: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 10 contains error at 51: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 11 contains error at 91: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 12 contains error at 46: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 13 contains error at 68: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line 14 contains error at 74: value of attribute
> "http-equiv" is invalid; must be equal to "content-type", "default-style" or
> "refresh"
> ERROR [ValidationReport] Line -1 contains error at -1: report:
>   Using the ômetaö element to specify the document-wide default language is
> obsolete. Consider specifying the language on the root element instead.
> ERROR [HtmlValidationResponseFilter] java.lang.IllegalStateException:
> Calling Context.exit without previous Context.enter
> java.lang.IllegalStateException: Calling Context.exit without previous
> Context.enter
> at org.mozilla.javascript.Context.exit(Unknown Source)
> at org.mozilla.javascript.Context.exit(Unknown Source)
> at org.whattf.datatype.FunctionBody.checkValid(FunctionBody.java:59)
> at
> org.whattf.datatype.AbstractDatatype.checkValid(AbstractDatatype.java:75)
> at
> com.thaiopensource.relaxng.pattern.DataDataDerivType.dataDeriv(DataDataDerivType.java:25)
> at
> com.thaiopensource.relaxng.pattern.PatternMemo.dataDeriv(PatternMemo.java:191)
> at
> com.thaiopensource.relaxng.pattern.PatternMatcher.matchAttributeValue(PatternMatcher.java:161)
> at
> com.thaiopensource.relaxng.sax.PatternValidator.startElement(PatternValidator.java:38)
> at
> com.thaiopensource.xml.sax.ForkContentHandler.startElement(ForkContentHandler.java:43)
> at
> org.wicketstuff.htmlvalidator.xml.dataattributes.DataAttributeDroppingContentHandlerWrapper.startElement(DataAttributeDroppingContentHandlerWrapper.java:158)
> at
> org.wicketstuff.htmlvalidator.xml.langattributes.XmlLangAttributeDroppingContentHandlerWrapper.startElement(XmlLangAttributeDroppingContentHandlerWrapper.java:149)
> at
> nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:141)
> at
> nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:35)
> at
> nu.validator.htmlparser.impl.TreeBuilder.push(TreeBuilder.java:3976)
> at
> nu.validator.htmlparser.impl.TreeBuilder.appendToCurrentNodeAndPushFormattingElementMayFoster(TreeBuilder.java:4558)
> at
> nu.validator.htmlparser.impl.TreeBuilder.startTag(TreeBuilder.java:1849)
> at
> nu.validator.htmlparser.impl.Tokenizer.emitCurrentTagToken(Tokenizer.java:1311)
> at
> nu.validator.htmlparser.impl.Tokenizer.stateLoop(Tokenizer.java:2152)
> at
> nu.validator.htmlparser.impl.Tokenizer.tokenizeBuffer(Tokenizer.java:1522)
> at nu.validator.htmlparser.io.Driver.runStates(Driver.java:317)
> at nu.validator.htmlparser.io.Driver.tokenize(Driver.java:217)
> at
> nu.validator.htmlparser.sax.HtmlParser.tokenize(HtmlParser.java:459)
> at nu.validator.htmlparser.sax.HtmlParser.parse(HtmlParser.java:402)
> at
> org.wicketstuff.htmlvalidator.HtmlValidationResponseFilter.validateMarkup(HtmlValidationResponseFilter.java:226)
> at
> org.wicketstuff.htmlvalidator.HtmlVa

wicketstuff-htmlvalidator problem

2016-08-18 Thread Dirk Forchel
Hi,
we're trying to use the Wicketstuff Html Validator (see
https://github.com/dashorst/wicket-stuff-markup-validator.) with our Wicket7
project. We've built our application with the lates release of Wicket 7
(7.4.0) and with the latest release of wicketstuff-htmlvalidator (1.11).
By the way, our generated Html markup is not valid, but we get all the time
if we're using the validator the following IllegalStateException. Any idea
how to solve the problem?

ERROR [ValidationReport] Line 6 contains error at 81: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 7 contains error at 73: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 8 contains error at 50: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 9 contains error at 45: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 10 contains error at 51: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 11 contains error at 91: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 12 contains error at 46: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 13 contains error at 68: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line 14 contains error at 74: value of attribute
"http-equiv" is invalid; must be equal to "content-type", "default-style" or
"refresh"
ERROR [ValidationReport] Line -1 contains error at -1: report:
  Using the ômetaö element to specify the document-wide default language is
obsolete. Consider specifying the language on the root element instead.
ERROR [HtmlValidationResponseFilter] java.lang.IllegalStateException:
Calling Context.exit without previous Context.enter
java.lang.IllegalStateException: Calling Context.exit without previous
Context.enter
at org.mozilla.javascript.Context.exit(Unknown Source)
at org.mozilla.javascript.Context.exit(Unknown Source)
at org.whattf.datatype.FunctionBody.checkValid(FunctionBody.java:59)
at
org.whattf.datatype.AbstractDatatype.checkValid(AbstractDatatype.java:75)
at
com.thaiopensource.relaxng.pattern.DataDataDerivType.dataDeriv(DataDataDerivType.java:25)
at
com.thaiopensource.relaxng.pattern.PatternMemo.dataDeriv(PatternMemo.java:191)
at
com.thaiopensource.relaxng.pattern.PatternMatcher.matchAttributeValue(PatternMatcher.java:161)
at
com.thaiopensource.relaxng.sax.PatternValidator.startElement(PatternValidator.java:38)
at
com.thaiopensource.xml.sax.ForkContentHandler.startElement(ForkContentHandler.java:43)
at
org.wicketstuff.htmlvalidator.xml.dataattributes.DataAttributeDroppingContentHandlerWrapper.startElement(DataAttributeDroppingContentHandlerWrapper.java:158)
at
org.wicketstuff.htmlvalidator.xml.langattributes.XmlLangAttributeDroppingContentHandlerWrapper.startElement(XmlLangAttributeDroppingContentHandlerWrapper.java:149)
at
nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:141)
at
nu.validator.htmlparser.sax.SAXStreamer.elementPushed(SAXStreamer.java:35)
at
nu.validator.htmlparser.impl.TreeBuilder.push(TreeBuilder.java:3976)
at
nu.validator.htmlparser.impl.TreeBuilder.appendToCurrentNodeAndPushFormattingElementMayFoster(TreeBuilder.java:4558)
at
nu.validator.htmlparser.impl.TreeBuilder.startTag(TreeBuilder.java:1849)
at
nu.validator.htmlparser.impl.Tokenizer.emitCurrentTagToken(Tokenizer.java:1311)
at
nu.validator.htmlparser.impl.Tokenizer.stateLoop(Tokenizer.java:2152)
at
nu.validator.htmlparser.impl.Tokenizer.tokenizeBuffer(Tokenizer.java:1522)
at nu.validator.htmlparser.io.Driver.runStates(Driver.java:317)
at nu.validator.htmlparser.io.Driver.tokenize(Driver.java:217)
at
nu.validator.htmlparser.sax.HtmlParser.tokenize(HtmlParser.java:459)
at nu.validator.htmlparser.sax.HtmlParser.parse(HtmlParser.java:402)
at
org.wicketstuff.htmlvalidator.HtmlValidationResponseFilter.validateMarkup(HtmlValidationResponseFilter.java:226)
at
org.wicketstuff.htmlvalidator.HtmlValidationResponseFilter.filter(HtmlValidationResponseFilter.java:195)
at
org.apache.wicket.protocol.http.BufferedWebResponse$WriteCharSequenceAction.invoke(BufferedWebResponse.java:168)
at
org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:602)
at
org.apache.wicket.request.handler.render.WebPageRend