AVI in Wicket

2011-01-27 Thread vov

Hi All,

Can anybody say how to play video on wicket page?
(Using Adobe Media Player or something else)

Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AVI-in-Wicket-tp3241694p3241694.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: AVI in Wicket

2011-01-27 Thread Martin Grigorov
I have never used Adobe Media Player but I guess you can integrate it like
Flash object.
Search in Google/mailing lists for swfobject+wicket. I think there is a wiki
page for that too.

Also take a look at wicketstuff  core  jdk1.6  html5 to see a demo for
html5's video

On Thu, Jan 27, 2011 at 10:09 AM, vov vov...@mail.ru wrote:


 Hi All,

 Can anybody say how to play video on wicket page?
 (Using Adobe Media Player or something else)

 Thanks
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AVI-in-Wicket-tp3241694p3241694.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: AVI in Wicket

2011-01-27 Thread vov

Thank a lot!!
I found wicket-html5 and hope that it help.
Thanks!!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AVI-in-Wicket-tp3241694p3241770.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket examples very slow

2011-01-27 Thread Martin Grigorov
On Tue, Jan 25, 2011 at 1:25 PM, kondwani kondw...@gmail.com wrote:


 Any luck in resolving this problem?  I'm unable to even look at the Source
 Code.

Tomcat is upgraded from 5.5.x to 6.0.x and all is fine again.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/wicket-examples-very-slow-tp3234627p3236027.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




Can i catch urls like http://localhost:8080/ShowThemePage-ti325-Twilight.html by IRequestTargetUrlCodingStrategy?

2011-01-27 Thread Mike Mander

Hi,

urls in my shop look like this
code
http://localhost:8080/ShowThemePage-ti325-Twilight.html
/code
ShowThemePage should be mapped to my ThemePage.class
The ti325 and Twilight Tokens should be indexed parameters
and the .html is for ornament.

Until now i mounted my own Strategy in my application.init
code
mount(new ThemeUrlCodingStrategy());
/code

The strategy looks like
code
import org.apache.wicket.IRequestTarget;
import org.apache.wicket.PageParameters;
import org.apache.wicket.request.RequestParameters;
import 
org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
import 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
import 
org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget;

import org.apache.wicket.util.string.AppendingStringBuffer;

import de.shop.shopping.ThemePage;

public class ThemeUrlCodingStrategy extends 
AbstractRequestTargetUrlCodingStrategy {


public ThemeUrlCodingStrategy() {
super(ShowThemePage);
}

@Override
public CharSequence encode(IRequestTarget requestTarget) {
AppendingStringBuffer url = new 
AppendingStringBuffer(ShowThemePage-ti);
IBookmarkablePageRequestTarget target = 
(IBookmarkablePageRequestTarget) requestTarget;

PageParameters parameters = target.getPageParameters();

url.append(urlEncodePathComponent(String.valueOf(parameters.get(ti.append(-).append(urlEncodePathComponent(escape(String.valueOf(parameters.get(name);

return url.append(.html);
}

private String escape(String value) {
return value == null ? null : value.replaceAll( , _);
}

@Override
public IRequestTarget decode(RequestParameters requestParameters) {
return new BookmarkablePageRequestTarget(ThemePage.class, new 
PageParameters(ti=99, name=Hello_kitty)); // for testing use constant 
parameters

}

@Override
public boolean matches(IRequestTarget requestTarget) {
if (requestTarget instanceof IBookmarkablePageRequestTarget) {
IBookmarkablePageRequestTarget target = 
(IBookmarkablePageRequestTarget) requestTarget;

return ThemePage.class.isAssignableFrom(target.getPageClass());
}
return false;
}
}
/code

But all i get is a 404 for page not found. Do i have to implement 
something else?


Thanks for help
Mike

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



Re: FormComponentPanel and invalid child FormComponents question

2011-01-27 Thread Sam Zilverberg
Thanks again.
Just tried it out and it works perfect.

ContainerFeedbackMessageFilter for my form-comp-panel's feedback panel
allowed it to show it's children messages.

Using a visitor in my invalid-css-class-behavior allowed me to enable the
behavior when one of the children has an error.

This is how the isEnabled method in the invalid-css-class-behavior looks
like now:

@Override
public boolean isEnabled(Component component)
{
if (component instanceof MarkupContainer)
{
if (component.hasErrorMessage()) return true;
Object obj = ((MarkupContainer) component).visitChildren(new
IVisitorComponent()
{

public Object component(Component component)
{
if (component.hasErrorMessage())
return true;
else
return Component.IVisitor.CONTINUE_TRAVERSAL;
}
});
return super.isEnabled(component)  (obj != null) 
(Boolean.TRUE.equals(obj));
}
else
return super.isEnabled(component) 
component.hasErrorMessage();
}

kind of a mess but it works great :)


Compound Property Model, sharing for children

2011-01-27 Thread Brown, Berlin [GCG-PFS]
How does the compound property model work in these instances:
 
If I do (pseudo code):
 
Form form = new Form ( new CompoundPropertyModel(someObject))
 
form.add (new MyTextField(someFieldFromObject);
 
...
 
public class MyTextField {
 
   public MyTextField() {
  super(id);
  getModel()   - will this return an object? 
  getModelObject()  -- will this return an object?
   } 
}
 
Basically, when is the model object and model bound to a component that
uses the compound property model.
 
Berlin Brown


Re: Compound Property Model, sharing for children

2011-01-27 Thread Pedro Santos
No because the MyTextField will not be able to init its model based on the
parent CompoundPropertyModel since it don't know him yet. Only after exit
the form.add call MyTextField.getModel will work as expected.
If MyTextField invokes getModel inside the onInitialize it will work fine,
since at this point since an path exists from this component to the page.


On Thu, Jan 27, 2011 at 10:59 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 How does the compound property model work in these instances:

 If I do (pseudo code):

 Form form = new Form ( new CompoundPropertyModel(someObject))

 form.add (new MyTextField(someFieldFromObject);

 ...

 public class MyTextField {

   public MyTextField() {
  super(id);
  getModel()   - will this return an object?
  getModelObject()  -- will this return an object?
   }
 }

 Basically, when is the model object and model bound to a component that
 uses the compound property model.

 Berlin Brown




-- 
Pedro Henrique Oliveira dos Santos


RE: Compound Property Model, sharing for children

2011-01-27 Thread Brown, Berlin [GCG-PFS]
Also, I am assuming a call to compoundPropertyModel.bind(expression) is
called, does this return a property model?  Or is more involved?


New
TextField().setDefaultModel(compoundPropertyModel.bind(obj.fieldName))
; -- return a propertymodel.

If I change the instance of modelobject obj in the case above, how
does the compound property model use the new instance.  E.g:

public class SomeObject {
  public class Inner {
 fieldName
  }
  private SomeObject.Inner obj;

  getObj() { }
  setObj() { }
}

SomeObject someObjectMain = new SomeObject()
Form form = new Form ( new CompoundPropertyModel(new SomeObject()));
form.add (new MyTextField(obj.fieldName);

someObjectMain.setObj(new SomeObject.Inner());  --- In this case, will
the model object for the text field be updated and how??

...

-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Thursday, January 27, 2011 8:07 AM
To: users@wicket.apache.org
Subject: Re: Compound Property Model, sharing for children

No because the MyTextField will not be able to init its model based on
the parent CompoundPropertyModel since it don't know him yet. Only after
exit the form.add call MyTextField.getModel will work as expected.
If MyTextField invokes getModel inside the onInitialize it will work
fine, since at this point since an path exists from this component to
the page.


On Thu, Jan 27, 2011 at 10:59 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 How does the compound property model work in these instances:

 If I do (pseudo code):

 Form form = new Form ( new CompoundPropertyModel(someObject))

 form.add (new MyTextField(someFieldFromObject);

 ...

 public class MyTextField {

   public MyTextField() {
  super(id);
  getModel()   - will this return an object?
  getModelObject()  -- will this return an object?
   }
 }

 Basically, when is the model object and model bound to a component 
 that uses the compound property model.

 Berlin Brown




--
Pedro Henrique Oliveira dos Santos


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



Re: Compound Property Model, sharing for children

2011-01-27 Thread Pedro Santos
On Thu, Jan 27, 2011 at 11:18 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 Also, I am assuming a call to compoundPropertyModel.bind(expression) is
 called, does this return a property model?  Or is more involved?


 New
 TextField().setDefaultModel(compoundPropertyModel.bind(obj.fieldName))
 ; -- return a propertymodel.

 If I change the instance of modelobject obj in the case above, how
 does the compound property model use the new instance.  E.g:

 public class SomeObject {
  public class Inner {
 fieldName
  }
  private SomeObject.Inner obj;

  getObj() { }
  setObj() { }
 }

 SomeObject someObjectMain = new SomeObject()
 Form form = new Form ( new CompoundPropertyModel(new SomeObject()));
 form.add (new MyTextField(obj.fieldName);

 someObjectMain.setObj(new SomeObject.Inner());  --- In this case, will
 the model object for the text field be updated and how??

 in this case no, because the model object is untouched, in the last line
you set a new object at someObjectMain, but this variable is not pointing to
the SomeObject instance in the model.

to update the model object you can call:
form.getDefaultModelObject().setObj(new SomeObject.Inner())
or create the form as: new Form ( new CompoundPropertyModel(someObjectMain
 /*instead of create another SomeObject here*/  ));

...

 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: Thursday, January 27, 2011 8:07 AM
 To: users@wicket.apache.org
 Subject: Re: Compound Property Model, sharing for children

 No because the MyTextField will not be able to init its model based on
 the parent CompoundPropertyModel since it don't know him yet. Only after
 exit the form.add call MyTextField.getModel will work as expected.
 If MyTextField invokes getModel inside the onInitialize it will work
 fine, since at this point since an path exists from this component to
 the page.


 On Thu, Jan 27, 2011 at 10:59 AM, Brown, Berlin [GCG-PFS] 
 berlin.br...@primerica.com wrote:

  How does the compound property model work in these instances:
 
  If I do (pseudo code):
 
  Form form = new Form ( new CompoundPropertyModel(someObject))
 
  form.add (new MyTextField(someFieldFromObject);
 
  ...
 
  public class MyTextField {
 
public MyTextField() {
   super(id);
   getModel()   - will this return an object?
   getModelObject()  -- will this return an object?
}
  }
 
  Basically, when is the model object and model bound to a component
  that uses the compound property model.
 
  Berlin Brown
 



 --
 Pedro Henrique Oliveira dos Santos


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




-- 
Pedro Henrique Oliveira dos Santos


Re: Noob question: Link to Page that only Redirects?

2011-01-27 Thread flavius


On your MyLinkPage you can just setResponsePage...

So

if (gotoQuestionPage)
  setResponsePage(QuestionPage.class);
else
  setResponsePage(ErrorPage.class);

Is that what you're after?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Noob-question-Link-to-Page-that-only-Redirects-tp3242125p3242300.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: Can i catch urls like http://localhost:8080/ShowThemePage-ti325-Twilight.html by IRequestTargetUrlCodingStrategy?

2011-01-27 Thread Igor Vaynberg
instead of mounting it set in the settings. mounting is for
intercepting path segments.

also set a breakpoint and see if its being hit.

-igor


On Thu, Jan 27, 2011 at 2:56 AM, Mike Mander wicket-m...@gmx.de wrote:
 Hi,

 urls in my shop look like this
 code
 http://localhost:8080/ShowThemePage-ti325-Twilight.html
 /code
 ShowThemePage should be mapped to my ThemePage.class
 The ti325 and Twilight Tokens should be indexed parameters
 and the .html is for ornament.

 Until now i mounted my own Strategy in my application.init
 code
            mount(new ThemeUrlCodingStrategy());
 /code

 The strategy looks like
 code
 import org.apache.wicket.IRequestTarget;
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.request.RequestParameters;
 import
 org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
 import
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
 import
 org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget;
 import org.apache.wicket.util.string.AppendingStringBuffer;

 import de.shop.shopping.ThemePage;

 public class ThemeUrlCodingStrategy extends
 AbstractRequestTargetUrlCodingStrategy {

    public ThemeUrlCodingStrategy() {
        super(ShowThemePage);
    }

    @Override
    public CharSequence encode(IRequestTarget requestTarget) {
        AppendingStringBuffer url = new
 AppendingStringBuffer(ShowThemePage-ti);
        IBookmarkablePageRequestTarget target =
 (IBookmarkablePageRequestTarget) requestTarget;
        PageParameters parameters = target.getPageParameters();

  url.append(urlEncodePathComponent(String.valueOf(parameters.get(ti.append(-).append(urlEncodePathComponent(escape(String.valueOf(parameters.get(name);
        return url.append(.html);
    }

    private String escape(String value) {
        return value == null ? null : value.replaceAll( , _);
    }

    @Override
    public IRequestTarget decode(RequestParameters requestParameters) {
        return new BookmarkablePageRequestTarget(ThemePage.class, new
 PageParameters(ti=99, name=Hello_kitty)); // for testing use constant
 parameters
    }

    @Override
    public boolean matches(IRequestTarget requestTarget) {
        if (requestTarget instanceof IBookmarkablePageRequestTarget) {
            IBookmarkablePageRequestTarget target =
 (IBookmarkablePageRequestTarget) requestTarget;
            return ThemePage.class.isAssignableFrom(target.getPageClass());
        }
        return false;
    }
 }
 /code

 But all i get is a 404 for page not found. Do i have to implement something
 else?

 Thanks for help
 Mike

 -
 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 deal with vertical tabs?

2011-01-27 Thread Carsten Luckmann
Hello,

thank you for your replies. Yes, we are using Wicket 1.4 (I should have
mentioned it in my original post), and unfortunatley, project constraints
prohibit a Wicket upgrade at this time. I shall consider an upgrade as soon
as the project permits.

Yours,
Carsten

2011/1/26 Martin Grigorov mgrigo...@apache.org

 This is fixed in 1.5 only.

 https://issues.apache.org/jira/browse/WICKET-2264
 https://issues.apache.org/jira/browse/WICKET-3330

 On Wed, Jan 26, 2011 at 5:10 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  wicket should already be escaping such characters in markup. please
  file a jira with a quickstart.
 
  -igor
 
  On Wed, Jan 26, 2011 at 6:36 AM, Carsten Luckmann
  carsten.luckm...@freiheit.com wrote:
   Hello,
  
   I have a problem with a Wicket Ajax response not being processed. Here
  the
   details:
  
   I have a link which is supposed to open a ModalWindow. The Ajax request
  is
   sent to the server, processed by the server, and the response is sent
 to
  the
   client. The client receives the response, including the HTML code for
 the
   ModalWindow and the JavaScript to open it. Nevertheless, the
   Wicket.Window.create call is never executed. After having investigated
  the
   problem, I have found out that this strange behaviour is triggered by a
   vertical tab character, which is an illegal XML character and causes
 the
  XML
   parser in Firefox and Chrome to exit (IE works though). This vertical
 tab
   character entered the markup from the application's data store and was
  part
   of the content of a data field.
  
   Until now, I came up with the following strategies:
  
   1. One possible solution would be inhibition of illegal XML characters
 in
   the data. Besides the question, if this is semantically acceptable, it
 is
   difficult and sometimes not possible to intercept and clean all data
   entering the data store.
  
   2. Another solution would be a Servlet filter, filtering all illegal
   characters. The problem I see with this solution is varying character
   encoding of the response, which makes it difficult to recognize the
  illegal
   characters in all circumstances.
  
   3. My favourite solution would be some kind of mechanism in Wicket,
 which
   allows for filtering or modifying the data before the markup is
 rendered.
  I
   just do not know whether there is a way to do this in wicket and how to
   perform this task.
  
   Maybe you can help me and point me into the right direction. Other
   suggestions are welcome, too.
  
   Yours,
   Carsten
  
   --
   Dr. rer. nat. Carsten Luckmann
   Dipl.-Phys.
  
   freiheit.com technologies gmbh
   Straßenbahnring 22 / 20251 Hamburg, Germany
   fon   +49 (0)40 / 890584-0
   fax   +49 (0)40 / 890584-20
   HRB Hamburg 70814
  
   E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
   Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Dr. rer. nat. Carsten Luckmann
Dipl.-Phys.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


Re: How to deal with vertical tabs?

2011-01-27 Thread Igor Vaynberg
the fix in 1.5 has caused a bit of havoc as it cascaded to a lot of
places, so i dont think we are going to backport it into the stable
1.4. so until you switch to 1.5 you can roll the filter you talked
about.

-igor

On Thu, Jan 27, 2011 at 8:08 AM, Carsten Luckmann
carsten.luckm...@freiheit.com wrote:
 Hello,

 thank you for your replies. Yes, we are using Wicket 1.4 (I should have
 mentioned it in my original post), and unfortunatley, project constraints
 prohibit a Wicket upgrade at this time. I shall consider an upgrade as soon
 as the project permits.

 Yours,
 Carsten

 2011/1/26 Martin Grigorov mgrigo...@apache.org

 This is fixed in 1.5 only.

 https://issues.apache.org/jira/browse/WICKET-2264
 https://issues.apache.org/jira/browse/WICKET-3330

 On Wed, Jan 26, 2011 at 5:10 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  wicket should already be escaping such characters in markup. please
  file a jira with a quickstart.
 
  -igor
 
  On Wed, Jan 26, 2011 at 6:36 AM, Carsten Luckmann
  carsten.luckm...@freiheit.com wrote:
   Hello,
  
   I have a problem with a Wicket Ajax response not being processed. Here
  the
   details:
  
   I have a link which is supposed to open a ModalWindow. The Ajax request
  is
   sent to the server, processed by the server, and the response is sent
 to
  the
   client. The client receives the response, including the HTML code for
 the
   ModalWindow and the JavaScript to open it. Nevertheless, the
   Wicket.Window.create call is never executed. After having investigated
  the
   problem, I have found out that this strange behaviour is triggered by a
   vertical tab character, which is an illegal XML character and causes
 the
  XML
   parser in Firefox and Chrome to exit (IE works though). This vertical
 tab
   character entered the markup from the application's data store and was
  part
   of the content of a data field.
  
   Until now, I came up with the following strategies:
  
   1. One possible solution would be inhibition of illegal XML characters
 in
   the data. Besides the question, if this is semantically acceptable, it
 is
   difficult and sometimes not possible to intercept and clean all data
   entering the data store.
  
   2. Another solution would be a Servlet filter, filtering all illegal
   characters. The problem I see with this solution is varying character
   encoding of the response, which makes it difficult to recognize the
  illegal
   characters in all circumstances.
  
   3. My favourite solution would be some kind of mechanism in Wicket,
 which
   allows for filtering or modifying the data before the markup is
 rendered.
  I
   just do not know whether there is a way to do this in wicket and how to
   perform this task.
  
   Maybe you can help me and point me into the right direction. Other
   suggestions are welcome, too.
  
   Yours,
   Carsten
  
   --
   Dr. rer. nat. Carsten Luckmann
   Dipl.-Phys.
  
   freiheit.com technologies gmbh
   Straßenbahnring 22 / 20251 Hamburg, Germany
   fon   +49 (0)40 / 890584-0
   fax   +49 (0)40 / 890584-20
   HRB Hamburg 70814
  
   E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
   Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




 --
 Dr. rer. nat. Carsten Luckmann
 Dipl.-Phys.

 freiheit.com technologies gmbh
 Straßenbahnring 22 / 20251 Hamburg, Germany
 fon   +49 (0)40 / 890584-0
 fax   +49 (0)40 / 890584-20
 HRB Hamburg 70814

 E5FA C55C A15B 27CB 0EEE  D4F5 F8DE 4DBD 524A F375
 Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


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



Re: Can i catch urls like http://localhost:8080/ShowThemePage-ti325-Twilight.html by IRequestTargetUrlCodingStrategy?

2011-01-27 Thread wicket-mike
Thanks Igor,

i checked the settings but couldn't find anything what i could use to solve my 
problem.
Can you please push me a bit further and tell me what i can do to map the url 
to a page with appropriate parameters.

Thanks again
Mike

 Original-Nachricht 
 Datum: Thu, 27 Jan 2011 08:04:53 -0800
 Von: Igor Vaynberg igor.vaynb...@gmail.com
 An: users@wicket.apache.org
 Betreff: Re: Can i catch urls like 
 http://localhost:8080/ShowThemePage-ti325-Twilight.html; by 
 IRequestTargetUrlCodingStrategy?

 instead of mounting it set in the settings. mounting is for
 intercepting path segments.
 
 also set a breakpoint and see if its being hit.
 
 -igor
 
 
 On Thu, Jan 27, 2011 at 2:56 AM, Mike Mander wicket-m...@gmx.de wrote:
  Hi,
 
  urls in my shop look like this
  code
  http://localhost:8080/ShowThemePage-ti325-Twilight.html
  /code
  ShowThemePage should be mapped to my ThemePage.class
  The ti325 and Twilight Tokens should be indexed parameters
  and the .html is for ornament.
 
  Until now i mounted my own Strategy in my application.init
  code
             mount(new ThemeUrlCodingStrategy());
  /code
 
  The strategy looks like
  code
  import org.apache.wicket.IRequestTarget;
  import org.apache.wicket.PageParameters;
  import org.apache.wicket.request.RequestParameters;
  import
 
 org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
  import
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
  import
 
 org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget;
  import org.apache.wicket.util.string.AppendingStringBuffer;
 
  import de.shop.shopping.ThemePage;
 
  public class ThemeUrlCodingStrategy extends
  AbstractRequestTargetUrlCodingStrategy {
 
     public ThemeUrlCodingStrategy() {
         super(ShowThemePage);
     }
 
     @Override
     public CharSequence encode(IRequestTarget requestTarget) {
         AppendingStringBuffer url = new
  AppendingStringBuffer(ShowThemePage-ti);
         IBookmarkablePageRequestTarget target =
  (IBookmarkablePageRequestTarget) requestTarget;
         PageParameters parameters = target.getPageParameters();
 
 
  url.append(urlEncodePathComponent(String.valueOf(parameters.get(ti.append(-).append(urlEncodePathComponent(escape(String.valueOf(parameters.get(name);
         return url.append(.html);
     }
 
     private String escape(String value) {
         return value == null ? null : value.replaceAll( , _);
     }
 
     @Override
     public IRequestTarget decode(RequestParameters requestParameters) {
         return new BookmarkablePageRequestTarget(ThemePage.class, new
  PageParameters(ti=99, name=Hello_kitty)); // for testing use constant
  parameters
     }
 
     @Override
     public boolean matches(IRequestTarget requestTarget) {
         if (requestTarget instanceof IBookmarkablePageRequestTarget)
 {
             IBookmarkablePageRequestTarget target =
  (IBookmarkablePageRequestTarget) requestTarget;
             return
 ThemePage.class.isAssignableFrom(target.getPageClass());
         }
         return false;
     }
  }
  /code
 
  But all i get is a 404 for page not found. Do i have to implement
 something
  else?
 
  Thanks for help
  Mike
 
  -
  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
 

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

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



Re: Can i catch urls like http://localhost:8080/ShowThemePage-ti325-Twilight.html by IRequestTargetUrlCodingStrategy?

2011-01-27 Thread Igor Vaynberg
webapplication {
protected IRequestCycleProcessor newRequestCycleProcessor()
 {
return new WebRequestCycleProcessor() {
   protected IRequestCodingStrategy newRequestCodingStrategy() {
  return new MyStrategy();===

also make yours either extend WebRequestCodingStrategy or chain to it.

-igor


On Thu, Jan 27, 2011 at 11:00 AM,  wicket-m...@gmx.de wrote:
 Thanks Igor,

 i checked the settings but couldn't find anything what i could use to solve 
 my problem.
 Can you please push me a bit further and tell me what i can do to map the url 
 to a page with appropriate parameters.

 Thanks again
 Mike

  Original-Nachricht 
 Datum: Thu, 27 Jan 2011 08:04:53 -0800
 Von: Igor Vaynberg igor.vaynb...@gmail.com
 An: users@wicket.apache.org
 Betreff: Re: Can i catch urls like 
 http://localhost:8080/ShowThemePage-ti325-Twilight.html; by 
 IRequestTargetUrlCodingStrategy?

 instead of mounting it set in the settings. mounting is for
 intercepting path segments.

 also set a breakpoint and see if its being hit.

 -igor


 On Thu, Jan 27, 2011 at 2:56 AM, Mike Mander wicket-m...@gmx.de wrote:
  Hi,
 
  urls in my shop look like this
  code
  http://localhost:8080/ShowThemePage-ti325-Twilight.html
  /code
  ShowThemePage should be mapped to my ThemePage.class
  The ti325 and Twilight Tokens should be indexed parameters
  and the .html is for ornament.
 
  Until now i mounted my own Strategy in my application.init
  code
             mount(new ThemeUrlCodingStrategy());
  /code
 
  The strategy looks like
  code
  import org.apache.wicket.IRequestTarget;
  import org.apache.wicket.PageParameters;
  import org.apache.wicket.request.RequestParameters;
  import
 
 org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
  import
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
  import
 
 org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget;
  import org.apache.wicket.util.string.AppendingStringBuffer;
 
  import de.shop.shopping.ThemePage;
 
  public class ThemeUrlCodingStrategy extends
  AbstractRequestTargetUrlCodingStrategy {
 
     public ThemeUrlCodingStrategy() {
         super(ShowThemePage);
     }
 
     @Override
     public CharSequence encode(IRequestTarget requestTarget) {
         AppendingStringBuffer url = new
  AppendingStringBuffer(ShowThemePage-ti);
         IBookmarkablePageRequestTarget target =
  (IBookmarkablePageRequestTarget) requestTarget;
         PageParameters parameters = target.getPageParameters();
 
 
  url.append(urlEncodePathComponent(String.valueOf(parameters.get(ti.append(-).append(urlEncodePathComponent(escape(String.valueOf(parameters.get(name);
         return url.append(.html);
     }
 
     private String escape(String value) {
         return value == null ? null : value.replaceAll( , _);
     }
 
     @Override
     public IRequestTarget decode(RequestParameters requestParameters) {
         return new BookmarkablePageRequestTarget(ThemePage.class, new
  PageParameters(ti=99, name=Hello_kitty)); // for testing use constant
  parameters
     }
 
     @Override
     public boolean matches(IRequestTarget requestTarget) {
         if (requestTarget instanceof IBookmarkablePageRequestTarget)
 {
             IBookmarkablePageRequestTarget target =
  (IBookmarkablePageRequestTarget) requestTarget;
             return
 ThemePage.class.isAssignableFrom(target.getPageClass());
         }
         return false;
     }
  }
  /code
 
  But all i get is a 404 for page not found. Do i have to implement
 something
  else?
 
  Thanks for help
  Mike
 
  -
  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


 --
 Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
 belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

 -
 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.5.x javadoc

2011-01-27 Thread Todd Wolff
Hi,

 

Is there a URL where I can pull up javadoc for latest 1.5 RC without
having to checkout source and generate myself?  Thanks.



1.5 Javascript HeaderContribution

2011-01-27 Thread Todd Wolff
Hi,

 

Struggling with new HeaderContribution semantics ...  Trying to
dynamically add a javascript reference to header section. 

 

My old code (that worked):

 

add(JavascriptPackageResource.getHeaderContribution(js/fb-auth-redirect
.js));

 

Tried refactoring (unsuccessfully) as:

 

response.renderJavaScriptReference(new
PackageResourceReference(js/fb-auth-redirect.js)); 

 

What is the correct way to duplicate the old logic?  Thanks.



Re: 1.5 Javascript HeaderContribution

2011-01-27 Thread Igor Vaynberg
response.renderJavaScriptReference(SomeClassInThePackage.class,
js/fb-auth-redirect.js);

-igor

On Thu, Jan 27, 2011 at 3:44 PM, Todd Wolff todd.wo...@utsa.edu wrote:
 Hi,



 Struggling with new HeaderContribution semantics ...  Trying to
 dynamically add a javascript reference to header section.



 My old code (that worked):



 add(JavascriptPackageResource.getHeaderContribution(js/fb-auth-redirect
 .js));



 Tried refactoring (unsuccessfully) as:



 response.renderJavaScriptReference(new
 PackageResourceReference(js/fb-auth-redirect.js));



 What is the correct way to duplicate the old logic?  Thanks.



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



Submit form from ajaxlink not a part of the form

2011-01-27 Thread Brown, Berlin [GCG-PFS]
So, I was able to submit a form WITHOUT ajax.  Now, how can I submit a
form with ajax but from a link not associated with that form.  I tried
the following.But, I couldn't get the proper URLs / Button?   Are
those needed for the wicketSubmFormById call?
 
Also, do i have an issue using target.appendJavascript(...);
 
...
 
If you look at the event handler method, 
 
public class MyPanel {
 
public static final String
JS_SUBMIT_THIS_WORKS_BUT_HOW_TO_SUBMIT_BY_AJAX = try {
document.forms['%s'].submit(); } catch(err) { alert('ERR:' + err); if
(window.console != undefined) { console.log(err); } };
 
this.add(new AjaxLinkObject(link) {
@Override
public void onClick(final AjaxRequestTarget target) {

// Find the dynamic form on the page. 
final Object objAtStopTraversal =
getParentContainer().visitChildren(new FindFormVisitor());
if (objAtStopTraversal instanceof Form?) {
// Form found, invoke javascript submit
final Form? form = (Form?) objAtStopTraversal;

 
target.appendJavascript(getEventHandler(form.getMarkupId(), ???, this));
}
}
} );
 
protected CharSequence getEventHandler(final String formMarkupId, final
String inputName, final AbstractLink link) {
final String formId = formMarkupId;
final CharSequence url = 
AppendingStringBuffer call = new AppendingStringBuffer(var
wcall=wicketSubmitFormById(')
.append(formId).append(', ').append(url).append(', );

call.append(')
.append(inputName)
.append(' );
call.append(,function() { }.bind(this),function() {
}.bind(this), function() { }.bind(this));;; return false;;);
return call;
}
 
Berlin Brown


Re: Access to HttpServletResponse gone in 1.5?

2011-01-27 Thread mbrictson


Todd Wolff wrote:
 
 How can I access HttpServletResponse?
 

I think this will work in the latest 1.5-SNAPSHOT:

(HttpServletResponse) getResponse().getContainerResponse();
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Access-to-HttpServletResponse-gone-in-1-5-tp3239121p3243679.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: 1.5.x javadoc

2011-01-27 Thread Steve Swinsburg
Wicket By Example has a section for the Javadocs, but it needs a refresh.
http://wicketbyexample.com/api/

cheers,
Steve

On 28/01/2011, at 10:36 AM, Todd Wolff wrote:

 Hi,
 
 
 
 Is there a URL where I can pull up javadoc for latest 1.5 RC without
 having to checkout source and generate myself?  Thanks.
 


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



Re: Submit form from ajaxlink not a part of the form

2011-01-27 Thread Igor Vaynberg
add(new ajaxsubmitlink(submit, form));

-igor

On Thu, Jan 27, 2011 at 7:46 PM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 So, I was able to submit a form WITHOUT ajax.  Now, how can I submit a
 form with ajax but from a link not associated with that form.  I tried
 the following.    But, I couldn't get the proper URLs / Button?   Are
 those needed for the wicketSubmFormById call?

 Also, do i have an issue using target.appendJavascript(...);

 ...

 If you look at the event handler method,

 public class MyPanel {

 public static final String
 JS_SUBMIT_THIS_WORKS_BUT_HOW_TO_SUBMIT_BY_AJAX = try {
 document.forms['%s'].submit(); } catch(err) { alert('ERR:' + err); if
 (window.console != undefined) { console.log(err); } };

 this.add(new AjaxLinkObject(link) {
            @Override
            public void onClick(final AjaxRequestTarget target) {

                // Find the dynamic form on the page.
                final Object objAtStopTraversal =
 getParentContainer().visitChildren(new FindFormVisitor());
                if (objAtStopTraversal instanceof Form?) {
                    // Form found, invoke javascript submit
                    final Form? form = (Form?) objAtStopTraversal;


 target.appendJavascript(getEventHandler(form.getMarkupId(), ???, this));
                }
            }
        } );

 protected CharSequence getEventHandler(final String formMarkupId, final
 String inputName, final AbstractLink link) {
        final String formId = formMarkupId;
        final CharSequence url = 
        AppendingStringBuffer call = new AppendingStringBuffer(var
 wcall=wicketSubmitFormById(')
        .append(formId).append(', ').append(url).append(', );

        call.append(')
        .append(inputName)
        .append(' );
        call.append(,function() { }.bind(this),function() {
 }.bind(this), function() { }.bind(this));;; return false;;);
        return call;
    }

 Berlin Brown


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