Re: Repeaters, dynamic data & detaching models

2018-08-30 Thread Igor Vaynberg



> On Aug 27, 2018, at 6:00 AM, Tobias Gierke  
> wrote:
> 
> Hi,
> 
> A collegue of mine just came across a rather interesting bug in our Wicket 
> application.
> 
> 1. We have a simple page with a repeater (ListView) that displays a table and 
> on each row, some buttons to perform actions on the item shown on this row  
> (edit/delete/etc.)
> 2. The underlying data source (a database table) gets updated concurrently by 
> another process running on another machine
> 3. The table is supposed to always show the latest data at the very top, so 
> the page uses a LoadableDetachableModel to always hit the database on every 
> request
> 
> The bug:
> 
> Users complained that performing actions on the data items would actually 
> affect an item different from what they clicked.
> 
> The explanation:
> 
> Since the list model got detached at the end of the previous request, 
> clicking any of the action buttons would re-populate the data model, fetching 
> previously unseen rows from the database. Since (according to my 
> collegue,didn't double-check) the ListView associates the item models only 
> based on their list index, the action button on the very first row now all of 
> a sudden referred to a database row the user didn't even know about.
> 

This is exactly why ListViews should not be used to work with database data 
unless you override getListItemModel() to return a model to represent the item 
itself like Sven mentioned in his reply.

Here are three different ways to fix your problem from worst to best:

1. add(new AjaxButton( "delete , new EntityModel(item.getModelObject()))
Where EntityModel knows how to load the entity from the database - ie the jpa 
model sven mentioned.

2. New ListView<….> {
  getListItemModel(imodel list, int index) { return new 
EntityModel(list.getobject().get(index)); }
This is the same as above but has the advantage of item.getmodel() returning 
the better model

3. Use a RefreshingView or a DataView instead.

-Igor



>  add(new AjaxButton( "delete , item.getModelObject() )



> His fix:
> 
> Instead of
> 
> view = new ListView("listView" , dataProvider )
> {
>@Override
>protected void populateItem(ListItem item)
>{
>add(new AjaxButton( "delete , item.getModel() ) // use model from 
> ListItem (model gets detached after request)
>{
> public void onClick(AjaxRequestTarget target) {
> delete( getModelObject() );
> }
>});
>// ... more stuff
>}
> }
> 
> he changed the code to read:
> 
> view = new ListView("listView" , dataProvider )
> {
>@Override
>protected void populateItem(ListItem item)
>{
>add(new AjaxButton( "delete , item.getModelObject() ) // capture model 
> object when constructing the button
>{
> public void onClick(AjaxRequestTarget target) {
> delete( getModelObject() );
> }
>});
>// ... more stuff
>}
> }
> 
> This obviously is a rather subtle issue and - depending on the size of your 
> model objects - also comes with a certain performance/memory cost because of 
> the additional serialization for the model items the repeater components are 
> now holding onto.
> 
> Is this the recommended approach for dealing with dynamically changing data 
> or is there a better way to do it ?
> 
> Thanks,
> Tobias
> 
> 


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



Wicket Job Opportunity

2017-11-02 Thread Igor Vaynberg
Hi,
My company is looking to fill a 100% telecommuting (must reside within
two time zones of US/Central time GMT-0600) senior software engineer
position. We use Wicket/Weld/Hibernate stack. If you are interested
you can read more about the position here:
https://www.42lines.net/careers/software-eng/

Cheers,
-Igor

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



Re: Best practice for updating JPA object without persisting changes

2014-03-05 Thread Igor Vaynberg
have a look here:

https://www.42lines.net/2011/12/01/simplifying-non-trivial-user-workflows-with-conversations/

-igor

On Wed, Mar 5, 2014 at 3:47 AM, Chris Snyder chris.sny...@biologos.org wrote:
 I'm dealing with an issue that I'm sure has been solved by many people on
 this list, but I'm struggling to ascertain the best way to solve it.

 I'm working on implementing in-place-edit functionality for some of our
 site content. The content is stored in a database and mapped via JPA. The
 edit form has the JPA entity as the backing model object.

 One of the features I'm implementing is the ability to preview what's been
 entered in the form without the updates being committed to the database
 (until the user explicitly clicks on the Save button). I can think of a
 few ways to accomplish this:

 1. Rollback the transaction when not saving - This would require me to
 manage the transaction manually (right now, they're being managed
 automatically by Guice's PersistFilter).

 2. Detach the object from the persistence context, merge it to save - This
 seems like the most elegant solution, but I can see how there could be
 issues (not intractable) with lazy loading.

 3. Prevent the form from updating the model until save - This would break
 my preview panel, and seems to be contrary to how forms normally behave.

 4. Copy the data into a non-managed DTO, copying it back to the JPA object
 on save - Would require a lot of clone/copy code.

 This seems like such a common problem to solve - I think my relative
 unfamiliarity with JPA is the main stumbling block here. How have others
 implemented it? Is there a best-practice pattern that my Googling didn't
 discover?

 Thanks in advance for the help. I hope that it isn't too off-topic since it
 is mainly JPA-related.

 Best,
 Chris

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



Re: Best practice for updating JPA object without persisting changes

2014-03-05 Thread Igor Vaynberg
you simple need to change where the entitymanager instance lives, and
control it via cdi conversation api. no need to expose any more of the
jpa stuff.

-igor

On Wed, Mar 5, 2014 at 9:06 AM, Chris Snyder chris.sny...@biologos.org wrote:
 Thanks, Igor - that's very helpful. Not sure how I missed that article
 while I was searching.

 It would be a bit tricky to implement in my situation (as I described in
 another response, the JPA implementation of the data storage is abstracted
 behind a service API), but I could make it work - perhaps by adding detach
 and merge methods to the API; that would perhaps expose a little too much
 of the implementation, but I think that other (hypothetical)
 implementations could also need to expose similar functionality.

 Of course, I might be over-engineering this whole abstraction anyways. I
 have no intention of implementing a non-JPA version - perhaps I should
 embrace a hard dependency on JPA and simplify everything. JPA is itself an
 abstraction layer, after all...

 Thanks,
 Chris


 On Wed, Mar 5, 2014 at 11:44 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 have a look here:


 https://www.42lines.net/2011/12/01/simplifying-non-trivial-user-workflows-with-conversations/

 -igor

 On Wed, Mar 5, 2014 at 3:47 AM, Chris Snyder chris.sny...@biologos.org
 wrote:
  I'm dealing with an issue that I'm sure has been solved by many people on
  this list, but I'm struggling to ascertain the best way to solve it.
 
  I'm working on implementing in-place-edit functionality for some of our
  site content. The content is stored in a database and mapped via JPA. The
  edit form has the JPA entity as the backing model object.
 
  One of the features I'm implementing is the ability to preview what's
 been
  entered in the form without the updates being committed to the database
  (until the user explicitly clicks on the Save button). I can think of a
  few ways to accomplish this:
 
  1. Rollback the transaction when not saving - This would require me to
  manage the transaction manually (right now, they're being managed
  automatically by Guice's PersistFilter).
 
  2. Detach the object from the persistence context, merge it to save -
 This
  seems like the most elegant solution, but I can see how there could be
  issues (not intractable) with lazy loading.
 
  3. Prevent the form from updating the model until save - This would break
  my preview panel, and seems to be contrary to how forms normally behave.
 
  4. Copy the data into a non-managed DTO, copying it back to the JPA
 object
  on save - Would require a lot of clone/copy code.
 
  This seems like such a common problem to solve - I think my relative
  unfamiliarity with JPA is the main stumbling block here. How have others
  implemented it? Is there a best-practice pattern that my Googling didn't
  discover?
 
  Thanks in advance for the help. I hope that it isn't too off-topic since
 it
  is mainly JPA-related.
 
  Best,
  Chris

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




 --
 Chris Snyder
 Web Developer, BioLogos
 616.328.5218 x203
 biologos.org

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



Re: Show textfield as plaintext when disabled?

2014-03-01 Thread Igor Vaynberg
class MyTextField extends TextField {
  onComponentTag(tag) {
super.onComponentTag(tag);
if (!enabledInHierarchy()) {
tag.setName(label);
tag.removeAttribute(type);
tag.removeAttribute(value);
tag.setType(TagType.OPEN);
}
  }

 void onComponentTagBody(final MarkupStream markupStream, final
ComponentTag openTag) {
 replaceComponentTagBody(markupStream, openTag,
getDefaultModelObjectAsString());
  }
}

-igor

On Fri, Feb 28, 2014 at 11:33 AM, Entropy blmulholl...@gmail.com wrote:
 Is there a way to have my textfield show as plain text when in a readonly
 mode rather than as a disabled textbox?

 Backup question: I can imagine making a panel to do this...having a
 textfield and label and hiding whichever I didn't want, but I would want my
 panel to bind to a textbox in the parent page and replace that tag
 (otherwise I would have two textboxes, right).  How would I go about that?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Show-textfield-as-plaintext-when-disabled-tp4664723.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



Component Queueing is here (master), aka Free Wicket From Hierarchy Hell, aka Markup Driven Component Tree

2014-02-27 Thread Igor Vaynberg
in the past couple of weeks i finally had some time to finish up the
component queueing feature. it is meant to greatly decrease common
maintenance headaches associated with markup tweaks and moving
components around. see the intro here:

https://www.42lines.net/2014/02/28/component-queueing-in-wicket-7/

-igor

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



Re: ajax child component and enclosures visibility doesn't seem to work properly

2014-02-21 Thread Igor Vaynberg
that only works on inline enclosure - enclosures that do not use
wicket:enclosure tags.

-igor


On Fri, Feb 21, 2014 at 5:37 AM, Simon B simon.bott...@gmail.com wrote:
 Hi,

 I'm using wicket 6.13.

 I've got an ajax link that I want to toggle the visibility of two
 components, each component is nested with an html div with a
 wicket:enclosure attribute.



 In my WebPage when the AjaxLink is clicked I add the components to the
 AjaxRequestTarget but not the div wicket:enclosure elements.

 WebPage code:


 Looking at this post I understand that I shouldn't need to add the element
 that has the wicket:enclosure attribute.

 Simplified visibility control of Enclosures in Ajax requests -
 https://issues.apache.org/jira/browse/WICKET-3422

 Does any one have any suggestions as to why this isn't working?

 Any help greatly appreciated




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ajax-child-component-and-enclosures-visibility-doesn-t-seem-to-work-properly-tp4664606.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: ajax child component and enclosures visibility doesn't seem to work properly

2014-02-21 Thread Igor Vaynberg
yes, thats what i mean. the markup you posted did not come through to
the mailing list...

-igor


On Fri, Feb 21, 2014 at 7:48 AM, Simon B simon.bott...@gmail.com wrote:
 Hi Igor,

 Thanks for the reply.

 I'm a bit confused, the markup that I'm using (and that I posted originally)
 does have inline enclosure attributes:



 I understand that by inline enclosure you mean an html tag with a
 wicket:enclosure=... attribute like:

 div wicket:enclosure=aChildId

 Is that correct, or am I misunderstanding?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ajax-child-component-and-enclosures-visibility-doesn-t-seem-to-work-properly-tp4664606p4664615.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: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Igor Vaynberg
see

IAjaxRegionMarkupIdProvider

-igor

On Mon, Feb 17, 2014 at 7:37 AM, Simon B simon.bott...@gmail.com wrote:
 Hi,

 I have a behavior that decorates the component that it is added to by
 using beforeRender(Component) and afterRender(Component).

 So a simplified version of my behavior would be



 I wish for the visibility of the surrounding html that is written to be
 driven by the visibility of the component that it wraps including when the
 component that it wraps is sent to the client in an AjaxRequestTarget.

 What would be the best way to do this?

 Any suggestions very much appreciated.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511.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: setting visibility of a component decocorated with a behavior

2014-02-17 Thread Igor Vaynberg
cheers

-igor

On Mon, Feb 17, 2014 at 1:53 PM, Simon B simon.bott...@gmail.com wrote:
 Igor,

 Incidentally the javadoc on that interface is awesome, thanks for taking the
 time to make it so easily readable and understandable.

 Cheers
 Simon

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setting-visibility-of-a-component-decocorated-with-a-behavior-tp4664511p4664520.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: Jetty, Wicket and getting live JavaScript changes?

2014-02-15 Thread Igor Vaynberg
Make sure wicket is running in development mode. It will scan resources for
changes. A refresh in the browser will load the latest version.

-igor
On Feb 14, 2014 3:59 PM, tertioptus benpaige...@hotmail.com wrote:

 I use Jetty, maven and Eclipse.

 *What's the best way for me to have Jetty pick up my changes from a
 JavaScript file not in the war project?*

 Currently, I have clean install both projects and then restart jetty to see
 changes.

 I am assuming this is common among Wicket users with the advent of
 component
 bound resources.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Jetty-Wicket-and-getting-live-JavaScript-changes-tp4664472.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: Jetty, Wicket and getting live JavaScript changes?

2014-02-15 Thread Igor Vaynberg
Yes. Because they have shared classpath.

-igor
On Feb 15, 2014 7:58 AM, tertioptus benpaige...@hotmail.com wrote:

 Even if the resource files are in another project? Which is my particular
 issue.

 /For instance:
 Module 1 - jar
---some-wicket-component.java
---some-javascript-file.js

 Module 2 - war
-depends on Module 1

 Running Module 2 via jetty
 /

 I'm not sure how Wicket could pick up those changes.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Jetty-Wicket-and-getting-live-JavaScript-changes-tp4664472p4664481.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: Why is getDisplayValue in getDisplayValue final?

2014-01-09 Thread Igor Vaynberg
On Wed, Jan 8, 2014 at 11:41 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi Igor,

 While I see what you mean I think that often this is not the case. At least
 when using open source library.
 Most of the time users/developers do not read Javadoc but use the code
 directly.

this is not my experience. most users can barely attach javadoc to
their ide, not even speaking about source.

 If I want to override a method I'd first consult with the source of the
 overridden method, not with the Javadoc of the overridden method or its
 super.

if you consulted with the source you would see that there is no reason
to override that method directly as its functionality can  be
completely replaced by overriding postprocess()... so why override the
original?

-igor



 Martin Grigorov
 Wicket Training and Consulting


 On Thu, Jan 9, 2014 at 1:12 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 the method is final because overriding it means you will most likely
 break the contract of the resourceKey and postprocess methods which
 are meant to be used by you to customze the behavior of
 getDisplayValue().

 so lets say you create subclass MyEnumChoiceRenderer with an
 overridden getDisplayValue() that no longer calls postprocess(). then
 someone subclasses your subclass and overrides postprocess() expecting
 it to be called (thats what the javadoc says) but it wont be, because
 you broke the contract.

 having getDisplayValue() be final prevents you from breaking this
 contract and saving hours of head scratching down the road.

 if you look at EnumChoiceRenderer without getDisplayValue() there is
 only one meaningful line of code left:

 return Classes.simpleName(object.getDeclaringClass()) + '.' + object.name
 ();

 everything else is javadoc or declarations. so why all the fuss over a
 trivial line of code?

 -igor

 ps: ironically if you did want to override getDisplayValue() in a way
 that broke the contract you would have to make your subclass final so
 no one further down the road could subclass it...


 On Tue, Jan 7, 2014 at 6:37 AM, Oliver B. Fischer mails...@swe-blog.net
 wrote:
  Hi,
 
  I just tried to customize EnumChoiceRenderer and to override
  getDisplayValue, but is final. Why?
 
  Can I submit a patch to remove final?
 
  Bye,
 
  Oliver
 
  -
  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: Why is getDisplayValue in getDisplayValue final?

2014-01-08 Thread Igor Vaynberg
the method is final because overriding it means you will most likely
break the contract of the resourceKey and postprocess methods which
are meant to be used by you to customze the behavior of
getDisplayValue().

so lets say you create subclass MyEnumChoiceRenderer with an
overridden getDisplayValue() that no longer calls postprocess(). then
someone subclasses your subclass and overrides postprocess() expecting
it to be called (thats what the javadoc says) but it wont be, because
you broke the contract.

having getDisplayValue() be final prevents you from breaking this
contract and saving hours of head scratching down the road.

if you look at EnumChoiceRenderer without getDisplayValue() there is
only one meaningful line of code left:

return Classes.simpleName(object.getDeclaringClass()) + '.' + object.name();

everything else is javadoc or declarations. so why all the fuss over a
trivial line of code?

-igor

ps: ironically if you did want to override getDisplayValue() in a way
that broke the contract you would have to make your subclass final so
no one further down the road could subclass it...


On Tue, Jan 7, 2014 at 6:37 AM, Oliver B. Fischer mails...@swe-blog.net wrote:
 Hi,

 I just tried to customize EnumChoiceRenderer and to override
 getDisplayValue, but is final. Why?

 Can I submit a patch to remove final?

 Bye,

 Oliver

 -
 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-el - is this a safe way to hook into wicket?

2013-12-19 Thread Igor Vaynberg
On Wed, Dec 18, 2013 at 9:40 PM, Steve Coughlan shadders@gmail.com wrote:
 A few weeks back I made a post about the first version of universal
 expression language for wicket.  Since then it's come quite a way.  The
 initial version hooked into by implementing IMarkupResourceStreamProvider
 for markup owning MarkupContainers (Panel, Page etc...) and by regenerating
 markup fragments for markup receiving MarkupContainers (ListView).
 Unfortunately due to the fact that the EL expressions need to be evaluated
 on every request this meant a huge performance hit (about 75% less than
 standard wicket) due to forcing wicket to constantly parse markup on every
 request cycle.

 The current evolution of wicket-el hooks in very differently.  My first
 preference was to create a dynamic version of Markup and MarkupFragment
 that replaces MarkupElements that contain EL expressions with a dynamic
 version.  Unfortuantely this was impossible because I need to subclass
 Markup (wicket uses a few case of 'instanceof Markup') and Markup has many
 final methods.  And simply wrapping all the MarkupElements isn't possible
 because RawMarkup is a final class and is also reference inside wicket with
 'instanceof'.

 So the only way I could think of to do it (which I've done and it works) is
 to create a subclass of Markup (ModifiableMarkup) that takes the original
 wicket-parsed markup, and adds all it's elements.  Then during the onRender
 phase EL enabled components call
 ModifiableMarkup.resolve(ExpressionResolver, ELParseMatchList) which
 internally replaces RawMarkup elements belonging to that compenent with an
 EL resolved version.  This is done just before calling super.onRender().
 Sounds ugly but it works and performance is now equal to standard wicket
 (in some cases can even be a little faster due to not needing
 PropertyModels).

 Because the Markup instances are now mutable I can't use wicket's markup
 cache as it's one per class and ModifiableMarkup.resolve method could
 easily be called by many threads at once.  So I've had to implement caching
 per thread/class combination.  i.e. ELPanel will have a cached instance of
 Markup for every thread.

 My question is twofold:
 1/ As I have no choice but to leave ModifiableMarkup mutable, what is the
 purpose of making Markup immutable?  From what I can see from browsing
 wicket source all it achieves is a bit of safety and releasing some
 resources from the backing XmlTags in the MarkupElements.  Is there any
 other purpose to it?  i.e. can you forsee any problems with using a mutable
 instance of Markup for rendering?

because its immutable it is thread-safe. making it mutable would add a
lot of complexity to make sure it is thread-safe.

-igor



 2/ Is the per thread/class caching strategy really safe?  The only way I
 could think it could be broken is if it was possible for the server to
 suspend a thread mid-render cycle and give another request use of that
 thread.  If that happened the new request would overwrite the markup
 expressions and the when the old resumed and expressions already resolved
 would have values from the the request that interrupted it.
 As far as I'm aware with the work I've done with Jetty and NIO connectors
 before this will only happen if you ask Jetty to do it while processing the
 request. Is this a possibility with wicket or can I rely on a complete
 render cycle to happen uninterrupted before the thread is reused for
 another request?

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



Re: Enfocing INPUT field names to respect hCard formats

2013-11-17 Thread Igor Vaynberg
override getInputName() and return the string you want.

-igor

On Sun, Nov 17, 2013 at 5:21 AM, Arjun Dhar dhar...@yahoo.com wrote:
 http://microformats.org/wiki/hcard-input-examples#person_billing_shipping_input

 To ensure browsers can Auto fill Input form fields for E-Commerce forms and
 common fields. I want to ensure the fieldNames match this convention.

 I tried a test class something like


 ..but it does not respect the input field provided; specially if the INput
 field is Bound via CompoundPropertyModel. Say shippingAddress contains city.
 Then the field is still named shippingAddress:city.

 How best to overcome this so I can standardize my field Names via HTML.
 I dont want to be writing HTML field names in Java code. That would suck.

 thanks




 -
 Software documentation is like sex: when it is good, it is very, very good; 
 and when it is bad, it is still better than nothing!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Enfocing-INPUT-field-names-to-respect-hCard-formats-tp4662465.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: weld conversation propagation page

2013-11-13 Thread Igor Vaynberg
this is the desired behavior. see conversation propagation settings.
by default conversations are only propagated to non-bookmarkable
pages.

-igor

On Wed, Nov 13, 2013 at 4:36 AM, brazz alexander.li...@man.eu wrote:
 Hi,

 after spending a hard time debugging i found this problem:

 i have to pages:
 FirstPage.class
 SecondPage.class

 on FirstPage.class i create a new conversation with conversation.begin();
 and on FirstPage.class i have a link:

 *setResponsePage(SecondPage.class);*

 this link results in a new transient Conversation on SecondPage.class

 if i create a new instance in setResponsePage():
 *setResponsePage(new SecondPage());*

 the conversation is propagated correctly ot SecondPage.class.

 As i am new to cdi and weld i cannot really estimate if this is a bug or
 desired behavior:

 Thanks for any explanations.




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/weld-conversation-propagation-page-tp4662389.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: Interesting article from Zeroturnaround

2013-07-31 Thread Igor Vaynberg
unless youve built and maintained a real non-trivial application using all
those frameworks how can you put numbers on them?

-igor


On Wed, Jul 31, 2013 at 5:47 AM, Michael Mosmann mich...@mosmann.de wrote:

 Am 31.07.13 13:56, schrieb Andrea Del Bene:

  I don't agree with everything in it, but it's a good article anyway :) ...

 http://zeroturnaround.com/**rebellabs/the-curious-coders-**
 java-web-frameworks-**comparison-spring-mvc-grails-**
 vaadin-gwt-wicket-play-struts-**and-jsf/http://zeroturnaround.com/rebellabs/the-curious-coders-java-web-frameworks-comparison-spring-mvc-grails-vaadin-gwt-wicket-play-struts-and-jsf/

 I will take some time and put my own numbers (with some hopefully good
 explanations) in to the mix. So stay tuned:)


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



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




its that time of year again, 42lines is hiring java devs

2013-07-30 Thread Igor Vaynberg
the company i work for ( 42lines.net ) is growing and we are looking
for a few good devs.

about our approach:

* we are a distributed usa-based company
* everyone telecommutes either from home or a coworking space of your
choice (paid for by the company)
* we use a variation of agile methodology (daily scrums, iterations,
peer code reviews, etc)
* we offer a great compensation package

tech stack:

* wicket
* jpa/hibernate/querydsl
* cdi/weld
* resteasy
* jquery / jquery mobile

what we want from you:

* first and foremost you are smart and you know how to apply those
smarts to writing code
* you work on PST/EST time
* you have a decent internet connection capable of skype
* you understand (not just know) java and oop
* you are comfortable in sql, hibernate, and wicket

there is lots more info, including how to apply, available here:

https://www.42lines.net/2013/07/24/now-hiring-one-new-software-engineer/

cheers,
-igor

ps, if you have a question please email me personally.


Re: http://wicketinaction.com/ broken?

2013-07-19 Thread Igor Vaynberg
works for me


On Fri, Jul 19, 2013 at 1:19 PM, Dan Retzlaff dretzl...@gmail.com wrote:

 Busted for me.


 On Fri, Jul 19, 2013 at 12:54 PM, William Speirs wspe...@apache.org
 wrote:

  Worked for me... try again?
 
  Bill-
 
 
  On Fri, Jul 19, 2013 at 2:52 PM, Gabriel Landon glan...@piti.pf wrote:
 
   Hi,
  
   The website wicketinaction.com seems to be down, only the home page is
   working.
   All the other pages return a 404.
  
   Where can I find a working version of the website?
  
   Regards,
   Gabriel.
  
  
  
  
   --
   View this message in context:
  
 
 http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: How to prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Igor Vaynberg
the easiest way to do it is to tell the ajax channel used by the link
to drop requests if one is already in progress, this is called an
active channel.


add(new AjaxLink(..) {
  updateAjaxAttributes(attrs) {
 attrs.setChannel(new AjaxChannel(blocking, AjaxChannel.Type.ACTIVE));
  }
}

if you wan to block across a group of links then create a channel
singleton and give it to all the links.

-igor


On Fri, Jul 12, 2013 at 4:17 AM, Steamus steam...@gmail.com wrote:
 When I fast click in an AjaxFallbackLink in my DataTable the first click
 works correct but next click generates Access Denied (You do not have access
 to the page you requested.). And there is an exception
 “RequestListenerInterface.invoke(..) | behavior not enabled; ignore call.”

 I was trying to investigate a forum and looks like it is famous problem. But
 all advices proposed to read a topic
 http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/.

 Unfortunately the link unavailable any more. May be anybody can repeat a
 solution or for last five years was proposed something new?

 I really appreciate any help you can provide.




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226.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: Adding border in border

2013-07-10 Thread Igor Vaynberg
SubBorder.java
class SubBorder extends Border {
   SubBorder() {
 ...
   }
}
SubBorder.html
wicket:border xmlns:wicket
   ... border:body/ ...
/wicket:border
MainBorder.java
class MainBorder extends Border {
   MainBorder() {
  addToBorder(new SubBorder(sub1));
  addToBorder(new SubBorder(sub2));
   }
}
MainBorder.html
wicket:border
   div wicket:id=sub1
   /div
   border:body/
div wicket:id=sub2
/div
/wicket:border
TestPage.java
class TestPage extends WebPage {
   TestPage() {
  add(new MainBorder(border):
}
}
TestPage.html
body
div wicket:id=border
/div
/body

-igor

On Wed, Jul 10, 2013 at 9:34 AM, miao2oo miao...@gmail.com wrote:
 Hi need some help here. Anyone knows how to add a Border in a Border.
 Eg.
 [HTML]
 wicket:border wicket:id=mainBorder
 wicket:border wicket:id=subBorder1

 /wicket:border
 wicket:border wicket:id=subBorder2

 /wicket:border
 /wicket:border

 [Java]
 public TestPage(final String id) {
 super(id);
 MainBorder mainBorder = new MainBorder(mainBorder);
 mainBorder.addToBorder(new SubBorder(subBorder1));
 mainBorder.addToBorder(new SubBorder(subBorder2));
 add(mainBorder);
 }



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Adding-border-in-border-tp4660191.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: What is the purpose of Validatable.model?

2013-06-25 Thread Igor Vaynberg
this method is useful for validators that integrate with other
frameworks. take for example bean-validation framework.

a bean validation validator can call getModel(), get the model, cast
it to IPropertyReflectionAwareModel, get the property, and retrieve
validation annotations associated with it.

-igor


On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis msc...@gmail.com wrote:
 Hi all,

 What is the purpose of Validatable.model?

 I don't seem to be able to find any usages of Validatable.getModel(),
 setModel() or model...

 Thanks
 Marios

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



Re: CDI WELD-000070 Simple bean cannot be a non-static inner class

2013-06-10 Thread Igor Vaynberg
you cannot inject non-static classes...

class org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot
be a non-static inner class

-igor

On Mon, Jun 10, 2013 at 8:32 AM, Phill gilberth...@gmail.com wrote:
 I'm trying to use wicket-cdi with Glassfish 4.0 and get the following
 exceptions.
 Should wicket-cdi work with soon-to-be-released Java EE 7 / CDI 1.1 ?

 2013-06-10 17:12:34,351 [http-listener-2(2)] DEBUG
 o.apache.wicket.MarkupContainer - Add markupHighlight to [Page class =
 org.apache.wicket.markup.html.pages.ExceptionErrorPage, id = 3, render count
 = 0]
 2013-06-10 17:12:34,354 [http-listener-2(2)] ERROR
 o.a.w.DefaultExceptionMapper - An error occurred while handling a previous
 error: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
 non-static inner class
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-70 Simple bean
 [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
 non-static inner class
 at
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:82)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:68)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1039)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.apache.wicket.cdi.NonContextual.init(NonContextual.java:118)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.cdi.NonContextual.of(NonContextual.java:84)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.NonContextualManager.inject(NonContextualManager.java:54)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.ComponentInjector.onInstantiation(ComponentInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
 ~[wicket-util-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.Component.init(Component.java:683)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.WebMarkupContainer.init(WebMarkupContainer.java:52)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:57)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:44)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.markup.html.link.Link.init(Link.java:105)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1.init(ExceptionErrorPage.java:97)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.pages.ExceptionErrorPage.init(ExceptionErrorPage.java:96)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:128)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.DefaultExceptionMapper.map(DefaultExceptionMapper.java:62)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.handleException(RequestCycle.java:352)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:229)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 

Re: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-03 Thread Igor Vaynberg
you might have to override updateAttributes on the behavior and say
attributes.allowdefault(true)

-igor

On Mon, Jun 3, 2013 at 11:28 AM, divad91 diva...@hotmail.com wrote:
 Hi,

 Im not sure if my problem is related to wicket or jQuery but since I
 upgraded from wicket 6.6.0 to 6.8.0, my required validation on RadioChoice
 is not working anymore.

 The problems occurs on every RadioChoice with an
 AjaxFormChoiceComponentUpdatingBehavior behavior.
 If I removed the behavior, my validation works perfectly. When the behavior
 is on my radioChoice, my ajax listener is called but my field stays in
 error.

 I didn't change anycode. I just upgraded from 6.6.0 to 6.8.0.

 I am using jQuery Validation Plugin 1.11.1 for validation.
 Do we still need to use AjaxFormChoiceComponentUpdatingBehavior on
 RadioChoice ? Does anyone encounter  a similar problem ?

 Thanks
 David




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216.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: [wicket 6] Create/Register Spring Bean in wicket ?

2013-05-10 Thread Igor Vaynberg
see spring's FactoryBean, its an indirect way to create beans.

-igor

On Fri, May 10, 2013 at 12:33 PM, smallufo small...@gmail.com wrote:
 Hi , I wonder if it possible to programmatically create / register a spring
 bean in wicket?
 maybe in Application.init() ...

 Most documents about spring are making use of existent beans , and inject
 to WebPage or Panel via @SpringBean , and it indeed works well.

 But my interface implementations are depend on wicket-component ,
 such as getting absolute URL of a page or a DynamicImageResource

 So these beans should be initialized and register to Spring in init()
 (correct me if I am wrong)

 Any way to achieve this ?

 Thanks.

 (I am using wicket 6.7 )

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



Re: Handling user-specific timezones

2013-05-09 Thread Igor Vaynberg
we should write components that work with multiple types.

for example this is what code of a DateLabel might look like:

@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag
openTag) {

String body = ;
Object date = getDefaultModelObject();
if (date != null) {
 if (date instanceof ReadablePartial) { body = ... }
 else if (date instanceof ReadableInstant) { body = ... }
 else if (date instanceof Date) { body = ...}
 else if (date instanceof Timestamp) { body = ... }
 else {
throw new IllegalStateException(Object of type : +
date.getClass().getName() +  is not supported);
  }
}
replaceComponentTagBody(markupStream, openTag, body);
}

we are not using a converter because DateLabel carries a format string
as a property.

such a component is convenient because you dont need to worry if you
are using it with older api that has Date or a newer one that has Joda

we cannot go solely on threeten because version 1.0 is not coming
until jdk8 and only with jdk8.

-igor

On Thu, May 9, 2013 at 12:03 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi Dan,

 I have no much experience with this matter so I cannot help much.

 The new Joda-Time is http://threeten.github.io/

 Question to other devs: do you think it is OK to migrate wicket-datetime
 module to JDK 1.7 version of ThreeTen for Wicket 7 ?
 I find this task interesting to me so I'll gladly work on it if other devs
 think that the API break is worth it.



 On Thu, May 9, 2013 at 12:46 AM, Dan Retzlaff dretzl...@gmail.com wrote:

 Hi all,

 I'd like to know what conventions you've established for your sites that
 deal with users in many time zones.

 Do you simply replace the converters (Date, SqlDate, SqlTime,
 SqlTimestamp)?

 Do you avoid MessageFormats in StringResourceModels? (I don't see a way to
 configure its MessageFormat.)

 We currently bypass this stuff and do our formatting with application
 utility methods, and adapting input into users' timezones as manual steps,
 e.g. with Joda-Time's DateTime#withZoneRetainFields().

 I'd like to sweep this stuff under the rug with some application-level
 configuration, e.g. of converters. But before I embark, I was hoping to
 hear from someone who's already gone on this journey.

 And related: maybe you have some golden rules time zone handling to share?
 A couple of mine are:
 1. Avoid date types in SQL tables because it's hard to correctly compare
 to now across timezones.
 2. Anything that shifts millis to adjust for timezones is a red flag
 (including the aforementioned #withZoneRetainFields() sadly).
 3. java.util.Date is evil and you should avoid it whenever possible.
 Calendar is marginally better, but Joda-Time is the way to go.

 Thanks,
 Dan




 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/

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



Re: Handling user-specific timezones

2013-05-09 Thread Igor Vaynberg
On Thu, May 9, 2013 at 12:32 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Thu, May 9, 2013 at 5:37 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 we should write components that work with multiple types.


 But this will mean that we will have to re-write it to javax.time for the
 version of Wicket that will use JDK 8.
 Your suggestion doesn't sound attractive to me anymore :-/

no, it just means we *add* handling for javax.time types when they
become available.


 for example this is what code of a DateLabel might look like:

 @Override
 public void onComponentTagBody(MarkupStream markupStream, ComponentTag
 openTag) {

 String body = ;
 Object date = getDefaultModelObject();
 if (date != null) {
  if (date instanceof ReadablePartial) { body = ... }
  else if (date instanceof ReadableInstant) { body = ... }
  else if (date instanceof Date) { body = ...}
  else if (date instanceof Timestamp) { body = ... }
  else {
 throw new IllegalStateException(Object of type : +
 date.getClass().getName() +  is not supported);
   }
 }
 replaceComponentTagBody(markupStream, openTag, body);
 }

 we are not using a converter because DateLabel carries a format string
 as a property.

 such a component is convenient because you dont need to worry if you
 are using it with older api that has Date or a newer one that has Joda

 we cannot go solely on threeten because version 1.0 is not coming
 until jdk8 and only with jdk8.


 I don't get the only with jdk8 part.
 http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.threeten%22%20AND%20a%3A%22threetenbp%22
 threetenbp is the backport for JDK 7. It is version 0.8.1 at the moment so
 API changes may be expected, but it can be used now.

right. but can we have a production version with a pre 1.0 dependency?
as far as semver goes pre 1.0 is the wild west - anything can change.
i think thats a bit dicy. and even if we do that, we should still
suport java.util.Date and java.sql.Timestamp. these types are in wide
use currently and will be for a while.

-igor





 -igor

 On Thu, May 9, 2013 at 12:03 AM, Martin Grigorov mgrigo...@apache.org
 wrote:
  Hi Dan,
 
  I have no much experience with this matter so I cannot help much.
 
  The new Joda-Time is http://threeten.github.io/
 
  Question to other devs: do you think it is OK to migrate wicket-datetime
  module to JDK 1.7 version of ThreeTen for Wicket 7 ?
  I find this task interesting to me so I'll gladly work on it if other
 devs
  think that the API break is worth it.
 
 
 
  On Thu, May 9, 2013 at 12:46 AM, Dan Retzlaff dretzl...@gmail.com
 wrote:
 
  Hi all,
 
  I'd like to know what conventions you've established for your sites that
  deal with users in many time zones.
 
  Do you simply replace the converters (Date, SqlDate, SqlTime,
  SqlTimestamp)?
 
  Do you avoid MessageFormats in StringResourceModels? (I don't see a way
 to
  configure its MessageFormat.)
 
  We currently bypass this stuff and do our formatting with application
  utility methods, and adapting input into users' timezones as manual
 steps,
  e.g. with Joda-Time's DateTime#withZoneRetainFields().
 
  I'd like to sweep this stuff under the rug with some application-level
  configuration, e.g. of converters. But before I embark, I was hoping to
  hear from someone who's already gone on this journey.
 
  And related: maybe you have some golden rules time zone handling to
 share?
  A couple of mine are:
  1. Avoid date types in SQL tables because it's hard to correctly
 compare
  to now across timezones.
  2. Anything that shifts millis to adjust for timezones is a red flag
  (including the aforementioned #withZoneRetainFields() sadly).
  3. java.util.Date is evil and you should avoid it whenever possible.
  Calendar is marginally better, but Joda-Time is the way to go.
 
  Thanks,
  Dan
 
 
 
 
  --
  Martin Grigorov
  Wicket Training  Consulting
  http://jWeekend.com http://jweekend.com/

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




 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/

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



Re: Handling user-specific timezones

2013-05-09 Thread Igor Vaynberg
On Thu, May 9, 2013 at 1:12 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Thu, May 9, 2013 at 9:45 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Thu, May 9, 2013 at 12:32 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
  On Thu, May 9, 2013 at 5:37 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  we should write components that work with multiple types.
 
 
  But this will mean that we will have to re-write it to javax.time for the
  version of Wicket that will use JDK 8.
  Your suggestion doesn't sound attractive to me anymore :-/

 no, it just means we *add* handling for javax.time types when they
 become available.


 having support for both joda and javax.time sounds a bit too much

 additionally https://issues.apache.org/jira/browse/WICKET-466 is since
 2007. Everyone knows the issues with j.u.Date/Calendar.
 The fact that JDK development is slow doesn't mean that we should be slow
 too. It is 6 years since this request has been made. Isn't it time to drop
 support for j.u.Date/Calendar ?

there are a lot of issues with j.u.Date. no one here is going to
dispute that. but, even with all these issues it is still a widely
used class, and will continue to be long after jdk8 is released.

i do not care if internally wicket used joda or anything else to
represent time. we can encapsulate whatever mechanism we want. but,
externally we should support j.u.Date as well as joda, etc.

for example, jpa codebases which need to be portable or jee apps can
only map j.u/s.Date and j.s.Timestamp because those are the only
temporal types jpa has support for. if we do not support these
directly then the users will either have to convert their domain to
perform conversion in getters/setters or use a model adapter to bind
to those types. either way, its a hassle, especially since its really
easy for us to support these types directly.

-igor






 
  for example this is what code of a DateLabel might look like:
 
  @Override
  public void onComponentTagBody(MarkupStream markupStream, ComponentTag
  openTag) {
 
  String body = ;
  Object date = getDefaultModelObject();
  if (date != null) {
   if (date instanceof ReadablePartial) { body = ... }
   else if (date instanceof ReadableInstant) { body = ... }
   else if (date instanceof Date) { body = ...}
   else if (date instanceof Timestamp) { body = ... }
   else {
  throw new IllegalStateException(Object of type : +
  date.getClass().getName() +  is not supported);
}
  }
  replaceComponentTagBody(markupStream, openTag, body);
  }
 
  we are not using a converter because DateLabel carries a format string
  as a property.
 
  such a component is convenient because you dont need to worry if you
  are using it with older api that has Date or a newer one that has Joda
 
  we cannot go solely on threeten because version 1.0 is not coming
  until jdk8 and only with jdk8.
 
 
  I don't get the only with jdk8 part.
 
 http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.threeten%22%20AND%20a%3A%22threetenbp%22
  threetenbp is the backport for JDK 7. It is version 0.8.1 at the moment
 so
  API changes may be expected, but it can be used now.

 right. but can we have a production version with a pre 1.0 dependency?
 as far as semver goes pre 1.0 is the wild west - anything can change.
 i think thats a bit dicy. and even if we do that, we should still
 suport java.util.Date and java.sql.Timestamp. these types are in wide
 use currently and will be for a while.

 -igor


 
 
 
  -igor
 
  On Thu, May 9, 2013 at 12:03 AM, Martin Grigorov mgrigo...@apache.org
  wrote:
   Hi Dan,
  
   I have no much experience with this matter so I cannot help much.
  
   The new Joda-Time is http://threeten.github.io/
  
   Question to other devs: do you think it is OK to migrate
 wicket-datetime
   module to JDK 1.7 version of ThreeTen for Wicket 7 ?
   I find this task interesting to me so I'll gladly work on it if other
  devs
   think that the API break is worth it.
  
  
  
   On Thu, May 9, 2013 at 12:46 AM, Dan Retzlaff dretzl...@gmail.com
  wrote:
  
   Hi all,
  
   I'd like to know what conventions you've established for your sites
 that
   deal with users in many time zones.
  
   Do you simply replace the converters (Date, SqlDate, SqlTime,
   SqlTimestamp)?
  
   Do you avoid MessageFormats in StringResourceModels? (I don't see a
 way
  to
   configure its MessageFormat.)
  
   We currently bypass this stuff and do our formatting with application
   utility methods, and adapting input into users' timezones as manual
  steps,
   e.g. with Joda-Time's DateTime#withZoneRetainFields().
  
   I'd like to sweep this stuff under the rug with some
 application-level
   configuration, e.g. of converters. But before I embark, I was hoping
 to
   hear from someone who's already gone on this journey.
  
   And related: maybe you have some golden rules time zone handling to
  share?
   A couple of mine are:
   1. Avoid date types in SQL tables because it's hard to correctly

Re: Migrating WebRequestCycleProcessor from 1.4.x to 6.5.0

2013-05-07 Thread Igor Vaynberg
all these things can be accomplished from inside IRequestCycleListener

-igor

On Mon, May 6, 2013 at 10:26 PM, iamrakesh iamrakes...@rediffmail.com wrote:
 Hi,

 In resolve() method we're trying to catch  handle InvalidUrlException to
 prevent exception due to multiple clicks on a button.
 In respond() method we're logging the request target
 [RequestCycle#getRequestTarget() value] and if it is of type
 AjaxRequestTarget we're trying to add components to request target which
 needs to updated on the page, this must be done just before the actual
 response is rendered.
 And in newRequestCodingStrategy() method, we're returning a custom
 implementation of
 org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy
 class. This custom implementation overrides the encodeURL() method.

 Regards,
 Rakesh.A



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Migrating-WebRequestCycleProcessor-from-1-4-x-to-6-5-0-tp4658605p4658607.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: Change signature of AbstractTree or Model.ofSet

2013-05-07 Thread Igor Vaynberg
jira ticket please. can only be fixed in 7.0

-igor

On Sun, May 5, 2013 at 5:30 AM, Илья Нарыжный phan...@ydn.ru wrote:
 Hello,

 I have following problem in wicket 6 with trees:
 Constructor of
 class org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree
 have following signature:
 protected AbstractTree(String id, ITreeProviderT provider, IModelSetT
 state)
 The problem is in IModelSetT state argument and fact that Model.ofSet
 return IModelSet? extends C, so it's not possible directly pass
 IModelSet? extends C to constructor. It seems that either Model.ofSet
 should be changed or AbstractTree.

 What do you think?

 Regards,

 Ilia

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



Re: How to unit test AttributeModifier

2013-05-07 Thread Igor Vaynberg
attribute modifiers are behaviors, so use
component.getbehavior(AttributeModifier.class) to get it.

-igor

On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hello,

 Is it possible to unit test an AttributeModifier?

 I have a simple component:

 WebMarkupContainer container = new WebMarkupContainer(containerId);
 container.add(new AttributeModifier(name, anyDynamicValue));

 In the unit test:

 WebMarkupContainer container = (WebMarkupContainer)
 tester.getComponentFromLastRenderedPage(containerId);

 Is it possible to get the modifier above? I can see it in the object state
 (while debugging) but I have no idea how to get it to test an
 anyDynamicValue...

 Any ideas?

 Regards,

 Dmitriy

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



Re: Wicket RepeatingView refresh / rerender ? Possibilities? [List items missing]

2013-05-07 Thread Igor Vaynberg
repeatingviews are manual repeaters - meaning they do not get updated
once they are built.

you should most likely use a RefreshingView, or navigate back to the
page in such a way that a new instance is created which will rebuild
the repeatingview.

-igor

On Tue, May 7, 2013 at 5:59 AM, DaWicketUser d3nny...@web.de wrote:
 Hi Community,

 i got a little problem with my wicket application.

 The problem is on a page called OverviewPage, here are some panels like the
 ListPanel, in which my RepeatingView is.

 This RepeatingView (List) got some items with a button for each item, if i
 press the button, i will be redirected to another page (RegistationPage) and
 some changes to the RepeatingView (list) are done.

 If i now navigate back to the OverviePage with the RepeatingView (list), the
 list is exactly the same like before. I did changes to the list items but
 they are not visible. (I did not press the browser back button, i clicked a
 link of my navigation)

 I know instances of wicket pages last over the session... can i tell wicket
 to rerender this page / list again? what possibilities are there? can anyone
 help oder give advices?

 Thanks

 DaWicketUser



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-RepeatingView-refresh-rerender-Possibilities-List-items-missing-tp4658623.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: Wicket 6.x and Repeaters API change to use longs

2013-05-03 Thread Igor Vaynberg
4.8.4 Aggregate Functions in the SELECT Clause The result of a query
...

The Java type that is contained in the result of a query using an
aggregate function is as follows:
COUNT returns Long.
...

-igor

On Fri, May 3, 2013 at 8:35 AM, Paul Bors p...@bors.ws wrote:
 I'm a bit confused and can't find the JPA version that uses longs instead of
 ints as mentioned in the migration guide at:

 https://cwiki.apache.org/WICKET/migration-to-wicket-60.html

 Repeaters

 *   `IDataProvider` was converted to using `long` instead of `int` to
 better line up with JPA and other persistence frameworks. This has caused a
 rather large cascade of `int` to `long` changes all over the repeater
 packages (WICKET-1175 https://issues.apache.org/jira/browse/WICKET-1175 ).



 Could someone shed some light? I'm still using JEE 6 (as many of us) and I
 don't feel comfortable casting a bunch of longs to int in my DAO code.



 ~ Thank you,

 Paul Bors




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



Re: Wicket 6.x and Repeaters API change to use longs

2013-05-03 Thread Igor Vaynberg
yes. when i was looking at this i thought about making the
dataprovider paging param ints, but then the long return type didnt
make sense.

since count() returns a long its feasible to request offsets in the
long range - eg user presses last page and you actually have more rows
then an int can hold.

so rather then going with a mixed approach that made the code base a
big mess i went with the biggest type everywhere, which is a long.

what i did at my day job is to create an entity data provider that
handles all these inconsistencies and castings and exposes a
consistent api to how our application works...

-igor

On Fri, May 3, 2013 at 8:58 AM, Paul Bors p...@bors.ws wrote:
 All good and solid, but take for example Javax's Query API:
 http://docs.oracle.com/javaee/6/api/javax/persistence/Query.html#setFirstRes
 ult(int)

 Since Wicket's DataProvider now offers the first and count as longs, one
 would have to cast first to an int to pass it through the JEE 6 API, right?
 Or am I missing something?

 ~ Thank you,
   Paul Bors

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, May 03, 2013 11:45 AM
 To: users@wicket.apache.org
 Subject: Re: Wicket 6.x and Repeaters API change to use longs

 4.8.4 Aggregate Functions in the SELECT Clause The result of a query ...

 The Java type that is contained in the result of a query using an aggregate
 function is as follows:
 COUNT returns Long.
 ...

 -igor

 On Fri, May 3, 2013 at 8:35 AM, Paul Bors p...@bors.ws wrote:
 I'm a bit confused and can't find the JPA version that uses longs
 instead of ints as mentioned in the migration guide at:

 https://cwiki.apache.org/WICKET/migration-to-wicket-60.html

 Repeaters

 *   `IDataProvider` was converted to using `long` instead of `int` to
 better line up with JPA and other persistence frameworks. This has
 caused a rather large cascade of `int` to `long` changes all over the
 repeater packages (WICKET-1175
 https://issues.apache.org/jira/browse/WICKET-1175 ).



 Could someone shed some light? I'm still using JEE 6 (as many of us)
 and I don't feel comfortable casting a bunch of longs to int in my DAO
 code.



 ~ Thank you,

 Paul Bors




 -
 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: Question regarding exceptions in Apache Wicket

2013-05-01 Thread Igor Vaynberg
what is the purpose of knowing whether an exception is a wicket
exception or something from further down the stack?

eg how would you handle a runtime exception that came from within
java.lang.String differently then the one that came from Wicket or the
one that came from the servlet api?

-igor

On Wed, May 1, 2013 at 12:23 AM, Behrooz Nobakht nob...@gmail.com wrote:
 Hello,

 I've been working on an error page in Apache Wicket and came across a
 general pattern in Apache Wicket and I'd like to understand the reason for
 it.

 Exceptions in Apache Wicket do not have a single class hierarchy; i.e.
 there are exceptions that eventually extend WicketRuntimeException but
 they are also many others that start either from RuntimeException or
 Exception. I could guess for the reasons for checked exceptions but why
  did *not* Apache Wicket introduce exception classes that all inherit from
 a single exception class?

 A direct side effect of this design decision is that the check (e
 instanceof WicketRuntimeException) cannot give an indication if the
 exception is actually an exception raised by Wicket and need separate
 checks for different concerns.

 Thanks in advance for your explanations.

 Regards,
 Behrooz

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



Re: Question regarding exceptions in Apache Wicket

2013-05-01 Thread Igor Vaynberg
On Wed, May 1, 2013 at 1:23 AM, Behrooz Nobakht nob...@gmail.com wrote:
 More clearly, the intention is to be able to distinguish exceptions from
 Apache Wicket and other frameworks and not really handle them.

for what purpose? an unhandled exception is an unhandled exception...

 For
 instance, there can be two exceptions: MarkupException and
 CouldNotLockPageException. Both are in the context of Apache Wicket,
 however, we actually need to two checks to determine either. If they
 inherited a common parent class, it needed one check.

 I do not want to say that Apache Wicket should have done this. I first want
 to understand why this design decision has been made.

because we could not come up with a good usecase for having a common
parent. in any case there would have to be two parents - one for
checked and one for unchecked exceptins. which means that both would
have to implement some kind of a tagging interface to allow a single
instanceof check. but without a valid usecase why do this?

if you really want to know you can see if the exception class lives in
the org.apache.wicket.* package, and if it does its a wicket
exception.

-igor






 On Wed, May 1, 2013 at 10:04 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 what is the purpose of knowing whether an exception is a wicket
 exception or something from further down the stack?

 eg how would you handle a runtime exception that came from within
 java.lang.String differently then the one that came from Wicket or the
 one that came from the servlet api?

 -igor

 On Wed, May 1, 2013 at 12:23 AM, Behrooz Nobakht nob...@gmail.com wrote:
  Hello,
 
  I've been working on an error page in Apache Wicket and came across a
  general pattern in Apache Wicket and I'd like to understand the reason
 for
  it.
 
  Exceptions in Apache Wicket do not have a single class hierarchy; i.e.
  there are exceptions that eventually extend WicketRuntimeException but
  they are also many others that start either from RuntimeException or
  Exception. I could guess for the reasons for checked exceptions but
 why
   did *not* Apache Wicket introduce exception classes that all inherit
 from
  a single exception class?
 
  A direct side effect of this design decision is that the check (e
  instanceof WicketRuntimeException) cannot give an indication if the
  exception is actually an exception raised by Wicket and need separate
  checks for different concerns.
 
  Thanks in advance for your explanations.
 
  Regards,
  Behrooz

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




 --
 -- Behrooz Nobakht

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



Re: Question regarding exceptions in Apache Wicket

2013-05-01 Thread Igor Vaynberg
how is this different than handling an exception that comes from say javax.mail?

-igor

On Wed, May 1, 2013 at 2:48 AM, Behrooz Nobakht nob...@gmail.com wrote:
 Thanks for the reply.

 The purpose is that when it's determined that exception comes from Wicket,
 the error page (1) can reduce the cause chain (which can be independent of
 Apache Wicket of course), and (2) based on this information provide the
 user to report a bug or email the stack trace to a set of stack holders.
 That's why I was thinking using instanceof as less as possible is more
 preferred and indeed cleaner instead of checking package names.

 I generally agree that this could be done independent of how Apache Wicket
 exceptions are designed and it's more categorized in the convenience
 zone.


 On Wed, May 1, 2013 at 11:06 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Wed, May 1, 2013 at 1:23 AM, Behrooz Nobakht nob...@gmail.com wrote:
  More clearly, the intention is to be able to distinguish exceptions from
  Apache Wicket and other frameworks and not really handle them.

 for what purpose? an unhandled exception is an unhandled exception...

  For
  instance, there can be two exceptions: MarkupException and
  CouldNotLockPageException. Both are in the context of Apache Wicket,
  however, we actually need to two checks to determine either. If they
  inherited a common parent class, it needed one check.
 
  I do not want to say that Apache Wicket should have done this. I first
 want
  to understand why this design decision has been made.

 because we could not come up with a good usecase for having a common
 parent. in any case there would have to be two parents - one for
 checked and one for unchecked exceptins. which means that both would
 have to implement some kind of a tagging interface to allow a single
 instanceof check. but without a valid usecase why do this?

 if you really want to know you can see if the exception class lives in
 the org.apache.wicket.* package, and if it does its a wicket
 exception.

 -igor


 
 
 
 
  On Wed, May 1, 2013 at 10:04 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  what is the purpose of knowing whether an exception is a wicket
  exception or something from further down the stack?
 
  eg how would you handle a runtime exception that came from within
  java.lang.String differently then the one that came from Wicket or the
  one that came from the servlet api?
 
  -igor
 
  On Wed, May 1, 2013 at 12:23 AM, Behrooz Nobakht nob...@gmail.com
 wrote:
   Hello,
  
   I've been working on an error page in Apache Wicket and came across a
   general pattern in Apache Wicket and I'd like to understand the reason
  for
   it.
  
   Exceptions in Apache Wicket do not have a single class hierarchy; i.e.
   there are exceptions that eventually extend WicketRuntimeException
 but
   they are also many others that start either from RuntimeException or
   Exception. I could guess for the reasons for checked exceptions
 but
  why
did *not* Apache Wicket introduce exception classes that all inherit
  from
   a single exception class?
  
   A direct side effect of this design decision is that the check (e
   instanceof WicketRuntimeException) cannot give an indication if the
   exception is actually an exception raised by Wicket and need separate
   checks for different concerns.
  
   Thanks in advance for your explanations.
  
   Regards,
   Behrooz
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  -- Behrooz Nobakht

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




 --
 -- Behrooz Nobakht

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



Re: Disabling Individual Checkboxes in CheckGroup

2013-04-28 Thread Igor Vaynberg
On Fri, Apr 26, 2013 at 8:39 AM, eugenebalt eugeneb...@yahoo.com wrote:
 Igor,

 The problem is, you do check.setEnabled(false) in *ListView.populateItem()*
 for a CheckGroup control.

so?

 This method executes AFTER the Ajax update. It's too late to do
 check.setEnable(false) on the render of the CheckGroup's ListView. We need
 to disable/enable checkboxes in a CheckGroup as part of the Ajax update.

you call setenabled(false) on a check. then rerender it using ajax.
perhaps you should show some code so we can better understand what you
are trying to do.

-igor


 (This does work with CheckBoxMultipleChoice, because there is no ListView
 rendering and the checkboxes can be handled individually, but we need a grid
 layout and we don't get it with that control.)

 Thanks



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Disabling-Individual-Checkboxes-in-CheckGroup-tp4658165p4658320.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: Disabling Individual Checkboxes in CheckGroup

2013-04-22 Thread Igor Vaynberg
check.setEnabled(false)

-igor

On Mon, Apr 22, 2013 at 2:09 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 I'm not sure this is what you want, but you can subclass the Check class
 and override its onComponentTag method to add disabled=disabled to the
 input tags you want to disable. You can also do it with a behavior instead
 of subclassing.

 Remember that if you replace the checkbox html inputs via ajax to toggle
 the disable state of checkboxes, you will likely lose their current
 client-side checked state. Maybe toggling the disabled attribute via
 javascript using the component ids would be better.


 On 22/04/2013 12:06 PM, eugenebalt wrote:

 How would you disable individual checkboxes in a CheckGroup?

 With a CheckBoxMultipleChoice, it's easy: just override isDisabled(int
 index) for the particular index you want to disable.

 But we are using a CheckGroup, not CheckBoxMultipleChoice, because we need
 a
 grid layout for our set of checkboxes. The CheckGroup components works via
 a
 repeater, such as ListView. We've tried addOrReplace a new ListView, with
 some new disabled checkboxes, and it doesn't pick it up until it goes to
 render, which doesn't work for us in an Ajax request.

 The new disabled checkboxes in the CheckGroup have to be set as part of
 the
 Ajax update. Thanks.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Disabling-Individual-Checkboxes-in-CheckGroup-tp4658165.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


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



Re: How to force user to select from AutoComplete choices

2013-04-16 Thread Igor Vaynberg
you can try using this:

https://github.com/ivaynberg/wicket-select2

-igor

On Tue, Apr 16, 2013 at 8:30 AM, heikki tropic...@gmail.com wrote:
 hello,

 I've an autocomplete textfield (this one:
 com.googlecode.wicket.jquery.ui.form.autocomplete.AutoCompleteTextField) and
 I'd like to restrict users to select one of the values presented in its
 choices.

 As it is, you can also input values that are not in the choices.

 Is there an easy way to do this ?

 Kind regards
 Heikki Doeleman



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-force-user-to-select-from-AutoComplete-choices-tp4658033.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: AddOrReplace with Ajax

2013-04-11 Thread Igor Vaynberg
addOrReplace will copy the id for you.

you just have to make sure that the component you are replacing has
its setOutputMarkupId() set to true during the initial non-ajax
render. from then on everything will work the same.

-igor

On Thu, Apr 11, 2013 at 3:01 PM, Nick Pratt nbpr...@gmail.com wrote:
 I use addOrReplace fairly frequently in normal requests, but Im having
 trouble making this work in an Ajax request.

 1. Add EmptyPanel(someId); to page
 2. User clicks link, and then on the server side I do: addOrReplace(new
 DetailPanel(someId));
  and the Details Panel appears in place of the EmptyPanel.

 How do I make this work in an AjaxLink?

 In order to update the component via Ajax, I need its markupId in the
 existing markup - EmptyPanel doesnt have one (or has a different one to the
 DetailPanel).

 Should I set the markupId of the EmptyPanel and the constructed DetailPanel
 to be the same value?

 Regards

 Nick

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



Re: Repainting repeaters - why the need for the enclosing element

2013-04-09 Thread Igor Vaynberg
this has to do with how wicket repaints things with ajax. what it does
is render the component and then replace the component's root dom node
in the existing markup with the one rendered via ajax.

lets take a simple example of attaching a listview to a [tr]

add(new ListView(rows, ...) { });

[table][tr wicket:id=rows]...[/tr][/table]

suppose there are 3 items in the list

when rendered during initial request it looks like this

[table][tr][/tr][tr][/tr][tr][/tr][table]

now you say target.add(listview) to repaint it via ajax.

what will be rendered is this: [tr][/tr][tr][/tr][tr][/tr] but there
is no root dom node to replace...thus the problem

if you attach a webmarkup container to [table] and then repaint that
instead of the listview then the markup getting repainted is:
[table][tr][/tr][tr][/tr][tr][/tr][table] and that has the one
top-level tag you need to replace in markup.

you might argue that wicket should be smart and handle each [tr] separately.

what happens if elements change order? wicket would need to reorder
the nodes as well.

what happens if some elements in the list are no longer there? they
need to be somehow removed from the markup - but this information is
missing from the markup generated by re-rendering a repeater for ajax.
we cant just say : take the parent of the [tr] tag, clear all
children, add ones in ajax response. the reason we cannot is because
there may be two repeaters attached under the same parent node and you
may only be repainting one of them.

a possible solution would be to keep a list of previously rendered
repeater item ids in the repeater - that way we would know what to
nuke in the markup. but that would make the internals more
complicated.

adding a parent container and repainting that seems like a simple
solution to the problem.

-igor


On Tue, Apr 9, 2013 at 9:45 AM, Nick Pratt nbpr...@gmail.com wrote:
 I've never really understood this concept, and Im hoping that someone can
 explain:

 When I have a repeater, say a ListView, and I have the tags set up:

 div wicket:id=myRepeater
  ...
  whatever
  ...
 /div

 Why cant I repaint that component via Ajax? There's an ID etc.  - what in
 Wicket forces us to wrap that component in a (typically) WebMarkupContainer
 just to repaint the repeater?

 N

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



Re: Markup ID set on a container

2013-04-03 Thread Igor Vaynberg
this warning is because you attach the webmarkupcontainer to a
wicket:container tag

this tag is not rendered in deployment mode, so the id you want to
output using setOutputMarkupId() wont be there either - thus the
warning.

-igor

On Wed, Apr 3, 2013 at 11:18 AM, Nick Pratt nbpr...@gmail.com wrote:
 Ive started to see this in my logs:

 2013-04-03 14:11:31,332 WARN  [http-bio-8080-exec-2]
 org.apache.wicket.Component - Markup id set on a component that is usually
 not rendered into markup. Markup id: wmcb7, component id: wmc, component
 tag: container.
 2013-04-03 14:11:35,079 WARN  [http-bio-8080-exec-2]
 org.apache.wicket.Component - Markup id set on a component that is usually
 not rendered into markup. Markup id: wmcdb, component id: wmc, component
 tag: container.
 2013-04-03 14:11:50,590 WARN  [http-bio-8080-exec-2]
 org.apache.wicket.Component - Markup id set on a component that is usually
 not rendered into markup. Markup id: wmcfe, component id: wmc, component
 tag: container.
 2013-04-03 14:12:01,359 WARN  [http-bio-8080-exec-2]
 org.apache.wicket.Component - Markup id set on a component that is usually
 not rendered into markup. Markup id: wmc12c, component id: wmc, component
 tag: container.


 When did this warning get added (Im using Wicket 6.7.0-SNAPSHOT)? It's very
 common (at least here) to put repeaters and other groups of components in
 to WebMarkupContainers and then update them via Ajax as a single unit.

 N

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



Re: Adding a large amount of MarkupContainers into the ListView or RepeatingView

2013-03-26 Thread Igor Vaynberg
putting a 10 components into a page is ill advised even if they
are under different parents. what is the usecase you are trying to
implement?

-igor

On Tue, Mar 26, 2013 at 8:07 AM, Marco Springer ma...@glitchbox.nl wrote:
 Hi,

 Lets say I have about ~100.000 of MarkupContainer objects that I want to put
 into a ListView or RepeatingView.
 This works fine functional wise... It's rather slow though.

 It boils down to:
 MarkupContainer:
 1309 private Component put(final Component child)
 1310{
 1311int index = children_indexOf(child);
 1312if (index == -1)
 1313{
 1314children_add(child);
 1315return null;
 1316}
 1317else
 1318{
 1319return children_set(index, child);
 1320}
 1321}

 and the call to children_indexOf(child) where it loops over all it's
 existing children and compares the id's until a match is found.
 With an increasing amount of children this can get rather slow...

 I though off overruling some functionality in the MarkupContainer class since
 I'm sure that for this list of items the children will be unique in their id
 and don't need that lookup, and overruling the put or children_indexOf
 function would give me enough power to skip that performance impacting part.
 But most functions have private access, leaving me nothing to control the
 adding of child components to a MarkupContainer.

 Does anyone else have experience with adding rather large quantities to
 something like the ListView and/or RepeatingView?
 Or is there another way of rendering this large amount of containers?

 Thanks in advance.

 Kind regards,
 Marco

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



Re: Adding a large amount of MarkupContainers into the ListView or RepeatingView

2013-03-26 Thread Igor Vaynberg
On Tue, Mar 26, 2013 at 1:31 PM, Marco Springer ma...@glitchbox.nl wrote:
 Actually, the performance problem was in the first row, well actually the 
 header that
 was rendering all days in a week/month/year.

 Each data row itself has a lot less items.
 Each row has items that are absolutely positioned within the relatively 
 positioned row.
 Each item can span over multiple days/week/months or even years, depending on 
 the
 task duration.

 Doing this instead of rendering divs for each day saves a lot of calculation 
 on the
 server side and a whole lot less html on the client side.
 And this creates other nifty possibilities like making the item divs 
 resizable and
 draggable in that row with bound ajax calls to those actions.
 For showing a grid I've done some background images that match the zoom level,
 since each day is static in width.

 I've thought about lazy loading the rows that where outside of the scrollable 
 view,
 since I indeed have a scrollable view.
 But that's something for the future.

 Rendering the 287 years

pretty sure gantt charts didnt exist 287 years ago... :)

-igor

 , e.g. 104k~ ish days, did render eventually and the server
 and browser didn't choke, but the div with was about 5M px width wide, so 
 that was
 nonsense :P

 On Wednesday 27 March 2013 05:25:40 Bernard wrote:
 Hi,

 AFAIK the solutions for large numbers of cells in GUI frameworks are:

 1) Do not render cells that are not in the scrollable view
 2) Create components only per once row or column and provide cell
 renderers. See javax.swing.table.TableCellRenderer

 With these approaches there is basically no limit to the amount of
 data that can be displayed on the screen.

 The current architecture seems to be here that the entire view is
 rendered on the server irrespective of how much of it is displayed
 in the client. This rules out 1)

 Still the current architecture allows to exploit 2) which would solve
 your performance problem if applicable to your use case. But that is
 theory until someone creates TableCellRenderer for Wicket.

 Kind Regards,

 Bernard

 On Tue, 26 Mar 2013 16:07:17 +0100, you wrote:
 Hi,
 
 Lets say I have about ~100.000 of MarkupContainer objects that I want to
 put into a ListView or RepeatingView.
 This works fine functional wise... It's rather slow though.
 
 It boils down to:
 MarkupContainer:
 1309 private Component put(final Component child)
 1310 {
 1311 int index = children_indexOf(child);
 1312 if (index == -1)
 1313 {
 1314 children_add(child);
 1315 return null;
 1316 }
 1317 else
 1318 {
 1319 return children_set(index, child);
 1320 }
 1321 }
 
 and the call to children_indexOf(child) where it loops over all it's
 existing children and compares the id's until a match is found.
 With an increasing amount of children this can get rather slow...
 
 I though off overruling some functionality in the MarkupContainer class
 since I'm sure that for this list of items the children will be unique in
 their id and don't need that lookup, and overruling the put or
 children_indexOf function would give me enough power to skip that
 performance impacting part. But most functions have private access,
 leaving me nothing to control the adding of child components to a
 MarkupContainer.
 
 Does anyone else have experience with adding rather large quantities to
 something like the ListView and/or RepeatingView?
 Or is there another way of rendering this large amount of containers?
 
 Thanks in advance.
 
 Kind regards,
 Marco

 -
 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: Adding a large amount of MarkupContainers into the ListView or RepeatingView

2013-03-26 Thread Igor Vaynberg
On Tue, Mar 26, 2013 at 2:00 PM, Marco Springer ma...@glitchbox.nl wrote:

 On Tuesday 26 March 2013 13:48:05 Igor Vaynberg wrote:
 On Tue, Mar 26, 2013 at 1:31 PM, Marco Springer ma...@glitchbox.nl wrote:
  Actually, the performance problem was in the first row, well actually the
  header that was rendering all days in a week/month/year.
 
  Each data row itself has a lot less items.
  Each row has items that are absolutely positioned within the relatively
  positioned row. Each item can span over multiple days/week/months or even
  years, depending on the task duration.
 
  Doing this instead of rendering divs for each day saves a lot of
  calculation on the server side and a whole lot less html on the client
  side.
  And this creates other nifty possibilities like making the item divs
  resizable and draggable in that row with bound ajax calls to those
  actions.
  For showing a grid I've done some background images that match the zoom
  level, since each day is static in width.
 
  I've thought about lazy loading the rows that where outside of the
  scrollable view, since I indeed have a scrollable view.
  But that's something for the future.
 
  Rendering the 287 years

 pretty sure gantt charts didnt exist 287 years ago... :)
 who talks about the past! the future baby! 26 Feb 2013 - 26 Feb 2300 :)

thats some optimistically farsighted planning :)



 -igor

  , e.g. 104k~ ish days, did render eventually and the server
  and browser didn't choke, but the div with was about 5M px width wide, so
  that was nonsense :P
 
  On Wednesday 27 March 2013 05:25:40 Bernard wrote:
  Hi,
 
  AFAIK the solutions for large numbers of cells in GUI frameworks are:
 
  1) Do not render cells that are not in the scrollable view
  2) Create components only per once row or column and provide cell
  renderers. See javax.swing.table.TableCellRenderer
 
  With these approaches there is basically no limit to the amount of
  data that can be displayed on the screen.
 
  The current architecture seems to be here that the entire view is
  rendered on the server irrespective of how much of it is displayed
  in the client. This rules out 1)
 
  Still the current architecture allows to exploit 2) which would solve
  your performance problem if applicable to your use case. But that is
  theory until someone creates TableCellRenderer for Wicket.
 
  Kind Regards,
 
  Bernard
 
  On Tue, 26 Mar 2013 16:07:17 +0100, you wrote:
  Hi,
  
  Lets say I have about ~100.000 of MarkupContainer objects that I want to
  put into a ListView or RepeatingView.
  This works fine functional wise... It's rather slow though.
  
  It boils down to:
  MarkupContainer:
  1309 private Component put(final Component child)
  1310 {
  1311 int index = children_indexOf(child);
  1312 if (index == -1)
  1313 {
  1314 children_add(child);
  1315 return null;
  1316 }
  1317 else
  1318 {
  1319 return children_set(index, child);
  1320 }
  1321 }
  
  and the call to children_indexOf(child) where it loops over all it's
  existing children and compares the id's until a match is found.
  With an increasing amount of children this can get rather slow...
  
  I though off overruling some functionality in the MarkupContainer class
  since I'm sure that for this list of items the children will be unique
  in
  their id and don't need that lookup, and overruling the put or
  children_indexOf function would give me enough power to skip that
  performance impacting part. But most functions have private access,
  leaving me nothing to control the adding of child components to a
  MarkupContainer.
  
  Does anyone else have experience with adding rather large quantities to
  something like the ListView and/or RepeatingView?
  Or is there another way of rendering this large amount of containers?
  
  Thanks in advance.
  
  Kind regards,
  Marco
 
  -
  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


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



Re: Wicket for Hybrid App

2013-03-25 Thread Igor Vaynberg
why wait? https://code.google.com/p/i-jetty/

-igor

On Mon, Mar 25, 2013 at 3:38 PM, Paul Bors p...@bors.ws wrote:
 I was kidding hence the smiling face :P
 Although, you might be able to do so in a few years or so...

 You'll have to have a full native phone app since you're already have a
 requirement to run the app offline (and you can't run Wicket on the phone).
 If the app is static, you might get to cache some HTML on the phone
 otherwise you'll only get to use Wicket on the server side.

 ~ Thank you,
   Paul Bors

 -Original Message-
 From: manuelbarzi [mailto:manuelba...@gmail.com]
 Sent: Monday, March 25, 2013 5:14 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket for Hybrid App

 Create a native app for your phone that installs Tomcat, Jetty along
 with your Wicket webapp and whatever else you might nedd.
 Have your webapp on all those clients sync up with your central db
 whenever they come online :)


 how do you do explain that? running a fully compliant jvm in a smartphone,
 for instance? doesn't seem to have sense, at least nowadays for the moment.


 -
 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: Custom DropDownChoice using HeaderItem

2013-03-21 Thread Igor Vaynberg
use OnDomReadyHeaderItem

-igor

On Thu, Mar 21, 2013 at 10:16 AM, prasopes vladimirkro...@gmail.com wrote:
 Hi,
 I'd like to have a DropDownChoice that gets transformed with Javascript on
 each rendering. The Javascript manipulates the option tags. Is it possible
 to achieve this using override of renderHead method?
 I tried:

 But when the Javascript gets called, the select has no options yet. Am I
 headed in a completely wrong direction?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Custom-DropDownChoice-using-HeaderItem-tp4657418.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: wicket:for behavior

2013-03-14 Thread Igor Vaynberg
wicket:for cant set output markup id because it comes after the form
component in markup and so the form component has already been
rendered. it already sets the output of markup, but it only helps if
the label is before the component in markup.

-igor

On Thu, Mar 14, 2013 at 1:35 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 Try with : textField.setOutputMarkupId(true).
 If this helps please file a ticket - 'wicket:for' should do this for you.


 On Thu, Mar 14, 2013 at 5:01 AM, Maxim Solodovnik solomax...@gmail.comwrote:

 Hello,

 I'm trying to use wicket:for as follows:
 input wicket:id=rememberMe type=checkbox /label
 wicket:for=rememberMewicket:ommessage key=288 //label

 https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html

 the resulting HTML is:
 tdinput type=checkbox name=rememberMelabel for=id3Remember
 login/label/td
 http://demo.dataved.ru/openmeetings/html

 and label for is not working :(

 Am I using this feature improperly?
 Wicket 6.6.0 is used

 Thanks in advance

 --
 WBR
 Maxim aka solomax




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

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



Re: Another question on stateless/bookmarkable pages

2013-03-05 Thread Igor Vaynberg
a bookmarkable page is a page that can be instantiated via a url -
meaning it has a default constructor or one that takes a
PageParameters object.

a stateful page can or can not be bookmarkable.
a stateless page must be bookmarkable.

-igor


On Tue, Mar 5, 2013 at 1:40 PM, Andrea Del Bene an.delb...@gmail.com wrote:
 Hi,

 I still have a little doubt about stateless and bookmarkable pages. if i
 have understood well a stateless page must respect the following
 requirements:
 -all its children components and behaviors must be stateless
 -the page must be instantiated with a constructor with no argument or
 with a single PageParameters argument.

 That said, is it right to state that a bookmarkable page is also a stateless
 page? And the vice versa? I mean, does a stateless page always have a
 bookmarkable URL when it is rendered?

 -
 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: 42lines CDI injection failure fallback - set to null?

2013-03-04 Thread Igor Vaynberg
this is how cdi works, if it cannot inject something it fails. notice
the top frame is inside weld not wicket nor wicket-cdi.

if you have things that can be optional you should inject
InstanceThing and query that for thing.

-igor

On Mon, Mar 4, 2013 at 1:25 PM, Ondrej Zizka ozi...@redhat.com wrote:
 Hi all,

 I use the CDI integration.

new
 CdiConfiguration(bm).setPropagation(ConversationPropagation.NONE).configure(this);

 When the injection fails, it happens in init. Can I configure it to set
 the field to null,  as a NPE during page rendering is easier to handle than
 init exception?
 I didn't find anything in the lib itself.

 The stacktrace is:

  at
 org.jboss.weld.manager.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:102)
  at net.ftlines.wicket.cdi.NonContextual.inject(NonContextual.java:141)
  at
 net.ftlines.wicket.cdi.NonContextualManager.inject(NonContextualManager.java:49)
  at
 net.ftlines.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:38)
  at
 net.ftlines.wicket.cdi.ComponentInjector.onInstantiation(ComponentInjector.java:43)
  at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:36)
  at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
  at
 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
  at
 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:32)
  at org.apache.wicket.Component.init(Component.java:679)


 Thanks,
 Ondra

 -
 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 to automatically add a parameter to every request

2013-02-26 Thread Igor Vaynberg
see IRequestCycleListener#onUrlMapped()

-igor

On Tue, Feb 26, 2013 at 6:35 PM, Florian Braun florianbrau...@gmail.com wrote:
 Hello,

 I am currently in the process of migrating an application from Wicket 1.4 to 
 Wicket 6.

 In my application I have a parameter that needs to be part of every request 
 (kind of like pageMaps used to be in 1.4).
 This means I have to check each request to see if the parameter is there and 
 if not create a new one and add it.

 In Wicket 1.4 I had logic in the resolve() method of the 
 WebRequestCycleProcessor where I basically called setResponsePage() with the 
 new parameter and threw a AbstractRestartResponseException().

 In Wicket 6 I was able to achieve the same by creating a custom Mapper that 
 extends the MountedMapper.
 In this Mapper I added logic to the parseRequest method to check if the 
 UrlInfo includes the parameter and if not create a new UrlInfo instance based 
 on the original one that includes the parameter.

 This works but it requires that all pages are mounted with this specific 
 Mapper.

 Is there a better way to add this logic so that it automatically applies to 
 every request and does not require the developers to use the custom mapper?

 Thanks,
 Florian

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



Re: Eclipse or IntelliJ

2013-02-19 Thread Igor Vaynberg
all the popular IDEs have more or less converged in regard to their
java feature set. now its just a matter of muscle memory :)

-igor

On Tue, Feb 19, 2013 at 4:39 PM, Timo Schmidt wic...@xomit.de wrote:
 On Tue 19.02.2013 15:17, Stephen Walsh wrote:
 Who uses what and why?

 I've only ever used Eclipse, but I discovered IntelliJ earlier this week
 and it's so different.  Just wondering pros and cons on each.

 I'm using NetBeans for serveral years now and havn't missed a
 feature yet. IMHO NetBeans is worth a try.

   -Timo

 -
 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: Behaviour.onInitialise()

2013-02-07 Thread Igor Vaynberg
What happens if the behavior is added after the component has already been
initialized? Does its oninitialize() still get called? Ambiguities like
this is the reason why there is no such method.

-igor

On Wednesday, February 6, 2013, Colin Rogers wrote:

 Martin and other Wicketeers,

 I have a quick, small question; why is there no 'onInitiailise()' method
 on Behaviour classes?

 There is an 'bind' method, but this, unlike 'onInitialise' is call
 immediately on binding to component, whether the component is in the
 component tree or not. Obviously it's very easy to work around;

 * Simply ensure that bind is called after the component is added
 to the component tree, even throwing an exception when 'component'
 parameter has null for a parent. (This is how AbstractAjaxBehavior works).

 * Add a 'firstTime' flag in onConfigure, and set to false after
 the onInitialise functionality is performed.

 While it is easy to work around, it seems odd that Behaviours lack the
 common onInitialise that all Wicket components otherwise have, I'm curious
 as to why that is, and hoping it wouldn't be an issue to add - it would aid
 in removing boiler plate code in Behaviours.

 Cheers,
 Col.

 PS. Apologies for spelling 'initialise' and 'behaviour' correctly - I
 can't help it... :)

 EMAIL DISCLAIMER This email message and its attachments are confidential
 and may also contain copyright or privileged material. If you are not the
 intended recipient, you may not forward the email or disclose or use the
 information contained in it. If you have received this email message in
 error, please advise the sender immediately by replying to this email and
 delete the message and any associated attachments. Any views, opinions,
 conclusions, advice or statements expressed in this email message are those
 of the individual sender and should not be relied upon as the considered
 view, opinion, conclusions, advice or statement of this company except
 where the sender expressly, and with authority, states them to be the
 considered view, opinion, conclusions, advice or statement of this company.
 Every care is taken but we recommend that you scan any attachments for
 viruses.



Re: Behaviour.onInitialise()

2013-02-07 Thread Igor Vaynberg
On Thu, Feb 7, 2013 at 3:33 PM, Colin Rogers
colin.rog...@objectconsulting.com.au wrote:
 That ambiguous-ness is ever more present when you use bind - as there is no 
 guarantee what state the component is in (hence our need for boilerplate 
 code, to determine that state). It's not there if  you are using 
 onInitialise, as it's part of the component lifecycle, you know what state 
 the parent component is in.

thats why bind() makes no guarantee about the state of the component,
it is simply called when the behavior is added to the component.

 What happens if the behaviour is added after the component has already been 
 initialized? Does its oninitialize() still get called?

 Of course - I'd expect adding a Behaviour to a Panel is no different from add 
 a Label to a Panel. The onInitialise in the Behaviour would be called the 
 same as the Label - as and when it's part of the component tree. As 
 behaviours are re-useable extensions to components, I'd expect them to behave 
 in the same way.

there is a small problem with this line of thinking: behaviors are
different from components in that one instance of a behavior can be
added to multiple components. so behavior A gets added to a component
that is already initialized - no onInitialize call, then same instance
gets added to component B that is not yet initialized, now
onInitialize is called? doesnt make any sense unfortunately.

perhaps what you can do is describe your concrete usecase for needing
this method and we may be able to better help  you.

-igor


 Cheers,
 Col.

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: 07 February 2013 19:14
 To: users@wicket.apache.org
 Subject: Re: Behaviour.onInitialise()

 What happens if the behavior is added after the component has already been 
 initialized? Does its oninitialize() still get called? Ambiguities like this 
 is the reason why there is no such method.

 -igor

 On Wednesday, February 6, 2013, Colin Rogers wrote:

 Martin and other Wicketeers,

 I have a quick, small question; why is there no 'onInitiailise()'
 method on Behaviour classes?

 There is an 'bind' method, but this, unlike 'onInitialise' is call
 immediately on binding to component, whether the component is in the
 component tree or not. Obviously it's very easy to work around;

 * Simply ensure that bind is called after the component is added
 to the component tree, even throwing an exception when 'component'
 parameter has null for a parent. (This is how AbstractAjaxBehavior works).

 * Add a 'firstTime' flag in onConfigure, and set to false after
 the onInitialise functionality is performed.

 While it is easy to work around, it seems odd that Behaviours lack the
 common onInitialise that all Wicket components otherwise have, I'm
 curious as to why that is, and hoping it wouldn't be an issue to add -
 it would aid in removing boiler plate code in Behaviours.

 Cheers,
 Col.

 PS. Apologies for spelling 'initialise' and 'behaviour' correctly - I
 can't help it... :)

 EMAIL DISCLAIMER This email message and its attachments are
 confidential and may also contain copyright or privileged material. If
 you are not the intended recipient, you may not forward the email or
 disclose or use the information contained in it. If you have received
 this email message in error, please advise the sender immediately by
 replying to this email and delete the message and any associated
 attachments. Any views, opinions, conclusions, advice or statements
 expressed in this email message are those of the individual sender and
 should not be relied upon as the considered view, opinion,
 conclusions, advice or statement of this company except where the
 sender expressly, and with authority, states them to be the considered view, 
 opinion, conclusions, advice or statement of this company.
 Every care is taken but we recommend that you scan any attachments for
 viruses.

 EMAIL DISCLAIMER This email message and its attachments are confidential and 
 may also contain copyright or privileged material. If you are not the 
 intended recipient, you may not forward the email or disclose or use the 
 information contained in it. If you have received this email message in 
 error, please advise the sender immediately by replying to this email and 
 delete the message and any associated attachments. Any views, opinions, 
 conclusions, advice or statements expressed in this email message are those 
 of the individual sender and should not be relied upon as the considered 
 view, opinion, conclusions, advice or statement of this company except where 
 the sender expressly, and with authority, states them to be the considered 
 view, opinion, conclusions, advice or statement of this company. Every care 
 is taken but we recommend that you scan any attachments for viruses.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org

Re: Log user changes to a form

2013-02-07 Thread Igor Vaynberg
if you are using hibernate here is envers...easier to do it on that
level rather then ui...

-igor

On Thu, Feb 7, 2013 at 4:11 PM, Paul Bors p...@bors.ws wrote:
 We have an enterprise web-app which is going through SAP qualification and
 a requirement has come through for our application’s settings changes to be
 logged.



 There are quite a number of pages for which now we must log the values of
 the form fields as they were before the user changed them and after they
 have been changed.



 Before I go crazy and implement my own form to traverse the wicket
 component tree for all of its children looking at form components and
 capturing their model objects I was wondering if anyone out there has run
 into such as use-case and how did you go about resolving it?



 Obviously I would like a generic approach rather than fix this at a
 per-page or per-form basics.

 ~ Thank you,
Paul Bors

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



Re: Page load without version redirect for Bootstrap Modal

2013-02-07 Thread Igor Vaynberg
instead of doing it that way have the ajax operation that opens the
dialog render the content into some div in the markup and call the
dialog on that div.

-igor

On Thu, Feb 7, 2013 at 4:38 PM, Tom Eicher t...@teicher.net wrote:
 Hello,

 with Bootstrap's modal functionality, I can make very cool modal
 popups.

 http://twitter.github.com/bootstrap/javascript.html#modals

 The problems start when I want to provide the popup's content
 dynamically via Wicket, because I need to provide a href that will be
 loaded by JQuerys load method, which apparently does not respect
 redirects.
 In other words, I need to provide a PageLink (Bookmarkable or other...)
 that will load the page directly, without redirecting to include the
 page version. But I do not want ONE_PASS_RENDER for the whole of
 the application.

 Previous questions about such things pointed to the restart
 exception, but I guess that's a different use case...

 Maybe if I already included a page version in the link, would the
 page still redirect ? Can I switch off redirecting for one
 page only ? Or even better, for one page constructor only ?

 Anybody successfully doing Bootstrap modals with remote content
 (using href or data-remote) ?

 Cheers, Tom.


 -
 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 to contribute to the reference guide

2013-02-06 Thread Igor Vaynberg
why doesnt the guide live in a subdir of the project. that way there
will be a guide per branch. one of the biggest problems with the wiki,
etc, is that it doesnt account for code differences between the
versions. having a guide per branch (major version) makes more sense.

-igor

On Wed, Feb 6, 2013 at 1:04 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 Few people contacted me personally to ask how they can contribute to the
 reference guide.
 I've just added
 http://martin-g.github.com/wicket-reference-guide/howtohelp.html that
 explains the steps.

 Let me know if I can improve it. Or just me a patch ;-)

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

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



Re: HP Fortify Critical Security Issues

2013-02-05 Thread Igor Vaynberg
On Tue, Feb 5, 2013 at 10:43 AM, sthomps stho...@gmail.com wrote:
 Hello,

 As part of an evaluation of web frameworks, one of the checkboxes to tick is
 security vulnerabilities.

 In this case the tool being used to scan for those vulnerabilities is  HP
 Fortify
 http://www8.hp.com/us/en/software-solutions/software.html?compURI=1349399#.URFMM6WbR2o

 I wanted to get the communities feedback on critical security issues that
 were presented based on this tool (I'll leave my opinion out of it for now)
 and if other teams are using are using this software - what is their process
 for evaluating/fixing/etc these kinds of issues in open-source software.

 Appreciate your input.

 Issue 1 - wicket-ajax-jquery.js:651 (Open Redirect)



 *Abstract:*

 The file wicket-ajax-jquery.js passes unvalidated data to an HTTP redirect
 function on line 651. Allowing unvalidated input to control the URL used in
 a redirect can aid phishing attacks.

invalid. the javascript code referenced here is only invoked as a
callback to an ajax request object. the url passed in is generating on
the server. in order to take advantage of this vulnerability the
attacker would need to gain javascript execution via a GET url at
which point they may easily execute window.location=foo themselves
rather then utilizing our javascript.



 *Explanation*:

 Redirects allow web applications to direct users to different pages within
 the same application or to external sites. Applications utilize redirects to
 aid in site navigation and, in some cases, to track how users exit the site.
 Open redirect vulnerabilities occur when a web application redirects clients
 to any arbitrary URL that can be controlled by an attacker.

 Attackers can utilize open redirects to trick users into visiting a URL to a
 trusted site and redirecting them to a malicious site. By encoding the URL,
 an attacker can make it more difficult for end-users to notice the malicious
 destination of the redirect, even when it is passed as a URL parameter to
 the trusted site. Open redirects are often abused as part of phishing scams
 to harvest sensitive end-user data.

 *Recommendations*:

 Unvalidated user input should not be allowed to control the destination URL
 in a redirect. Instead, a level of indirection should be introduced: create
 a list of legitimate URLs that users are allowed to specify, and only allow
 users to select from the list. With this approach, input provided by users
 is never used directly to specify a URL for redirects.


 Issue 2 - FileUpload:253 (Path Manipulation)



 *Abstract:*

 Attackers can control the filesystem path argument to createTempFile() at
 FileUpload.java line 253, which allows them to access or modify otherwise
 protected files.


invalid. the prefix part of the file name is fixed to be the user's
session id and request timestamp - so the user cannot access other
user's temp files by manipulating the file name.

 *Explanation*:

 Path manipulation errors occur when the following two conditions are met:

 1. An attacker can specify a path used in an operation on the filesystem.

 2. By specifying the resource, the attacker gains a capability that would
 not otherwise be permitted.

 For example, the program may give the attacker the ability to overwrite the
 specified file or run with a configuration controlled by the attacker.

 In this case, the attacker can specify the value that enters the program at
 getId() in FileUpload.java at line 251, and this value is used to access a
 filesystem resource at createTempFile() in FileUpload.java at line 253.

 *Recommendations:*

 The best way to prevent path manipulation is with a level of indirection:
 create a list of legitimate resource names that a user is allowed to
 specify, and only allow the user to select from the list. With this approach
 the input provided by the user is never used directly to specify the
 resource name.

 In some situations this approach is impractical because the set of
 legitimate resource names is too large or too hard to keep track of.
 Programmers often resort to blacklisting in these situations. Blacklisting
 selectively rejects or escapes potentially dangerous characters before using
 the input. However, any such list of unsafe characters is likely to be
 incomplete and will almost certainly become out of date. A better approach
 is to create a white list of characters that are allowed to appear in the
 resource name and accept input composed exclusively of characters in the
 approved set.

 Issue 3 - WicketServlet:327 (Race Condition: Singleton Member Field)


 *Abstract:*

 The class WicketServlet is a singleton, so the member field wicketFilter is
 shared between users. The result is that one user could see another user's
 data.

invalid. this field is meant to be shared.

-igor



 *Explanation:*

 Many Servlet developers do not understand that a Servlet is a singleton.
 There is only one instance of the Servlet, and that single instance is used
 and 

Re: wicket-cdi fails when netbeans deploys to Glassfish with maven

2013-01-09 Thread Igor Vaynberg
you need to add seam-conversation-your cdi impl.jar as well.

-igor

On Wed, Jan 9, 2013 at 10:55 AM, Dieter Tremel
tre...@tremel-computer.de wrote:
 Hello,

 at the moment I try to migrate my wicket ant projects to maven, and have
 a final problem with CDI. I am using netbeans 7.2.1 and Glassfish 3.1.2,
 when I click run the the war is deployed to glassfish in the pom with
 mvn.bat -Dnetbeans.deploy=true package
 and the property
 netbeans.hint.deploy.servergfv3ee6/netbeans.hint.deploy.server
 defined in the pom. Don't know how exactly.

 When I try to use CDI, I get the error:
 WARNING: StandardWrapperValve[default]: PWC1406: Servlet.service() for 
 servlet default threw exception
 javax.enterprise.context.ContextNotActiveException: Conversation Context not 
 active when method called on conversation Transient conversation
   at 
 org.jboss.weld.context.conversation.ConversationImpl.verifyConversationContextActive(ConversationImpl.java:197)
   at 
 org.jboss.weld.context.conversation.ConversationImpl.touch(ConversationImpl.java:159)
   at 
 org.jboss.weld.context.conversation.ConversationImpl.init(ConversationImpl.java:72)
   at 
 org.jboss.weld.bean.builtin.ConversationBean.create(ConversationBean.java:48)
   at 
 org.jboss.weld.bean.builtin.ConversationBean.create(ConversationBean.java:17)
   at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
   at 
 org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
   at 
 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)
   at 
 org.jboss.weld.proxies.Conversation$-493077674$Proxy$_$$_WeldClientProxy.isTransient(Conversation$-493077674$Proxy$_$$_WeldClientProxy.java)
   at 
 org.apache.wicket.cdi.ConversationPropagator.onRequestHandlerExecuted(ConversationPropagator.java:177)


 I built a small Quickstart and added the injection of a tiny HelloBean
 in the simplest way, but same problem.

 Dependency to wicket-cdi 6.4.0 has transient dependency to
 seam-conversation-spi, which is included in war/WEB-INF/libs.

 With ant based project, no error. Any idea?

 Thank You
 Dieter Tremel



 -
 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: [ANNOUNCE] Apache Wicket 6.4.0 released

2013-01-03 Thread Igor Vaynberg
there are some incompatibilities. ive optimized some code to make it
faster and remove some other code that i do not thing belongs.

so, no, it is not a drop in replacement
and, yes, this code deprecates the net.ftlines code for wicket 6+

-igor

On Thu, Jan 3, 2013 at 3:44 AM, heapifyman heapify...@gmail.com wrote:
 Hello,

 I've been using net.ftlines.wicket-bean-validation for a while now and I
 suppose that the new experimantal org.apache.wicket.wicket-bean-validation
 is based on the ftlines version and will eventually replace it (at least
 for wicket 6 and above)?
 Can I just replace the ftlines version with the new one or are there any
 incompatibilities (except from the obvious difference in package names)?

 Thanks in advance



 2012/12/18 Martijn Dashorst martijn.dasho...@gmail.com

 The Apache Wicket PMC is proud to announce Apache Wicket 6.4.0!

 This release marks the fourth minor release of Wicket 6. Starting
 with Wicket 6 we use semantic versioning for the future development of
 Wicket, and as such no API breaks are present in this release compared
 to 6.0.0.

 New and noteworthy
 ===

 JQuery was upgraded to 1.8.3, bootstrap to 2.2.2.

 JSR 303 BeanValidation support
 --

 Native support for BeanValidation (JSR 303) was added as an
 experimental module and released as version 0.5. You can grab it
 by using these maven coordinates:

 org.apache.wicket:wicket-bean-validation:0.5:jar

 or by pasting in the pom snippet below:

 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-bean-validation/artifactId
 version0.5/version
 /dependency

 Note that this is an experimental module and that it is not released
 under the semantic versioning rules. Use at your own risk.

 Hierarchical feedback panel
 ---

 A new kind of feedback panel was introduced: a hierarchical feedback
 panel. A specialized feedback panel that only displays messages from
 inside a fence defined by a container component. Instances will not
 show messages coming from inside a nested fence, allowing the nesting
 of these panels to work correctly without displaying the same
 feedback message twice. A constructor that does not takes a fencing
 component creates a catch-all panel that shows messages that do not
 come from inside any fence or from the Session.

 For more information see:

 http://s.apache.org/wicket-FencedFeedbackPanel

 For the full changelog see the release notes attached to the end of
 this announcement.

 Using this release
 =

 With Apache Maven update your dependency to (and don't forget to
 update any other dependencies on Wicket projects to the same version):

 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-core/artifactId
 version6.4.0/version
 /dependency

 Or download and build the distribution yourself, or use our
 convenience binary package

  * Source: http://www.apache.org/dyn/closer.cgi/wicket/6.4.0
  * Binary: http://www.apache.org/dyn/closer.cgi/wicket/6.4.0/binaries

 Upgrading from earlier versions
 ===

 If you upgrade from 6.0.0, 6.1.0, 6.2.0 or 6.3.0 this release is a drop in
 replacement. If you come from a version prior to 6.0.0, please
 read our Wicket 6 migration guide found at

 http://s.apache.org/wicket-6.0-migration

 Have fun!

 — The Wicket team

 ==

 Release Notes - Wicket - Version 6.4.0

 ** Sub-task
 * [WICKET-4880] - Make it possible to override the Ajax behavior
 of AjaxSubmitLink and AjaxButton

 ** Bug
 * [WICKET-4869] - Wicket-Atmosphere track message length
 * [WICKET-4872] - IllegalArgumentException on
 ReloadingWicketFilter and inheritance markup
 * [WICKET-4877] - encodeUrl fails parsing jsessionid when using root
 context
 * [WICKET-4878] - Rendering of feedback messages fails with DebugBar
 in page
 * [WICKET-4881] - IE 8 : error when handling Wicket Ajax Response
 * [WICKET-4884] - ValidationError messages for NumberTextFields
 with minimum/maximum are always English
 * [WICKET-4886] - Do not register Ajax timer if the component is
 removed
 * [WICKET-4890] - Bad validation messages after WICKET-2128
 * [WICKET-4891] - UrlRenderer.renderRelativeUrl misbehavior if the
 filterPath is composed.
 * [WICKET-4894] - Internet Explorer fails fails to properly
 include conditional stylesheet links added via AjaxRequestTarget
 * [WICKET-4895] - WicketRuntimeException: addOrReplace for
 feedback panel does not clear Component.FEEDBACK_LIST - feedback from
 replaced component causes error.
 * [WICKET-4899] - autocomplete shows strings with quotes strings
 as string2 with quot;quotequot;
 * [WICKET-4900] - Setting a status code on an AbstractResource
 results in no HTTP body
 * [WICKET-4908] - Wrong charset or screwed up characters in
 Norwegian properties-file
 * [WICKET-4911] - Palette Ajax 

Re: Select2 - Wicket 1.4.18

2012-12-26 Thread Igor Vaynberg
it can, but it needs to be ported to that version of wicket.

-igor

On Wed, Dec 26, 2012 at 6:06 AM, xe0nre mvlupan.s...@gmail.com wrote:
 Hello,

 I have a quick question about the Select2 component created by Igor.I tried
 to integrated it in my project (witch uses wicket 1.4.18) and could not do
 it...just received errors. When i tried it with wicket 1.5 i had no problem.

 So my question is: Can the select2 component be integrated in wicket 1.4.18?

 Thanks



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Select2-Wicket-1-4-18-tp4655059.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: Select2 - Wicket 1.4.18

2012-12-26 Thread Igor Vaynberg
yes, only 1.5 and 6 are supported.

-igor

On Wed, Dec 26, 2012 at 11:14 AM, xe0nre mvlupan.s...@gmail.com wrote:
 Hmm...so at this point only wicket 1.5 and 6 are supported ?

 Oh...and that Igor for this component :) Nice work



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Select2-Wicket-1-4-18-tp4655059p4655065.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: Are Wicket models loaded concurrently ?

2012-12-26 Thread Igor Vaynberg
the bug is that something does not serialize access to the page. the
contract on models and components is that they always run in a
single-threaded environment. this is what allows the user code to be
simple and free of any synchronization logic.

so whatever push/pull/whatever framework you are using - it should
properly synchronize access to the page instance that owns the models.

-igor

On Wed, Dec 26, 2012 at 6:16 PM, Hendy Irawan he...@soluvas.com wrote:
 I think I just found a bug ... LoadableDetachableModel is potentially
 non-threadsafe.

 I experience weird behavior, my concurrent models are chained (i.e. calls
 other models getObject()), and my concurrent models extend
 LoadableDetachableModel. The weird behavior is that sometimes (!!) the
 models return null. But if debugged, they're not null. It's like a timing
 and race condition problem.

 Now I think I know why. LoadableDetachableModel, upon getObject(), sets
 attached=true before caling load(), which can take some time. If
 getObject() gets called again, it then immediately returns the loaded
 object, which was still null (sometimes.).

 Should I report this as bug?

 On Wed, Dec 26, 2012 at 6:14 PM, Siefart, Olaf [via Apache Wicket] 
 ml-node+s1842946n4655056...@n4.nabble.com wrote:

 Hi,

 A dashboard with unrelated web services is exactly the usecase of our
 christmas project (https://github.com/osiefart/wicket-christmas).

 @Hendy: I would not start the execution immediately upon model creation. I
 would choose a Visitor - onConfigure - Solution. Then it is possible to
 check the visibility of the component before loading data...

 Kindly regards,
 Olaf

 -Ursprüngliche Nachricht-
 Von: Serban.Balamaci [mailto:[hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4655056i=0]

 Gesendet: Mittwoch, 26. Dezember 2012 11:45
 An: [hidden email] http://user/SendEmail.jtp?type=nodenode=4655056i=1
 Betreff: Re: Are Wicket models loaded concurrently ?

 Hello guys.
 For sure this would be useful. I encountered many cases where the models
 are using different unrelated web services and starting the requests in
 parallel would be a nice improvement.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655055.html

 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4655056i=2
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4655056i=3


 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4655056i=4
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4655056i=5



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655056.html
  To unsubscribe from Are Wicket models loaded concurrently ?, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4655046code=aGVuZHlAc29sdXZhcy5jb218NDY1NTA0NnwxNTI0Njc4NzUy
 .
 NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --
 Hendy Irawan - on Twitter http://twitter.com/hendybippo - on
 LinkedInhttp://id.linkedin.com/in/hendyirawan
 Web Developer | Bippo Indonesia http://www.bippo.co.id/ | Akselerator
 Bisnis | Bandung




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655067.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: wicket-cdi and TomEE

2012-12-20 Thread Igor Vaynberg
looks like you have two jars on the classpath that provide the
javax.enterprise.inject.spi.BeanManager interface. maybe one comes
with wicket-cdi and the other one is included in tomee...

-igor

On Thu, Dec 20, 2012 at 12:54 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 javax.enterprise.inject.spi.BeanManage

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



Re: Possible to use static IBehavior/ReadOnlyModels?

2012-12-05 Thread Igor Vaynberg
yes, you can use singleton instances as long as they are threadsafe.

-igor

On Wed, Dec 5, 2012 at 2:40 AM, Davli lidz@gmail.com wrote:
 Well as the title says...
 Would this be possible assuming that they have have no real relation to a
 value in a session?
 For example:

 An AttributeAppender that always appends the same value.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Possible-to-use-static-IBehavior-ReadOnlyModels-tp4654507.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: Possible to use static IBehavior/ReadOnlyModels?

2012-12-05 Thread Igor Vaynberg
true, but you can override writereplace() and readresolve() to keep it
a singleton. further, even though it is no longer a singleton within a
given page there will be only one instance of it even when
serialized/deserialized, so you still get some memory savings.

-igor

On Wed, Dec 5, 2012 at 9:37 AM, Dan Retzlaff dretzl...@gmail.com wrote:
 Might be worth noting that as soon as it goes through a serialization
 round-trip it's no longer a singleton. Not a concern for a trivial
 AttributeAppender, but it's a Wicket+static+serialization gotcha we learned
 the hard way. :)

 On Wed, Dec 5, 2012 at 4:40 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 yes, you can use singleton instances as long as they are threadsafe.

 -igor

 On Wed, Dec 5, 2012 at 2:40 AM, Davli lidz@gmail.com wrote:
  Well as the title says...
  Would this be possible assuming that they have have no real relation to a
  value in a session?
  For example:
 
  An AttributeAppender that always appends the same value.
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Possible-to-use-static-IBehavior-ReadOnlyModels-tp4654507.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



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



Re: master branch compiler error in core?

2012-12-02 Thread Igor Vaynberg
im on osx

-igor

On Sun, Dec 2, 2012 at 4:37 AM, Martin Grigorov mgrigo...@apache.org wrote:
 I use Ubuntu 12.
 BuildBot (the CI) is some Unix too (
 http://ci.apache.org/builders/wicket-master).
 I cannot test builds on Windows here.


 On Sun, Dec 2, 2012 at 1:29 PM, Chris Colman
 chr...@stepaheadsoftware.comwrote:

 I'm still having the problem.

 I can see the clirr exclusions Igor added and they seem fine according
 to the (vary sparse) Clirr doco.

 What platform are you and Igor building on? I'm building on:

 Win XP
 Java 1.6.0_31
 4GB RAM

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Friday, 30 November 2012 11:52 PM
 To: users@wicket.apache.org
 Subject: Re: master branch compiler error in core?
 
 No errors here.
 Igor added an exclusion in parent pom.xml for this change.
 
 https://git-wip-
 us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=c3d4744
 8d1b
 f5b5d0e8207bb8c0cf605cef8c18c
 
 
 On Fri, Nov 30, 2012 at 1:36 PM, Chris Colman
 chr...@stepaheadsoftware.comwrote:
 
  I've just updated the master branch and I get the following build
  errors:
 
  [INFO] --- clirr-maven-plugin:2.5:check (clirr-check) @ wicket-core
 ---
  [INFO] Comparing to version: 6.0.0
  [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public
  java.util.List collect()' is now final
  [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public
  java.util.List
  collect(org.apache.wicket.feedback.IFeedbackMessageFilter)' is now
 final
  [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public
  org.apache.wicket.feedback.FeedbackCollector
 setIncludeSession(boolean)'
  is now final
  [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public
  org.apache.wicket.feedback.FeedbackCollector setRecursive(boolean)'
 is
  now final
  [INFO]
 
 
 
  Am I doing something wrong or is there an error in the latest source?
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com 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 http://jweekend.com/

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



Re: initial bean validation integration checked into experimental module

2012-11-25 Thread Igor Vaynberg
On Sun, Nov 25, 2012 at 4:12 PM, Paul Bors p...@bors.ws wrote:
 Looks awesome!

 One suggestion/question about it (might sound silly at first but keep an
 open mind).

 I understand you're implementing the JSR-303, but I was wondering if it
 would be possible to allow some of the settings be borrowed from other
 annotation framework like Hibernate or some other 3rd party not necessary
 out of the box but perhaps via a user defined mapping?

 Given your example POJO:
 public class Person implements Serializable
 {
@NotNull
@Size(min = 2, max = 30)
private String name;
 ...

 If one were to use the same POJO to map it via Hibernate the code would look
 like:
 @Entity
 public class Person implements Serializable
 {
@NotNull
@Size(min = 2, max = 30)
@Column(name = full_name, nullable = false, length=30)
private String name;
 ...

 That seems like duplicated meta data to me since you're defining the same
 info twice such as the null state and length in two or more different
 annotations.

i believe you are coming into this from the wrong angle. the
integration should not be between Wicket validation and hibernate
annotations, the integration should instead be between bean validation
(303) and hibernate annotations.

303 provides the validator and the metadata constraint discovery which
i use. if you choose to integrate between wicket and hibernate
annotations you have to basically build a parallel 303 implementation.

instead, figure out how to integrate hibernate annotations with 303
and you get to piggy back on everything thats already there.

-igor



 ~ Thank you,
   Paul Bors

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Sunday, November 25, 2012 1:41 AM
 To: users@wicket.apache.org
 Subject: initial bean validation integration checked into experimental
 module

 just checked in a first pass on bean validation (jsr 303) integration.
 see this commit for details:

 https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=580a8dd9
 ;hp=2d47bf340875f6053aa2a3b69c4f442f2fbb03e1

 feedback is welome.

 -igor

 -
 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



new hierarchical feedback panel added

2012-11-25 Thread Igor Vaynberg
a common question on this list is how to build hierarchical feedback
panels. i just checked in my attempt to help solve this problem into
master. here is the javadoc that explains what it does. feedback
welcome.

-igor

/**
 * A specialized feedback panel that only displays messages from
inside a fence defined by a
 * container component. Instances will not show messages coming from
inside a nested fence, allowing
 * the nesting of these panels to work correctly without displaying
the same feedback message twice.
 * A constructor that does not takes a fencing component creates a
catch-all panel that shows
 * messages that do not come from inside any fence or from the {@link Session}.
 *
 * h2IN DEPTH EXPLANATION/h2
 * p
 * It is often very useful to have feedback panels that show feedback
that comes from inside a
 * certain container only. For example given a page with the following
structure:
 * /p
 *
 * pre
 * Page
 *   Form1
 * Feedback1
 * Input1
 * Form2
 *   Feedback2
 *   Input2
 * /pre
 * p
 * we want Feedback2 to show messages originating only from inside
Form2 and Feedback1 to show
 * messages only originating from Form1 but not Form2 (because
messages originating from Form2 are
 * already shown by Feedback2).
 * /p
 * p
 * It is fairly simple to configure Feedback2 - a {@link
ContainerFeedbackMessageFilter} added to
 * the regular {@link FeedbackPanel} will do the trick. The hard part
is configuring Feedback1. We
 * can add a {@link ContainerFeedbackMessageFilter} to it, but since
Form2 is inside Form1 the
 * container filter will allow messages from both Form1 and Form2 to
be added to FeedbackPanel1.
 * /p
 * p
 * This is where the {@link FencedFeedbackPanel} comes in. All we have
to do is to make
 * FeedbackPanel2 a {@link FencedFeedbackPanel} with the fencing
component defined as Form2 and
 * Feedback1 a {@link FencedFeedbackPanel} with the fencing component
defiend as Form1.
 * {@link FencedFeedbackPanel} will only show messages that original
from inside its fencing
 * component and not from inside any descendant component that acts as
a fence for another
 * {@link FencedFeedbackPanel}.
 * /p
 * p
 * When created with a {@code null} fencing component or using a
constructor that does not take one
 * the panel will only display messages that do not come from inside a
fence. It will also display
 * messages that come from {@link Session}. This acts as a catch-all
panels showing messages that
 * would not be shown using any other instance of the {@link
FencedFeedbackPanel} created witha
 * fencing component. There is usually one instance of such a panel at
the top of the page to
 * display notifications of success.
 * /p

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



initial bean validation integration checked into experimental module

2012-11-24 Thread Igor Vaynberg
just checked in a first pass on bean validation (jsr 303) integration.
see this commit for details:

https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=580a8dd9;hp=2d47bf340875f6053aa2a3b69c4f442f2fbb03e1

feedback is welome.

-igor

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



Re: Ideas on implementing dynamic addition of components that use AJAX?

2012-11-22 Thread Igor Vaynberg
historically the components you add from auto resolvers are added via
the autoAdd() method, not using add(). these components only exist
during render of the page (in detach() phase all auto-added components
are removed). the thinking here is that auto resolved components are
not normal components. because they are resolved so late in the
lifecycle they do not typically implement the entire lifecycle like
onInitialize(), onConfigure(), etc may not necessarily be called. such
components are also not meant to have their own state. because of
these reasons we remove them at the end of the request and readd a new
instance next time the page is rendered. these are basically
transient render-once components.

starting with wicket 1.5, however, components are able to resole their
markup earlier in their lifecycle. the reason auto resolved components
are added so late and treated specially was because the markup was
only available during render.  if you are using 1.5 or 6 you can build
your own mechanism. something that kicks off a page/panel's
oninitialize(), gets the markup, walks it, and adds any components -
maybe ones you mark by special tags in your own namespace. the problem
here is that even if you can find these components you may still not
be able to put them into the right parent because in onInitialize()
the parent may not yet be added to the container. so perhaps you
should have some mechanism that kicks off when page#onComponentAdded()
is called. you can pull the newly added component's markup, see if it
has any of these special components defined as a child of the
components markup, and add them right there. since you are doing this
early on these components will have normal lifecycle and should work
just like any other component.

hope this helps you get started. keep us in the loop.

-igor


On Thu, Nov 22, 2012 at 4:54 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 We've been using Wicket since version 1.3 and have been using the
 IComponentResolver interface with great effect to allow the web
 designers to effectively 'plug and play' with the Wicket components.

 We have multiple layouts using Wicket's 'variation' feature. Each
 designer can build up a different collection of components in any
 particular variation as they like - all without changing the Java code.

 Normally, without using IComponentResolver, the Java code to support
 such flexibility would be mind boggingly complex and ugly but with an
 IComponentResolver we simply have code that's capable of instantiating
 any component anywhere - and it works and the resulting code is
 extremely elegant.

 While we use lots of AJAX it is restricted to components that are
 explicitly added to components i.e. not added dynamically via the
 component resolver because such components are not able to contribute
 anything to the head section.

 This is starting to become a bit of a problem as we want some of the
 more advanced components (with AJAX) to take part in the 'plug and play'
 flexibility. We also are starting to get into using Twitter Bootstrap
 with Wicket and much of the 'funkiness' in some of those components
 comes from JS that needs to be injected into the header.

 Is anyone else using this 'plug and play' capability of Wicket made
 available via the IComponentResolver interface or is everyone sticking
 to the rigid 1 to 1 relationship between markup and the corresponding
 statically coded Java component hierarchy? (which we found quite
 constricting after a few weeks =] )

 I understand that there are some workarounds suggested for empowering
 AJAX in dynamically added components but they seem to involve manually
 parsing markup in the onInitialize method and then explicitly adding any
 required components there - it sounds non ideal and would result in an
 extra parse of all page and panel markups I would think - which may
 affect performance. Would we be parsing raw XHTML at that stage or would
 a preparsed DOM be available to search through?

 What is the fundamental issue with the Wicket architecture that prevents
 dynamically resolved components from contributing to the header?

 Is one of the causes the fact that by the time the ComponentResolver is
 being called the header has already been rendered to the response stream
 and so once body rendering commences no more header injection is
 possible?

 If so, that could probably (thinking out aloud without an in depth
 knowledge of Wicket's internals =] ) be solved by splitting the
 rendering into two streams: header injection goes to current output
 stream while body rendering goes to a temporary 'body' stream. When the
 page render is complete the output of the body is then appended to the
 current stream, after the header rendering. This would allow header
 injection to continue during processing of the body markup because both
 are not being sequentially output to the same stream.

 There was mention of another issue - something about auto added
 (component 

Re: Generically Append a JavaScript Method to all Buttons/Links Throughout App

2012-10-31 Thread Igor Vaynberg
if you do a type search for o.a.w.I*Listener you will see a bunch of
interesting ones, especially:

IComponentInstantiationListener and IComponentInitializationListener

-igor

On Wed, Oct 31, 2012 at 10:57 AM, eugenebalt eugeneb...@yahoo.com wrote:
 I guess what I'm asking is, is there a common Post-Constructor place that
 could be generically called in Wicket, where I could iterate through all
 components and append a JavaScript modifier to selective ones (Button and
 Link types)?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Generically-Append-a-JavaScript-Method-to-all-Buttons-Links-Throughout-App-tp4653495p4653498.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: form with arbitrary number of fields

2012-10-31 Thread Igor Vaynberg
this should get you most of the way there

http://wicketinaction.com/2008/10/building-a-listeditor-form-component/

-igor

On Wed, Oct 31, 2012 at 4:35 PM, Steve Swinsburg
steve.swinsb...@gmail.com wrote:
 Hi,

 Thanks, I have a repeater already and have the form components, but the part 
 I am unsure about is how those form components map to a model. So when the 
 person clicks submit, how do I get the arbitrary number of fields of data 
 that were submitted?

 Is there an example of this?

 cheers,
 Steve



 On 29/09/2012, at 2:39 PM, Ondrej Zizka ozi...@redhat.com wrote:

 On Fri, 2012-09-28 at 13:37 +0530, vineet semwal wrote:

 sorry somehow i didn't type last message correctly :)
 use a repeater and you can add your formcoponents to its items ,see
 listview/dataview

 FYC,
 http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/repeater/RepeatingView.html




 On Fri, Sep 28, 2012 at 1:35 PM, vineet semwal vineetsemwa...@gmail.com 
 wrote:
 use a repeater which and yo can attach your formcomponents to items

 On Fri, Sep 28, 2012 at 8:18 AM, Steve Swinsburg
 steve.swinsb...@gmail.com wrote:
 Hi all,

 I have a form that allows users to add an arbitrary number of fields, for 
 example keywords for an item where there could be multiple.

 Up until now I have been processing my form where the fields are known 
 and map directly to a model. However I'm unsure as to how this mapping 
 works, for example having two or more keywords for one item. Would the 
 property in the backing model be a list for this item? Rather than a 
 string for example?

 Are there any examples of a similar dynamic form?

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




 --
 regards,

 Vineet Semwal







 -
 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: X-Forwarded-For handling in method getRemoteAddr()

2012-09-25 Thread Igor Vaynberg
On Tue, Sep 25, 2012 at 2:10 AM, Benjamin Steinert
benjamin.stein...@comsysto.com wrote:
 Hi everyone,

 I need you input regarding the Wicket  WebClientInfo implementation of
 getRemoteAddr() (extracted from Wicket 1.5.3 but I think it did not
 change in release 6):

 ...
 String remoteAddr = request.getHeader(X-Forwarded-For);
   if (remoteAddr == null)
   {
 remoteAddr = req.getRemoteAddr();
   }
   else
   {
 if (remoteAddr.contains(,))
 {
 // we just want the client
   remoteAddr = remoteAddr.split(,)[0].trim();
 }
   }
 return remoteAddr;

 I am facing the problem that we get the String unknown set by some
 Proxy in the Forwarded-For field.
 According to the IETF draft this is in fact a valid value:
 http://tools.ietf.org/html/draft-petersson-forwarded-for-02#section-6

 Now unfortunately the the simple null check prevents falling back to the
 Servlet request based getRemoteAddr which would be more helpful than
 having a String that is no IP Address.

how is an ip address of some proxy in your data center more useful? i
dont think an external proxy would set such a header

-igor


 I would suggest something like
 if (remoteAddr == null ||
   !InetAddressValidator.getInstance().isValid(remoteAddr))
 { ... }

 to ensure that the given value is an IP. What would you say? Bug,
 Feature or simply unnecessary? ;)

 Cheers
 Ben

 -
 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: [announce] Wicket-CDI for Wicket 6.0.0 released

2012-09-18 Thread Igor Vaynberg
no update. the cdi spec does not require ejbs to be serializable
because they are not in cdi spec.

if you want to use ejbs inject them into a cdi bean and then inject
that into wicket.

-igor

On Tue, Sep 18, 2012 at 9:56 AM, Bruno Borges bruno.bor...@gmail.com wrote:
 Igor, any update on the Serialization issue?

 I'm getting the exception again... :-/

 # Running on GlassFish 3.1.2.2 / Wicket 6 + wicket-cdi

 SEVERE: Error serializing object class code.webapp.pages.Index
 [object=[Page class = code.webapp.pages.Index, id = 3, render count = 1]]
 org.apache.wicket.core.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class:
 com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
 Field hierarchy is:
   3 [class=code.webapp.pages.Index, path=3]
 private code.services.Service code.webapp.pages.Base.service
 [class=code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$]
   javassist.util.proxy.MethodHandler
 code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$.methodHandler
 [class=org.jboss.weld.bean.proxy.ProxyMethodHandler]
 private org.jboss.weld.bean.proxy.BeanInstance
 org.jboss.weld.bean.proxy.ProxyMethodHandler.beanInstance
 [class=org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance]
   private final javassist.util.proxy.MethodHandler
 org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.methodHandler
 [class=org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler]
 private final org.jboss.weld.ejb.api.SessionObjectReference
 org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.reference
 [class=org.glassfish.weld.ejb.SessionObjectReferenceImpl]
   private java.lang.Object
 org.glassfish.weld.ejb.SessionObjectReferenceImpl.ejbRef [class=$Proxy149]
 protected java.lang.reflect.InvocationHandler
 java.lang.reflect.Proxy.h
 [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
 - field that is not serializable
 at
 org.apache.wicket.core.util.io.SerializableChecker.internalCheck(SerializableChecker.java:411)
 at
 org.apache.wicket.core.util.io.SerializableChecker.check(SerializableChecker.java:390)



 *Bruno Borges*
 (11) 99564-9058
 *www.brunoborges.com*



 On Tue, Sep 18, 2012 at 12:29 AM, Bruno Borges bruno.bor...@gmail.comwrote:

 Jeremy, the archetype is already on the Gamboa project repository:

 http://github.com/brunoborges/gamboa-project :-)

 It's just not up to date

 *Bruno Borges*
 (11) 99564-9058
 *www.brunoborges.com*



 On Thu, Sep 13, 2012 at 11:39 AM, Jeremy Thomerson 
 jer...@wickettraining.com wrote:

 On Wed, Sep 12, 2012 at 3:59 PM, Bruno Borges bruno.bor...@gmail.com
 wrote:

  This is really great Igor, thanks.
 
  I am preparing my slides for my Wicket/Java EE session at JavaOne, and
 this
  just came in perfect time.
 
  I'll update my archetype and some slides to show this and let everyone
 know
  about =)


 Will you be posting those slides and archetype somewhere non-attendees can
 access when done?

 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*




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



Re: [announce] Wicket-CDI for Wicket 6.0.0 released

2012-09-18 Thread Igor Vaynberg
so join the jsr expert group and emphasize the importance of making
EJB proxies serializable :)

On Tue, Sep 18, 2012 at 10:45 AM, Bruno Borges bruno.bor...@gmail.com wrote:
 Yeah, that workaround that I wanted to not do... :-)

 But okay, thanks!

 *Bruno Borges*
 (11) 99564-9058
 *www.brunoborges.com*



 On Tue, Sep 18, 2012 at 2:26 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 no update. the cdi spec does not require ejbs to be serializable
 because they are not in cdi spec.

 if you want to use ejbs inject them into a cdi bean and then inject
 that into wicket.

 -igor

 On Tue, Sep 18, 2012 at 9:56 AM, Bruno Borges bruno.bor...@gmail.com
 wrote:
  Igor, any update on the Serialization issue?
 
  I'm getting the exception again... :-/
 
  # Running on GlassFish 3.1.2.2 / Wicket 6 + wicket-cdi
 
  SEVERE: Error serializing object class code.webapp.pages.Index
  [object=[Page class = code.webapp.pages.Index, id = 3, render count = 1]]
 
 org.apache.wicket.core.util.io.SerializableChecker$WicketNotSerializableException:
  Unable to serialize class:
  com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
  Field hierarchy is:
3 [class=code.webapp.pages.Index, path=3]
  private code.services.Service code.webapp.pages.Base.service
  [class=code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$]
javassist.util.proxy.MethodHandler
 
 code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$.methodHandler
  [class=org.jboss.weld.bean.proxy.ProxyMethodHandler]
  private org.jboss.weld.bean.proxy.BeanInstance
  org.jboss.weld.bean.proxy.ProxyMethodHandler.beanInstance
  [class=org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance]
private final javassist.util.proxy.MethodHandler
  org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.methodHandler
  [class=org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler]
  private final org.jboss.weld.ejb.api.SessionObjectReference
  org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.reference
  [class=org.glassfish.weld.ejb.SessionObjectReferenceImpl]
private java.lang.Object
  org.glassfish.weld.ejb.SessionObjectReferenceImpl.ejbRef
 [class=$Proxy149]
  protected java.lang.reflect.InvocationHandler
  java.lang.reflect.Proxy.h
  [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
  - field that is not serializable
  at
 
 org.apache.wicket.core.util.io.SerializableChecker.internalCheck(SerializableChecker.java:411)
  at
 
 org.apache.wicket.core.util.io.SerializableChecker.check(SerializableChecker.java:390)
 
 
 
  *Bruno Borges*
  (11) 99564-9058
  *www.brunoborges.com*
 
 
 
  On Tue, Sep 18, 2012 at 12:29 AM, Bruno Borges bruno.bor...@gmail.com
 wrote:
 
  Jeremy, the archetype is already on the Gamboa project repository:
 
  http://github.com/brunoborges/gamboa-project :-)
 
  It's just not up to date
 
  *Bruno Borges*
  (11) 99564-9058
  *www.brunoborges.com*
 
 
 
  On Thu, Sep 13, 2012 at 11:39 AM, Jeremy Thomerson 
  jer...@wickettraining.com wrote:
 
  On Wed, Sep 12, 2012 at 3:59 PM, Bruno Borges bruno.bor...@gmail.com
  wrote:
 
   This is really great Igor, thanks.
  
   I am preparing my slides for my Wicket/Java EE session at JavaOne,
 and
  this
   just came in perfect time.
  
   I'll update my archetype and some slides to show this and let
 everyone
  know
   about =)
 
 
  Will you be posting those slides and archetype somewhere non-attendees
 can
  access when done?
 
  --
  Jeremy Thomerson
  http://wickettraining.com
  *Need a CMS for Wicket?  Use Brix! http://brixcms.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: [announce] Wicket-CDI for Wicket 6.0.0 released

2012-09-18 Thread Igor Vaynberg
cause cdi spec says they have to be and ejb one does not?

-igor

On Tue, Sep 18, 2012 at 10:56 AM, Bruno Borges bruno.bor...@gmail.com wrote:
 Why are the CDI proxies serializable and EJB's proxy aren't? Hell...

 *Bruno Borges*
 (11) 99564-9058
 *www.brunoborges.com*



 On Tue, Sep 18, 2012 at 2:48 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 so join the jsr expert group and emphasize the importance of making
 EJB proxies serializable :)

 On Tue, Sep 18, 2012 at 10:45 AM, Bruno Borges bruno.bor...@gmail.com
 wrote:
  Yeah, that workaround that I wanted to not do... :-)
 
  But okay, thanks!
 
  *Bruno Borges*
  (11) 99564-9058
  *www.brunoborges.com*
 
 
 
  On Tue, Sep 18, 2012 at 2:26 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  no update. the cdi spec does not require ejbs to be serializable
  because they are not in cdi spec.
 
  if you want to use ejbs inject them into a cdi bean and then inject
  that into wicket.
 
  -igor
 
  On Tue, Sep 18, 2012 at 9:56 AM, Bruno Borges bruno.bor...@gmail.com
  wrote:
   Igor, any update on the Serialization issue?
  
   I'm getting the exception again... :-/
  
   # Running on GlassFish 3.1.2.2 / Wicket 6 + wicket-cdi
  
   SEVERE: Error serializing object class code.webapp.pages.Index
   [object=[Page class = code.webapp.pages.Index, id = 3, render count =
 1]]
  
 
 org.apache.wicket.core.util.io.SerializableChecker$WicketNotSerializableException:
   Unable to serialize class:
   com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
   Field hierarchy is:
 3 [class=code.webapp.pages.Index, path=3]
   private code.services.Service code.webapp.pages.Base.service
  
 [class=code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$]
 javassist.util.proxy.MethodHandler
  
 
 code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$.methodHandler
   [class=org.jboss.weld.bean.proxy.ProxyMethodHandler]
   private org.jboss.weld.bean.proxy.BeanInstance
   org.jboss.weld.bean.proxy.ProxyMethodHandler.beanInstance
   [class=org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance]
 private final javassist.util.proxy.MethodHandler
   org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.methodHandler
   [class=org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler]
   private final
 org.jboss.weld.ejb.api.SessionObjectReference
   org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.reference
   [class=org.glassfish.weld.ejb.SessionObjectReferenceImpl]
 private java.lang.Object
   org.glassfish.weld.ejb.SessionObjectReferenceImpl.ejbRef
  [class=$Proxy149]
   protected java.lang.reflect.InvocationHandler
   java.lang.reflect.Proxy.h
   [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
   - field that is not serializable
   at
  
 
 org.apache.wicket.core.util.io.SerializableChecker.internalCheck(SerializableChecker.java:411)
   at
  
 
 org.apache.wicket.core.util.io.SerializableChecker.check(SerializableChecker.java:390)
  
  
  
   *Bruno Borges*
   (11) 99564-9058
   *www.brunoborges.com*
  
  
  
   On Tue, Sep 18, 2012 at 12:29 AM, Bruno Borges 
 bruno.bor...@gmail.com
  wrote:
  
   Jeremy, the archetype is already on the Gamboa project repository:
  
   http://github.com/brunoborges/gamboa-project :-)
  
   It's just not up to date
  
   *Bruno Borges*
   (11) 99564-9058
   *www.brunoborges.com*
  
  
  
   On Thu, Sep 13, 2012 at 11:39 AM, Jeremy Thomerson 
   jer...@wickettraining.com wrote:
  
   On Wed, Sep 12, 2012 at 3:59 PM, Bruno Borges 
 bruno.bor...@gmail.com
   wrote:
  
This is really great Igor, thanks.
   
I am preparing my slides for my Wicket/Java EE session at JavaOne,
  and
   this
just came in perfect time.
   
I'll update my archetype and some slides to show this and let
  everyone
   know
about =)
  
  
   Will you be posting those slides and archetype somewhere
 non-attendees
  can
   access when done?
  
   --
   Jeremy Thomerson
   http://wickettraining.com
   *Need a CMS for Wicket?  Use Brix! http://brixcms.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



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



Re: PageReference as page parameter?

2012-09-17 Thread Igor Vaynberg
you can pass in the page id obtained from page#getpageid() as a
bookmarkable url, then to navigate back to the original page you can
do setResponsePage(new PageReference(pageid).getPage())

this will, however, leave you on a nonbookmarkable url when you come back.

if you want bookmarkable urls all the way around then you need to do
what stateless frameworks do, pass the return url to the detail page
as a parameter.

-igor

On Mon, Sep 17, 2012 at 3:07 PM, Nelson Segura nsegu...@gmail.com wrote:
 Hello,
 I have a very common pattern in which from a list, I can to detail of
 an element in the list.
 In the detail page I have a reference back to the page list.
 The page list can be different, several list might point to the same detail.
 Until now I have been using page reference to return to the previous
 page, and it works well.
 However, passing the page reference to the constructor of the detail
 page, means that page is not bookmarkable (unless I am mistaking
 something)

 Is there a way a can pass the page reference as a request parameter,
 and so make the page bookmarkable? (ex. by using id, page map, etc).
 Of course if no page reference can be retraced from the map, then we
 just ignore the back reference.

 Any ideas?

 - Nelson

 -
 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: PageReference as page parameter?

2012-09-17 Thread Igor Vaynberg
its public in 6. but yeah, you can do that yourself.

-igor

On Mon, Sep 17, 2012 at 3:20 PM, Nelson Segura nsegu...@gmail.com wrote:
 That is what I thought, but PageReference constructor is not public,
 so I cannot do that, unless I am missing something?
 But I could do

 (Page)Session.get().getPageManager().getPage(pageId)

 As PageReference does internally, correct?

 - Nelson

 On Mon, Sep 17, 2012 at 3:11 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 you can pass in the page id obtained from page#getpageid() as a
 bookmarkable url, then to navigate back to the original page you can
 do setResponsePage(new PageReference(pageid).getPage())

 this will, however, leave you on a nonbookmarkable url when you come back.

 if you want bookmarkable urls all the way around then you need to do
 what stateless frameworks do, pass the return url to the detail page
 as a parameter.

 -igor

 On Mon, Sep 17, 2012 at 3:07 PM, Nelson Segura nsegu...@gmail.com wrote:
 Hello,
 I have a very common pattern in which from a list, I can to detail of
 an element in the list.
 In the detail page I have a reference back to the page list.
 The page list can be different, several list might point to the same detail.
 Until now I have been using page reference to return to the previous
 page, and it works well.
 However, passing the page reference to the constructor of the detail
 page, means that page is not bookmarkable (unless I am mistaking
 something)

 Is there a way a can pass the page reference as a request parameter,
 and so make the page bookmarkable? (ex. by using id, page map, etc).
 Of course if no page reference can be retraced from the map, then we
 just ignore the back reference.

 Any ideas?

 - Nelson

 -
 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


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



Re: 42lines wicket full calendar

2012-09-13 Thread Igor Vaynberg
i believe the javascript component supports it. i am not sure the
wicket wraper's Config object exposes that option though. if it does
not please add it and submit a pull request.

-igor

On Thu, Sep 13, 2012 at 1:04 AM, Gytis lietuvis...@mail.ru wrote:
 Hello,
 Recently I started to use wicket-fullcalendar of 42lines.
 I`d like to ask is there any possibility to change week starting day (by
 default it is Sunday, but I need it to be Monday)?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/42lines-wicket-full-calendar-tp4651969.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: wicket-select2 as AutoCompleteTextField replacement

2012-09-12 Thread Igor Vaynberg
you need to define your own createSearchChoice function and pass it to
the config. see the docs on the demo site.

-igor

On Wed, Sep 12, 2012 at 2:33 AM, Thomas Götz t...@decoded.de wrote:
 I want to use wicket-select2 as a replacement for Wicket's 
 AutoCompleteTextField. Is it somehow possible to accept user input that is 
 not contained in the list of choices? Say, my choices list returns [A, B, C] 
 but user may also enter D in the textfield. How can I achieve this?

-Tom


 -
 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



[announce] Wicket-CDI for Wicket 6.0.0 released

2012-09-11 Thread Igor Vaynberg
A Wicket 6.0 compatible version of the wicket-cdi module has been
released and is available via Maven. It is also becoming an official
module and will be bundled with Wicket starting with 6.1.0 release.
More details here:

https://www.42lines.net/2012/09/11/status-of-wicket-cdi-module/

-igor

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



Re: setRequired(true) without required-validator

2012-09-11 Thread Igor Vaynberg
you can create your own version of string length validator and
override its validateOnNull to return true.

keep in mind that most validators in wicket and other libraries are
not equipped to handle null and will most likely blow up.
setrequired(true) is what is designed to handle nulls.

-igor

On Tue, Sep 11, 2012 at 2:55 PM, raphw rafael@web.de wrote:
 Is there a way to ungo the validator that checks for a required field when I
 e.g. reqistered a String-Length-Validator? I feel that the
 String-Length-Validator is more verbose than the Required-Validator that
 Wicket adds by itself and I'd like the String-Length-Validator to send its
 error message instead when a user did not enter anything. Setting
 setRequired(false) unfortunately deactivates any validaton and not only the
 Required-Validator. Thanks for help! Best, Rafael



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setRequired-true-without-required-validator-tp4651929.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: Is anyone using ObjectAutoCompleteField from wicketstuff?

2012-09-11 Thread Igor Vaynberg
http://ivaynberg.github.com/select2/

https://github.com/ivaynberg/wicket-select2

-igor

On Tue, Sep 11, 2012 at 5:50 PM, James Eliyezar ja...@mcruncher.com wrote:
 Hi all,

 What do you all do display objects in an autocomplete field?
 I used to use ObjectAutoCompleteField from wicketstuff but seems that it is
 having some problem with
 wicket-1.5.xhttps://github.com/wicketstuff/core/issues/148
 Do you all use this component or stick to the traditional
 AutoCompleteTextField?
 Would love to hear your voice on this.

 --
 Thanks  regards
 James Selvakumar

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



Re: Add an invisible component to an AjaxRequestTarget target

2012-09-06 Thread Igor Vaynberg
isVisibleInHierarchy() will make sure all parents are visible as well

-igor

On Thu, Sep 6, 2012 at 1:27 PM, Thijs Vonk vonk.th...@gmail.com wrote:
 Hi,

 We have partial page updates all over a page. So panels and components all
 over the place that need Ajax updates.
 We're using an Interface on those components and with an IVisitor we
 traverse the component tree and add every component to the target that has
 this interface.

 But during development we see that we get errors in the ajax debug log when
 these components have an invisible state. These components themselves can
 have this state but some of the times, the parent component is invisible. In
 these cases when such a hidden component is added to the AjaxRequestTarget
 we get an error in the ajax debug log.

 Adding the isVisible check before adding the component to the target could
 save us in some situations but not all (as it might get visible or
 invisible) at a later state.
 How can I prevent these components from being added to the
 AjaxRequestTarget? Or from the error being thrown? I had hoped that a
 component being in an invisible state (somewhere in the tree) wouldn't get
 rendered. It's not really a problem in a 'deployment' situation, but it's
 not 'nice' either.


 Thijs

 -
 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: select2 localization questions

2012-09-04 Thread Igor Vaynberg
On Tue, Sep 4, 2012 at 7:27 AM, Sandor Feher sfe...@bluesystem.hu wrote:
 Hi,

 I successfuly created a Select2Choice item in my form. I fill it up from a
 model and everything works fine but the listed choices' display in wrong
 codepage. I use utf8 everywhere and have no problems with cp.

i believe this was fixed recently in master.

 The second one is how to localize select2 messages from select2.js ?
 E.g. formatNoMatches,  formatSearching and so one.

select2 is localized by you providing those functions with the correct
strings. in wicket you can do the same by specifying them in the
config object.

-igor


 thnx., Sandor



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/select2-localization-questions-tp4651732.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: select2 localization questions

2012-09-04 Thread Igor Vaynberg
On Tue, Sep 4, 2012 at 10:14 AM, Sandor Feher sfe...@bluesystem.hu wrote:

 Igor Vaynberg-2 wrote

 On Tue, Sep 4, 2012 at 7:27 AM, Sandor Feher lt;sfeher@gt; wrote:
 Hi,

 I successfuly created a Select2Choice item in my form. I fill it up from
 a
 model and everything works fine but the listed choices' display in wrong
 codepage. I use utf8 everywhere and have no problems with cp.

 i believe this was fixed recently in master.

 I use 1.0 from maven repo. Is it possible that 1.0 does not contain that ?

i know for sure that one does not.

-igor




 Igor Vaynberg-2 wrote

 The second one is how to localize select2 messages from select2.js ?
 E.g. formatNoMatches,  formatSearching and so one.

 select2 is localized by you providing those functions with the correct
 strings. in wicket you can do the same by specifying them in the
 config object.

 -igor


 Stupid I was. Figured out meanwhile.. Sorry.




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/select2-localization-questions-tp4651732p4651741.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: Migration to 1.5: BaseWicketTester#startPanel

2012-09-04 Thread Igor Vaynberg
we migrated from 1.4.x to 1.5.x. but, we use selenium to test ui
instead of wicket tester :)

-igor

On Tue, Sep 4, 2012 at 12:07 PM, Alec Swan alecs...@gmail.com wrote:
 This makes me wonder how many big apps actually migrated from 1.4 to
 1.5 (instead of starting from scratch) if this problem has never been
 discovered. I also noticed that getComponentFromLastRenderedPage
 assumes that the id of the instantiated component is different from
 the id of it's first child (if (path.startsWith(componentIdPageId) ==
 false { path = componentIdPageId + path;} ) This feels kludgy.

 I will follow your recommendation but I think this code should be refactored.

 Thanks,

 Alec


 On Tue, Sep 4, 2012 at 12:25 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 Even if there is a place for improvement it is too late now.
 There are many apps in production with 1.5 at that time and this
 change will break them.
 You can extend WicketTester and override the problematic method to
 behave as you need it.

 On Tue, Sep 4, 2012 at 8:11 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Now that most of my production code is migrated to 1.5 I started
 migrating my tests. The first problem I ran into is with
 BaseWicketTester#startPanel and
 BaseWicketTester#getComponentFromLastRenderedPage.

 In 1.4 I could use startPanel and then find components with
 getComponentFromLastRenderedPage using paths relative to the panel. In
 1.5 I need to prefix those paths with panel:. Adding this prefix in
 hundreds of tests is overwhelming.

 BaseWicketTester#startComponentInPage(Class) JavaDoc says that it can
 use RELATIVE paths to look up components, but this is not the case for
 BaseWicketTester#startComponentInPage(Component)! That's because the
 method with Class parameter sets ComponentInPage#isInstantiated flag
 which is then checked in getComponentFromLastRenderedPage. I think all
 overloaded startComponentInPage methods should do that.

 Is this a bug?

 Thanks,

 Alec

 -
 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


 -
 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: select2 localization questions

2012-09-04 Thread Igor Vaynberg
you should declare your Select2Choice as Select2ChoiceShort since
that is its model type. once you do this the compiler will tell you
that your TextChoiceProvider should be TextChoiceProviderShort
instead of HrpBbhepar5

-igor

On Tue, Sep 4, 2012 at 1:42 PM, Sandor Feher sfe...@bluesystem.hu wrote:
 Okay. Just one more question.

 I have a domain model (HrpBbheerk) which contains a Short column. I would
 like to fill this via Select2Choice.
 I read the select2-examples but not able to get rid it.

 So the steps I took.

 1. Fill my hepar5list list from my domain model (HrpBbhepar5). This contains
 couple of columns but I only need for two. One for value and one for
 description. If possible I don't want to create another wrapper class just
 for this case.
 2. Create a form, added a model (HrpBbheerk)
 3. Added a new Select2Choice to the form with that Short column mentioned
 above.

 Snippets:

 ...
 fillHepar5(); // step 1
 HrpBbheertk heertk = fillHeertk();
 IModel model=new CompoundPropertyModel(heertk);
 sform.setModel(model);  // step 2
 Select2Choice dimelemert = new Select2Choice(dimelemert,new
 PropertyModel(sform.getModel(),dimelemert),new Hepar5Provider());  // step
 3

 ..

   private static ListHrpBbhepar5 queryMatches(String term, int page, int
 pageSize) {

 ListHrpBbhepar5 result = new ArrayListHrpBbhepar5();
 term = term.toUpperCase();

 final int offset = page * pageSize;

 int matched = 0;

 for (HrpBbhepar5 hepar5 : hepar5list) {
 if (result.size() == pageSize) {
 break;
 }

 if (hepar5.getDertekmegnev().toUpperCase().startsWith(term)) {
 matched++;
 if (matched  offset) {
 result.add(hepar5);
 }
 }
 }
 return result;
 }


 public class Hepar5Provider extends TextChoiceProviderHrpBbhepar5 {

 @Override
 protected String getDisplayText(HrpBbhepar5 choice) {
 return choice.getDertekmegnev();
 }

 @Override
 protected Object getId(HrpBbhepar5 choice) {
return choice;
 }

 @Override
 public void query(String term, int page, ResponseHrpBbhepar5
 response) {
 response.addAll(queryMatches(term, page, 10));
 response.setHasMore(response.size() == 10);
 }

 @Override
 public CollectionHrpBbhepar5 toChoices(CollectionString ids) {
 ArrayListHrpBbhepar5 hepar5idlist = new
 ArrayListHrpBbhepar5();

 Iterator it = hepar5list.iterator();
 while (it.hasNext()) {
 HrpBbhepar5 h = (HrpBbhepar5) it.next();
 hepar5idlist.add(h);
 }
 return hepar5idlist;
 }
 }

 .

 It complains that java.lang.Short cannot be cast to
 hu.xxx.model.HrpBbhepar5.
 Please let me know what  should I do.

 thnx., Sandor








 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/select2-localization-questions-tp4651732p4651753.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: Dataview: need message nothing found

2012-08-20 Thread Igor Vaynberg
data table has the NoRecordsToolbar

-igor

On Mon, Aug 20, 2012 at 3:01 AM, Delange delan...@telfort.nl wrote:
 I tried this, but I can't figure out how to convert from datatable to an
 AbstractRepeater.



 DataTable table = new DataTable(datatable, columns, kostenOVProvider, 10){
 protected Item newRowItem(String id, int index, 
 IModel model) {
 Item item = super.newRowItem(id, index, model);
 item.add(new AttributeModifier(class,  new Model(
 index % 2 == 0 ? even : odd)));
 return item;
 }
 };
 FilterToolbar filterToolbar = new FilterToolbar(table, form,
 kostenOVProvider);
 table.addTopToolbar(new HeadersToolbar(table, 
 kostenOVProvider));
 table.addTopToolbar(filterToolbar);
 table.addBottomToolbar(new NavigationToolbar(table));
 form.add(table);
 form.add(new NoRecordsContainer(norecordsFound, table));



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337p4651369.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: Dataview: need message nothing found

2012-08-17 Thread Igor Vaynberg
add a webmarkup container that is only visible when the dataview has no records.

public class NoRecordsContainer extends WebMarkupContainer {
private final AbstractRepeater repeater;

public NoRecordsContainer(String id, AbstractRepeater repeater) {
super(id);
this.repeater = repeater;
setOutputMarkupPlaceholderTag(true);
}

@Override
protected void onConfigure() {
super.onConfigure();
setVisible(repeater.size() == 0);
}
}

-igor

On Fri, Aug 17, 2012 at 8:00 AM, Delange delan...@telfort.nl wrote:
 Hi, when my dataview (with selections) does not return any result, it doesn't
 say anything.

 How can i return a message that there are no results found.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337.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: IExceptionMapper to notify support of errors

2012-08-15 Thread Igor Vaynberg
perhaps an error occurs during an ajax request whose response is
ignored. or maybe it happens during resource processing...

eg tinymce requests a resource, wicket doesnt find it and throws an
exception. your panel renders. but, because the url was for a resource
the response is ignored because its not a 200 response.

-igor


On Wed, Aug 15, 2012 at 9:40 AM, jchappelle jchappe...@4redi.com wrote:
 I have written an IExceptionMapper that notifies our support team if an
 unexpected exception occurs. It will redirect the user to our ErrorPage and
 in the ErrorPanel.onBeforeRender I send a notification via email in a new
 Thread. This mostly works except we are getting several false positives.
 What I mean is that the user never sees the ErrorPanel and continues to
 work. So our support team doesn't know if the user really notices an error
 or not.

 Here are the things that I don't understand about this behavior. If my
 notification code is in the onBeforeRender of my ErrorPanel, then how does
 this code execute and the user never see the panel? Also, we keep getting
 the following exceptions (it seems to happen where we have a tinymce in a
 form). The first one we see in development only but the second we see in
 production only. However, they both seem to be around
 org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass. The
 second generates a notification and the user never sees the ErrorPanel.

 *Error seen in development environment:*

 *Error seen in production*




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/IExceptionMapper-to-notify-support-of-errors-tp4651251.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: IExceptionMapper to notify support of errors

2012-08-15 Thread Igor Vaynberg
not really. like i said, if this happens during a resource url then
the browser will never show the response.
your best bet is to use a timer or any other callback that gets
triggered via javascript, so you know the user sees the error panel.

-igor

On Wed, Aug 15, 2012 at 10:22 AM, jchappelle jchappe...@4redi.com wrote:
 Thanks for the quick response Igor.

 Are there any callback methods in Panel that will allow me to put my
 notification code and guarantee that it will be rendered to the user? Worst
 case I could add a timer behavior to the panel that makes a callback to the
 server and executes the notification, but I don't really like that solution.

 Josh



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/IExceptionMapper-to-notify-support-of-errors-tp4651251p4651254.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: Key = Value search panel with actf

2012-08-08 Thread Igor Vaynberg
you can try using this:

http://ivaynberg.github.com/select2/

there is also wicket integration in my github

-igor

On Wed, Aug 8, 2012 at 2:12 PM, Sandor Feher sfe...@bluesystem.hu wrote:
 Hi,

 I'm looking for a component similar to DatePicker which let user to choose a
 value from a key = value list. It should contain an actf field let user to
 filter the values.
 Something like this:

 http://apache-wicket.1842946.n4.nabble.com/file/n4651064/lov.png

 thnx., Sandor



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Key-Value-search-panel-with-actf-tp4651064.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: AutocompleteTextField and object (not just String)

2012-08-06 Thread Igor Vaynberg
probably easier to use

https://github.com/ivaynberg/wicket-select2

which integrates

http://ivaynberg.github.com/select2/

rather then writing your own from scratch...

-igor

On Mon, Aug 6, 2012 at 3:36 PM, Per p...@hamburg.de wrote:
 Hi Daniele,

 while I don't have the answer to your question, here's a recent blogpost
 about how we implemented a reusable wicket autocomplete field. We were not
 entirely satisfied by the solutions we found about a year ago, so we cooked
 our own. There might be better solutions by now, and it's not a 100% native
 solution (uses jQuery UI, and a JSON action), but we keep using it a lot in
 our application for various use-cases, and it's been a huge help.

 Check out the screenshot and the explanation over here:
 http://www.small-improvements.com/blog/technical/wicket-autocomplete-component

 It requires some work to adapt, but it may be worth it, depending on your
 usecase.

 Cheers,
 Per



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AutocompleteTextField-and-object-not-just-String-tp4650911p4651026.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: DataTable in wicket 6 using wicket:container

2012-08-02 Thread Igor Vaynberg
how exactly would you attach a link to a span? link would complain
that it is not attached to an anchor tag...

-igor

On Wed, Aug 1, 2012 at 2:45 PM, Steve Lowery slow...@gatessolutions.com wrote:
 The DataTable was changed in wicket 6 to use wicket:container instead of
 span on the td and th elements (
 https://issues.apache.org/jira/browse/WICKET-4224).  While this fixed the
 issue described in the ticket, it can make dealing with the DataTable a
 little more cumbersome and introduces a new bug in my opinion.  If I want
 to simply add a link into a column (very usual use case), I cannot do so
 now without creating a dummy panel around it, or at least I don't know of a
 way.  Any component with attributes in the componentTag itself get dropped
 because the wicket:container tag doesn't get rendered, only the child does.
  It works fine with plain Label's, but that's about it.

 I can create a handful of dummy components that wrap the columns real
 content, but wasn't sure if this was the best way to do it.  Other people
 will certainly have the same issues when they upgrade to wicket 6.

 If you want me to create a quickstart for the link issue, I can do that.

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



Re: AutocompleteTextField and object (not just String)

2012-08-01 Thread Igor Vaynberg
On Wed, Aug 1, 2012 at 4:08 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hey Sven,

 On Wed, Aug 1, 2012 at 2:01 PM, Sven Meier s...@meiers.net wrote:
 DropDown has a clear pattern:
 the renderer is used only for
 rendering purpose

 BTW this is not correct: all choice components use their renderer for 
 rendering AND input, AutoCompleteTextField uses its renderer for rendering 
 only.

 Do you know why this is the case ?

because autocomplete is *not* a choice component. you can pick a value
that is not in the choices collection. that is why i created select2.
we had a bunch of autocompletes we were using to pick from existing
choices and it led to all kinds of headaches because it is not what
autocomplete is meant for.

-igor

 Is it possible to improve ACTF to be smarter ?


 Sven

 Sven Meier s...@meiers.net schrieb:

You have to overwrite AutoCompleteTextfield#getConverter() and provide a 
converter for your object.

You can use #getChoices() to find the correct object for the new input.

Sven

Daniele Dellafiore ilde...@gmail.com schrieb:

Hi.

I'm sure I'm talking about something that has already been discussed
here and on stackoverflow a lot, but still I haven't found a solution.

I do not understand how AutocompleteTextField works when dealing with
list of objects that are not just strings. Other wicket components
like DropDown has a clear pattern: the renderer is used only for
rendering purpose, there's a model to store selection and a model to
store choices options.

Still, I can't figure out how to do the very same thing with
AutocompleteTextField.

The best I can get is:
  TextField codeField = new 
 AutoCompleteTextFieldJSONObject(code,
model, JSONObject.class, renderer,
new AutoCompleteSettings());


I'm using an AbstractAutoCompleteTextRenderer and a PropertyModel
binded to a JSONObject variable.
It all works but when I submit the form, it says me that the selected
string is not a valid JSONObject, so he cannot attach it to the field.

the ITerator returned by AutocompleteTextField.getChoices(String
input) is an Iterator of JSONObject.
I expect that when I submit, the setObject receives the selected
JSONObject, not the String I do render using a specific Renderer.

How can that be done?

Thanks anyone for help.

--
Daniele Dell
 -
 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


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



Re: wicket 1.6 snapshot - cdi - inject - NullPointerException

2012-07-28 Thread Igor Vaynberg
a stack trace would be helpful...

-igor

On Sat, Jul 28, 2012 at 11:26 AM, Francois Meillet
francois.meil...@gmail.com wrote:
 Hi All,

 The problem is :  I got a NullPointerException after using @Inject
 environment : wicket 1.6 snapshot - cdi (weld) - inject - 
 NullPointerException - tomcat 7 / jboss AS 7

 module 1 : bookstoreservice  (with a beans.xml file)
 module 2 : bookstoreweb  (with a beans.xml file)

 in the bookstoreservice module I have these 2 classes:

 @ApplicationScoped
 public class Clock {
 public DateTime getTime() {
 return new DateTime().now();
 }
 }

 @ApplicationScoped
 public class BigBenClock {

 @Inject
 Clock clock;

 public BigBenClock() {
 }

 public DateTime getBigBenTime() {
 return clock.getTime().plusHours(2);
 }
 }



 First use : All works fine

 In a webpage, I have

 @Inject
 Clock clock;

 @Inject
 BigBenClock bigBenClock;

 add(new Label(time, new PropertyModel(this, clock.time)));
 add(new Label(bigBenTime, new PropertyModel(this, 
 bigBenClock.bigBenTime)));

 All works fine, thanks to Igor's example 
 https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/


 Second use : NullPointerException

 If I use the injection in the bookstoreservice module with no injection in 
 the webpage like this


 @Inject
 Clock clock;

 add(new Label(time, new PropertyModel(this, clock.time)));

 BigBenClock bigBenClock = new BigBenClock();
 DateTime bigBenTime = bigBenClock.getBigBenTime();

 I get a NullPointerException.  The BigBenClock's clok is null.
 Same result in Tomcat 7 and Jboss AS7.


 This is how I start the Wicket application

 getComponentInstantiationListeners().add(new JavaEEComponentInjector(this, 
 new ModuleJndiNamingStrategy()));
 BeanManager beanManager = (BeanManager)getServletContext().getAttribute(  
 Listener.BEAN_MANAGER_ATTRIBUTE_NAME);
 new 
 CdiConfiguration(beanManager).setPropagation(ConversationPropagation.NONE).configure(this);


 Any advice ?

 Thanks

 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



  1   2   3   4   5   6   7   8   9   10   >