Re: Ajax calls loads my server

2008-09-25 Thread Benny Weingarten

Of course, I meant javascript...

thanks for the clarification. 

To preserve functionality, (That is, having a Select all
 and select none links instead of a single checkbox to select or deselect
all) I will go with writing my own javascript.

In addition, I have, in a different form in my application, two fields and a
checkbox:
field1: _
field2: _

[] checkbox

I want to have a functionality that if a user types something in field2, the
checkbox becomes disabled. currently I use an onChangeAjaxBehavior on the
textfield, and that is AJAX, making a call to the server. I don't really
want that sort of communication.  Would I need to write my own javascript?
is there some sort of wicket component with this sort of behavior? 


thanks,
Benny.




walnutmon wrote:
 
 While this javascript behavior doesn't qualify as Ajax, how else could you
 get that behavior without making an ajax component so that you can get
 form element objects to submit without a page refresh?  Do you need to
 write javascript in the Wicket code?  I suppose you could write javascript
 in the html files, but can you do things like div resizing, and other
 useful javascript functions using wicket?
 
 
 
 Matej Knopp-2 wrote:
 
 If it doesn't call the server than it's not Ajax...
 
 Anyway, you can accomplish what you want by writing the javascript by
 yourself. Or use Check, CheckGroup and CheckGroupSelector components
 that user client side javascript to change the state of checkboxes.
 
 -Matej
 
 On Wed, Sep 24, 2008 at 6:12 PM, Benny Weingarten [EMAIL PROTECTED]
 wrote:

 Hello.

 In my application I have a panel with a list of users and a checkbox
 next to
 each user.
 [] user 1
 [] user 2
 [] user 3
 ..
 [] user n

 I also have an ajaxlink called select all, which selects all the
 checkboxes.

 Problem: when there are a lot of checkboxes, the operations takes a long
 time - more than is tolerable. Is there a way to make the ajax do its
 work
 COMPLETELY on the client side, without accessing the server?

 In general, does wicket provide a way have pages that have ajax behavior
 that doesn't make calls to the server at all?

 thanks,
 Benny.

 --
 View this message in context:
 http://www.nabble.com/Ajax-calls-loads-my-server-tp19652337p19652337.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]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Ajax-calls-loads-my-server-tp19652337p19664171.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]



Ajax calls loads my server

2008-09-24 Thread Benny Weingarten

Hello.

In my application I have a panel with a list of users and a checkbox next to
each user.
[] user 1
[] user 2
[] user 3
..
[] user n

I also have an ajaxlink called select all, which selects all the
checkboxes. 

Problem: when there are a lot of checkboxes, the operations takes a long
time - more than is tolerable. Is there a way to make the ajax do its work
COMPLETELY on the client side, without accessing the server?

In general, does wicket provide a way have pages that have ajax behavior
that doesn't make calls to the server at all?

thanks,
Benny.

-- 
View this message in context: 
http://www.nabble.com/Ajax-calls-loads-my-server-tp19652337p19652337.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: Wicket fails to set seesion and request attributes for external webpages

2008-09-16 Thread Benny Weingarten

Thanks Igor.

I did not try your solution, but instead I decided to make the External
page a wicket page inside my application.

Benny.



igor.vaynberg wrote:
 
 it is quiet obvious that if you issue a redirect then a new request is
 created from the client to the server, and thus new request/response
 objects - so instead of setting your paramters into the request object
 you have to encode them into the url that you give to the redirect
 exception.
 
 -igor
 
 On Sat, Sep 13, 2008 at 11:09 PM, Benny Weingarten
 [EMAIL PROTECTED] wrote:

 No response.. I'll try re-posting this:

 Basically I want a wicket page to forward the user to a non-wicket page
 and
 pass some request attributes to that non-wicket page.

 I have not been successful in doing so. See the code I use below.

 Any help would be appreciated.
 thanks,
 Benny.




 Benny Weingarten wrote:

 Hello.

 I am working on a Jboss server, with a security-constraint set on the
 same path as the wicket filter. Thus, all wicket pages are under the
 security constraint.

 To support that I have a login page outside the path of
 security-constraint. I also have an error page in the same location as
 the login page:

 Path:
 / login.jsp
 / error.jsp
 /folder_under_constraint/Wicket_Class1.java
 /folder_under_constraint/Wicket_Class2.java
 .
 .
 /folder_under_constraint/Wicket_Classn.java

 In case of an error I want to redirect to invalidate the session,
 redirect
 to the error page, and pass an error message to the error page. I
 haven't
 been able to do this. It appears that wicket doesn't pass session or
 request attributes to external pages. What am I doing wrong?

 Session.get().invalidate();
 // none of the following setAttribute statements actually mange to pass
 any http attributes to the error page.
 httpServletRequest.setAttribute(some_attribute, some_value);
 HttpServletRequest.getSession().setAttribute(some_attribute,
 some_value);
 request.getParameterMap().put(some_attribute, some_value);
 throw new
 org.apache.wicket.RedirectToUrlException(/some_page_not_under_wicket_filter.jsp);

 thanks,
 Benny.



 --
 View this message in context:
 http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19477610.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19513081.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: Wicket fails to set seesion and request attributes for external webpages

2008-09-14 Thread Benny Weingarten

No response.. I'll try re-posting this:

Basically I want a wicket page to forward the user to a non-wicket page and
pass some request attributes to that non-wicket page. 

I have not been successful in doing so. See the code I use below.

Any help would be appreciated.
thanks,
Benny.




Benny Weingarten wrote:
 
 Hello.
 
 I am working on a Jboss server, with a security-constraint set on the
 same path as the wicket filter. Thus, all wicket pages are under the
 security constraint. 
 
 To support that I have a login page outside the path of
 security-constraint. I also have an error page in the same location as
 the login page:
 
 Path:
 / login.jsp
 / error.jsp
 /folder_under_constraint/Wicket_Class1.java
 /folder_under_constraint/Wicket_Class2.java
 .
 .
 /folder_under_constraint/Wicket_Classn.java
 
 In case of an error I want to redirect to invalidate the session, redirect
 to the error page, and pass an error message to the error page. I haven't
 been able to do this. It appears that wicket doesn't pass session or
 request attributes to external pages. What am I doing wrong?
 
 Session.get().invalidate();
 // none of the following setAttribute statements actually mange to pass
 any http attributes to the error page.
 httpServletRequest.setAttribute(some_attribute, some_value);
 HttpServletRequest.getSession().setAttribute(some_attribute,
 some_value);
 request.getParameterMap().put(some_attribute, some_value);
 throw new
 org.apache.wicket.RedirectToUrlException(/some_page_not_under_wicket_filter.jsp);
 
 thanks,
 Benny.
 
 

-- 
View this message in context: 
http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19477610.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]



Wciket fails to set seesion and request attributes for external webpages

2008-09-11 Thread Benny Weingarten

Hello.

I am worker on a Jboss server, with a security-constraint set on the same
path as the wicket filter. Thus, all wicket pages are under the security
constraint. 

To support that I have a login page outside the path of
security-constraint. I also have an error page in teh same location as the
login page:

Path:
/ login.jsp
/ error.jsp
/folder_under_constraint/Wicket_Class1.java
/folder_under_constraint/Wicket_Class2.java
.
.
/folder_under_constraint/Wicket_Classn.java

In case of an error I want to redirect to invalidate the session, redirect
to the error page, and pass an error message to the error page. I haven't
been able to do this. It appears that wicket doesn't pass session or request
attributes to external pages. What am I doing wrong?

Session.get().invalidate();
// none of the following setAttribute statements actually mange to pass any
http attributes to the error page.
httpServletRequest.setAttribute(some_attribute, some_value);
HttpServletRequest.getSession().setAttribute(some_attribute,
some_value);
request.getParameterMap().put(some_attribute, some_value);
throw new
org.apache.wicket.RedirectToUrlException(/some_page_not_under_wicket_filter.jsp);

thanks,
Benny.

-- 
View this message in context: 
http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19438970.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: Pre render action common to all pages

2008-08-14 Thread Benny Weingarten

Some pages trigger the onBeginRequest() method in my RequestCycle around 3-4
times, others even 10 times. The number is constant for each page, i.e. for
PageA, the number of calls is always 5, and for PageB the number of calls is
always 8 (though, I haven't monitored the number of executions closely - the
number may be different between the first time a page is invoked, and
subsequent times).

The way I monitor the number of calls is a simple system.out.println call
here:

public class MyRequestCycle extends WebRequestCycle {

public MyRequestCycle(MyApp application, WebRequest request,
Response response) {
super(application, request, response);
}

@Override
protected void onBeginRequest() {
System.out.println(On begin request called!);
}
}


I wonder if the complexity of a page should have any affect on the number of
calls to  RequestCycle.onBeginRequest()? if a page has many panels and those
panels in turn have even more nested panels?



thanks,
Benny.

igor.vaynberg wrote:
 
 by numerous you mean two?
 
 by default wicket uses something similar to redirect-after-post so
 after you click a link there is a http redirect to a view-url that
 will no longer execute the link. so that is two http requests/two
 request cycles.
 
 -igor
 
 On Wed, Aug 13, 2008 at 7:18 AM, Benny Weingarten [EMAIL PROTECTED]
 wrote:

 Thanks Igor.

 I have done that, and it is exactly what I was looking for.

 However, I have noticed something that strikes me odd:
 on every request to render a page in my application (every time I click a
 link in my application to another page in my application), the method
 newRequestCycle() in WebApplication is called numerous times, and
 subsequently, my pre-render actions are performed many times. Is this
 expected? shouldn't one page require only one RequestCycle?

 thanks,
 Benny.




 igor.vaynberg wrote:

 create a custom request cycle and put this stuff in
 requestcycle#onbeginrequest

 -igor

 On Sun, Aug 10, 2008 at 11:15 PM, Benny Weingarten
 [EMAIL PROTECTED] wrote:

 Hello.

 I'm writing a wicket application for facebook, but I think my problem
 may
 be
 common to many wicket applications.

 In my case, I'm using the wicket-facebook authentication strategy that
 is
 described in a different thread here on nabble. That works great - when
 a
 page is rendered, the AuthenticationStrategy makes sure that I have a
 valid
 FacebookRestClient object in my session.
 In my application I need to do some other init stuff in a service
 class,
 and I do that in the onUnauthorizedInstantiation method. This init
 information is stored in a ThreadLocal variable in my BACKEND-Service.
 This
 is an important point, because wicket uses many different threads for
 user
 requests, so I need to make sure that in the beginning of each render
 request, the init information is stored on THAT REQUEST's thread.

 ALL my components in all my pages and panels try to fetch information
 from
 the BACKEND-Service. If the BACKEND-Service hasn't been initialized
 with
 the
 init information on the ThreadLocal variable on the same thread that
 the
 render request is issued on, an exception would be thrown and the page
 would
 fail to render.

 This is all great when a user is browsing through PAGES. However, in
 one
 page I have a tabbedpanel. When first the user loads the page, the
 authorization strategy kicks in, and the init actions are performed,
 the
 page renders correctly.

 *** and here is my problem:
 when the user clicks on the second tab in the page, the request can be
 made
 from a different thread (wicket controls that), but the init stuff is
 not
 performed because it is not a new page that needs to be rendered. This
 problem also arises when I use ajax components.

 I thought of putting the init stuff in the onBeforeRender() method of
 each
 separate component that requires the init information.

 Would this be the preferred way of doing init actions for components?

 Thanks,
 Benny.
 --
 View this message in context:
 http://www.nabble.com/Pre-render-action-common-to-all-pages-tp18920691p18920691.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]




 --
 View this message in context:
 http://www.nabble.com/Pre-render-action-common-to-all-pages-tp18920691p18963966.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: Pre render action common to all pages

2008-08-13 Thread Benny Weingarten

Thanks Igor.

I have done that, and it is exactly what I was looking for.

However, I have noticed something that strikes me odd:
on every request to render a page in my application (every time I click a
link in my application to another page in my application), the method
newRequestCycle() in WebApplication is called numerous times, and
subsequently, my pre-render actions are performed many times. Is this
expected? shouldn't one page require only one RequestCycle?

thanks,
Benny.




igor.vaynberg wrote:
 
 create a custom request cycle and put this stuff in
 requestcycle#onbeginrequest
 
 -igor
 
 On Sun, Aug 10, 2008 at 11:15 PM, Benny Weingarten
 [EMAIL PROTECTED] wrote:

 Hello.

 I'm writing a wicket application for facebook, but I think my problem may
 be
 common to many wicket applications.

 In my case, I'm using the wicket-facebook authentication strategy that is
 described in a different thread here on nabble. That works great - when a
 page is rendered, the AuthenticationStrategy makes sure that I have a
 valid
 FacebookRestClient object in my session.
 In my application I need to do some other init stuff in a service
 class,
 and I do that in the onUnauthorizedInstantiation method. This init
 information is stored in a ThreadLocal variable in my BACKEND-Service.
 This
 is an important point, because wicket uses many different threads for
 user
 requests, so I need to make sure that in the beginning of each render
 request, the init information is stored on THAT REQUEST's thread.

 ALL my components in all my pages and panels try to fetch information
 from
 the BACKEND-Service. If the BACKEND-Service hasn't been initialized with
 the
 init information on the ThreadLocal variable on the same thread that
 the
 render request is issued on, an exception would be thrown and the page
 would
 fail to render.

 This is all great when a user is browsing through PAGES. However, in one
 page I have a tabbedpanel. When first the user loads the page, the
 authorization strategy kicks in, and the init actions are performed, the
 page renders correctly.

 *** and here is my problem:
 when the user clicks on the second tab in the page, the request can be
 made
 from a different thread (wicket controls that), but the init stuff is
 not
 performed because it is not a new page that needs to be rendered. This
 problem also arises when I use ajax components.

 I thought of putting the init stuff in the onBeforeRender() method of
 each
 separate component that requires the init information.

 Would this be the preferred way of doing init actions for components?

 Thanks,
 Benny.
 --
 View this message in context:
 http://www.nabble.com/Pre-render-action-common-to-all-pages-tp18920691p18920691.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Pre-render-action-common-to-all-pages-tp18920691p18963966.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]



Pre render action common to all pages

2008-08-11 Thread Benny Weingarten

Hello.

I'm writing a wicket application for facebook, but I think my problem may be
common to many wicket applications.

In my case, I'm using the wicket-facebook authentication strategy that is
described in a different thread here on nabble. That works great - when a
page is rendered, the AuthenticationStrategy makes sure that I have a valid
FacebookRestClient object in my session.
In my application I need to do some other init stuff in a service class,
and I do that in the onUnauthorizedInstantiation method. This init
information is stored in a ThreadLocal variable in my BACKEND-Service. This
is an important point, because wicket uses many different threads for user
requests, so I need to make sure that in the beginning of each render
request, the init information is stored on THAT REQUEST's thread. 

ALL my components in all my pages and panels try to fetch information from
the BACKEND-Service. If the BACKEND-Service hasn't been initialized with the
init information on the ThreadLocal variable on the same thread that the
render request is issued on, an exception would be thrown and the page would
fail to render.

This is all great when a user is browsing through PAGES. However, in one
page I have a tabbedpanel. When first the user loads the page, the
authorization strategy kicks in, and the init actions are performed, the
page renders correctly. 

*** and here is my problem:
when the user clicks on the second tab in the page, the request can be made
from a different thread (wicket controls that), but the init stuff is not
performed because it is not a new page that needs to be rendered. This
problem also arises when I use ajax components. 

I thought of putting the init stuff in the onBeforeRender() method of each
separate component that requires the init information.

Would this be the preferred way of doing init actions for components? 

Thanks,
Benny.
-- 
View this message in context: 
http://www.nabble.com/Pre-render-action-common-to-all-pages-tp18920691p18920691.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]



Absolute URL mounting for wicket links in a facebook application

2008-08-10 Thread Benny Weingarten

I am trying to have restful URLs for my facebook application.
These links are DYNAMIC, so I can't put them in the markup. I have to use
some sort of wicket Link component.

I have posted this question as a reply on an old thread, with little
responses... so I'm trying to repost in a new thread.:working:

I have tried to follow instruction from the forum here, but I got to a dead
end. Here is my declaration inside MyApp.java.init():

QueryStringUrlCodingStrategy page1URLS = new
QueryStringUrlCodingStrategy(
page1,
Page1.class
);
mount(page1URLS);

QueryStringUrlCodingStrategy page2URLS = new
QueryStringUrlCodingStrategy(
http://apps.facebook.com/myapp/page2;,
Page2.class
);
mount(page1URL2);


my application is run in an IFrame in facebook. when I use a
BookmarkablePageLink to link to page1 and page2, The links render to have
the following values:
page1: http://localhost:8080/some-directory/page1?some_param=29
page2: http://apps.facebook.com/bennyworkbook/page2?some_param=2

clicking page1 link works perfectly. however, If the link is bookmarked or
saved by the user, and accessed later, the application is loaded outside the
facebook realm. I would like the links to all point to facebook, so
bookmarking them would link to my application's page ON FACEBOOK.

page2 link looks perfect, because it links to facebook. However, it doesn't
work. I get a 4040 with the following error:
The requested resource (/page2) is not available.

any ideas how I can have all the links look like page2 link but work good
(link page1 link)?

thanks,
Benny. 
-- 
View this message in context: 
http://www.nabble.com/Absolute-URL-mounting-for-wicket-links-in-a-facebook-application-tp18920465p18920465.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: Facebook Wicket Integration

2008-08-07 Thread Benny Weingarten

Thanks Cao, but I don't see how this helps me.

Let me further explain my situation. 
1) I need to display links to the users of my facebook application. These
links are DYNAMIC, so I can't put them in the markup. I have to use some
sort of wicket Link component.

2) In your example, the URLs are relative URLs, as opposed to the absolute
URLs that I want to display to the user.

In my application, all the links (currently) are relative links, i.e. when I
hover over the link when the application is running in facebook, the URL
displayed at the bottom left corner of the screen is:
http://my-server-doamin/page-address
But I would want them to be:
http://apps.facebook.com/application-name/page-address

My trouble with achieving this is described at my previous post on this
thread. Any further assistance on this matter would be appreciated.

thanks,
Benny.


caoanhkiet wrote:
 
 I think you had come to
 http://wiki.developers.facebook.com/index.php/FBML.
 My demo use FBML's tab, for example:
 fb:tabs
   fb:tab-item href=?wicket:bookmarkablePage=%3Areno.GuestBook title='Go
 GuestBook' /
   fb:tab-item href=?wicket:bookmarkablePage=%3Areno.Invite
 title='Invite' /
 /fb:tabs
 my package is src\reno that include all my page.
 
 Sender
 Cao Anh Kiet
 website: http://www.renovationsoft.com
 
 
 Benny Weingarten wrote:
 
 I am also trying to have restful URLs for my facebook application.
 
 I have tried to follow the instruction here, but I got to a dead end.
 Here is my declaration inside MyApp.java.init():
 
  QueryStringUrlCodingStrategy page1URLS = new
 QueryStringUrlCodingStrategy(
  page1,
 Page1.class
 );
 mount(page1URLS);
 
 QueryStringUrlCodingStrategy page2URLS = new
 QueryStringUrlCodingStrategy(
  http://apps.facebook.com/myapp/page2;,
 Page2.class
 );
  mount(page1URL2);
 
 
 my application is run in an IFrame in facebook. when I use a
 BookmarkablePageLink to link to page1 and page2, I get the following
 urls:
 page1: http://localhost:8080/some-directory/page1?some_param=29
 page2: http://apps.facebook.com/bennyworkbook/page2?some_param=2
 
 clicking page1 link works perfectly. however, If the link is bookmarked
 or saved by the user, and accessed later, the application is loaded
 outside the facebook realm. I would like the links to all point to
 facebook, so bookmarking them would link to my application's page ON
 FACEBOOK.
 
 page2 link looks perfect, because it links to facebook. However, it
 doesn't work. I get a 4040 with the following error:
 The requested resource (/page2) is not available.
 
 any ideas how I can have all the links look like page2 link but work good
 (link page1 link)?
 
 thanks,
 Benny.
 
 
 caoanhkiet wrote:
 
 Hi,
 I have been following
 http://cwiki.apache.org/WICKET/facebook-integration.html and version
 tomcat 5.5.25. and ran NullPointerException.
 
 error at: client.friends_get();
 
 SEVERE: Can't instantiate page using constructor public Login()
 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public Login()
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:92)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:268)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
 at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
 at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363)
 at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117

Re: Facebook Wicket Integration

2008-08-06 Thread Benny Weingarten

I am also trying to have restful URLs for my facebook application.

I have tried to follow the instruction here, but I got to a dead end. Here
is my declaration inside MyApp.java.init():

QueryStringUrlCodingStrategy page1URLS = new
QueryStringUrlCodingStrategy(
page1,
Page1.class
);
mount(page1URLS);

QueryStringUrlCodingStrategy page2URLS = new
QueryStringUrlCodingStrategy(
http://apps.facebook.com/myapp/page2;,
Page2.class
);
mount(page1URL2);


my application is run in an IFrame in facebook. when I use a
BookmarkablePageLink to link to page1 and page2, I get the following urls:
page1: http://localhost:8080/some-directory/page1?some_param=29
page2: http://apps.facebook.com/bennyworkbook/page2?some_param=2

clicking page1 link works perfectly. however, If the link is bookmarked or
saved by the user, and accessed later, the application is loaded outside the
facebook realm. I would like the links to all point to facebook, so
bookmarking them would link to my application's page ON FACEBOOK.

page2 link looks perfect, because it links to facebook. However, it doesn't
work. I get a 4040 with the following error:
The requested resource (/page2) is not available.

any ideas how I can have all the links look like page2 link but work good
(link page1 link)?

thanks,
Benny.


caoanhkiet wrote:
 
 Hi,
 I have been following
 http://cwiki.apache.org/WICKET/facebook-integration.html and version
 tomcat 5.5.25. and ran NullPointerException.
 
 error at: client.friends_get();
 
 SEVERE: Can't instantiate page using constructor public Login()
 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public Login()
   at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
   at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
   at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:92)
   at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:268)
   at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
   at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
   at
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
   at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
   at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363)
   at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
   at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 

-- 
View this message in context: 
http://www.nabble.com/Facebook-Wicket-Integration-tp16558748p18850389.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: Page specific authorization

2008-07-28 Thread Benny Weingarten

Yes, I meant the RestartResponseException.

So indeed, if there is no way to access page parameters from the context of
the method isInstantiationAuthorized or isActionAuthorized (ANY INPUT ON
THIS MATTER will be appreciated :-), I will do the authorization check in
the constructor.

thanks!
Benny.



Mr Mean wrote:
 
 On Sun, Jul 27, 2008 at 4:30 PM, Benny Weingarten [EMAIL PROTECTED]
 wrote:

 Hello.

 First let me congratulate this forum - I have always gotten wonderful
 responses.

 In my application I have a bookmarkable picture viewing page. That page
 should only be viewed by users who have permission. The permissions are
 stored in the DB.

 When a user that doesn't have permission tries to access the page, I want
 him to be redirected to the picture browsing page, with an error
 message
 explaining that he has no permissions to view the picture he was trying
 to
 access.

 I have read the RoleAuthorizationStrategy and PageAuthorizationStrategy
 classes and examples, and haven't found a way to make them work for me.
 That
 is because, in order ot determind the permission, I need the
 currentUserID,
 and the pictureID. The currentUserID is easy anough to obtain through the
 session, but the pictureID is passed as a parameter to the constructor of
 the PicturePage.

 public PicturePage(long pictureID) {
 ... build the picture page
 }

 This parameter isn't available (As far as I know) to the
 isPageAuthorized(Class pageClass) method of PageAuthorizationStrategy.

 Thus, I have resolved to perform the authorization check at the
 constructor
 of the PicturePage. Is this the correct way of implementing this kind of
 authorization?
 
 Yes this is a good place to perform any check where you need more then
 just the class info. The drawback is that your page is constructed for
 the most part which could mean that valuable time/resources have been
 wasted should you decline the request at this point.
 

 In addition, I don't know if it is good practice to throw a
 RedirectException from the isPageAuthorized() method?
 
 Considering that isInstantiationAuthorized (which calls that method
 will trigger an exception if you return false, it is allright to throw
 an exception, however i hope you mean you throw a
 RestartResponseException? If not you should use that.
 
 Maurice
 

 thanks,
 Benny.
 --
 View this message in context:
 http://www.nabble.com/Page-specific-authorization-tp18676911p18676911.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Page-specific-authorization-tp18676911p18684771.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]



Page specific authorization

2008-07-27 Thread Benny Weingarten

Hello.

First let me congratulate this forum - I have always gotten wonderful
responses.

In my application I have a bookmarkable picture viewing page. That page
should only be viewed by users who have permission. The permissions are
stored in the DB.

When a user that doesn't have permission tries to access the page, I want
him to be redirected to the picture browsing page, with an error message
explaining that he has no permissions to view the picture he was trying to
access.

I have read the RoleAuthorizationStrategy and PageAuthorizationStrategy
classes and examples, and haven't found a way to make them work for me. That
is because, in order ot determind the permission, I need the currentUserID,
and the pictureID. The currentUserID is easy anough to obtain through the
session, but the pictureID is passed as a parameter to the constructor of
the PicturePage. 

public PicturePage(long pictureID) {
... build the picture page
}

This parameter isn't available (As far as I know) to the
isPageAuthorized(Class pageClass) method of PageAuthorizationStrategy.

Thus, I have resolved to perform the authorization check at the constructor
of the PicturePage. Is this the correct way of implementing this kind of
authorization?

In addition, I don't know if it is good practice to throw a
RedirectException from the isPageAuthorized() method?

thanks,
Benny.
-- 
View this message in context: 
http://www.nabble.com/Page-specific-authorization-tp18676911p18676911.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]



Feedback message across pages or tabs

2008-07-24 Thread Benny Weingarten

Hello,

I have searched the web for examples of what I'm trying to achieve, but
could not find one. Here it is:

I have a page that is used to create a user. Once the fields are filled, the
user is redirected to a page that allows him to upload a picture to his
newly created profile. 

I want the picture upload page to display a user creation success
information panel, IIF the user has been redirected to the picture upload
page from the user create page. Note, that the picture upload page can
be accessed from various points in the web application, and in those
occurrences, I don't want to display any special message at all.

I have thought about adding a constructor to the picture upload page that
would accept special messages. e.g:
public PictureUploadPage(String specialMessage)

but I think that is too ugly. In addition, I want the message to disappear
after a refresh, just like the behaviour of a FeedbackPanel. The best thing
would be if I could share a Feedback panel between pages, or a
FeedbackMessage across pages. 

Any suggestions on how I can accomplish this elegantly?

thanks,
Benny.
-- 
View this message in context: 
http://www.nabble.com/Feedback-message-across-pages-or-tabs-tp18633013p18633013.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: FeedbackPanel and page refresh (f5) after submit

2008-06-26 Thread Benny Weingarten

I am fronting a similar problem. My users don't refresh, they go back and
forward using the browser's back and forward buttons.

In my wicket application, I have a FeedbackPanel in my page that displays
error or success, depending on whether the form submitted successfully or
not. My Form is a personal information edit form, in which a user can change
information about themselves (such as name, interests, hobbies, etc`..)

Lets say a user does the following in the form:
1) changes a hobby, submit the form (success). A success message is
idsplayed via the FeedbackPanel
2) blanks the name field, submit the form (failure. In wicket terms, the
validation failed on the TexfField Model object, and the Form's onError
method was called) an error message displayed via the Feedback Panel
3) changes the name field to a valid name, then submit.  (success). A
success message is displayed via the FeedbackPanel

At this point, if the user clicks on the browser's back button, I would
expect the form to be visible with the erroneous name field, and the error
message. However, the form is displayed with the value entered at (3),
without any error message.

User clicks back again and I would expect the form to display the new hobby
field, with the success message from (1).  What I see is the same page as
after (3), with no feedback message.

Its as if once I submit the form, the previous values of the form are not
retained. I am calling setVersioned(true) on the form, and according to the
docuumentation that should make the form retian previous states, but it
doesn't seem to work. 
Suggestions?


SantiagoA wrote:
 
 feedbackMessages are stored to show them once, aftewards they were
 deleted. Perhaps, try to store them in your own List and feed the
 FeedbackPanel with the List when the page is displayed again. Maybe this
 work, i´m not sure about that. ;-)
 
 -Santiago
 
 
 Thomas Lutz wrote:
 
 Hi,
 
 First of all, great framework !
 
 I've a form with some validation added, nothing special (Required, Email 
 check). When I submit the form I get the validation messages in the 
 FeedbackPanel as expected, but :-), hitting f5 for a page refresh after 
 the submit removes them (don't ask why refresh after submit... users of 
 my webapp do stuff like this :-)).
 The form is not submitted, only redisplayed, but the validation messages 
 are missing.
 Is there something I can do about this ?
 
 Thanks in advance,
 Tom
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p18128149.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]