wicket 1.4.21, glassfish, @font-face

2012-12-10 Thread Adam Gray
I'm running into a curious issue and wondered if anyone has any idea what
else I can look into for a solution.

In wicket 1.4.21 (legacy app), I'm attempting to switch to font awesome for
icons in twitter bootstrap.

I've added the following patterns to the resource guard
  guard.addPattern(+*.svg);
  guard.addPattern(+*.ttf);
  guard.addPattern(+*.eot);
  guard.addPattern(+*.woff);

The css file is served as a CSSPackageResource and gets loaded correctly.
The css file references the fonts by url, those seem to be referenced
correctly and are returned from the server with a 200 OK.

The issue is that somehow, the font files are corrupted.  The original ttf
font is 68kb on disk.  The downloaded version is 85kb.

At this point, I don't know if I should be looking into glassfish or
wicket.  Are my guard patterns correct?  I'd like to think so since the
request is completed with something.  Is there a known packaging problem
with maven I should look for?


Re: wicket 1.4.21, glassfish, @font-face

2012-12-10 Thread Adam Gray
For anyone else out there that runs into this thread looking for anything
similar, the final solution was (as usual) pretty dumb.  A while ago our
static resources were moved from an external directory into
/src/main/resources.  This directory was still being filtered in the
pom.xml.  This is a no, no with binary files (like fonts and images).

http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

At that page at the bottom it says: *Warning:* Do not filter files with
binary content like images! This will most likely result in corrupt output.
If you have both text files and binary files as resources, you need to
declare two mutually exclusive resource sets. The first resource set
defines the files to be filtered and the other resource set defines the
files to copy unaltered...

Heed this warning.


On Mon, Dec 10, 2012 at 5:05 PM, Adam Gray adam.j.g...@gmail.com wrote:

 I'm running into a curious issue and wondered if anyone has any idea what
 else I can look into for a solution.

 In wicket 1.4.21 (legacy app), I'm attempting to switch to font awesome
 for icons in twitter bootstrap.

 I've added the following patterns to the resource guard
   guard.addPattern(+*.svg);
   guard.addPattern(+*.ttf);
   guard.addPattern(+*.eot);
   guard.addPattern(+*.woff);

 The css file is served as a CSSPackageResource and gets loaded correctly.
 The css file references the fonts by url, those seem to be referenced
 correctly and are returned from the server with a 200 OK.

 The issue is that somehow, the font files are corrupted.  The original ttf
 font is 68kb on disk.  The downloaded version is 85kb.

 At this point, I don't know if I should be looking into glassfish or
 wicket.  Are my guard patterns correct?  I'd like to think so since the
 request is completed with something.  Is there a known packaging problem
 with maven I should look for?



Re: css style in listview

2012-08-30 Thread Adam Gray
It could be this:  background-colr:red .  You're missing an 'o' in there.

On Thu, Aug 30, 2012 at 6:55 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 On Thu, Aug 30, 2012 at 12:46 PM, Pratibha pratibha.pari...@gmail.com
 wrote:
  Hi team
 
  i like to add  style in listview as mentioned below
  item.add(new SimpleAttributeModifier(style, background-colr:red));
 
  Its not working for me but rest others are working

 Please define it's not working. We need more information to be able
 to help you.

 
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/css-style-in-listview-tp4651642.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
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: extending wicket classes - markup only

2012-07-21 Thread Adam Gray
Copy the html file in your code, make your modifications and put it in a
folder structure that matches where it was in the wicket jar.  I can't
remember if we had to tweak our resource loading to get this to work, but I
don't think so.  It should find yours first.

On Sat, Jul 21, 2012 at 5:50 PM, mlabs mlabs@gmail.com wrote:

 I want to tweak the markup of an  existing class in such a way that it wont
 affect the hierarchy of the component .. is there a way to do this without
 extending the java class ?
 TIA



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/extending-wicket-classes-markup-only-tp4650680.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: Need a link in a dataview filter column

2012-06-03 Thread Adam Gray
Did you want to put the link in the rows of the datatable or in the header
row with the filter column itself?

If you're just adding the links to the data rows, I typically use a
Fragment when making custom DataTable columns.  You could create a new
fragment that has the link that will call your service method to return the
pdf for the provided row model.  So in your column definition in
populateItem, you do something like:

cellItem.add(new PdfLinkFragment(componentId, fragmentId, YourPage.class,
cellItem.getModel());

And define PdfLinkFragment to extend Fragment.  This fragment would have
your link defined for the provided model.

I hope this makes sense, I'm not in a place where I can give more detailed
code right now.

Alternatively, you could just create a PdfLinkPanel and add that to the
cellItem instead of using a fragment.  Both options would accomplish the
same thing.

If you need to put the link in the header column, you'll probably have to
do some subclassing of FilteredAbstractColumn and probably make your own
header bar.

On Sun, Jun 3, 2012 at 8:15 AM, lang delan...@telfort.nl wrote:

 Hi, in my datatable i use different columns with filters. One of those
 columns contain a invoice number
 I want to show a pdf if a user click this row

 Example
 Order  invoice
 input input
 1001  123401--- This column must be clicable. After click it must
 open a pdf with 123401.pdf
 Who can help?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Need-a-link-in-a-dataview-filter-column-tp4649688.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: AjaxFormChoiceComponentUpdatingBehavior CheckGroup and CheckGroupSelector

2012-05-17 Thread Adam Gray
That was almost exactly how I ended up solving it last night.  In the end,
the AjaxCheckBox just sets the CheckGroup's model object such that it's all
selected then adds the group to the AjaxRequestTarget just the once.  That
worked nicely for reducing the roundtrips.

As an aside, I noticed that wicket:enclosure is quite a lot slower than
setting individual component visibility, at least in my case.  I was really
just making sure the Label was hidden its input was hidden.  It'd be really
nice if label wicket:for= could link visibility, but not necessary.
 Just something I happened to notice when rendering a large ListView of
Checks and Labels.

On Thu, May 17, 2012 at 8:08 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Can org.apache.wicket.ajax.markup.html.form.AjaxCheckBox help for your
 case ?
 I'd write a custom selector that changes the checkboxes's state to
 'selected' and then uses ajax to make a batch update.

 On Wed, May 16, 2012 at 9:28 PM, Adam Gray adam.j.g...@gmail.com wrote:
  Wicket 1.4.20
 
  Use case:  I have a rather large CheckGroup (~250 items) that is
  controlling filters to include for an ad hoc reporting solution.  Because
  this is so large, the group itself needs to be collapsible.  Easy enough.
   But because it's collapsible, form components in hidden areas won't be
  submitted.  So these needs to be pushed to the server as soon as they are
  selected.  AjaxFormChoiceComponentUpdatingBehavior works nicely here.
 
  The problem that I'm seeing is that there is no apparent way of knowing
  which Check was clicked in this behavior.  As such, the only component
  that seems to available to add to the AjaxRequestTarget is the CheckGroup
  itself.  Even then, this isn't too bad when you're checking individual
  items.
 
  The real issue becomes apparent when you throw the CheckGroupSelector
 into
  the mix.  This component goes down the list and calls .click() on each
  checkbox.  So you get as many checkgroup refreshes as you have
 checkboxes.
   Definitely not a problem with typical use cases.  With an extreme use
 case
  like mine, however; it becomes rather unwieldy.
 
  Is it possible to determine which Check was actually clicked and only add
  the necessary components to the AjaxRequestTarget to avoid getting
  checkgroup postback spam?  Or is there a way that I can customize one of
  these classes to somehow batch these updates, a custom CheckGroupSelector
  for instance?



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




AjaxFormChoiceComponentUpdatingBehavior CheckGroup and CheckGroupSelector

2012-05-16 Thread Adam Gray
Wicket 1.4.20

Use case:  I have a rather large CheckGroup (~250 items) that is
controlling filters to include for an ad hoc reporting solution.  Because
this is so large, the group itself needs to be collapsible.  Easy enough.
 But because it's collapsible, form components in hidden areas won't be
submitted.  So these needs to be pushed to the server as soon as they are
selected.  AjaxFormChoiceComponentUpdatingBehavior works nicely here.

The problem that I'm seeing is that there is no apparent way of knowing
which Check was clicked in this behavior.  As such, the only component
that seems to available to add to the AjaxRequestTarget is the CheckGroup
itself.  Even then, this isn't too bad when you're checking individual
items.

The real issue becomes apparent when you throw the CheckGroupSelector into
the mix.  This component goes down the list and calls .click() on each
checkbox.  So you get as many checkgroup refreshes as you have checkboxes.
 Definitely not a problem with typical use cases.  With an extreme use case
like mine, however; it becomes rather unwieldy.

Is it possible to determine which Check was actually clicked and only add
the necessary components to the AjaxRequestTarget to avoid getting
checkgroup postback spam?  Or is there a way that I can customize one of
these classes to somehow batch these updates, a custom CheckGroupSelector
for instance?


Re: Unusual problem is coming in rendering component

2012-05-02 Thread Adam Gray
It looks that since you aren't giving the text field a model to bind to,
it's walking up the component hierarchy to find a model to check for a
getter getPostTextField().  I'm guessing that PostDomain does have a
getPost() method, which it's finding and using.  You'll either want to keep
the wicket id as post, or give the text field an explicit property model
like, new PropertyModelString(form.getModel(), post) as the second
argument to the text field constructor (assuming you are providing the form
with the model for PostDomain).

On Wed, May 2, 2012 at 3:07 PM, kshitiz k.agarw...@gmail.com wrote:

 Hi,

 I am trying to render a text field :

 Java code:

 *final RequiredTextFieldString postTextField = new
 RequiredTextFieldString(
postTextField);

 *postForm.add(postTextField);*

 Html code
 *input type=text id=postTextField wicket:id=postTextField/*

 But I am gettin the error:

 Root cause:

 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class domain.PostDomain expression: postTextField
 at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499)
 at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:341)
 at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:244)
 at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:97)
 at

 org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:134)
 at
 org.apache.wicket.Component.getDefaultModelObject(Component.java:1668)
 at

 org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1695)
 at

 org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1211)
 at

 org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:837)
 at

 org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:108)
 at
 org.apache.wicket.Component.internalRenderComponent(Component.java:2510)
 at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
 at org.apache.wicket.Component.internalRender(Component.java:2369)
 at org.apache.wicket.Component.render(Component.java:2297)

 Now, when I replace *postTextField* with *post*, no error comes...!!!

 That is, if my java code is:
 *final RequiredTextFieldString postTextField = new
 RequiredTextFieldString(
post);

 and Html code is:

 *input type=text id=postTextField wicket:id=post/*

 The code runs fine...

 What can be the problem...?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163.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: Override BrowserInfoPage

2012-03-23 Thread Adam Gray
You can provide your own markup for BrowserInfoPage if you place it in the
correct package within your application
(org.apache.wicket.markup.html.pages? I believe).  From there you can
replace the text with a wicket:message that you can translate.

On Fri, Mar 23, 2012 at 12:47 PM, sudeivas sureshkumar@gmail.comwrote:

 Hello,
  I am using
 getRequestCycleSettings().setGatherExtendedBrowserInfo(true) to gather the
 browser information. But I am seeing this hard-coded message
 If you see this, it means that both javascript and meta-refresh are not
 support by your browser configuration. Please click this link to continue
 to
 the original destination.

 This is impossible to read for non-english users and it stays in the page
 for 5 to 10 seconds sometimes and this is causing some issues when the user
 clicks on the link. I wish to override to a simple message like
 'Loading...'
 but I am not sure how to override this message.

 I did search in google but couldn't find any API. Please provide some
 suggestions.

 Thanks,
 Suresh

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Override-BrowserInfoPage-tp4499400p4499400.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: JavaScriptReference with TextTemplate only returns the first retrieved value

2012-01-26 Thread Adam Gray
I just ran into this today.  Has this been solved yet (in 1.4)?

On Tue, Aug 23, 2011 at 10:23 PM, Doug Leeper douglee...@yahoo.com wrote:

 I have encountered this issue as well...and I believe I know the reason for
 this behavior.

 The TextTemplateResourceReference eventually is bound to the Application
 shared resources.  It never gets reset.  So the
 TextTemplateResourceReference will always use the first variables used
  to
 substitute in the template.

 I believe the correct way to do achieve this behavior is to couple the text
 template substitution with a dynamic web resource.

 Am I correct on this?

 Has anyone done this before?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/JavaScriptReference-with-TextTemplate-only-returns-the-first-retrieved-value-tp1877334p3764346.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 ajax page versioning

2011-12-07 Thread Adam Gray
That's funny, I was just really hoping for a way to do the exact opposite
so that the back button works correctly.

On Wed, Dec 7, 2011 at 7:31 AM, Nazaret Kazarian nazaret.kazar...@gmail.com
 wrote:

 Hi,

 I would like to ask whether wicket keeps version of pages when changes
 are made with ajax requests.

 If it does, it seems as a waste of resources, unless ajax back button
 support is implemented (with javascript history, etc).

 Thanks.

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




Re: feedback messages not appearing using ajax button

2011-12-01 Thread Adam Gray
Perhaps you aren't overriding onError(AjaxRequestTarget) ?  Add the
feedback panel in there.

On Fri, Dec 2, 2011 at 12:22 AM, Squash james.stewart...@gmail.com wrote:

 I am using a SecureAjaxButton to do some business functionality. This
 function throws an exception which I catch and then set an error. I then
 add
 the feedback panel to the AjaxRequestTarget.
 Unfortunately the feedback panel is always empty when I view it in the
 debug
 window.

 If I however create a new page of the same type and return it then the
 messages appear. It is as if wicket ignores the fact that there is a
 message
 in the ajax call. Does it cache the messages or have some sort of dirty
 flag
 that is not set?

 Some code snippets with details changed as it is proprietary application.

  private class PayButton extends SecureAjaxButton {
 ...

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form) {
target.addComponent(feedbackPanel);
doStuff(target);
 ...


private void doStuff(AjaxRequestTarget target) {
try {
 
 info(Success);
} catch (EJBException e) {
 error(e.getMessage());
}
 ...



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/feedback-messages-not-appearing-using-ajax-button-tp4145174p4145174.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




Using multiple AjaxFormChoiceComponentUpdatingBehavior in a Panel

2011-11-28 Thread Adam Gray
I'm using the latest 1.4 release and it seems like there is an issue where
two AjaxFormChoiceComponentUpdatingBehavior will not work correctly.  The
first one will function properly but the second one does nothing.  We've
looked for a resolution to this, but have thusfar come up empty.  Is there
a known workaround (other than not using a Radio/CheckGroup) for this type
of behavior in 1.4?


Re: Using multiple AjaxFormChoiceComponentUpdatingBehavior in a Panel

2011-11-28 Thread Adam Gray
In a nutshell, we have two radio groups in a panel.  We are adding an
AjaxFormChoiceComponentUpdatingBehavior to each one in order to provide
different components based on the selection.  Whichever one is added in the
component hierarchy first will get its proper callback.  The other behavior
does nothing.

div wicket:id=group1
  input type=radio
  input type=radio
/div

div wicket:id=group2
  input type=radio
  input type=radio
/div

So, group1's ajax behavior will fire while group2's will not.

On Mon, Nov 28, 2011 at 12:43 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 What exactly is the problem ?

 On Mon, Nov 28, 2011 at 6:15 PM, Adam Gray adam.j.g...@gmail.com wrote:
  I'm using the latest 1.4 release and it seems like there is an issue
 where
  two AjaxFormChoiceComponentUpdatingBehavior will not work correctly.  The
  first one will function properly but the second one does nothing.  We've
  looked for a resolution to this, but have thusfar come up empty.  Is
 there
  a known workaround (other than not using a Radio/CheckGroup) for this
 type
  of behavior in 1.4?
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: Using multiple AjaxFormChoiceComponentUpdatingBehavior in a Panel

2011-11-28 Thread Adam Gray
I'll get one created in the next couple hours.  Thanks.

On Mon, Nov 28, 2011 at 1:58 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Create a quickstart application and attach it to a ticket in Jira

 On Mon, Nov 28, 2011 at 6:49 PM, Adam Gray adam.j.g...@gmail.com wrote:
  In a nutshell, we have two radio groups in a panel.  We are adding an
  AjaxFormChoiceComponentUpdatingBehavior to each one in order to provide
  different components based on the selection.  Whichever one is added in
 the
  component hierarchy first will get its proper callback.  The other
 behavior
  does nothing.
 
  div wicket:id=group1
   input type=radio
   input type=radio
  /div
 
  div wicket:id=group2
   input type=radio
   input type=radio
  /div
 
  So, group1's ajax behavior will fire while group2's will not.
 
  On Mon, Nov 28, 2011 at 12:43 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
 
  Hi,
 
  What exactly is the problem ?
 
  On Mon, Nov 28, 2011 at 6:15 PM, Adam Gray adam.j.g...@gmail.com
 wrote:
   I'm using the latest 1.4 release and it seems like there is an issue
  where
   two AjaxFormChoiceComponentUpdatingBehavior will not work correctly.
  The
   first one will function properly but the second one does nothing.
  We've
   looked for a resolution to this, but have thusfar come up empty.  Is
  there
   a known workaround (other than not using a Radio/CheckGroup) for this
  type
   of behavior in 1.4?
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: BookmarkablePageLink to an existing instance of a page?

2011-11-28 Thread Adam Gray
You mean something like:

add(new Link(theLink) {
  @Override
  public void onClick() {
   setResponsePage(yourPageInstance);
  }
});

On Mon, Nov 28, 2011 at 3:31 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Then the page is no longer bookmarkable, since you depend on state.

 page.getClass() will work though.

 Martijn

 On Mon, Nov 28, 2011 at 9:27 PM, eugenebalt eugeneb...@yahoo.com wrote:
  When you create a BookmarkablePageLink, you can set as its target the
 class
  of your page.
 
  But what if you want to use an existing instance of a page? Is there a
 way
  to construct a link like that?
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/BookmarkablePageLink-to-an-existing-instance-of-a-page-tp4116739p4116739.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
 
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com

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




Re: Apache Wicket is a Flawed Framework

2011-11-18 Thread Adam Gray
That's actually interesting you feel that way because I was just making the
comment that I was surprised at how little hate was being displayed.  Sure
there are a couple here and there, but par for the internet is far, far
lower (higher? maybe a golf analogy was a bad idea) than what we're seeing
here.  And, in fact, many people did attempt to address specific issues.
 However, you can't really expect sunshine and rainbows when the initial
post says nothing positive whatsoever and offers no suggestions for
improvement.  This more recent post, however, I like so much better because
you actually get into specific instances where there is room for
improvement and link to a potential guide for a solution.

I would definitely agree with you that something like the spring petclinic
would be really handy.  I, personally, can't count the number of times I
found myself doing it wrong because I hadn't known to look at the javadoc
in that other class over there (I'm looking at you, ListView vs DataTable).
 One of the largest strengths of wicket is its flexibility, but it tends to
come at the cost of there being too many ways to do something.  That makes
it difficult to know which is the right way to accomplish the task.
 Until you really get to know wicket, it definitely feels a bit like you
need to learn the secret handshakes and hidden incantations to make it do
something as simple as showing feedback properly in a repeating view.
 There are a lot of us here that have gone through (and still going) that
learning curve and could probably contribute to a large sample application
that shows how to do stuff.

Additionally, I believe work on Wicket 6 has officially started, so if
there are concrete suggestions for improvement, I bet Jira would love to
record them for you.  Is Wicket perfect?  No, no framework is.  But it's
getting better and the more help it has, the better it will get.

On Fri, Nov 18, 2011 at 9:27 AM, Eric Kizaki erickiz...@gmail.com wrote:

 I was not expecting so much hate.  I guess now I am infamous in the Java
 world now.  Look, it is just my opinion.  Not many people actually stopped
 to address many of my points.  They just immediately bashed me.

 I am sticking with Wicket because it is required for work.  I am able to do
 stuff in it but it seems unnecessarily complicated.  I own the “Wicket in
 Action” book and “Enjoying Web Development with Wicket Book” by Kent Ka Iok
 Tong.  The second book is much more practical.  Without these books I would
 not be able to do anything in Wicket.  That is why I did not mention
 documentation.  I would prefer to just be able to check out something like
 this http://static.springsource.org/docs/petclinic.html.  This is a real
 working application that shows how to do things with databases etc.  With
 Wicket, I had to string a bunch of snippets together and read two books.  I
 am still not sure I am doing things the best way.

 To people who say I am inexperienced, I have tried JSF and GWT.  Wicket is
 better than both of those.  JSF has an invasive and complicated lifecycle.
 When I saw the lifecycle diagram I just stopped even looking into it.  GWT
 uses terrible Swing style layouts and all these crappy interfaces for RPC.
 There was also no real help on the server.  At least with Wicket I can
 still
 use HTML and CSS for my layouts.  However, these component based frameworks
 are still way too complicated for a simple task:  building a web page.  In
 my humble opinion Spring MVC done right (no scriplets) with JSTL  EL and
 jQuery is better than Wicket.  You can also use Velocity templating.  I
 have
 also used Swing to build desktop apps.  I would not say Swing is a shining
 example of how to build GUIs.  I thought it was pretty bad, verbose, and
 impractical.  The Play Framework has the right idea:  stateless and
 restful.
 No clunky components and over-engineered objected-oriented baggage.

 Here is a quote from the Restlet page
 (http://www.restlet.org/about/introduction):
 “While powerful for complex centralized models, the object-oriented
 paradigm
 isn't always the best suited for Web development. Java developers need
 realize this and start thinking more RESTfully when developing new Web
 servers or new AJAX-based Web clients. The Restlet project is providing a
 simple yet solid foundation that can get you started right away on the Web
 2.0.”
 - Jérôme Louvel, Restlet founder
 Maybe you can look up his Linkdin and start bashing him too.  Oh no he said
 object-oriented is not the Holy Grail!

 I am definitely in the “I like to hand-code HTML, CSS, and Javascript”
 camp.
 I even like hand-coding SQL.  I get complete control.  These are all pretty
 easy languages; most of them are declarative.  They are easier than Java.
  I
 know most Java developers do not feel this way and want to just do
 everything in Java.  I think you should use the best tool for the job.
  Java
 is a mediocre tool to use in every domain.



 --
 View this message in context:
 

Re: Apache Wicket is a Flawed Framework

2011-11-17 Thread Adam Gray
I'm curious why you wasted your time if you have already determined
that Stateful,
component-based frameworks are a terrible idea.  Html5 + jQuery + Restlet
is over -- http://www.restlet.org/

No framework is for everyone or even the best solution for every problem.
 If you have real suggestions for improvements:
https://issues.apache.org/jira/browse/WICKET.  If you're just trolling, I
had a good laugh.

This is not the framework you're looking for.
You can go about your business.
#jedimindtrick


On Thu, Nov 17, 2011 at 11:43 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

 Ah, it's been a while since a JSF/JSP zealot bothered to annoy Wicket
 users.

 Now go away and cook up a tag library or five.

 - Tor Iver



Clarification on defining component visibility

2011-11-11 Thread Adam Gray
Recently some co-workers and I started questioning what is the (most)
correct method for determining component visibility.  In the past we've
gone from calling setVisible() to overriding isVisible() and now are
finding some people pointed to using setVisibilityAllowed() in
onBeforeRender while override callOnBeforeRenderIfNotVisible() to return
true.  Clearly, there are some pitfalls/gotchas to each method, but we're
trying to develop a clean and consistent codebase (or rather, trying to
make a dirty and inconsistent codebase less so).  What is the intended,
preferred, or rules-of-thumb for how to accomplish this?  Is some
combination of these methods the inevitable result, or is there a
consistent method to this?


Re: Clarification on defining component visibility

2011-11-11 Thread Adam Gray
And, as usual, twitter ends up being faster.  Thanks Igor. 8)

Answer: none of the above (below?).  Call override onConfigure() and call 
setVisible() from there.

On Nov 11, 2011, at 4:14 PM, Adam Gray wrote:

 Recently some co-workers and I started questioning what is the (most) correct 
 method for determining component visibility.  In the past we've gone from 
 calling setVisible() to overriding isVisible() and now are finding some 
 people pointed to using setVisibilityAllowed() in onBeforeRender while 
 override callOnBeforeRenderIfNotVisible() to return true.  Clearly, there are 
 some pitfalls/gotchas to each method, but we're trying to develop a clean and 
 consistent codebase (or rather, trying to make a dirty and inconsistent 
 codebase less so).  What is the intended, preferred, or rules-of-thumb for 
 how to accomplish this?  Is some combination of these methods the inevitable 
 result, or is there a consistent method to this?


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



Re: DropDownChoice updates onchange event.

2011-07-27 Thread Adam Gray
What type of collection are you using in the model object?

On Wed, Jul 27, 2011 at 2:09 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 I didn't see the question.

 On Wed, Jul 27, 2011 at 8:42 PM, Archana.AA
 archanaacharya.adhik...@gmail.com wrote:
  Hi All,
 
  I am using a DropDownChoice with a list of values. The choice list come
 from
  DB in a sorted order.
  When I new AjaxFormComponentUpdatingBehavior(onchange) event, the
  onUpdate(AjaxRequestTarget target) method is excecuted and it updates
 some
  values. After this method executed, choice list is sequence in the
  DropDownChoice changes. I am not updating the sequence any where in the
  onUpdate().
 
  I am very new to wicket. So I am not able to understand where I am going
  wrong. Please help me out to resolve this.
 
  Thanks in advance.
 
  -
  Thanks,
  Archana
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699271.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
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: image from data

2011-07-02 Thread Adam Gray
Perhaps check out DynamicImageResource?

On Sat, Jul 2, 2011 at 7:39 AM, Miroslav F. mir...@seznam.cz wrote:

 Hi folks,

 I have images in database as BLOBs and retrieving it with JDBC (not good
 code, just test at the moment)
 with this (just snip of the code):

 conn = Utils.makeConnection();//make connection with JDBC
 try
 {
conn.setAutoCommit(false);
st = conn.createStatement();
rs = st.executeQuery(SELECT * FROM testdatabase.images);
LargeObjectManager lobj = ((org.postgresql.PGConnection)
 conn).getLargeObjectAPI();
while(rs.next())
{
Long oid = rs.getLong(7);
LargeObject obj = lobj.open(oid, LargeObjectManager.READ);
byte buf[] = new byte[obj.size()];
obj.read(buf, 0, obj.size());
//--now I have image data in buf[], how can I put them into
 html?
obj.close();
}
rs.close();
st.close();
conn.commit();
 }
 catch(SQLException e)
 {
e.printStackTrace();
 }

 How can I put this image data into html page? Save it as file onto file
 system and then
 insert in src atribute of img tag? Or something else? Example is welcome.

 Thanks in advance,

 Miro


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




MockHttpServletRequest

2011-06-07 Thread Adam Gray
My application's base page does checking against the user agent string to
redirect unsupported browsers to a support page.  The problem we're seeing
is that WicketTester is using a hardcoded user agent from a crazy-old
version of firefox.

Is there any recommended way to specify the user-agent used by WicketTester,
or is this a known limitation?  From what I can tell, there doesn't seem to
be a way to get at the actual header data to make the change.


Re: MockHttpServletRequest

2011-06-07 Thread Adam Gray
Will do, thanks.

On Tue, Jun 7, 2011 at 10:23 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Looking at the code I see a lot of things are not possible to
 configure in this area.
 The easiest way to allow what you need is to add #setHeader(name,
 value) which will override the previous value(s) for this name.

 Please create a ticket.

 On Tue, Jun 7, 2011 at 4:11 PM, Adam Gray adam.j.g...@gmail.com wrote:
  My application's base page does checking against the user agent string to
  redirect unsupported browsers to a support page.  The problem we're
 seeing
  is that WicketTester is using a hardcoded user agent from a crazy-old
  version of firefox.
 
  Is there any recommended way to specify the user-agent used by
 WicketTester,
  or is this a known limitation?  From what I can tell, there doesn't seem
 to
  be a way to get at the actual header data to make the change.
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: JavaScript enabled or disabled

2011-05-21 Thread Adam Gray
Unless there's another way I'm not familiar with, I believe you can use
getScreenHeight or getScreenWidth from ClientProperties.  Someone correct me
if I'm wrong, but I believe these values will still be -1 (their default) if
javascript is disabled.

Be sure to add:
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);  to your
application's init method.

On Sat, May 21, 2011 at 6:51 AM, meduolis meduol...@gmail.com wrote:

 Hi, is there any way to check if JS is enabled from wicket code?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/JavaScript-enabled-or-disabled-tp3540451p3540451.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: ComponentFeedbackPanel works during ajax validation, not on form submit

2011-05-05 Thread Adam Gray
I believe that method is intended to render a placeholder tag when a
component isn't visible on the page to allow ajax updates.  My ajax
validation works great already.  The component feedback panel is never
hidden, it just doesn't get picked up as a valid destination for feedback
messages on a non-ajax form submit.

I'm not sure if this might matter, but perhaps my earlier component
hierarchy was a little too simplistic a representation.  It looks a little
more like this:

page
--form
components
--form
listview (1 or more form panels)
barcodeTextField
barcodeFeedbackPanel

The part that confuses me is the difference between the ajax validation that
works and the normal submit process validation which can't seem find the
feedback panels in the hierarchy.  It feels like if one works, the other
should as well, or are these using separate visitor patterns to find the
feedback panels?

On Thu, May 5, 2011 at 5:34 AM, Andrea Del Bene adelb...@ciseonweb.itwrote:

 Hi Adam,

 try calling setOutputMarkupPlaceholderTag(true) instead of
 setOutputMarkupId on your barcodeFeedback.



  I have a component hierarchy that looks (grossly oversimplified) like:

 page
 --form
 components
 --form
 barcodeTextField
 barcodeFeedbackPanel

 TextFieldString  barcodeField = new TextFieldString(barcode);
 barcodeField.add(new StringValidator.ExactLengthValidator(11));
 form.add(barcodeField);

 ComponentFeedbackPanel barcodeFeedback = new
 ComponentFeedbackPanel(barcodeFeedback, barcodeField);
 barcodeFeedback.setOutputMarkupId(true);
 form.add(barcodeFeedback);

 barcodeField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
  @Override
 protected void onUpdate(AjaxRequestTarget target) {
 // nothing important
 }
  @Override
 protected void onError(AjaxRequestTarget target, RuntimeException e) {
 super.onError(target, e);
 target.addComponent(barcodeField);
 target.addComponent(barcodeFeedback);
 }
 });

 The onblur validation happens as expected and works great.  The form
 validation does not.  I'm given the ever-so-fun warning message about not
 finding the feedback panel:

 WARNING: Component-targetted feedback message was left unrendered. This
 could be because you are missing a FeedbackPanel on the page.  Message:
 [FeedbackMessage message = asdfas is an invalid barcode, reporter =
 barcode, level = ERROR]

 Is there something obvious that I'm missing that could cause something
 like
 this?  I believe that ajax validation does a truncated version of child
 visitation for validation and error message handling, but it seems odd
 that
 one process can find the feedback panel while the other cannot.  Any ideas
 or further insights into how the validation process works would be
 incredibly help since, at this point, I've hit the wall where what little
 expertise I have in wicket ends.

 Disclaimer: the above code was typed by hand, so there may be typos in the
 above that isn't necessarily reflected in the real code.

 ~Adam



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




Re: ComponentFeedbackPanel works during ajax validation, not on form submit

2011-05-05 Thread Adam Gray
Wow.  I guess that's me not understanding the inner-workings of list view.
 Thanks for pointing me at the list view.  Once that was pointed out, the
documentation explained it very well.  Knowing where to look seemed to be
what was blocking me.

Thanks again.

~Adam

On Thu, May 5, 2011 at 11:03 AM, Andrea Del Bene adelb...@ciseonweb.itwrote:

 Have called setReuseItems(true) on your listview component? Without this
 property setted to true, messages inside listview won't be displayed.

  I believe that method is intended to render a placeholder tag when a
 component isn't visible on the page to allow ajax updates.  My ajax
 validation works great already.  The component feedback panel is never
 hidden, it just doesn't get picked up as a valid destination for feedback
 messages on a non-ajax form submit.

 I'm not sure if this might matter, but perhaps my earlier component
 hierarchy was a little too simplistic a representation.  It looks a little
 more like this:

 page
 --form
 components
 --form
 listview (1 or more form panels)
 barcodeTextField
 barcodeFeedbackPanel

 The part that confuses me is the difference between the ajax validation
 that
 works and the normal submit process validation which can't seem find the
 feedback panels in the hierarchy.  It feels like if one works, the other
 should as well, or are these using separate visitor patterns to find the
 feedback panels?

 On Thu, May 5, 2011 at 5:34 AM, Andrea Del Beneadelb...@ciseonweb.it
 wrote:

  Hi Adam,

 try calling setOutputMarkupPlaceholderTag(true) instead of
 setOutputMarkupId on your barcodeFeedback.



  I have a component hierarchy that looks (grossly oversimplified) like:

 page
 --form
 components
 --form
 barcodeTextField
 barcodeFeedbackPanel

 TextFieldString   barcodeField = new TextFieldString(barcode);
 barcodeField.add(new StringValidator.ExactLengthValidator(11));
 form.add(barcodeField);

 ComponentFeedbackPanel barcodeFeedback = new
 ComponentFeedbackPanel(barcodeFeedback, barcodeField);
 barcodeFeedback.setOutputMarkupId(true);
 form.add(barcodeFeedback);

 barcodeField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
  @Override
 protected void onUpdate(AjaxRequestTarget target) {
 // nothing important
 }
  @Override
 protected void onError(AjaxRequestTarget target, RuntimeException e) {
 super.onError(target, e);
 target.addComponent(barcodeField);
 target.addComponent(barcodeFeedback);
 }
 });

 The onblur validation happens as expected and works great.  The form
 validation does not.  I'm given the ever-so-fun warning message about
 not
 finding the feedback panel:

 WARNING: Component-targetted feedback message was left unrendered. This
 could be because you are missing a FeedbackPanel on the page.  Message:
 [FeedbackMessage message = asdfas is an invalid barcode, reporter =
 barcode, level = ERROR]

 Is there something obvious that I'm missing that could cause something
 like
 this?  I believe that ajax validation does a truncated version of child
 visitation for validation and error message handling, but it seems odd
 that
 one process can find the feedback panel while the other cannot.  Any
 ideas
 or further insights into how the validation process works would be
 incredibly help since, at this point, I've hit the wall where what
 little
 expertise I have in wicket ends.

 Disclaimer: the above code was typed by hand, so there may be typos in
 the
 above that isn't necessarily reflected in the real code.

 ~Adam


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






ComponentFeedbackPanel works during ajax validation, not on form submit

2011-05-04 Thread Adam Gray
I have a component hierarchy that looks (grossly oversimplified) like:

page
--form
components
--form
barcodeTextField
barcodeFeedbackPanel

TextFieldString barcodeField = new TextFieldString(barcode);
barcodeField.add(new StringValidator.ExactLengthValidator(11));
form.add(barcodeField);

ComponentFeedbackPanel barcodeFeedback = new
ComponentFeedbackPanel(barcodeFeedback, barcodeField);
barcodeFeedback.setOutputMarkupId(true);
form.add(barcodeFeedback);

barcodeField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
 @Override
protected void onUpdate(AjaxRequestTarget target) {
// nothing important
}
 @Override
protected void onError(AjaxRequestTarget target, RuntimeException e) {
super.onError(target, e);
target.addComponent(barcodeField);
target.addComponent(barcodeFeedback);
}
});

The onblur validation happens as expected and works great.  The form
validation does not.  I'm given the ever-so-fun warning message about not
finding the feedback panel:

WARNING: Component-targetted feedback message was left unrendered. This
could be because you are missing a FeedbackPanel on the page.  Message:
[FeedbackMessage message = asdfas is an invalid barcode, reporter =
barcode, level = ERROR]

Is there something obvious that I'm missing that could cause something like
this?  I believe that ajax validation does a truncated version of child
visitation for validation and error message handling, but it seems odd that
one process can find the feedback panel while the other cannot.  Any ideas
or further insights into how the validation process works would be
incredibly help since, at this point, I've hit the wall where what little
expertise I have in wicket ends.

Disclaimer: the above code was typed by hand, so there may be typos in the
above that isn't necessarily reflected in the real code.

~Adam