Re: embedding Wicket into JSP

2008-08-12 Thread Martin Grigorov
On Tue, 2008-08-12 at 09:21 -0700, kgignatyev wrote:
> Hi,
> 
> I have problem embedding Wicket pages (1.3.4) into JSP application.
> index.jsp
> 
> 
> 
> and the cause is that inside WicketFilter 
> public String getRelativePath(HttpServletRequest request) returns empty
> string because the request returns path for the index.jsp and not the /wic/
> so the doGet method tries to do redirect which does not succeed.
> 
> So the question: is it possible at all to embed Wicket into JSP pages? 

Check if this helps you:
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Turn off SWARM

2008-08-12 Thread Jason Anderson
I've found that during development the combination of running mvn jetty:run
and using javarebel to automagically reload the newly compiled classes makes
for an extremely fast edit/compile/test cycle - much faster than even
letting jetty do the reloading

YMMV



On Thu, Aug 7, 2008 at 1:50 AM, Johan Compagner <[EMAIL PROTECTED]>wrote:

> then you should really look around so that you can use the hotcode/swap of
> the jvm
> Tomcat shouldnt rebuild/redeploy constantly on every change in development
> thats quite annoying if you ask me
>
> If you use eclipse and you want to use tomcat use the sysdeo plugin
> else just use jetty (see our quickstart)
>
> johan
>
>
> On Thu, Aug 7, 2008 at 1:20 AM, insom <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > Johan Compagner wrote:
> > >
> > > Why do you need to relogin?
> > >
> >
> > It happens whenever I change a Java file and rebuild. Even if I just
> change
> > one of the HTML files, Tomcat notices that and rebuilds. Then when I try
> to
> > navigate to a secure page in the application, I get redirected to the
> login
> > page.
> > --
> > View this message in context:
> > http://www.nabble.com/Turn-off-SWARM-tp18860819p18861491.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


Re: Pretty URLs depending on a Page's state (not params)

2008-08-12 Thread Igor Vaynberg
On Tue, Aug 12, 2008 at 10:39 PM, pixologe <[EMAIL PROTECTED]> wrote:
>
> Hi everybody,
>
> AFAIK it is not possible to have a variable nice URL for a page without
> using PageParameters, right?
>
> If I am right: shouldn't it be possible?

no. having a nice/bookmarkble url means having all the state in the
url. this means you can only effectively have state that is composed
of strings, this is what pageparameters does. when this url is invoked
wicket has to figure out how to construct the page object, eg which
constructor to use. that is why we have pageparameters, it helps you
manage the state and help wicket find the right constructor.

> Example: I think it would be cool to be able to do something like this:
> FriendListPage page = new FriendListPage();
> page.setUser("myUsername");
> page.setSorting("asc");
> response.setRedirect(page);
> and have a resulting URL like
> /user/myUsername
> while the sorting is not stored in the URL.

and you can do it like this:
PageParameters params=new PageParameters();
params.set("user","myusername");
params.set("sort","asc");
setresponsepage(mypage.class, params);

you can also encapsulate parameter creation within a page factory
method to make it cleaner

setresponsepage(mypage.class, mypage.params("myusername", "asc"));

-igor




>
> and later (on the page itself - when the user wants to switch sorting):
> FriendlyPage.this.setSorting("desc");
> setResponsePage(FriendlyPage.this);
>
> Would that be feasible?
>
> If there's another way to do it, I would be happy if someone could point it
> out to me...
>
> Thanks a lot :)
> --
> View this message in context: 
> http://www.nabble.com/Pretty-URLs-depending-on-a-Page%27s-state-%28not-params%29-tp18957325p18957325.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Pretty URLs depending on a Page's state (not params)

2008-08-12 Thread pixologe

Hi everybody,

AFAIK it is not possible to have a variable nice URL for a page without
using PageParameters, right?

If I am right: shouldn't it be possible?

Perhaps I'm missing the point or not knowing the internals good enough
(probably both ;-), but what I imagine is to map parts of the URL to
properties of the Page (or Models).

Why? I want to have pretty URLs, but I feel that not *every* view option
should be carried around through PageParameters, for this reason, I am
currently constructing a new page with every request (just for the URL's
sake) with the param I want to see in the URL + having the page's state
(view options - which shall not appear in the URL) saved to the session.

Example: I think it would be cool to be able to do something like this:
FriendListPage page = new FriendListPage();
page.setUser("myUsername");
page.setSorting("asc");
response.setRedirect(page);
and have a resulting URL like
/user/myUsername
while the sorting is not stored in the URL.

and later (on the page itself - when the user wants to switch sorting):
FriendlyPage.this.setSorting("desc");
setResponsePage(FriendlyPage.this);

Would that be feasible?

If there's another way to do it, I would be happy if someone could point it
out to me...

Thanks a lot :)
-- 
View this message in context: 
http://www.nabble.com/Pretty-URLs-depending-on-a-Page%27s-state-%28not-params%29-tp18957325p18957325.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DefaultDataTable Links and LazyInitializationException

2008-08-12 Thread Vijay Dharap
Hello,

I wanted to have links inside the DefaultDataTable cells and I followed
advice provided in following link:
http://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html

I could successfully get the links to new pages in the data table.
But now if I click these links to open other page. I would need to utilize
the model associated with that link to open correct page. Thats when I get a
error saying
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session

As far as my understanding goes, we need two things here:
1. OpenSessionInViewFilter - I have it configured in web.xml (oh ya, the
filter-mapping element above the Wicket Filter's filter-mapping
element)
2. Usage of LoadableDetachableModels - I have used those.

If I debug my code:

1.public LinkPanel(String id, final IModel model) {
2.   final Item item  = (Item) model.getObject();
3.Link link = new Link("itemLink", model) {
4.@Override
5.public void onClick() {
6.Item item = (Item) getModelObject();
7.getRequestCycle().setResponsePage(new
ItemPage(item.getItemId()));
8.}
9.};
10.link.add(new Label("label", item.getItemId()));
11.add(link);
12.}
-


If I have a breakpoint on line 6. before execution of the line 6,
this.getModel()  <== evaluates to ==> (jpetstore.page.DetachableItemModel)
Model:classname=[jpetstore.page.DetachableItemModel]:*attached=false:*
tempModelObject=[null]

But when I execute line 6 I would get the LazyInitializationException.

Full stacktrace:
ERROR: 2008-08-13 00:01:34,687: apache.wicket.RequestCycle: Method
onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener
targeted at component [MarkupContainer [Component id = itemLink, page =
jpetstore.page.ProductPage, path =
2:items:rows:4:cells:1:cell:itemLink.LinkPanel$1, isVisible = true,
isVersioned = true]] threw an exception
org.apache.wicket.WicketRuntimeException: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = itemLink, page =
jpetstore.page.ProductPage, path =
2:items:rows:4:cells:1:cell:itemLink.LinkPanel$1, isVisible = true,
isVersioned = true]] threw an exception
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:194)
at
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:90)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:111)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.

Re: Strange AjaxFormComponentUpdatingBehavior with Internet Explorer

2008-08-12 Thread Timo Rantalaiho
On Fri, 08 Aug 2008, Kai Mütz wrote:
> final CheckBox required = new CheckBox("required", new
> PropertyModel(project, "required"));
> add(required);
> final DropDownChoice officer = new DropDownChoice("officer", new
> PropertyModel(project, "officer"), users, true);
> add(officer);
> officer.setOutputMarkupId(true);
> officer.setEnabled(project.isRequired());
> required.add(new AjaxFormComponentUpdatingBehavior("onchange") {
...

Could it be that IE does not fire "onchange" event for 
checkboxes? 

Have you tried with "onclick"? And checked that you have 
Javascript enabled in IE :)

If nothing happens on the server side, it sounds just like 
the browser didn't run the Javascript event handler.

It might be a good idea to create a quickstart demonstrating
your problem so that others could try it live.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket and Flex integration

2008-08-12 Thread Ryan Gravener
Yea, I tested it.  Works great.  But maybe I'm biased :)

On Tue, Aug 12, 2008 at 7:17 PM, Fernando Wermus
<[EMAIL PROTECTED]>wrote:

> Does anyone have tried to test this example?
>
> http://ryangravener.com/wordpress/?p=21
>
>
> On Thu, Jul 31, 2008 at 2:11 PM, Fernando Wermus
> <[EMAIL PROTECTED]>wrote:
>
> > Dear all,
> >   We want to integrate wicket and Flex. The reason for the
> integration
> > is that we would like to keep the wicket wizard with individual swf
> instead
> > of developing all in Flex. I haven't seen any document about this
> > integration. If any, please could you send an example? We also want to
> know
> > if the integration was using blaze ds or the ayax bridge, etc
> >
> > Thanks in advance.
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> > http://mientretiempo.blogspot.com/
> >
>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
> http://mientretiempo.blogspot.com/
>



-- 
Ryan Gravener
http://twitter.com/ryangravener


Re: Wicket and Flex integration

2008-08-12 Thread Fernando Wermus
Does anyone have tried to test this example?

http://ryangravener.com/wordpress/?p=21


On Thu, Jul 31, 2008 at 2:11 PM, Fernando Wermus
<[EMAIL PROTECTED]>wrote:

> Dear all,
>   We want to integrate wicket and Flex. The reason for the integration
> is that we would like to keep the wicket wizard with individual swf instead
> of developing all in Flex. I haven't seen any document about this
> integration. If any, please could you send an example? We also want to know
> if the integration was using blaze ds or the ayax bridge, etc
>
> Thanks in advance.
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
> http://mientretiempo.blogspot.com/
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


Re: Generate URL for a Resource depending on component state

2008-08-12 Thread Igor Vaynberg
see how Link does it, but essentially you call urlfor(component,
listenerinterface)

-igor

On Tue, Aug 12, 2008 at 1:46 PM, Kaspar Fischer <[EMAIL PROTECTED]> wrote:
> On 12.08.2008, at 12:42, Kaspar Fischer wrote:
>
>> How can I register a resource reference (or, what I actually want: just
>> the
>> resource) with the component AND get a URL for it?
>
> To rephrase my question and hopefully make it clearer: How can I get a URL
> for my component which outputs the current value of my component's model
> (in JSON, XML, or whatever)?
>
> Any ideas?
>
> I know this has come up before,
>
>  http://markmail.org/message/yewk64k7i452cjhd
>
> but I could not find any answer...
>
> Thanks,
> Kaspar
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wrapping models

2008-08-12 Thread Martijn Dashorst
perhaps LoadableDetachableModel?

Martijn

On Wed, Aug 13, 2008 at 12:07 AM, John Patterson <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm stepping through my code that uses PropertyModel and noticed that it is
> called every time the object is required - which on my page is hundreds of
> time.  I know that the model object will not change so I am about to create
> a caching wrapper model that store the object in a transient field and sets
> it to null on detach.
>
> Do I need to implement IChainingModel?  I cannot find anywhere in Wicket
> that IChainignModel.getChainedModel() is used.  Have I overlooked something
> there?  What about IWrapModel?  That makes me uncomfortable as it seems to
> expose more implementation than needed.
>
> But my question is - is there already a way to do this or is it a bad idea?
>
> Thanks,
>
> John
> --
> View this message in context: 
> http://www.nabble.com/wrapping-models-tp18953465p18953465.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Markup inheritance for secure and non-secure pages

2008-08-12 Thread Neil McT

Ahh... I was digging about and found this nugget 
http://www.nabble.com/wicket-security%2C-everybodyprincipal-and-only-securepages-td15413102.html#a15419077
here 

"..since you probably want every page to extend BasePage why not
have a subclass that implements ISecurePage and have all your pages
that should be secure extend that page.
For the implementation of ISecurePage you can simply redirect all
calls to the SecureComponentHelper."

Looks like SecureComponentHelper is the answer to my problems.

Thanks for your help.


Neil McT wrote:
> 
> 
> So, in terms of WASP / SWARM... what is it that makes SecureBasePage
> secure? I.e. it doesn't extend SecureWebPage. I'm assuming, therefore,
> that it implements ISecurePage? 
> 
> ..
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Markup-inheritance-for-secure-and-non-secure-pages-tp18952852p18953560.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Markup inheritance for secure and non-secure pages

2008-08-12 Thread Martijn Dashorst
yup. and we make heavy use of SecureComponentHelper (also part of wasp/swarm)

Martijn

On Wed, Aug 13, 2008 at 12:03 AM, Neil McT <[EMAIL PROTECTED]> wrote:
>
>
> So, in terms of WASP / SWARM... what is it that makes SecureBasePage secure?
> I.e. it doesn't extend SecureWebPage. I'm assuming, therefore, that it
> implements ISecurePage?
>
> Thanks - Neil.
>
>
>
>
>
>
>
> Martijn Dashorst wrote:
>>
>> AbstractBasePage extends WebPage
>>
>> SecureBasePage extends AbstractBasePage
>>
>> This is how we do it in our projects.
>>
>> Martijn
>>
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Markup-inheritance-for-secure-and-non-secure-pages-tp18952852p18953397.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



wrapping models

2008-08-12 Thread John Patterson

Hi,

I'm stepping through my code that uses PropertyModel and noticed that it is
called every time the object is required - which on my page is hundreds of
time.  I know that the model object will not change so I am about to create
a caching wrapper model that store the object in a transient field and sets
it to null on detach.

Do I need to implement IChainingModel?  I cannot find anywhere in Wicket
that IChainignModel.getChainedModel() is used.  Have I overlooked something
there?  What about IWrapModel?  That makes me uncomfortable as it seems to
expose more implementation than needed.

But my question is - is there already a way to do this or is it a bad idea?

Thanks,

John
-- 
View this message in context: 
http://www.nabble.com/wrapping-models-tp18953465p18953465.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Markup inheritance for secure and non-secure pages

2008-08-12 Thread Neil McT


So, in terms of WASP / SWARM... what is it that makes SecureBasePage secure?
I.e. it doesn't extend SecureWebPage. I'm assuming, therefore, that it
implements ISecurePage? 

Thanks - Neil.

 





Martijn Dashorst wrote:
> 
> AbstractBasePage extends WebPage
> 
> SecureBasePage extends AbstractBasePage
> 
> This is how we do it in our projects.
> 
> Martijn
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Markup-inheritance-for-secure-and-non-secure-pages-tp18952852p18953397.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: help with css and image background

2008-08-12 Thread Kaspar Fischer

On 08.08.2008, at 22:21, oriana wrote:

I need urgent one since help I have the page of begin and it don't  
want me to
catch the styles of the leaf of styles. I besides that want to put  
an image
of background in a table that on her the texts of autentication come  
and it

neither leaves me. That does it be making wrong??
I am completely new in this and I don't have idea that sew me pass. If
somebody could help me very grateful for that reason.:confused:


I do not really understand the problem you are facing, so please excuse
if my hint is general: Maybe reading a book on the subject helps?

I can recommend "Wicket in Action". It is very well written (easy  
English)

and covers a broad range of topics -- maybe also the topic your problem
lies in?

  http://www.manning.com/dashorst/

Regards,
Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Scriptaculous with wicket 1.3.2

2008-08-12 Thread jchappelle

I would like to use the scriptaculous wicket-stuff but when I downloaded the
latest code there were generics in there so it didn't compile. I have
searched and searched but I cannot find where an older compatible snapshot
would be. 

Can someone please direct me to it? 

Thanks for your time.

Josh
-- 
View this message in context: 
http://www.nabble.com/Scriptaculous-with-wicket-1.3.2-tp18953199p18953199.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Markup inheritance for secure and non-secure pages

2008-08-12 Thread Martijn Dashorst
AbstractBasePage extends WebPage

SecureBasePage extends AbstractBasePage

This is how we do it in our projects.

Martijn


On Tue, Aug 12, 2008 at 11:24 PM, Neil McT <[EMAIL PROTECTED]> wrote:
>
> Hi folks,
>
> I'm new to Wicket so please forgive me if I ask something incredibly dumb :)
>
> I've just started using Wicket and am enjoying it very much. I'm putting
> together an application using SWARM / WASP for my authentication /
> authorisation and would like to use markup inheritance to give a consistent
> look and feel for both secure AND non-secure pages.. and this is where I've
> run into my first problem.
>
> I would like all off my pages to extend some base-page however my secure
> pages all extend  SecureWebPage. So basically my secure and non-secure web
> pages cannot extend the same base page.
>
> As far as I can see my options are
>
> 1) Rather than extend SecureWebPage my secure pages can implement
> ISecurePage, however this would require quite a few additional methods to be
> implemented (and duplicated) across my secure pages.
>
> 2) Rather than go for a page-based layout I could go for a single page with
> a panel-based layout and manage security on a panel-by-panel basis. However,
> I prefer the navigation aspect of the page-based layout and I prefer to
> assign permissions in SWARM on a page-by-page basis (and find it easier /
> more intuitive to authenticate on a page-basis).
>
> Am I missing something simple here? Does anyone have any other suggestions?
>
> Any help much appreciated,
>
> Neil.
> --
> View this message in context: 
> http://www.nabble.com/Markup-inheritance-for-secure-and-non-secure-pages-tp18952852p18952852.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Markup inheritance for secure and non-secure pages

2008-08-12 Thread Neil McT

Hi folks,

I'm new to Wicket so please forgive me if I ask something incredibly dumb :)

I've just started using Wicket and am enjoying it very much. I'm putting
together an application using SWARM / WASP for my authentication /
authorisation and would like to use markup inheritance to give a consistent
look and feel for both secure AND non-secure pages.. and this is where I've
run into my first problem.

I would like all off my pages to extend some base-page however my secure
pages all extend  SecureWebPage. So basically my secure and non-secure web
pages cannot extend the same base page.

As far as I can see my options are

1) Rather than extend SecureWebPage my secure pages can implement
ISecurePage, however this would require quite a few additional methods to be
implemented (and duplicated) across my secure pages.

2) Rather than go for a page-based layout I could go for a single page with
a panel-based layout and manage security on a panel-by-panel basis. However,
I prefer the navigation aspect of the page-based layout and I prefer to
assign permissions in SWARM on a page-by-page basis (and find it easier /
more intuitive to authenticate on a page-basis).

Am I missing something simple here? Does anyone have any other suggestions?

Any help much appreciated,

Neil. 
-- 
View this message in context: 
http://www.nabble.com/Markup-inheritance-for-secure-and-non-secure-pages-tp18952852p18952852.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Generate URL for a Resource depending on component state

2008-08-12 Thread Kaspar Fischer

On 12.08.2008, at 12:42, Kaspar Fischer wrote:

How can I register a resource reference (or, what I actually want:  
just the

resource) with the component AND get a URL for it?


To rephrase my question and hopefully make it clearer: How can I get a  
URL

for my component which outputs the current value of my component's model
(in JSON, XML, or whatever)?

Any ideas?

I know this has come up before,

  http://markmail.org/message/yewk64k7i452cjhd

but I could not find any answer...

Thanks,
Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: onComponentTag tag.append() javascript events ?

2008-08-12 Thread Martijn Dashorst
also, take a look at AttributeAppender

Martijn

On Tue, Aug 12, 2008 at 9:18 PM, Martijn Dashorst
<[EMAIL PROTECTED]> wrote:
> if you already know you want to append, then you can do this:
>
> tag.put(getJsEvent(), "doChoosenBehaviour();" + tag.get(getJsEvent(;
>
> Martijn
>
> On Tue, Aug 12, 2008 at 8:51 PM, ak <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> I stumbled upon this scenario wherein I have 'onclick=doSomething()'
>> associated with a button on the html page. Then there is a behaviour that
>> sets onclick event from java code for button component as:
>> public void onComponentTag(Component component, ComponentTag tag){
>>  tag.put(getJsEvent(),"doChoosenBehaviour();");
>> }
>> protected String getJsEvent(){
>>return "onclick";
>> }
>>
>> In this scenario, my html event was overridden by the onComponentTag()
>> method. I am wondering can the ComponentTag have a tag.append() method that
>> will prevent the loss of similar events described through html page. I am
>> not sure if that is possible, but will like to know your thoughts.
>>
>> Thanks and Regards,
>> Andy
>> --
>> View this message in context: 
>> http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: onComponentTag tag.append() javascript events ?

2008-08-12 Thread Martijn Dashorst
if you already know you want to append, then you can do this:

tag.put(getJsEvent(), "doChoosenBehaviour();" + tag.get(getJsEvent(;

Martijn

On Tue, Aug 12, 2008 at 8:51 PM, ak <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I stumbled upon this scenario wherein I have 'onclick=doSomething()'
> associated with a button on the html page. Then there is a behaviour that
> sets onclick event from java code for button component as:
> public void onComponentTag(Component component, ComponentTag tag){
>  tag.put(getJsEvent(),"doChoosenBehaviour();");
> }
> protected String getJsEvent(){
>return "onclick";
> }
>
> In this scenario, my html event was overridden by the onComponentTag()
> method. I am wondering can the ComponentTag have a tag.append() method that
> will prevent the loss of similar events described through html page. I am
> not sure if that is possible, but will like to know your thoughts.
>
> Thanks and Regards,
> Andy
> --
> View this message in context: 
> http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Ryan O'Hara
Argh.  I just tested the this.getPage(), and although it worked at  
some point, it doesn't work now - I apologize.  We need portable  
URLs, but we were looking for a method requiring less maintenance.   
Thanks, again for the response.


Ryan

On Aug 12, 2008, at 2:29 PM, Johan Compagner wrote:


how would setPage(this.getPage()) then work???
If you want those kind of urls with state in the urls you have to  
create a

PageParameter object
you can reuse existing or tweak an existing or create a new one

Or do you just want nice urls that dont have to work when there is no
session?
use Hybridurlencoder to mound the page then you can do setPage()


johan


On Tue, Aug 12, 2008 at 6:31 PM, Ryan O'Hara  
<[EMAIL PROTECTED]> wrote:


Thank for the response, Johan.  I don't think this is what we're  
looking

for, however.  If the user changes a form parameter, it will not be
reflected in the old page parameters.  Any other ideas?

Thanks,
Ryan


On Aug 12, 2008, at 8:34 AM, Johan Compagner wrote:

 call super(parameters) in the page constructor

then getPage().getParameters() should have the parameter map

johan


On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara <[EMAIL PROTECTED]>
wrote:

 We are trying to figure out the best way to make our URLs portable.
 Currently, we mount a QueryStringUrlEncodingStrategy in our  
application
class.  Then, in the beginning of the page's constructor, page  
parameters
are mapped to instance variables.  Then, when the form button is  
clicked,

a
map of parameters is created to pass to setResponsePage(Class,
PageParameters).  It seems like mapping the parameters to  
variables and
creating a map of parameters to setResponsePage() can be avoided  
by using
setResponsePage(this.getPage()), but the URL produced is not  
portable.
 Having to map parameters to instance variables and maintain a  
map to

pass
in is high maintenance.  Is there a better way to do this?   
Thanks for

the
help.

Ryan

public Search(PageParameters params) {
  //TODO:
  //it would be nice if this could be done automatically...
  //if there are parameters, map them to instance variables
  if (params.size() > 0) {
  setSourceSelection(params.getString("source"));
  setPosition(params.getString("position"));
  setSizeStart(params.getString("sizeStart"));
  setSizeEnd(params.getString("sizeEnd"));
  setSnpStart(params.getString("snpStart"));
  setSnpEnd(params.getString("snpEnd"));
  setSortorderSelection(params.getString("sortorder"));
  setVariationTypeSelection(params.getString 
("variationType"));


  if (params.getInt("pagesize", -1) != -1) {
  setPagesize(params.getInt("pagesize"));
  }

  //populate the result list now that the instance
  //variables have been set
  try {
  resultlist =
annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
getSortorderSelection(), getVariationTypeSelection());
  } catch (CnvException e) {
  e.printStackTrace();
  error(e.getMessage());
  }
  }

//submit button
  Button asl = new Button("submit") {
  public void onSubmit() {
  try {
  //TODO:
  //it would be nice if we could make the url of
  //setresponsepage(this.getPage()) to look nice
  //as it would handle all of the parameter  
business..

ugh
  HashMap params = new HashMap();
  params.put("source", getSourceSelection());
  params.put("position", getPosition());
  params.put("sortorder", getSortorderSelection());
  params.put("variationType",
getVariationTypeSelection());
  if (getSizeStart() != null) {
  params.put("sizeStart", getSizeStart());
  }
  if (getSizeEnd() != null) {
  params.put("sizeEnd", getSizeEnd());
  }
  if (getSnpStart() != null) {
  params.put("snpStart", getSnpStart());
  }
  if (getSnpEnd() != null) {
  params.put("snpEnd", getSnpEnd());
  }
  setPagesize((Integer)  
results_page.getModelObject());

  params.put("pagesize", getPagesize().toString());

  System.out.println(getSortorderSelection());
  setResponsePage(Search.class, new
PageParameters(params));
  } catch (Exception e) {
  error(e.getMessage());
  }
  }
  };

--- 
--

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--

onComponentTag tag.append() javascript events ?

2008-08-12 Thread ak

Hello,

I stumbled upon this scenario wherein I have 'onclick=doSomething()'
associated with a button on the html page. Then there is a behaviour that
sets onclick event from java code for button component as:
public void onComponentTag(Component component, ComponentTag tag){
  tag.put(getJsEvent(),"doChoosenBehaviour();");
}
protected String getJsEvent(){
return "onclick";
}

In this scenario, my html event was overridden by the onComponentTag()
method. I am wondering can the ComponentTag have a tag.append() method that
will prevent the loss of similar events described through html page. I am
not sure if that is possible, but will like to know your thoughts.

Thanks and Regards,
Andy
-- 
View this message in context: 
http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Johan Compagner
how would setPage(this.getPage()) then work???
If you want those kind of urls with state in the urls you have to create a
PageParameter object
you can reuse existing or tweak an existing or create a new one

Or do you just want nice urls that dont have to work when there is no
session?
use Hybridurlencoder to mound the page then you can do setPage()


johan


On Tue, Aug 12, 2008 at 6:31 PM, Ryan O'Hara <[EMAIL PROTECTED]> wrote:

> Thank for the response, Johan.  I don't think this is what we're looking
> for, however.  If the user changes a form parameter, it will not be
> reflected in the old page parameters.  Any other ideas?
>
> Thanks,
> Ryan
>
>
> On Aug 12, 2008, at 8:34 AM, Johan Compagner wrote:
>
>  call super(parameters) in the page constructor
>> then getPage().getParameters() should have the parameter map
>>
>> johan
>>
>>
>> On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara <[EMAIL PROTECTED]>
>> wrote:
>>
>>  We are trying to figure out the best way to make our URLs portable.
>>>  Currently, we mount a QueryStringUrlEncodingStrategy in our application
>>> class.  Then, in the beginning of the page's constructor, page parameters
>>> are mapped to instance variables.  Then, when the form button is clicked,
>>> a
>>> map of parameters is created to pass to setResponsePage(Class,
>>> PageParameters).  It seems like mapping the parameters to variables and
>>> creating a map of parameters to setResponsePage() can be avoided by using
>>> setResponsePage(this.getPage()), but the URL produced is not portable.
>>>  Having to map parameters to instance variables and maintain a map to
>>> pass
>>> in is high maintenance.  Is there a better way to do this?  Thanks for
>>> the
>>> help.
>>>
>>> Ryan
>>>
>>> public Search(PageParameters params) {
>>>   //TODO:
>>>   //it would be nice if this could be done automatically...
>>>   //if there are parameters, map them to instance variables
>>>   if (params.size() > 0) {
>>>   setSourceSelection(params.getString("source"));
>>>   setPosition(params.getString("position"));
>>>   setSizeStart(params.getString("sizeStart"));
>>>   setSizeEnd(params.getString("sizeEnd"));
>>>   setSnpStart(params.getString("snpStart"));
>>>   setSnpEnd(params.getString("snpEnd"));
>>>   setSortorderSelection(params.getString("sortorder"));
>>>   setVariationTypeSelection(params.getString("variationType"));
>>>
>>>   if (params.getInt("pagesize", -1) != -1) {
>>>   setPagesize(params.getInt("pagesize"));
>>>   }
>>>
>>>   //populate the result list now that the instance
>>>   //variables have been set
>>>   try {
>>>   resultlist =
>>> annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
>>> getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
>>> getSortorderSelection(), getVariationTypeSelection());
>>>   } catch (CnvException e) {
>>>   e.printStackTrace();
>>>   error(e.getMessage());
>>>   }
>>>   }
>>>
>>> //submit button
>>>   Button asl = new Button("submit") {
>>>   public void onSubmit() {
>>>   try {
>>>   //TODO:
>>>   //it would be nice if we could make the url of
>>>   //setresponsepage(this.getPage()) to look nice
>>>   //as it would handle all of the parameter business..
>>> ugh
>>>   HashMap params = new HashMap();
>>>   params.put("source", getSourceSelection());
>>>   params.put("position", getPosition());
>>>   params.put("sortorder", getSortorderSelection());
>>>   params.put("variationType",
>>> getVariationTypeSelection());
>>>   if (getSizeStart() != null) {
>>>   params.put("sizeStart", getSizeStart());
>>>   }
>>>   if (getSizeEnd() != null) {
>>>   params.put("sizeEnd", getSizeEnd());
>>>   }
>>>   if (getSnpStart() != null) {
>>>   params.put("snpStart", getSnpStart());
>>>   }
>>>   if (getSnpEnd() != null) {
>>>   params.put("snpEnd", getSnpEnd());
>>>   }
>>>   setPagesize((Integer) results_page.getModelObject());
>>>   params.put("pagesize", getPagesize().toString());
>>>
>>>   System.out.println(getSortorderSelection());
>>>   setResponsePage(Search.class, new
>>> PageParameters(params));
>>>   } catch (Exception e) {
>>>   error(e.getMessage());
>>>   }
>>>   }
>>>   };
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>
> --

Re: Authorization strategy help

2008-08-12 Thread Igor Vaynberg
you only implement the one strategy instance and let it control all
your components

eg you have a link that is only visible to "editors", you can do
something like this

link link=new link("link") {...}
link.setmetadata(mysecuritykey, roles.editor);

and in your security strategy

iactionauthorized (component c, action action) {
  if (action==component.render) {
 role role=c.getmetadata(mysecuritykey);
if (role==null) { return true; } else { return user.hasrole(role); }
}

and just like that you can have role-based visiblity of any component

instead of metadata you can also have an interface components implement, etc

-igor

On Tue, Aug 12, 2008 at 10:08 AM, Wayne Pope
<[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> hope we don't get a double posting, but for some reason the last email
> account I used couldn't seem to post. Anyhow !
>
> Ok so I'm very new around here so firstly I'd like to say hello! I'm looking
> to create an online application, and I think I shall be using Wicket, so I
> forgive the noob questions etc, but I hope to become good member of the
> community once I get to grip with it.
>
> Ok so first noob question - I need to implement authorization (and
> authentication) for my application that we're creating.
>
> I need to restict access to the application only users of the application
> and restrict access to certain pages/components within that depending on
> groups or roles.
> I'm aware of the IAuthorizationStrategy interface, but from what I can
> understand I would need to add listeners for every single component that we
> create within the application.
> THis seems just crazy and I presume there is a much better way - I see
> things like SWARM , but I think I must be missing some basic theory here..
>
> Any suggestions?
>
> thanks,
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Expiration

2008-08-12 Thread Uwe Schäfer

hi

i use getApplicationSettings().setPageExpiredErrorPage(getHomePage()); 
in my application.


in dev mode everything works as expected, in production though, i see
"Cannot find the rendered page in session 
pagemap=null,componentPath=7,versionNumber=0]"


when a user comes with a link from an expired session.
how can i handle this ?

cu uwe

--

THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T  + 49 761 3 85 59 0
F  + 49 761 3 85 59 550
E  [EMAIL PROTECTED]
www.thomas-daily.de

Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947

Registrieren Sie sich unter http://morningnews.thomas-daily.de für die 
kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages 
morgens um 9:00 in Ihrer Mailbox.


Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 
8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 
16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer 
Redaktion lautet [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Authorization strategy help

2008-08-12 Thread Wayne Pope
Hi everyone,

hope we don't get a double posting, but for some reason the last email
account I used couldn't seem to post. Anyhow !

Ok so I'm very new around here so firstly I'd like to say hello! I'm looking
to create an online application, and I think I shall be using Wicket, so I
forgive the noob questions etc, but I hope to become good member of the
community once I get to grip with it.

Ok so first noob question - I need to implement authorization (and
authentication) for my application that we're creating.

I need to restict access to the application only users of the application
and restrict access to certain pages/components within that depending on
groups or roles.
I'm aware of the IAuthorizationStrategy interface, but from what I can
understand I would need to add listeners for every single component that we
create within the application.
THis seems just crazy and I presume there is a much better way - I see
things like SWARM , but I think I must be missing some basic theory here..

Any suggestions?

thanks,


please ignore - test.

2008-08-12 Thread Wayne Pope
test


Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Ryan O'Hara
Thank for the response, Johan.  I don't think this is what we're  
looking for, however.  If the user changes a form parameter, it will  
not be reflected in the old page parameters.  Any other ideas?


Thanks,
Ryan

On Aug 12, 2008, at 8:34 AM, Johan Compagner wrote:


call super(parameters) in the page constructor
then getPage().getParameters() should have the parameter map

johan


On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara  
<[EMAIL PROTECTED]> wrote:



We are trying to figure out the best way to make our URLs portable.
 Currently, we mount a QueryStringUrlEncodingStrategy in our  
application
class.  Then, in the beginning of the page's constructor, page  
parameters
are mapped to instance variables.  Then, when the form button is  
clicked, a

map of parameters is created to pass to setResponsePage(Class,
PageParameters).  It seems like mapping the parameters to  
variables and
creating a map of parameters to setResponsePage() can be avoided  
by using
setResponsePage(this.getPage()), but the URL produced is not  
portable.
 Having to map parameters to instance variables and maintain a map  
to pass
in is high maintenance.  Is there a better way to do this?  Thanks  
for the

help.

Ryan

public Search(PageParameters params) {
   //TODO:
   //it would be nice if this could be done automatically...
   //if there are parameters, map them to instance variables
   if (params.size() > 0) {
   setSourceSelection(params.getString("source"));
   setPosition(params.getString("position"));
   setSizeStart(params.getString("sizeStart"));
   setSizeEnd(params.getString("sizeEnd"));
   setSnpStart(params.getString("snpStart"));
   setSnpEnd(params.getString("snpEnd"));
   setSortorderSelection(params.getString("sortorder"));
   setVariationTypeSelection(params.getString 
("variationType"));


   if (params.getInt("pagesize", -1) != -1) {
   setPagesize(params.getInt("pagesize"));
   }

   //populate the result list now that the instance
   //variables have been set
   try {
   resultlist =
annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
getSortorderSelection(), getVariationTypeSelection());
   } catch (CnvException e) {
   e.printStackTrace();
   error(e.getMessage());
   }
   }

//submit button
   Button asl = new Button("submit") {
   public void onSubmit() {
   try {
   //TODO:
   //it would be nice if we could make the url of
   //setresponsepage(this.getPage()) to look nice
   //as it would handle all of the parameter  
business.. ugh

   HashMap params = new HashMap();
   params.put("source", getSourceSelection());
   params.put("position", getPosition());
   params.put("sortorder", getSortorderSelection());
   params.put("variationType",
getVariationTypeSelection());
   if (getSizeStart() != null) {
   params.put("sizeStart", getSizeStart());
   }
   if (getSizeEnd() != null) {
   params.put("sizeEnd", getSizeEnd());
   }
   if (getSnpStart() != null) {
   params.put("snpStart", getSnpStart());
   }
   if (getSnpEnd() != null) {
   params.put("snpEnd", getSnpEnd());
   }
   setPagesize((Integer)  
results_page.getModelObject());

   params.put("pagesize", getPagesize().toString());

   System.out.println(getSortorderSelection());
   setResponsePage(Search.class, new
PageParameters(params));
   } catch (Exception e) {
   error(e.getMessage());
   }
   }
   };

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



embedding Wicket into JSP

2008-08-12 Thread kgignatyev

Hi,

I have problem embedding Wicket pages (1.3.4) into JSP application.
index.jsp



and the cause is that inside WicketFilter 
public String getRelativePath(HttpServletRequest request) returns empty
string because the request returns path for the index.jsp and not the /wic/
so the doGet method tries to do redirect which does not succeed.

So the question: is it possible at all to embed Wicket into JSP pages? 
-- 
View this message in context: 
http://www.nabble.com/embedding-Wicket-into-JSP-tp18947738p18947738.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AjaxSubmitlink vs AjaxButton

2008-08-12 Thread Milan Křápek
Thaks. You are right. I thought I need just add the AjaxSubmitLink to form as a 
Button but it must be set as default button. 

Best regards

Milan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AjaxSubmitlink vs AjaxButton

2008-08-12 Thread Ryan O'Hara

I think you'll need to call form.setDefaultButton(submitLink).

Ryan

On Aug 12, 2008, at 11:13 AM, Milan Křápek wrote:


Hi
  In my web application I realized form submiting by AjaxButtons.  
This wokrs great. I love the possibility to refresh just part of my  
page after submiting the form. Then  I decided to refactor my  
webapp tu use AjaxSubmitLink because I want to use some images and  
texts instead of buttons.
  This works too, but one thing make me confused. When I was using  
buttons I can submit my forms just by pressing the enter key, but  
with AjaxSubmitlink this  feathure does not work.
  I try to debug it and get this results. When I use buttons and  
press enter, Wicket call onSubmit method implemented by AjaxButton,  
but when I use AjaxSubmitLinks and press enter, wicket call  
onSubmit method on the form not on the link.


Why? Has it some purpose, should I use AjaxSubmitLinks by another  
way, or it is some bug?

Thanks for any response.

Milan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 17:07:40 +0200
Federico Fanton <[EMAIL PROTECTED]> wrote:

> On Tue, 12 Aug 2008 07:58:13 -0700 (PDT)
> Michael Sparer <[EMAIL PROTECTED]> wrote:
> 
> > try overriding
> > 
> > @Override
> > protected IAjaxCallDecorator getAjaxCallDecorator() {
> 
> Hi, thanks for your suggestion :)
> I tried that, but nothing changed :/ Same "Invalid procedure call or 
> argument" under IE7.. (still Ok in FF2)

Looks like my issue is like the one at 
https://issues.apache.org/jira/browse/WICKET-1585, but on line 849 instead (I'm 
using Wicket 1.3.4).. Any opinion?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AjaxSubmitlink vs AjaxButton

2008-08-12 Thread Milan Křápek
Hi
  In my web application I realized form submiting by AjaxButtons. This wokrs 
great. I love the possibility to refresh just part of my page after submiting 
the form. Then  I decided to refactor my webapp tu use AjaxSubmitLink because I 
want to use some images and texts instead of buttons.
  This works too, but one thing make me confused. When I was using buttons I 
can submit my forms just by pressing the enter key, but with AjaxSubmitlink 
this  feathure does not work. 
  I try to debug it and get this results. When I use buttons and press enter, 
Wicket call onSubmit method implemented by AjaxButton, but when I use 
AjaxSubmitLinks and press enter, wicket call onSubmit method on the form not on 
the link.

Why? Has it some purpose, should I use AjaxSubmitLinks by another way, or it is 
some bug?
Thanks for any response.

Milan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 07:58:13 -0700 (PDT)
Michael Sparer <[EMAIL PROTECTED]> wrote:

> try overriding
> 
>   @Override
>   protected IAjaxCallDecorator getAjaxCallDecorator() {

Hi, thanks for your suggestion :)
I tried that, but nothing changed :/ Same "Invalid procedure call or argument" 
under IE7.. (still Ok in FF2)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
On Tue, 12 Aug 2008 15:18:49 +0200
Federico Fanton <[EMAIL PROTECTED]> wrote:

> Hi everyone!
> I have a Button that shows a JS alert and then executes an AJAX call.
> It works fine under Firefox 2, but fails under IE7.. The alert appears, I 
> click "ok" and then I get the "Initiating Ajax GET request..." inside "WICKET 
> AJAX DEBUG", but it doesn't reach my serverside handler..

Just noticed:
After clicking "ok", in the bottom-left corner of the window appears a 
javascript error: "Invalid procedure call or argument", line 849, code 0... 
Does it mean inside wicket-ajax.js? ^^;


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Button with confirmation with IE7

2008-08-12 Thread Michael Sparer

try overriding

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {

private static final long 
serialVersionUID = 1L;

@Override
public CharSequence 
decorateScript(final CharSequence script) {
return "alert('foobar');" + 
script;
}
};
}

instead of getEventHandler

regards,
Michael



Federico Fanton wrote:
> 
> Hi everyone!
> I have a Button that shows a JS alert and then executes an AJAX call.
> It works fine under Firefox 2, but fails under IE7.. The alert appears, I
> click "ok" and then I get the "Initiating Ajax GET request..." inside
> "WICKET AJAX DEBUG", but it doesn't reach my serverside handler..
> Here's the code:
> 
> Button button = new Button("btn");
> button.add(new AjaxEventBehavior("onclick"){
> 
>   @Override
>   protected void onEvent(AjaxRequestTarget target) {
>   System.out.println("Ajax call works");
>   }
>   
>   @Override
>   protected CharSequence getEventHandler() {
>   return "alert('Press OK and check server
> log');"+super.getEventHandler();
>   }
> });
> add(button);
> 
> 
> So basically, with IE7 after the alert there's no "Ajax call works" in the
> serverside log.. Everything is OK with FF2.
> Am I doing something wrong? Should I open a JIRA issue? (I have a
> quickstart ready)
> Many thanks for your attention!
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Button-with-confirmation-with-IE7-tp18944137p18945992.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Button with confirmation with IE7

2008-08-12 Thread Federico Fanton
Hi everyone!
I have a Button that shows a JS alert and then executes an AJAX call.
It works fine under Firefox 2, but fails under IE7.. The alert appears, I click 
"ok" and then I get the "Initiating Ajax GET request..." inside "WICKET AJAX 
DEBUG", but it doesn't reach my serverside handler..
Here's the code:

Button button = new Button("btn");
button.add(new AjaxEventBehavior("onclick"){

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println("Ajax call works");
}

@Override
protected CharSequence getEventHandler() {
return "alert('Press OK and check server 
log');"+super.getEventHandler();
}
});
add(button);


So basically, with IE7 after the alert there's no "Ajax call works" in the 
serverside log.. Everything is OK with FF2.
Am I doing something wrong? Should I open a JIRA issue? (I have a quickstart 
ready)
Many thanks for your attention!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Best Practice for handling roles in a DB?

2008-08-12 Thread Markus
Hi all,

 

I am wondering, whether there is a best practice for saving roles in the
Database.

I want to do this:

 

An Admin should be able to create new Groups dynamically, assign users to
them and manage the Roles for the groups dynamically from a predefined set
of Roles.

 

Any suggestions?

 

Regards

Markus



Re: Footer Toolbar for DefaultDataTable (wicket 1.3.2)

2008-08-12 Thread swapnil.wadagave

hi Sanjeev,
I think you can able to do it using this code,

extend parent class as DataTable,dont use DefaultDataTable :
code:
DatatTable datatable=new DataTable("entries",column,provider,3)
{
protected Item newRowItem(String id,int index,IModel model)
{
return new OddEvenItem(id,indexmmodel);
}};
datatable.addTopToolBar(new HeadersToolBar(datatble,provider));
datatable.addBottomToolBar(new NavigationToolBar(datatble));
add(datatable);

Regards,
Swapnil



standon wrote:
> 
> I'm using DefaultDataTable with sortable data provider in my project. All
> the columns are sortable. This  data table has few amount columns, which I
> need to sum up and show as a last row (TotalRow) at the bottom of the
> table. This last row (TotalRow) should not be part of sortable data
> provider. Otherwise, if user clicks on any table column, the table will
> sort it and put in top (1st row, descending order) of the table.
> 
> Basically, the way the column headers are displayed on default data table,
> I want similar thing to be displayed at the bottom of the table
> (TotalRow), which I can control it. I don't know how to use
> addBottomToolbar to achieve this.
> 
> If there is a way, pls let me know. If you can provide a code snippet that
> would be great.
> 
> Thanks
> Sanjeev
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Footer-Toolbar-for-DefaultDataTable-%28wicket-1.3.2%29-tp16995010p18943872.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Easier way to accomplish setResponsePage(Class, PageParameters)

2008-08-12 Thread Johan Compagner
call super(parameters) in the page constructor
then getPage().getParameters() should have the parameter map

johan


On Mon, Aug 11, 2008 at 5:51 PM, Ryan O'Hara <[EMAIL PROTECTED]> wrote:

> We are trying to figure out the best way to make our URLs portable.
>  Currently, we mount a QueryStringUrlEncodingStrategy in our application
> class.  Then, in the beginning of the page's constructor, page parameters
> are mapped to instance variables.  Then, when the form button is clicked, a
> map of parameters is created to pass to setResponsePage(Class,
> PageParameters).  It seems like mapping the parameters to variables and
> creating a map of parameters to setResponsePage() can be avoided by using
> setResponsePage(this.getPage()), but the URL produced is not portable.
>  Having to map parameters to instance variables and maintain a map to pass
> in is high maintenance.  Is there a better way to do this?  Thanks for the
> help.
>
> Ryan
>
> public Search(PageParameters params) {
>//TODO:
>//it would be nice if this could be done automatically...
>//if there are parameters, map them to instance variables
>if (params.size() > 0) {
>setSourceSelection(params.getString("source"));
>setPosition(params.getString("position"));
>setSizeStart(params.getString("sizeStart"));
>setSizeEnd(params.getString("sizeEnd"));
>setSnpStart(params.getString("snpStart"));
>setSnpEnd(params.getString("snpEnd"));
>setSortorderSelection(params.getString("sortorder"));
>setVariationTypeSelection(params.getString("variationType"));
>
>if (params.getInt("pagesize", -1) != -1) {
>setPagesize(params.getInt("pagesize"));
>}
>
>//populate the result list now that the instance
>//variables have been set
>try {
>resultlist =
> annotatedQuery.getAnnotations(getSourceSelection(), getPosition(),
> getSizeStart(), getSizeEnd(), getSnpStart(), getSnpEnd(),
> getSortorderSelection(), getVariationTypeSelection());
>} catch (CnvException e) {
>e.printStackTrace();
>error(e.getMessage());
>}
>}
>
> //submit button
>Button asl = new Button("submit") {
>public void onSubmit() {
>try {
>//TODO:
>//it would be nice if we could make the url of
>//setresponsepage(this.getPage()) to look nice
>//as it would handle all of the parameter business.. ugh
>HashMap params = new HashMap();
>params.put("source", getSourceSelection());
>params.put("position", getPosition());
>params.put("sortorder", getSortorderSelection());
>params.put("variationType",
> getVariationTypeSelection());
>if (getSizeStart() != null) {
>params.put("sizeStart", getSizeStart());
>}
>if (getSizeEnd() != null) {
>params.put("sizeEnd", getSizeEnd());
>}
>if (getSnpStart() != null) {
>params.put("snpStart", getSnpStart());
>}
>if (getSnpEnd() != null) {
>params.put("snpEnd", getSnpEnd());
>}
>setPagesize((Integer) results_page.getModelObject());
>params.put("pagesize", getPagesize().toString());
>
>System.out.println(getSortorderSelection());
>setResponsePage(Search.class, new
> PageParameters(params));
>} catch (Exception e) {
>error(e.getMessage());
>}
>}
>};
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket 1.4m3 - AjaxButton, AjaxSubmitLink in ModalWindow in IE 7 Problem ?

2008-08-12 Thread Asgaut Mjølne

Thanks, I had a similar problem and your post saved my day!

Postet it on wicket's Jira here:
https://issues.apache.org/jira/browse/WICKET-1787

Regards,


Asgaut Mjølne



Martijn Dashorst wrote:
> 
> also, don't use a submit button with wicket:id "submit"
> 
> Martijn
> 
> On Mon, Aug 11, 2008 at 9:57 PM, FakeBoy <[EMAIL PROTECTED]> wrote:
>>
>> Hi, I GOT IT 
>> I found the problem. The Problem was in the TextField with wicket id
>> "id".
>> When you want to safetly use ajax submit components (AjaxButton,
>> AjaxSubmitLink) your form components (TextFiels etc.) CAN NOT have wicket
>> id
>> "id", because ajax submit stop work in IE. For example:
>> form.add(new TextField("id",...)) -> cause in IE Ajax Submit Problem
>>
>> I hope that it helps you, if you will have same problems like I had
>> :thinking:
>>
>> Dave
>>
>>
>>
>> FakeBoy wrote:
>>>
>>> Thanks for your interest :)
>>> I tried to isolate problem, because I use it in some context of my
>>> application. I made small fake startup project only with only necessary
>>> classes and this problem hasn't occured. So everything works fine. But I
>>> made only simple dummy modal window with no listeners and other
>>> features.
>>> Now I will try make it more complex step by step and I will try
>>> recognize,
>>> when it will stop working. If I detect something, let you know.
>>> Thanks one more for your help ;)
>>>
>>> Dave
>>>
>>>
>>> kag1526 wrote:

 I just tested my app in IE 7 since I also have a ModalWindow with an
 AjaxSubmitLink that submits my form and closes the window and mine
 worked
 fine. sorry I can't help with a solution but I can tell you that it is
 possible to make work.



 FakeBoy wrote:
>
> Hi,
> I tried to submit form from ModalWindow with AjaxButton or
> AjaxSubmitLink.
> In Firefox, Opera, Safari everything works fine, but in IE 7 doesn't.
> No onSubmit or onError method is fired after button or link cliked in
> IE
> 7.
> I used WICKET DEBUG console and after clik on Button or Link i see
> message:
> INFO: Ajax POST stopped because of precondition check,
> url:?wicket:interface=modal-dialog-pagemap:0:form:testLink1::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true
> What doe's it mean? It's wicket problem or I did something wrong?
> Thanks a lot for your soon reply.
>
>


>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Wicket-1.4m3---AjaxButton%2C-AjaxSubmitLink-in-ModalWindow-in-IE-7-Problem---tp18912755p18932529.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-1.4m3---AjaxButton%2C-AjaxSubmitLink-in-ModalWindow-in-IE-7-Problem---tp18912755p18943377.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Generate URL for a Resource depending on component state

2008-08-12 Thread Kaspar Fischer
I have a component that loads on the browser via JavaScript JSON-data  
from the server.
The data depends on the component's model and needs to be loaded from  
a URL. My
approach so far was to create a subclass DataSource of  
DynamicWebResource, and to do

in my component's constructor:

  MyComponent(String id, Model model)
  {
super(id, model);

final DataSource resource = new DataSource();
resourceReference = new ResourceReference(MyComponent.class,  
"something")

{
  @Override
  protected Resource newResource()
  {
return resource;
  }
};
  }

  private class DataSource extends DynamicWebResource
  // uses MyComponent.this.getDefaultModel() to obtain data
  ...

However, this registers my component class (and not the instance) with  
the resource
and all subsequently constructed components still point to the old  
resource.
How can I register a resource reference (or, what I actually want:  
just the

resource) with the component AND get a URL for it?

Thanks very much for any guidance.
Kaspar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hi, how to find the path for the page in wicket

2008-08-12 Thread Uwe Schäfer

shrimpywu schrieb:


but when the user try to provide the link of his blog to his friend,
how to know the link direct to the page blog.html


search for BookmarkablePageLink and mounting of pages.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hi, how to find the path for the page in wicket

2008-08-12 Thread James Carman
You need to "mount" the page.  This should give you some good examples:

http://cwiki.apache.org/WICKET/url-coding-strategies.html




On Tue, Aug 12, 2008 at 6:17 AM, shrimpywu <[EMAIL PROTECTED]> wrote:
>
> i have tried to use wicket for some days,
> and got a question.
>
> if i am doing a website, has three page,
> index.htm, blog.html and guestbook.html
> so we will have three class
> index.class, blog.class and guestbook.class
>
> in the java code, when we want to direct from index page to blog page, we
> can do setRespone(blog.class) something like that
>
> but when the user try to provide the link of his blog to his friend,
> how to know the link direct to the page blog.html
> --
> View this message in context: 
> http://www.nabble.com/hi%2C-how-to-find-the-path-for-the-page-in-wicket-tp18941425p18941425.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



hi, how to find the path for the page in wicket

2008-08-12 Thread shrimpywu

i have tried to use wicket for some days, 
and got a question.

if i am doing a website, has three page,
index.htm, blog.html and guestbook.html
so we will have three class
index.class, blog.class and guestbook.class

in the java code, when we want to direct from index page to blog page, we
can do setRespone(blog.class) something like that

but when the user try to provide the link of his blog to his friend,
how to know the link direct to the page blog.html
-- 
View this message in context: 
http://www.nabble.com/hi%2C-how-to-find-the-path-for-the-page-in-wicket-tp18941425p18941425.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Please comment the Branding Link idea

2008-08-12 Thread jensiator

Last comment from me. If anyone is interessed. Wicket:link is not suitible to
use because then you cant use dynamic pageParameters. In my final version I
registert all branded pages during deployment. Adds them as a global to in a
HashMap in MyApplication class. Navlink only check if there is a registrated
brand of this target page. I have one brand/war so I always call it
*_override.class


public class NavLink extends PageLink
{
public NavLink(String s, Class pClass)
{
super(s, GetBrandedClass(pClass));
}

@SuppressWarnings({"unchecked"})
private static Class GetBrandedClass(Class
pClass)
{
MyApplication app = (MyApplication) Application.get();
if(app.getBranded().containsKey(pClass.getName()))
return app.getBranded().get(pClass.getName());

return pClass;
}
}
-- 
View this message in context: 
http://www.nabble.com/Branding-a-PageLink-target-Page-tp18382006p18939733.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]