Re: Component specific JavaScript

2012-02-19 Thread Jorge Rodrigez
Hi,

I think you just need:

class MyComponent extends SomeWicketComponent {

  @Override public void renderHead(IHeaderResponse response) {
response.renderOnDomReadyJavascript(someJSToExecute());
  }
}

someJSToExecute() will be executed every time an instance of MyComponent is
rendered. Both Ajax and normal requests.

On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lind juergen.l...@iteratec.dewrote:

 Hi Christoph,

 thank you for your reply, I did not know that such a method exists (does
 it for 1.4
 or is this already Wicket 1.5). An secondly: are these handlers fired on a
 ajax
 update of an existing DOM Element or only when it is added?

 And where would I put the Javascript that registers the handler? In the
 Markup-Page of
 the Component? How do I make sure, the handler is added only once?


 J.


 On 18.02.2012 17:39, Christoph Leiter wrote:

 Hello Juergen,

 you can register a function that gets called when wicket creates a new
 element in the DOM:

 Wicket.Event.subscribe('/dom/**node/added', function(element) {
  // do stuff
 });

 You can also use the '/dom/node/removing' channel.

 Hope this helps.


 Christoph




 Jürgen Lind (2012-02-18 16:55):

 Hi,

 I was wondering if there is any kind of best practice to add specific
 javascript
 to a component. I often have the case, where a piece of javascript needs
 to run
 when the component is rendered as part of full-page request, and then
 subsequently
 as part of a self-triggered Ajax-Request or as part of an Ajax-Request
 triggered
 by another component.

 I would like to have one place where I can put the Javascript and be
 shure, it is
 run every time...

 Cheers,

 J.


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



 Mit freundlichen Grüßen,

 Jürgen Lind


 --
 Dr. Jürgen Lind
 iteratec GmbHFon: +49 (0)89 614551-44
 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
 82008 Unterhaching   Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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




Re: Howto go for editable grid with add/remove row in wicket 1.4?

2012-02-19 Thread Jorge Rodrigez
You just need to add/remove an item to your data source.
Next time you rerender the grid it will show/hide the added/removed
item/row.

On Sun, Feb 19, 2012 at 6:46 PM, Emmanouil Batsis (Manos) ma...@abiss.grwrote:

 Subject says it all... currently using inmethod from wicketstuff but there
 is no add/remove row in the 1.4.x versions.

 Manos


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




Re: Any news on 1.5 - mapping different error pages for specific errors

2011-06-16 Thread Jorge Rodrigez
If you spare a bit of your precious time to explain the problem in more
details then we may have an idea.

On Thu, Jun 16, 2011 at 2:33 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Does anybody have an idea howto implement this?

 regards Nino

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




Re: Guice Wicket Guice Proxy

2010-06-07 Thread Jorge Rodrigez
Why phoneDao is transient ?
Wicket-Guice injects a Serializable proxy and thus after deserialization the
field will be non-null.

On Mon, Jun 7, 2010 at 7:31 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 sure:

 public class ClassWithDao {

   public ClassWithDao() {
   InjectorHolder.getInjector().inject(this);
   }

   @Inject
   private transient PhoneDao phoneDao;

   public PhoneDao getPhoneDao() {
   return phoneDao;
 }

   public void setPhoneDao(PhoneDao phoneDao) {
   this.phoneDao = phoneDao;
   }

 That's where I get the failure... And the working version you have seen..

 2010/6/7 yaniv kessler yan...@gmail.com:
  Nino, can you show the ClassWithDao code before the so called ugliness
 was
  introduced?
 
  On Sun, Jun 6, 2010 at 1:44 PM, nino martinez wael 
  nino.martinez.w...@gmail.com wrote:
 
  im still working on the quickstart.. So far I've been unable to
  replicate.. I'll continue tomorrow
 
  2010/6/5 nino martinez wael nino.martinez.w...@gmail.com:
   I was too quick to say it worked, as it appears it does not. I'll try
   to make a quickstart based on legup, where should I put it? Just on
   jira?
  
   -Nino
  
   2010/6/4 nino martinez wael nino.martinez.w...@gmail.com:
   yeah me too, what Igor said worked so must be true or a bug.. I don't
   think it's a bug..
  
   2010/6/3 James Carman ja...@carmanconsulting.com:
   I thought the filters were executed in the order of their
   filter-mappings, not their filter definitions.
  
   On Thu, Jun 3, 2010 at 5:23 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
   Argh, how stupid.. Thanks a lot igor, how can I buy you a beer or
  Coke?
  
   I spend a tremendous time trying to figure out what was wrong. I
 even
   considered going back to spring..
  
   regards Nino
  
   2010/6/3 Igor Vaynberg igor.vaynb...@gmail.com:
   noep, the filters are processed in the order they are defined in
   web.xml, move the wicket filter decl below the warp persist stuff.
  
   -igor
  
   On Thu, Jun 3, 2010 at 1:05 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
   yes, i think so:
  
   ?xml version=1.0 encoding=ISO-8859-1?
   web-app xmlns=http://java.sun.com/xml/ns/j2ee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  version=2.4
  
  display-nameIVR Web frontend/display-name
  
  filter
  filter-namewicket.WicketWarp/filter-name
  
 
  filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
  init-param
  
  param-nameapplicationClassName/param-name
  
 
  param-valuecom.netdesign.codan.webadmin.WicketApplication/param-value
  /init-param
  
  init-param
  param-nameconfiguration/param-name
  param-valuedeployment/param-value
  /init-param
  /filter
  
  filter
  filter-namewarpPersistFilter/filter-name
  
 
  filter-classcom.wideplay.warp.persist.PersistenceFilter/filter-class
  /filter
  
  filter-mapping
  filter-namewarpPersistFilter/filter-name
  url-pattern/*/url-pattern
  /filter-mapping
  
  
  
  
  filter-mapping
  filter-namewicket.WicketWarp/filter-name
  url-pattern/*/url-pattern
  /filter-mapping
  
  
   /web-app
  
  
   2010/6/2 Igor Vaynberg igor.vaynb...@gmail.com:
   did you install warp's open entity manager in view filter
 *before*
   wicket's filter?
  
   -igor
  
   On Wed, Jun 2, 2010 at 5:46 AM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
   Hi I somehow think theres something wrong with the Wicket Guice
  proxy
   (probably only if you are using guice 2  possibly warp
 persist)
  
   Anyhow I have had to change my LDM's to this code, notice the
  injector
   holder in the getter method really really bad. But if not I get
 an
   entity manager is closed:
  
   public class ClassWithDao {
  
  public ClassWithDao() {
  InjectorHolder.getInjector().inject(this);
  }
  
  @Inject
  private transient PhoneDao phoneDao;
  
  /**
   * This method contains a fix, should ordinary be
 avoided!
  There
   should be no need for calling the extra InjectorHolder method!
   * @return
   */
public PhoneDao getPhoneDao() {
InjectorHolder.getInjector().inject(this);
return phoneDao;
}
  
  public void setPhoneDao(PhoneDao phoneDao) {
  this.phoneDao = phoneDao;
  }
  
   Am I doing anything wrong I wonder, however the first requests
 are
   always working it's after something has been trough the session
  store
   it goes wrong..
  
   

Parsing of resource locale

2010-06-06 Thread Jorge Rodrigez
Hi,

I observe that if my .css file is named like 'something_ab.css'
then org.apache.wicket.util.resource.locator.ResourceNameIterator confuses
that 'ab' is the locale of the resource.
As a result if I create a ResourceReference(MyPage.class,
something_ab.css, Locale.US, mystyle) then the produced URL is :
http://localhost:8080/resources/com.mycompany.HomePage/something_ab_mystyle_ab.css


Is this a bug or it is a known limitation in 1.4 ?

P.S. With 1.5 everything is OK:
http://localhost:8080/wicket/resource/com.mycompany.HomePage/something_ab.css?en_US-mystyle-variation