Problems with Border ID

2015-04-30 Thread David Kaufman
Hi,

we are currently struggling with getting our Border code to run. Initially
we used the isTransparentResolver() Method. The workaround posted in the
migration document, unfortunately didn't work out of the box.

The current solution fails with following RuntimeException:

Unable to find component with id 'content' in [BorderBodyContainer
[Component id = border_body]]
Expected: 'border:border_body:content'.
Found with similar names: 'border:content'

Where do I have to specify the name? If I specify the name in the markup
the error message reads:
border:border_body:content:border:border_body:content.

Thanks a lot,
David


Subclassing Localizer

2015-04-27 Thread David Kaufman
Hi,

I'm currently struggling with porting a wicket 1.4 subclass of Localizer to
wicket 6. Here subclassing is prohibited by the final keyword.

===
public class MyLocalizer extends Localizer {

@Override
public String getStringIgnoreSettings( final String key, final
Component component, final IModel model, final String defaultValue ) {

final boolean flag = Session.get().getFlag();
if (flag) {
return String.format("[%s]", key)
}

return super.getStringIgnoreSettings( key, component, model, defaultValue );
}

}
===


As you can see, I simply want to return the key if a certain flag is set.
Is this somehow possible by using the IStringResourceLoader interface? Any
help is appreciated.

Thanks,
David


How to get a map of parameters of a request in wicket 6

2015-04-15 Thread David Kaufman
Hi,

In Wicket 1.4 we have following code snippet:
final Map params =
getRequestCycle().getRequest().getParameterMap();

Wicket 6 doesn't have the capabilities of extracting a map. Is this
assumption correct? I can only find a method that extracts the keys:
final Set parameterNames =
getRequest().getRequestParameters().getParameterNames();

Do I have to built the map myself or is there a convenience function
somewhere I overlooked?

Thanks,
David


compiling wicket 6.19.0 from source fails ->

2015-04-14 Thread David Kaufman
Hi,

we have a few custom performance patches on our wicket 1.4 branch which I
want to port to the current wicket 6.19 branch (f8d3f258d1faa6).
Unfortunately, I'm unable to build the project from scratch, i.e. `mvn
install` fails with an error:

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 2.084 s
[INFO] Finished at: 2015-04-14T11:09:38+02:00
[INFO] Final Memory: 33M/395M
[INFO]

[ERROR] Failed to execute goal
org.codehaus.mojo:clirr-maven-plugin:2.6.1:check (clirr-check) on project
wicket-util: Execution clirr-check of goal
org.codehaus.mojo:clirr-maven-plugin:2.6.1:check failed: Invalid byte tag
in constant pool: 18 -> [Help 1]

A similar error was reported in mid August 2014, but no solution was
posted, see
http://mail-archives.apache.org/mod_mbox/wicket-users/201408.mbox/%3ccamomwmpakkq2wz5db0mhaxl6fdfeysqakn4rtq4uu4zfxxc...@mail.gmail.com%3E

My current setup is as follows:
mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1;
2014-12-14T18:29:23+01:00)
Maven home: /usr/share/maven3
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-49-generic", arch: "amd64", family:
"unix"

Any help is greatly appreciated.

Thanks,
David


Re: Concering Borders in Wicket 6

2015-04-14 Thread David Kaufman
Thanks Martin! That was the explanation that I expected.

Thanks a lot,
David

2015-04-14 10:42 GMT+02:00 Martin Grigorov :

> Hi,
>
> Your description is a bit confusing/unclear.
> The markup looks OK to me.
> YourBorder should add container1 and container2 components.
> Any user of YourBorder will add children components to the border body.
> In HTML terms the body is not direct descendant (because  class="layer2"> is in between) but for Wicket it is direct descendant
> because there is no Wicket component that is both a child of the Border and
> a parent of the Border's BodyContainer.
>
> Martin Grigorov
> Freelancer, available for hire!
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Apr 13, 2015 at 12:26 PM, David Kaufman 
> wrote:
>
> > Hi,
> >
> > I'm currently migration our border classes from Wicket 1.4 to Wicket 6.
> I'm
> > not quite sure if I understand the change correctly.
> >
> > We have markup that looks something like this:
> >
> > 
> > 
> > 
> > 
> > 
> > 
> >u
> >
> > 
> > 
> > 
> > 
> > 
> >
> > Is it sufficient to call the constructor of the border, i.e. super("id",
> > model), although the body is not a direct descendant? Since there is no
> > enclosing wicket component around the border, (except the border
> itself), I
> > don't have to be concerned about adding any container to the border. Is
> > this assumption correct?
> >
> > Thanks
> > -David
> >
>


Concering Borders in Wicket 6

2015-04-13 Thread David Kaufman
Hi,

I'm currently migration our border classes from Wicket 1.4 to Wicket 6. I'm
not quite sure if I understand the change correctly.

We have markup that looks something like this:







   
   






Is it sufficient to call the constructor of the border, i.e. super("id",
model), although the body is not a direct descendant? Since there is no
enclosing wicket component around the border, (except the border itself), I
don't have to be concerned about adding any container to the border. Is
this assumption correct?

Thanks
-David


Re: TextTemplateHeaderContributor from 1.4 to 6

2015-03-17 Thread David Kaufman
Hi Martin,

is it also eligible to put the body inside a behavior, i.e.:

 protected void addJavaScriptFile() {
add( new Behavior() {
@Override
public void renderHead( final Component component, final
IHeaderResponse response ) {
super.renderHead( component, response );
PackageTextTemplate template = new
PackageTextTemplate(ClassName.class,"filename.js");
Map variables = 
response.render(OnDomReadyHeaderItem.
forScript(template.asString(variables)));

The problem I'm facing is that the function addJavaScriptFile is accessable
from subclasses which either call the function or not, i.e. only in a few
cases the header should be actually added.

Thanks,
David


2015-03-16 15:16 GMT+01:00 Martin Grigorov :

> Hi,
>
> #renderHead(IHeaderResponse response) {
>   super.renderHead(response);
>
>   PackageTextTemplate template = new PackageTextTemplate(ClassName.class,
> "filename.js");
>   Map variables = 
>   ...
>
>
> response.render(OnDomReadyHeaderItem.forScript(template.asString(variables)));
> }
>
> Martin Grigorov
> Freelancer, available for hire!
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Mar 16, 2015 at 2:14 PM, David Kaufman 
> wrote:
>
> > Hello,
> >
> > I'm currently migrating a code snippet from version 1.4 to version 6:
> >
> >
> > add( TextTemplateHeaderContributor.forJavaScript( ClassName.class,
> > "filename.js", new LoadableDetachableModel > Object>>() {
> > @Override
> > protected Map load() {
> > final Map result = new
> > HashMap();
> > result.put( "id", "static string " );
> > // more parameters here
> > return result;
> > }
> > } ) );
> >
> > The migration documentation (
> >
> >
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-RemovedTextTemplateHeaderContributor/StringHeaderContributor
> > ) suggests using a custom template, e.g.
> > private TextTemplate template = CssTemplate(new MyTextTemplate());
> >
> > Unfortunately, I can't find a TextTemplate which mimics the behavior in
> my
> > 1.4 code snippet. I found a JavaScriptTemplate, but I was unable to find
> a
> > way to use it, as it needs a TextTemplate instance in its constructor.
> >
> > Thanks,
> > David
> >
>


TextTemplateHeaderContributor from 1.4 to 6

2015-03-16 Thread David Kaufman
Hello,

I'm currently migrating a code snippet from version 1.4 to version 6:


add( TextTemplateHeaderContributor.forJavaScript( ClassName.class,
"filename.js", new LoadableDetachableModel>() {
@Override
protected Map load() {
final Map result = new
HashMap();
result.put( "id", "static string " );
// more parameters here
return result;
}
} ) );

The migration documentation (
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-RemovedTextTemplateHeaderContributor/StringHeaderContributor
) suggests using a custom template, e.g.
private TextTemplate template = CssTemplate(new MyTextTemplate());

Unfortunately, I can't find a TextTemplate which mimics the behavior in my
1.4 code snippet. I found a JavaScriptTemplate, but I was unable to find a
way to use it, as it needs a TextTemplate instance in its constructor.

Thanks,
David


Accessing PageParameters within Panel

2015-03-12 Thread David Kaufman
Hi,

I'm currently migrating a fairly large project from wicket 1.4 to wicket 6.

We're currently getting the PageParameters from the RequestCycle
via getRequestCycle().getPageParameters(), with wicket 6 this is no longer
possible. Getting the PageParameters via getPage().getPageParameters() is a
viable option but I'm not quite sure if this is the way to go. Another way
of getting parameters is by calling getRequest().getQueryParameters() but
I'm also not sure if these are identical with the PageParameters (they are
differently typed so I suspect that they are inherently different).

Thanks,
David