Cannot create statless page

2010-10-15 Thread EC
Hi,
I am trying to create a simple stateless app according to:
https://cwiki.apache.org/WICKET/stateless-pages.html
and the example in the source.

Whenever I access this page, wicket tries to get an instance of
javax.servlet.http.HttpSession. Our java server traps that and notifies via
an exception.
What is the way around it?
Do I need to implement ISessionStore myself?

Here is the source:

public class MyApplication extends WebApplication {
public Class getHomePage() {
return HomePage.class;
}
@Override
protected void init() {
super.init();
getResourceSettings().setResourcePollFrequency(null);
}
@Override
protected ISessionStore newSessionStore() {
return new HttpSessionStore(this);
}
}
public class HomePage extends WebPage {
public HomePage() {
add(new Label(label, new Model(Hello, World)));
}
}

html
body
h1 wicket:id='label'HELLO/h1
/body
/html


regression

2010-10-15 Thread danisevsky
Hallo, fix this issue
https://issues.apache.org/jira/browse/WICKET-2886 broke Brix Menu
plugin, more info here
http://groups.google.com/group/brix-cms-discuss/browse_thread/thread/a1fe187920858b36
Could someone take a look?

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



Re-Rendering Table after submitting results in error

2010-10-15 Thread jluehr
Hello,

I've just come across wicket and started playing around - so far, I encounterd 
some issues:
My first issue is:

Given a table and a Panel:
//SomePage.java
private TablePanel tp;
tp = new TablePanel(tablePanel,columns,new 
PersonBeanProvider(searchFilter),12);

//TablePanel.java
class TablePanel extends Panel{
public TablePanel(String id, final ListIColumnPersonBean columns, 
PersonBeanProvider personBeanProvider, int rowsPerPage) {
super(id);
 AjaxFallbackDefaultDataTablePersonBean table = new 
AjaxFallbackDefaultDataTablePersonBean(table, columns,personBeanProvider, 
12);
 add(table);
}

}

And the html:
SomePage.html
(...)span wicket:id=tablePanel/span
TablePanel.html:
wicket:panel
table cellspacing=0 wicket:id=table[table]/table
/wicket:panel

Everything is fine. But: If I introduce a form for modifying searchFilter (a 
String to be passed) in this way:

searchField.add(new AjaxFormComponentUpdatingBehavior(onChange){
@Override
protected void onUpdate(AjaxRequestTarget target) {
tp = new TablePanel(tablePanel,columns,new 
PersonBeanProvider(searchFilter),12);
tp.setOutputMarkupId(true);
target.addComponent(tp);
}
 
 });

I get an error _after_ submitting the form - what may be wrong here? 

Thanks,
Keep smiling
yanosz

WicketMessage: The component(s) below failed to render. A common problem is 
that you have added a component in code but forgot to reference it in the 
markup (thus the component will never be rendered).

1. [MarkupContainer [Component id = tablePanel]]
2. [MarkupContainer [Component id = table]]
3. [MarkupContainer [Component id = body]]
4. [MarkupContainer [Component id = rows]]
5. [MarkupContainer [Component id = 1]]
6. [MarkupContainer [Component id = cells]]
7. [MarkupContainer [Component id = 1]]
8. [MarkupContainer [Component id = cell]]
9. [MarkupContainer [Component id = select]]
10. [MarkupContainer [Component id = 2]]
11. [Component id = cell]
12. [MarkupContainer [Component id = 3]]
13. [Component id = cell]
14. [MarkupContainer [Component id = 4]]
15. [Component id = cell]
16. [MarkupContainer [Component id = topToolbars]]
17. [MarkupContainer [Component id = 1]]
18. [MarkupContainer [Component id = 2]]
19. [MarkupContainer [Component id = toolbar]]
20. [MarkupContainer [Component id = headers]]
21. [MarkupContainer [Component id = 1]]
22. [MarkupContainer [Component id = header]]
23. [Component id = label]
24. [MarkupContainer [Component id = 2]]
25. [MarkupContainer [Component id = header]]
26. [MarkupContainer [Component id = orderByLink]]
27. [MarkupContainer [Component id = _body]]
28. [Component id = label]
29. [MarkupContainer [Component id = 3]]
30. [MarkupContainer [Component id = header]]
31. [MarkupContainer [Component id = orderByLink]]
32. [MarkupContainer [Component id = _body]]
33. [Component id = label]
34. [MarkupContainer [Component id = 4]]
35. [MarkupContainer [Component id = header]]
36. [MarkupContainer [Component id = orderByLink]]
37. [MarkupContainer [Component id = _body]]
38. [Component id = label]
39. [MarkupContainer [Component id = bottomToolbars]]
40. [MarkupContainer [Component id = 1]]

Root cause:

org.apache.wicket.WicketRuntimeException: The component(s) below failed to 
render. A common problem is that you have added a component in code but forgot 
to reference it in the markup (thus the component will never be rendered).

1. [MarkupContainer [Component id = tablePanel]]
2. [MarkupContainer [Component id = table]]
3. [MarkupContainer [Component id = body]]
4. [MarkupContainer [Component id = rows]]
5. [MarkupContainer [Component id = 1]]
6. [MarkupContainer [Component id = cells]]
7. [MarkupContainer [Component id = 1]]
8. [MarkupContainer [Component id = cell]]
9. [MarkupContainer [Component id = select]]
10. [MarkupContainer [Component id = 2]]
11. [Component id = cell]
12. [MarkupContainer [Component id = 3]]
13. [Component id = cell]
14. [MarkupContainer [Component id = 4]]
15. [Component id = cell]
16. [MarkupContainer [Component id = topToolbars]]
17. [MarkupContainer [Component id = 1]]
18. [MarkupContainer [Component id = 2]]
19. [MarkupContainer [Component id = toolbar]]
20. [MarkupContainer [Component id = headers]]
21. [MarkupContainer [Component id = 1]]
22. [MarkupContainer [Component id = header]]
23. [Component id = label]
24. [MarkupContainer [Component id = 2]]
25. [MarkupContainer [Component id = header]]
26. [MarkupContainer [Component id = orderByLink]]
27. [MarkupContainer [Component id = _body]]
28. [Component id = label]
29. [MarkupContainer [Component id = 3]]
30. [MarkupContainer [Component id = header]]
31. [MarkupContainer [Component id = orderByLink]]
32. [MarkupContainer [Component id = _body]]
33. [Component id = label]
34. [MarkupContainer [Component id = 4]]
35. [MarkupContainer [Component id = header]]

Re: WebPage: geting string

2010-10-15 Thread elesi

hi,

can we know where the Utils.replaceAll, escapeHighEnd() and
WebPageConstants.SRC_URL_PATTERN came from?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WebPage-geting-string-tp2993717p2996622.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: Yui not included in wicket-extensions?

2010-10-15 Thread Martin Grigorov
It is not.
You need wicket-datetime

On Fri, Oct 15, 2010 at 1:59 AM, mailinglists_in...@arcor.de wrote:

 Hello,

 Is yui included in wicket-extions?
 My pom.xml says:
dependency groupIdorg.apache.wicket/groupId
artifactIdwicket-extensions/artifactId
version${wicket.version}/version
/dependency
 But org.apache.wicket.extensions.yui seems to be missing. Do I have to
 include an additional artifact?

 Thanks,
 Keep smiling
 yanosz

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




Re: Getting the html output of a wicket page

2010-10-15 Thread elesi

Thanks for the reply

I tried the code, but it seems that calling it from java's main() method
doesn't work.
i got this error:
org.apache.wicket.WicketRuntimeException: There is no application attached
to current thread main
Could i have some insights on why this happened?

I think i'll have to run it from a separate thread...

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-the-html-output-of-a-wicket-page-tp2994739p2996646.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



Job for Wicket Developer in Berlin/Germany

2010-10-15 Thread Daniel Peters

Hallo,

my employer is currently looking for one new fulltime Java/Wicket-Developer in 
Berlin.

For those who are interested, here is the link to the job description:
http://bit.ly/9iuEgL (sorry, it's in german only)

Please don't reply to me directly, but instead to the address mentioned on the 
job page.
Thanks!


best regards,
Daniel

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



FeedbackPanel for each ListItem in ListView

2010-10-15 Thread Patrick Petermair

Hey!

I have ListView and every ListItem has multiple AjaxEditableLabels and 
one FeedbackPanel added to it. Each FeedbackPanel should only show 
messages that were reported within the same listitem.


I tried the following but it didn't work:

protected void populateItem(final ListItem item) {

[...]
item.add(new FeedbackPanel(someId, new
ContainerFeedbackMessageFilter(item)));
}

Somehow when the AjaxEditablelabel submits, the list items get created 
from scratch, which screws up object references and therefore 
container.contains(message.getReporter(), true) of the 
ContainerFeedbackMessageFilter never returns true.


Am I doing something wrong here? What would be the proper way to check 
if a feedback message was created within a listitem?


Cheers,
Patrick

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



Re: FeedbackPanel for each ListItem in ListView

2010-10-15 Thread jcgarciam

Hi, try:

yourListView.setReuseItems(true);

From the JavaDoc:
*WARNING:* though you can nest ListViews within Forms, you HAVE to set the
setReuseItems property to true in order to have validation work properly. By
default, setReuseItems is false, which has the effect that ListView replaces
all child components by new instances. The idea behind this is that you
always render the fresh data, and as people usually use ListViews for
displaying read-only lists (at least, that's what we think), this is good
default behavior.
However, as the components are replaced before the rendering starts, the
search for specific messages for these components fails as they are replaced
with other instances. Another problem is that 'wrong' user input is kept as
(temporary) instance data of the components. As these components are
replaced by new ones, your user will never see the wrong data when
setReuseItems is false.

*
*
On Fri, Oct 15, 2010 at 9:58 AM, Patrick Petermair [via Apache Wicket] 
ml-node+2996972-1727673597-65...@n4.nabble.comml-node%2b2996972-1727673597-65...@n4.nabble.com
 wrote:

 Hey!

 I have ListView and every ListItem has multiple AjaxEditableLabels and
 one FeedbackPanel added to it. Each FeedbackPanel should only show
 messages that were reported within the same listitem.

 I tried the following but it didn't work:

 protected void populateItem(final ListItem item) {

  [...]
  item.add(new FeedbackPanel(someId, new
  ContainerFeedbackMessageFilter(item)));
 }

 Somehow when the AjaxEditablelabel submits, the list items get created
 from scratch, which screws up object references and therefore
 container.contains(message.getReporter(), true) of the
 ContainerFeedbackMessageFilter never returns true.

 Am I doing something wrong here? What would be the proper way to check
 if a feedback message was created within a listitem?

 Cheers,
 Patrick

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



 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-for-each-ListItem-in-ListView-tp2996972p2996972.html
 To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-for-each-ListItem-in-ListView-tp2996972p2996985.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



Backbutton support

2010-10-15 Thread drf

Does anyone have any resources on BackButton support with Wicket? My
application, although complex, is all one WebPage, it uses Ajax to switch
panels dynamically. What would be the best way to handle the back button in
this case? Ideally, I would like a way to disable it completely.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Backbutton-support-tp2997052p2997052.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: Backbutton support

2010-10-15 Thread Martin Grigorov
Disable it completely is easy - just use any JavaScript library that can
handle the browser buttons and add no-op handlers
We use http://code.google.com/p/reallysimplehistory/ with some minor
modifications.
Check wicketstuff-jquery project. There is an example with another JS
solution.


On Fri, Oct 15, 2010 at 3:40 PM, drf davidrfi...@gmail.com wrote:


 Does anyone have any resources on BackButton support with Wicket? My
 application, although complex, is all one WebPage, it uses Ajax to switch
 panels dynamically. What would be the best way to handle the back button in
 this case? Ideally, I would like a way to disable it completely.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Backbutton-support-tp2997052p2997052.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: Cannot create statless page

2010-10-15 Thread Doug Leeper

Try adding setStatelessHint( true ) in the HomePage constructor.

public class HomePage extends WebPage {
public HomePage() {
 add(new Label(label, new Model(Hello, World)));
 setStatelessHint( true );   // - new 
}
} 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-create-statless-page-tp2996566p2997184.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: Re-Rendering Table after submitting results in error

2010-10-15 Thread vov

Hi, 
try to change your onUpdate method:

protected void onUpdate(AjaxRequestTarget target) {
TablePanel newTp = new TablePanel(tablePanel,columns,new
PersonBeanProvider(searchFilter),12);
tp.replaceWith(newTp);
tp = newTp;
target.addComponent(tp);
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-Rendering-Table-after-submitting-results-in-error-tp2996601p2997200.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: Getting the html output of a wicket page

2010-10-15 Thread Jeremy Thomerson

 i got this error:
 org.apache.wicket.WicketRuntimeException: There is no application attached
 to current thread main
 Could i have some insights on why this happened?


Yeah, it happened because your application isn't available (i.e., calling
Application.get() returns null or errors).  When running as a webapp, the
web app is created from your web.xml configuration when the container starts
and Wicket puts the Application into a ThreadLocal at the beginning of each
request.  You need to do something to set up the application yourself if
you're running this outside of the container.  If this is your goal, see the
examples for running WicketTester - they show how to set up your application
outside the container.

-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: Cannot create statless page

2010-10-15 Thread Jeremy Thomerson
On Fri, Oct 15, 2010 at 1:25 AM, EC chalanga.e...@gmail.com wrote:

 Hi,
 I am trying to create a simple stateless app according to:
 https://cwiki.apache.org/WICKET/stateless-pages.html
 and the example in the source.

 Whenever I access this page, wicket tries to get an instance of
 javax.servlet.http.HttpSession. Our java server traps that and notifies via
 an exception.
 What is the way around it?
 Do I need to implement ISessionStore myself?

 Here is the source:

 public class MyApplication extends WebApplication {
 public Class getHomePage() {
 return HomePage.class;
 }
 @Override
 protected void init() {
 super.init();
 getResourceSettings().setResourcePollFrequency(null);
 }
 @Override
 protected ISessionStore newSessionStore() {
 return new HttpSessionStore(this);
 }
 }
 public class HomePage extends WebPage {
 public HomePage() {
 add(new Label(label, new Model(Hello, World)));
 }
 }

 html
 body
 h1 wicket:id='label'HELLO/h1
 /body
 /html


The session is always going to be created for every request (stateless or
not).  But, if the session wasn't bound during the request, it is temporary
and thrown away at the end of the request.

-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: How to add image to table column and how to change image this on click?

2010-10-15 Thread gouthamrv

Yes this worked! Thank you very much.

I have another question, If I want to make the complete column header as
clickable, how do I do that. 

That is, currently it supports only clicking on column name, but I want to
have option to click anywhere on that table column header for sorting. 

Is it possible?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-image-to-table-column-and-how-to-change-image-this-on-click-tp2996263p2997566.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 externalize web page elements to make it configurable?

2010-10-15 Thread gouthamrv

I am looking for some design patterns or best practices for configuring web
page fields. 

My web page has a table, which is dynamically created by my API (Wicket). 

Currently all the column names are hard coded in the java but I want to make
it externalizable that way I can add/remove/modify fields without modifying
java code.

Also I want to define each field type, valid value ranges etc.. in this
external file.

Are there any recommended approaches for this requirement?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-externalize-web-page-elements-to-make-it-configurable-tp2997775p2997775.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 externalize web page elements to make it configurable?

2010-10-15 Thread James Carman
Column names (at least with DefaultDataTable) are supplied via an
IModelString in the constructor of AbstractColumn, so you can supply
whatever you want.  Those values can come from a database, properties
files, etc.  You can use a ResourceModel to load the values from your
page/component's properties file.

On Fri, Oct 15, 2010 at 6:06 PM, gouthamrv goutha...@yahoo.com wrote:

 I am looking for some design patterns or best practices for configuring web
 page fields.

 My web page has a table, which is dynamically created by my API (Wicket).

 Currently all the column names are hard coded in the java but I want to make
 it externalizable that way I can add/remove/modify fields without modifying
 java code.

 Also I want to define each field type, valid value ranges etc.. in this
 external file.

 Are there any recommended approaches for this requirement?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-externalize-web-page-elements-to-make-it-configurable-tp2997775p2997775.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