Re: Getting more stale page exception in wicket 1.5.6

2012-06-01 Thread Martin Grigorov
Hi,

Which version of Wicket do you use ?

On Thu, May 31, 2012 at 8:31 PM, sudeivas sureshkumar@gmail.com wrote:
 Hello Martin

 I think I found why I see the warning

 WARN: org.apache.wicket.request.handler.request.WebPageRenderer - The
 Buffered response should be handled by BufferedResponseRequestHandler.

 I am having a code like,

 setResponsePage(ProblemIndexPage.class);

 inside an Panel (last line). This is a hidden widget. Whenever I call this

I'm not sure what do you mean by last line. In the constructor ? In
another method ?

 widget, it will perform some task and redirect to the home page.

 When I call this panel first time, it shows the warning. Then if I try to
 call it once again, then it says ComponentNotFoundException.

 Is there a better way to redirect rather than setResponsePage ?

You can use : throw RestartResponseException(ProblemIndexPage.class)


 In my application I have already mounted the home page,
 mountPage(/main, ProblemIndexPage.class);

Create a quickstart app with 1.5.6 that reproduces the problem and
attach it to Jira.


 Thanks,
 Suresh


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649629.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: handling user agent

2012-06-01 Thread Martin Grigorov
Hi,

You have several options:
- use a IRequestMapper which will read the user agent and return : new
RenderPageRequestHandler(new PageProvider(UserAgentSpecificPage.class,
parameters))

- use IRequestCycleListener which implements #onBeginRequest() where
it reads the user agent and sets it as Session style (e.g.
Session.get().setStyle(android))

- your page can implement IMarkupResourceStreamProvider and in its
#getResourceStream() you can read the user agent and construct
dynamically the markup

On Thu, May 31, 2012 at 7:42 PM, wicket user samd...@live.com wrote:
 just wondering how to implement it , i tried the following code not sure am i
 doing correct,

 public class MyMapper implements IRequestMapper {

    private final IRequestMapper delegate;

    public MyMapper(IRequestMapper delegate) {
        this.delegate = delegate;
    }

    public IRequestHandler mapRequest(Request request) {
        Url url = request.getUrl();
        String user = WebSession.get().getClientInfo().getUserAgent();
       //System.out.println(user);

        return delegate.mapRequest(request.cloneWithUrl(url));
    }
 }

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/handling-user-agent-tp4649565p4649628.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: Filtercolumn and bigdecimal formatter

2012-06-01 Thread lang
I make my column with
@SuppressWarnings({ unchecked, rawtypes })
private TextFilteredPropertyColumn getVerkoopprijs() {
return new TextFilteredPropertyColumn(
new ModelString(Verkoopprijs), 
verkoopprijs, verkoopprijs) {
@Override
public String getCssClass() { 
return numeric; 
};  
};
} 
But I can not find any propriate method. Do you have an example? 
Currenty my output is:
  for 1 euro   1  but i want to display the amount always 2
decimals:  1,00
  for 1,50  1,50

1,50 etc




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624p4649637.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



inputcolumn for Filtercolumn in datatable uses to much space

2012-06-01 Thread lang
Default the input uses size=20 but for some colums that is too much.
How can i specify the size from Java?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/inputcolumn-for-Filtercolumn-in-datatable-uses-to-much-space-tp4649638.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



Replace goandclear with images

2012-06-01 Thread lang
How can I replace the text in the goAndClearFilter with a png?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Replace-goandclear-with-images-tp4649640.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: Filtercolumn and bigdecimal formatter

2012-06-01 Thread Sebastien
Just a quick update. For the solution to be reliable (I previously said it
was not perfect), you will need to implement you own Label like:

class BigDecimalLabel extends Label
{
public BigDecimalLabel(String id, IModelBigDecimal model)
{
super(id, model);
}

public C IConverterC getConverter(ClassC type)
{
if (BigDecimal.class.isAssignableFrom(type))
{
return (IConverterC)converter; //TODO: create an instance
of your decimal convertor, preferably in the constructor (you can have look
at DateConverter for help)
}

return super.getConverter(type);
}

Regards,
Sebastien.

On Fri, Jun 1, 2012 at 10:41 AM, Sebastien seb...@gmail.com wrote:

 Hi,

 I would have done something like that:

 public class BigDecimalFilteredPropertyColumn extends
 TextFilteredPropertyColumnBigDecimal, String
 {
 public BigDecimalFilteredPropertyColumn(IModelString displayModel,
 String sortProperty, String propertyExpression)
 {
 super(displayModel, sortProperty, propertyExpression);
 }

 public void populateItem(ItemICellPopulatorBigDecimal item, String
 componentId, IModelBigDecimal rowModel)
 {
 IModel? extends BigDecimal model = (IModel? extends
 BigDecimal) super.createLabelModel(rowModel);

 item.add(new Label(componentId, new
 ModelString(String.format(%#,00d, model.getObject(); //TODO: check
 the string.format pattern
 }
 }

 It is maybe not perfect but I think it should answer the use case...

 Regards,
 Sebastien.


 On Fri, Jun 1, 2012 at 9:29 AM, lang delan...@telfort.nl wrote:

 I make my column with
@SuppressWarnings({ unchecked, rawtypes })
private TextFilteredPropertyColumn getVerkoopprijs() {
return new TextFilteredPropertyColumn(
new ModelString(Verkoopprijs),
 verkoopprijs, verkoopprijs) {
@Override
public String getCssClass() {
return numeric;
};
};
}
 But I can not find any propriate method. Do you have an example?
 Currenty my output is:
  for 1 euro   1  but i want to display the amount always 2
 decimals:  1,00
  for 1,50  1,50
 1,50 etc




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624p4649637.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





How to manage redirects using rewrite maps

2012-06-01 Thread Jan Riehn

Hello,

we use a tomcat behind a apache. we also use mod_rewrite proxy rules to 
manage requests from the apache to the tomcat. Our wicket application 
modifies the location header:


curl -I http://wicket-application/application-context/login

HTTP/1.1 302 Moved Temporarily
Date: Wed, 30 May 2012 13:45:15 GMT
Server: Apache-Coyote/1.1
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache, no-store
Location: http://localhost:8080/application-context/login
Set-Cookie: JSESSIONID=5F08FEDBAAABD7F3E83C7EF785C6A688; 
Path=/application-context
Vary: User-Agent
Content-Type: text/plain


So we get a redirect to localhost. the hint: 
https://cwiki.apache.org/WICKET/wicket-application-behind-modproxyhttp-and-https.html 
does not work, because we are using rewrite maps for our mod_rewrite 
proxy rules. So we have no chance to use ReverseProxy.


How can I solve this issue?

Best regards,

Jan


Re: Filtercolumn and bigdecimal formatter

2012-06-01 Thread lang
It worked! Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624p4649646.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



get PageReference for ModalWinow

2012-06-01 Thread sabina_12
Hello,

I have a ModalWindow which can be opened from two different places in my
application.

modalWindowForUpload.setPageCreator(new ModalWindow.PageCreator() {
@Override
public Page createPage() {
try {
return new
UploadFisierModal(ClassName1.this.getPageReference(),modalWindowForUpload);
} catch (Exception ex) {
System.out.println(ex.getMessage());
return null;
}
}
});
And the constructor of the modal window:
public UploadFisierModal(final PageReference modalWindowPage,  
final ModalWindow window)

My question is how can i know from my ModalWindow which page opened it. Is
there a way to compare the PageReference modalWindowPage with ClassName1?

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/get-PageReference-for-ModalWinow-tp4649648.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



Conditional Popup

2012-06-01 Thread hfriederichs
Hello,

I have a wicket PopupPage that answers a wicket link, but I don't want it to
popup when certain conditions are not met. In that case I want an
info-message.

So I tried something like:
final LinkString theLink = new LinkString(...) {

public void onClick() {
if (condition) {
   info(Do this first);
} else {
  setPopupSettings(thePopupSettings);   
  setResponsePage(thePopupPage);
}
};

But no matter what I try, the popuppage always comes.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649.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: Conditional Popup

2012-06-01 Thread Thomas Götz
Could you please provide a quickstart or post the interesting HTML and Java 
snippets?

   -Tom


On 01.06.2012 at 15:24 hfriederichs wrote:

 Hello,
 
 I have a wicket PopupPage that answers a wicket link, but I don't want it to
 popup when certain conditions are not met. In that case I want an
 info-message.
 
 So I tried something like:
 final LinkString theLink = new LinkString(...) {
   
 public void onClick() {
 if (condition) {
   info(Do this first);
 } else {
  setPopupSettings(thePopupSettings);  
  setResponsePage(thePopupPage);
 }
 };
 
 But no matter what I try, the popuppage always comes.
 
 
   
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649.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: Conditional Popup

2012-06-01 Thread hfriederichs
A quick-start costs me one or two hours; in the end, maybe I will. But I
think this is a reasonably simple question, so I'll await some
straightforward suggestions first.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649651.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: Conditional Popup

2012-06-01 Thread Thomas Götz
To create a quickstart normally costs me around 5-7 seconds (copy/paste is my 
friend) ;-)
Isolating the problem is another question, right. But in your case this sound 
rather trivial. In my experience a lot of problems are solved easyly by 
creating a quickstart, in most cases because then I realize that I did 
something wrong ;-)

   -Tom


On 01.06.2012 at 16:06 hfriederichs wrote:

 A quick-start costs me one or two hours; in the end, maybe I will. But I
 think this is a reasonably simple question, so I'll await some
 straightforward suggestions first.


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



Stateless search page

2012-06-01 Thread romanasu
I'm trying to make a stateless search page with some filters in wicket 1.5.5.
I have some filter objects(check box, drop down, input) and a repeater. When
the page is loaded, i made a search and get some items. When the user change
a filter, i want to update the results(the repeater); or, maybe easier, to
redirect to the search page with some new parameters.

I use an AjaxFormComponentUpdatingBehavior with stateless hint put on true.
The page is staateless, but, there is a new instance of the page created
before calling the onUpdate method. So, a search is made(with the old filter
criteria). Then, when the onUpdate is called, a new search is made, with the
new criteria. So, i end up doing 2 search for each user action.

Any ideas ?
Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateless-search-page-tp4649653.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: Conditional Popup

2012-06-01 Thread hfriederichs
For other questions I had earlier on, I created quickstarts, but, since I'm
working on a very complex application, I couldn't reproduce the problem in a
quickstart. I spent hours and hours copying more and more of my application
into the quickstart, but to no avail.

So again, it's a simple question: how to make a conditional popup.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649654.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: Conditional Popup

2012-06-01 Thread Thomas Götz
As an alternative, you could use an AjaxLink and push the popup-opener JS to 
teh frontend, then you could have your decision logic (wether to open it or 
not) in the backend (Wicket layer).

   -Tom




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



Re: handling user agent

2012-06-01 Thread wicket user
Awesome thanks alot !! 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/handling-user-agent-tp4649565p4649658.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: Stateless search page

2012-06-01 Thread romanasu
Apparently, if i make the search in onbeforerender, i skip the first useless
search. Nice to find out after many hours...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateless-search-page-tp4649653p4649660.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 manage redirects using rewrite maps

2012-06-01 Thread Dan Retzlaff
Hi Jan,

Have you tried proxying with AJP instead of HTTP? Some of this complexity
goes away then.

Using mod_rewrite's [P] flag to proxy requests shouldn't be incompatible
with ProxyPassReverse or ProxyPassReverseCookieDomain. Did you try it?

Dan

On Fri, Jun 1, 2012 at 2:51 AM, Jan Riehn jan.ri...@1und1.de wrote:

 Hello,

 we use a tomcat behind a apache. we also use mod_rewrite proxy rules to
 manage requests from the apache to the tomcat. Our wicket application
 modifies the location header:

 curl -I 
 http://wicket-application/**application-context/loginhttp://wicket-application/application-context/login

 HTTP/1.1 302 Moved Temporarily
 Date: Wed, 30 May 2012 13:45:15 GMT
 Server: Apache-Coyote/1.1
 Expires: Thu, 01 Jan 1970 00:00:00 GMT
 Pragma: no-cache
 Cache-Control: no-cache, no-store
 Location: 
 http://localhost:8080/**application-context/loginhttp://localhost:8080/application-context/login
 Set-Cookie: JSESSIONID=**5F08FEDBAAABD7F3E83C7EF785C6A6**88;
 Path=/application-context
 Vary: User-Agent
 Content-Type: text/plain


 So we get a redirect to localhost. the hint: https://cwiki.apache.org/**
 WICKET/wicket-application-**behind-modproxyhttp-and-https.**htmlhttps://cwiki.apache.org/WICKET/wicket-application-behind-modproxyhttp-and-https.htmldoes
  not work, because we are using rewrite maps for our mod_rewrite proxy
 rules. So we have no chance to use ReverseProxy.

 How can I solve this issue?

 Best regards,

 Jan



Re: Loop.populateItem() while migrating from Wicket 1.4 to 1.5

2012-06-01 Thread paulstar
Thanks for looking into this.  It seems to be a deployment issue.  The way I
did it is right for Wicket 1.5.  

Now I am facing an even bigger problem.  I will post another one regarding
redirect loop.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loop-populateItem-while-migrating-from-Wicket-1-4-to-1-5-tp4649598p4649663.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: Conditional Popup

2012-06-01 Thread hfriederichs

Thomas Götz-2 wrote
 
 
 PopupSettings popupSettings = new PopupSettings() {
 @Override
 public String getPopupJavaScript() {
 return if(!condition) return false;  +
 super.getPopupJavaScript();
 }
 };
 
 

I'm sorry, but I don't understand your code. My condition is in the
Java/Wicket-layer, how can you put that between double quotes?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649665.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: Conditional Popup

2012-06-01 Thread Thomas Götz
I thought you might have some condition that you could evaluate in JS. This is 
the reason I asked for a short quickstart, it simply eases discussion.

   -Tom


On 01.06.2012 at 19:19 hfriederichs wrote:

 I'm sorry, but I don't understand your code. My condition is in the
 Java/Wicket-layer, how can you put that between double quotes?


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



Re: Wicket page has a redirect loop

2012-06-01 Thread Thomas Götz
Hm, put a breakpoint in FragmentMarkupSourcingStrategy.java:143 and see what 
causes the NullPointerException.

   -Tom


On 01.06.2012 at 19:08 paulstar wrote:

 Caused by: java.lang.NullPointerException
at
 org.apache.wicket.markup.html.panel.FragmentMarkupSourcingStrategy.getMarkup(FragmentMarkupSourcingStrategy.java:143)
at
 org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
at org.apache.wicket.Component.getMarkup(Component.java:737)
at
 org.apache.wicket.markup.html.list.ListView.getMarkup(ListView.java:662)
at org.apache.wicket.Component.getMarkup(Component.java:737)
at
 org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:83)
at
 org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
at org.apache.wicket.Component.getMarkup(Component.java:737)
at org.apache.wicket.Component.getMarkupTag(Component.java:1422)
at
 org.apache.wicket.Component.getMarkupIdFromMarkup(Component.java:777)
at org.apache.wicket.Component.getMarkupIdImpl(Component.java:1479)
at org.apache.wicket.Component.getMarkupId(Component.java:1525)
at org.apache.wicket.Component.getMarkupId(Component.java:1587)
at
 org.apache.wicket.markup.html.form.Form.appendDefaultButtonField(Form.java:1096)
at
 org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1575)
at
 org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at
 org.apache.wicket.Component.internalRenderComponent(Component.java:2551)
... 51 more

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



Re: Conditional Popup

2012-06-01 Thread hfriederichs

Martin Grigorov-4 wrote
 
 try with:
 
 if (condition) { setPopupSettings(nonNull) } else { setPopupSettings(null)
 }
 
 

This doesn't work. The condition has to be checked every time the link is
clicked, so within the onCLick().
setPopupSettings(null) gives the current page as popup.

Maybe this information is relevant: The link is part of a row in a repeater
(within the populateItem of a ListView).



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649670.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: Batch process message to user

2012-06-01 Thread Dan Retzlaff
Hi Kemal,

You could register your own root IRequestMapper. See the last paragraph
under The new way in Wicket 1.5:
https://cwiki.apache.org/WICKET/request-mapping.html

Dan

On Fri, Jun 1, 2012 at 9:52 AM, chrome1235 kemal.m...@gmail.com wrote:

 Hi,
 My Application has some batch processes, therefore I want to response to
 users a message like server is busy now.
 I mean, all user request will forward to single page. And I want to do it
 in
 Application class, not pages.

 Can I solve this problem?


 Best regards,
 kemal.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Batch-process-message-to-user-tp4649662.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