Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-05 Thread TH Lim
This worked. It didn't do a POST/REDIRECT/GET when I posted from Javascript
and/or HTML Form. This solution works great because, as you mentioned, I can
use  @SpringBean and other Wicket features along side with it. Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4360263.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.IMarkupCacheKeyProvider;
import org.apache.wicket.markup.IMarkupResourceStreamProvider;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.StringResourceStream;

public class AppLogin extends WebPage implements IMarkupCacheKeyProvider,
IMarkupResourceStreamProvider
{
public AppLogin(PageParameters params) {
setStatelessHint(true);
startAsyncProcss(params);
}

private void startAsyncProcss(PageParameters params)
{
// start asynchronous process with POSTed param
}

@Override
public String getCacheKey(MarkupContainer components, Class? aClass)
{
return null;
}

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer
components, Class? aClass)
{
return new StringResourceStream(?xml version=\1.0\?ok /);
}

@Override
protected void configureResponse(WebResponse response)
{
super.configureResponse(response);
response.setContentType(text/xml);
}
}

Thanks. 

http://apache-wicket.1842946.n4.nabble.com/file/n4354074/p-r-g.png 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4354074.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
The original constructor was

public class AppLogin extends WebPage implements IMarkupCacheKeyProvider,
IMarkupResourceStreamProvider 
 { 
public AppLogin(PageParameters params) { 
setStatelessHint(true); 
startAsyncProcss(params);  
*  throw new RestartResponseException(new PageProvider(getClass(), params),
RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT);
*}

The additional code, in bold, caused stackoverflow exception. This page
would be invoked by JavaScript call.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4354166.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
I tried and observed the PRG behavior as before. Even if it had worked, for
every page I need to an additional transfer page. I don't think this is a
good solution.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4354302.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
Thanks for your help so far. It would be great if you could pass me some
hints to allow me to do some research on my own. Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4354785.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
What I want is a very simple end point to service a POST request originated
from my JS using AJAX. What I was expecting was to do a POST and returned an
acknowledgement as response. What happened was, after the  POST request, the
browser received a HTTP 302 to redirect the browser to GET the final
response. I can see these states using the browser debugging tool. How do I
set this page to do what I was expecting?  thanks


P-R-G,  http://en.wikipedia.org/wiki/Post/Redirect/Get Post/Redirect/Get 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4354872.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-03 Thread TH Lim
I could use a servlet. I thought I could easily setup a Wicket page to do
something similar. Since I have @SpringBean ready to load services and DAOs.
I was almost there. Just that I couldn't get the NEVER_REDIRECT directive
work on a per page basis instead of global. 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4355044.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-02 Thread TH Lim
Is it possible to set the redirect feature localized to a page instead of
every page? There are 2 out 10 pages I don't want to redirect. Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4351160.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-02 Thread TH Lim
I have compilation error with this statement. Any help here would be great.
And I suppose I put this line of code at the end of my web page constructor,
right?


Martin Grigorov-4 wrote
 
 On Thu, Feb 2, 2012 at 1:27 PM, TH Lim lt;sshark@gt; wrote:
 Is it possible to set the redirect feature localized to a page instead of
 every page? There are 2 out 10 pages I don't want to redirect. Thanks
 
 Experiment with new RestartResponseException(new
 PageProvider(YourPage.class, PageParameters),
 RedirectPolicy.NEVER_REDIRECT)
 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4353522.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Unnecessary 302 redirects in Wicket 1.5

2012-02-02 Thread TH Lim
The compilation error was my fault. I tried and it didn't work. Probably I
missed something. What I did was throw the RestartResponseException at the
end of the said page and StackOverflowException was thrown, quite obvious to
me what has happened. With my limited knowledge of Wicket internal working
mechanism, I think RestartResponseException was not the right solution. What
I understood was a page accepted a request, redirected the request to a page
targeted by the exception. it basically worked like P-R-G.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unnecessary-302-redirects-in-Wicket-1-5-tp3921623p4353854.html
Sent from the Users forum mailing list archive at Nabble.com.

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



getAssociatedMarkup() invoked twice

2012-01-08 Thread TH Lim
Hi,

I made my custom markup WebPage, not the default HTML and WebPage pair, to
generate JSON responses. My custom WebPage implemented
IMarkupCacheKeyProvider and IMarkupResourceStreamProvider interfaces.

I come to realize that my implementation of
IMarkupResourceStreamProvider.getMarkupResourceStream(...) was invoked twice
for every request. Upon further investigation, I found out that the Wicket
(1.5.x and 6.x) core code in Component.getMarkup() was the source of this. 

...
if (container.hasAssociatedMarkup())
{
markup = container.getAssociatedMarkup();
return markup;
}
...

where container.hasAssociatedMarkup() will also invoke getAssociateMarkup()
i.e.

public boolean hasAssociatedMarkup()
{
return getAssociatedMarkup() != null;
}

As a result, my IMarkupResourceStreamProvider.getMarkupResourceStream(...)
is invoked twice. What I did now is I override hasAssociatedMarkup() to
return a true to avoid my implementation to be invoked twice. My question
is, is this the way going forward or is there a better way of doing this?

Thanks

/lim/


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getAssociatedMarkup-invoked-twice-tp4277728p4277728.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Does [Parent|Child]HeaderRenderStrategy work with wicket:head tag?

2011-11-17 Thread TH Lim
Bug posted

https://issues.apache.org/jira/browse/WICKET-4235

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Does-Parent-Child-HeaderRenderStrategy-work-with-wicket-head-tag-tp4075161p4079254.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Purely XML / JSON Result Page

2011-11-17 Thread TH Lim
Thanks for the tips.

I some help here too (in case anyone looking for the similar solution)

http://stackoverflow.com/questions/2086732/dynamic-markup-in-wicket

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Purely-XML-JSON-Result-Page-tp4075558p4079390.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Does [Parent|Child]HeaderRenderStrategy work with wicket:head tag?

2011-11-15 Thread TH Lim
I am using Wicket 1.5.x with wicket:head tag. I tried rendering the child
component (Wicket Panel) CSS / JS 1st then followed by the parent. It didn't
work. It always renders the parent (Wicket WebPage) JS 1st. I used
-DWicket_HeaderRenderStrategy=org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy
or ParentFirstHeaderRenderStrategy and it rendered the same HTML output. Do
these header renderers strategy works with wicket:head tag at all?

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Does-Parent-Child-HeaderRenderStrategy-work-with-wicket-head-tag-tp4075161p4075161.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Purely XML / JSON Result Page

2011-11-15 Thread TH Lim
With Wicket 1.5, can we have a WebPage that serves XML / JSON without having
an associated XML or HTML page? I understood how XMLPage.java example works
but I just wander if we could do *without* the additional template file with
a simple Wicket Label and stream tens of megabytes of XML/JSON as output? 

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Purely-XML-JSON-Result-Page-tp4075558p4075558.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Use Wicket 1.5 to serve text/xml content type (Rest-style)

2011-11-08 Thread TH Lim
try reversing the statements in configureResponse(...) body 


@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setContentType(text/xml);

}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Wicket-1-5-to-serve-text-xml-content-type-Rest-style-tp4018490p4018575.html
Sent from the Users forum mailing list archive at Nabble.com.

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



keygen tag

2010-09-10 Thread TH Lim

Hi,

I am want to use keygen,
https://developer.mozilla.org/En/HTML/Element/keygen, form component and
there is no Wicket equivalent FormComponent. Any suggestion on how do I
extend an existing component to cover this tag. 

Thanks

/lim/
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/keygen-tag-tp2534735p2534735.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Mulitple Forms in ListView

2010-07-01 Thread TH Lim

Sorry I didn't test it before I replied. Your solution didn't work because
for non-Ajax submit both forms r submitted. Non-ajax submit submits the page
instead of individual form in Ajax style.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2274681.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Mulitple Forms in ListView

2010-06-30 Thread TH Lim

Thank you for providing a solution to that.

It not so much of the solution I am looking for. I am curious why it didn't
work out of the box for non-Ajax submit but it works for AjaxSubmitLink.
Basically the code to determine if the FormComponent is the child of the
container is the same but for some reasons it didn't work out for non-Ajax
submit.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2274628.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Mulitple Forms in ListView

2010-06-29 Thread TH Lim

Hi,

I have multiple forms in a ListView. So in order not to show the same error
messages in all feedback panels I use ContainerFeedbackMessageFilter to
filter the error messages. This didn't work and the warning was
Component-targetted feedback message was left unrendered. This could be
because you are missing a FeedbackPanel on the page. because I use non-Ajax
form submit. 

However, if I switch to AjaxSubmitLink the problem was solved. It worked as
expected. My question is should I use Ajax submit with multiple forms in a
ListView? Am I missing anything here because the problem didn't surface for
a page with multiple forms using non-Ajax submit. 

Thanks

/lim/

Codes are included below.

html
body
ul
li wicket:id=listView
form wicket:id=form
input wicket:id=textfield /
div wicket:id=feedback/div
!--input type=submit wicket:id=submitALink /--
input type=submit  /
/form
/li
/ul
/body
/html

public MultiFormPage()
{
ListViewString listView = new ListViewString(listView,
Arrays.asList(new String[]{a, b}))
{
@Override
protected void populateItem(ListItem item)
{
Form form  = new Form(form)
{
@Override
protected void onSubmit()
{

}
};
//Form form = new Form(form);
final FeedbackPanel feedback = new FeedbackPanel(feedback,
new ContainerFeedbackMessageFilter(form));
/*
form.add(new AjaxSubmitLink(submitALink)
{
@Override
protected void onSubmit(AjaxRequestTarget target,
Form? form)
{
target.addComponent(feedback);
}

@Override
protected void onError(AjaxRequestTarget target, Form?
form)
{
target.addComponent(feedback);
}
});
*/
form.add(new RequiredTextFieldString(textfield, new
Model()));
form.add(feedback.setOutputMarkupId(true));
item.add(form);
}
};

add(listView);
}
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mulitple-Forms-in-ListView-tp2272668p2272668.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Cache oddity ... maybe

2009-04-10 Thread TH Lim

I have briefly looked at ur codes. Have u checked if your code has not
executed the refresh / reload routine? Some methods are not executed in
AJAX. Sorry I can't tell u what methods offhand. If you placed your code in
those methods then ur new items will not be loaded but it will when u do a
page refresh. This has happened to me before. 
-- 
View this message in context: 
http://www.nabble.com/Cache-oddity-...-maybe-tp22889814p22983675.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Dojo Tooltip JS Error (And Mootips)

2009-04-06 Thread TH Lim

As I went thru the new wicketstuff-core, I found there is a lightbox for
JQuery. I suppose we could use   lightbox for JQuery for those who move to
Wicket-1.4. Sorry I haven't gone in details but I presume it has the same
style and serves the same purpose.


nino martinez wael wrote:
 
 wicketstuff core.. But the common js lib are something that the
 libraries so use internally. Like Dojo, scriptaculous or minies.. So
 the thing would be to patch both to use that..
 
 2009/4/4 TH Lim ssh...@gmail.com:

 Are you refering to Wicket core or  wicketsutff-core? Where do I find
 this
 common JS library?

 I have made minor changes in lightbox-1.0.3. to be compliant with
 Wicket-1.4
 API. How do I check in the changes? Instead can I add to wicketstuff-core
 instead?

 Thanks

 /lim/


 nino martinez wael wrote:

 Bad it seem that we have a lot of clashes.. So the libs needs to be
 cleaned.. I know Jeremy has done an effort in wicket core by supplying a
 common js library..


 --
 View this message in context:
 http://www.nabble.com/Dojo-Tooltip-JS-Error-tp22164739p22886339.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/Dojo-Tooltip-JS-Error-tp22164739p22909815.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Cache oddity ... maybe

2009-04-05 Thread TH Lim

For starter, I would remove the filter and Hibernate codes, to localize the
problem to Wicket.

It helps if you could provide a snippet of the code or better if u can
provide working code of the problem u encounter.



luther.baker wrote:
 
 I have a page that displays a list of Titles.
 
 I have a few links off this page that take you to a second page where you
 can either
 
 a) create a new Title
 b) edit an existing Title
 c) delete an existing Title
 
 The onClick handlers for b and c create the destination page with the
 selected object where as option a simply prepares a blank form for the
 user
 to type in. In this simplistic case, a Title is simply a bare-bones Entity
 with just a Long id and a String name.
 
 All is fine -- except on the very first action. The very first meaning,
 right after I rebuild and restart the application. After ADDING a new
 Title
 - the onSubmit handler of that page simply sets the response page which is
 a
 POJO page that takes no arguments.
 
 That original page comes up - but the listing of Titles is always missing
 the very last one I entered. If I refresh the screen - all is well. If I
 add
 25 more Titles, they always show up right away - ie: as soon as page 2
 directs me back to page 1. But for some reason, the very first time - the
 new entry doesn't show up upon returning the first listing page.
 
 I am using some nominal Ajax on the 2nd page to go back and forth between
 viewing and editing ... but the final submit is always a full refresh back
 to the original page. I recently added b and c ... and oddly enough ...
 the
 edits or deletes do not show up on the first page ... the first time after
 a
 rebuild and restart ... but then work consistently everytime after that.
 
 Thoughts? Any quick thoughts as to what migh be going on in my env? For
 what
 its worth - I have an outer filter that is creating and commiting
 Hibernate
 transactions and they are firing as expected ...
 
 Thanks in advance,
 
 -Luther
 
 

-- 
View this message in context: 
http://www.nabble.com/Cache-oddity-...-maybe-tp22889814p22891364.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Dojo Tooltip JS Error (And Mootips)

2009-04-04 Thread TH Lim

Are you refering to Wicket core or  wicketsutff-core? Where do I find this
common JS library? 

I have made minor changes in lightbox-1.0.3. to be compliant with Wicket-1.4
API. How do I check in the changes? Instead can I add to wicketstuff-core
instead?

Thanks

/lim/


nino martinez wael wrote:
 
 Bad it seem that we have a lot of clashes.. So the libs needs to be 
 cleaned.. I know Jeremy has done an effort in wicket core by supplying a 
 common js library..
 

-- 
View this message in context: 
http://www.nabble.com/Dojo-Tooltip-JS-Error-tp22164739p22886339.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Multiple Forms in A Border

2009-03-01 Thread TH Lim

I found out that this exception only happened to Wicket-1.4. I tried Wicket
1.3.5 and it worked fine. I presume all Wicket 1.3.x works too.
-- 
View this message in context: 
http://www.nabble.com/Multiple-Forms-in-A-Border-tp22252817p22273577.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Multiple Forms in A Border

2009-02-27 Thread TH Lim

I am using Wicket-1.4-SNAPSHOT libraries. I have a  page with multiple forms.
These forms are within a Border as shown in the HTML below

html
body
   div wicket:id=border
   form wicket:id=form1
   input wicket:id=quantity1 /br/
   input type=submit value=Quantity1 /
   /formbr/
   form wicket:id=form2
   input wicket:id=quantity2 /br/
   input type=submit value=Quantity2 /
   /formbr/
   /div
/body
/html

The Wicket code to this page is

public class CommonModelPage extends WebPage
{
private static final long serialVersionUID = 1L;

int quantity1;
int quantity2;

public CommonModelPage()
{
CommonBorder border = new CommonBorder(border);
add(border);

Form form1 = new Form(form1);
border.add(form1);

form1.add(new TextField(quantity1, new PropertyModel(this,
quantity1)));

Form form2 = new Form(form2);
border.add(form2);

form2.add(new TextField(quantity2, new PropertyModel(this,
quantity2)));
}

public int getQuantity1()
{
return quantity1;
}

public void setQuantity1(int quantity1)
{
this.quantity1 = quantity1;
}

public int getQuantity2()
{
return quantity2;
}

public void setQuantity2(int quantity2)
{
this.quantity2 = quantity2;
}
}

CommonBorder is an empty border class with no Wicket components and simple
HTML texts. The problem was when I submitted form1 or form2 I get this
exception

WicketMessage: Can't convert null value to a primitive class: int for
setting it on [Page class = CommonModelPage, id = 10, version = 0]


I found 2 unlikely way to circumvent this exception: -
1. Do not use Border. 
2. Change quantity1 and quantity2 type from int to Integer.

My question is why does this happen? Ain't form1 and form2 are independent?
Do I need to change anything to Border to make this work?

Thanks

/lim/



-- 
View this message in context: 
http://www.nabble.com/Multiple-Forms-in-A-Border-tp22252817p22252817.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: CSS Arrangement Order

2009-02-02 Thread TH Lim

I tried writing it on the HTML file and using HeaderContributors. Somehow the
CSS file that I included in my HTML or .java file is always place 1st
followed by the libraries / components CSS.


Michael Sparer wrote:
 
 I'd say just write in in there ;-)
 
 Other possiblities are the use of HeaderContributors (see class
 HeaderContributor) also have a look at
 http://techblog.molindo.at/2008/08/wicket-interface-speed-up-merging-resources-for-fewer-http-requests.html
 which might interest you if a lot of your pages/panels come up with their
 own css
 
 regards,
 Michael
 
 
 TH Lim wrote:
 
 Hi,
 
 How do I arrange my CSS declaration order? For example, the current order
 is 
 
 ...
 head
 ... some script tags removed
 link rel=stylesheet type=text/css href=css/style.css /
 link rel=stylesheet type=text/css href=resources/com.acme/box.css
 /
 link rel=stylesheet type=text/css
 href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css
 /
 /head
 body
 ...
 
 resources/com.acme/box.css and
 resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css
 are CSS included with the libraries / components I used in my web
 application. How do I make my own CSS,css/style.css, to be placed after
 these CSS in head?
 
 Thanks
 
 /lim/
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/CSS-Arrangement-Order-tp21776162p21791475.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



CSS Arrangement Order

2009-02-01 Thread TH Lim

Hi,

How do I arrange my CSS declaration order? For example, the current order is 

...
head
... some script tags removed
link rel=stylesheet type=text/css href=css/style.css /
link rel=stylesheet type=text/css href=resources/com.acme/box.css /
link rel=stylesheet type=text/css
href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css
/
/head
body
...

resources/com.acme/box.css and
resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css
are CSS included with the libraries / components I used in my web
application. How do I make my own CSS,css/style.css, to be placed after
these CSS in head?

Thanks

/lim/

-- 
View this message in context: 
http://www.nabble.com/CSS-Arrangement-Order-tp21776162p21776162.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

Hi,

I am using Google collections with Wicket 1.3.4 and hit with this
serialization error.

ERROR - Objects- Error serializing object class
web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class: com.google.common.collect.LinkedListMultimap$1

I am pretty sure LinkedListMultimap is Serializable and I even did a test
i.e. obj instaceof Serializable

What am I missing here? Any input? Thanks.

/lim/


-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19027449.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

I am aware of the $1. I did the instanceof check in my code. I printed the
class name which is, of course, LinkedListMultimap$1 and it is indeed an
instanceof Serializable. So basically, LinkedListMultimap$1 implements
Serializable but it failed the checking at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:342).
I find this very puzzling.
 

Pierre Coquentin wrote:
 
 This is the anonymous inner class inside the LinkedListMultimap class
 which is not Serializable (LinkedListMultimap*$1*)
 Best regards
 
 Pierre
 
 
 TH Lim a écrit :
 Hi,

 I am using Google collections with Wicket 1.3.4 and hit with this
 serialization error.

 ERROR - Objects- Error serializing object class
 web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]]
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class: com.google.common.collect.LinkedListMultimap$1

 I am pretty sure LinkedListMultimap is Serializable and I even did a test
 i.e. obj instaceof Serializable

 What am I missing here? Any input? Thanks.

 /lim/


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

-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19027987.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

I tried another method. Instead of passing the reference to my IDataProvider
implementation, MyDataProvider, I recode MyDataProvider to get it from the
MySession which extends Wicket Session. I don't any difference here but it
works. I still not sure what caused MyDataProvider to fail to persist
because of the List instance it contained.  

Btw, 
http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java
LinkedListMultimap  uses the inner class Node which is also Serializable.


Michael Sparer wrote:
 
 The Serlializable-check isn't sufficient. you can mark any class
 serializable if you want. what really counts is that all fields of the
 class are serializable, you should have a look at them ...
 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19028815.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

Alright, if I pass LinkedListMultiMap instance into my IDataProvider
implementation, MyDataProvider, Wicket is able to persist. Whereas, if I
pass the List instance from LinkedListMultiMap.get(...), Wicket will throw
the unserializable exception. I presume something in LinkedListMultimap$1
made it not serializable. My initial thought that LinkedListMultimap$1 was a
serializable List was wrong.
-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19029050.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

No, I didn't save the provider in the session. Just the LinkedListMultimap
instance. As Martijn has pointed it out with the code snippet why $1 is not
serializable, the only way is to keep the LinkedListMultimap  and not the
List.

Wicket is pretty good. It points to the exact field where the problem was.

Thanks guys. 


Michael Sparer wrote:
 
 you save the provider to the session? that's kind of an anti-pattern as it
 gets serialized there anyway (at least in a clustered environment). you
 should rather boil down to the field that causes the not-serializable
 exception, wicket tells you exactly which field it is anyway. or provide
 us some code to help you. but if you inherit from sortabledataprovider or
 you implement IDataProvider it shouldn't be too difficult to find out
 which field it is ;-)
 
 regards,
 Michael
 
 TH Lim wrote:
 
 I tried another method. Instead of passing the reference to my
 IDataProvider implementation, MyDataProvider, I recode MyDataProvider to
 get it from the MySession which extends Wicket Session. I don't any
 difference here but it works. I still not sure what caused MyDataProvider
 to fail to persist because of the List instance it contained.  
 
 Btw, 
 http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java
 LinkedListMultimap  uses the inner class Node which is also Serializable.
 
 
 Michael Sparer wrote:
 
 The Serlializable-check isn't sufficient. you can mark any class
 serializable if you want. what really counts is that all fields of the
 class are serializable, you should have a look at them ...
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19033438.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

No, linkedlistmultimap  is serializable. only $1 is not. If you look at the
snippet the $1 class is created on the fly when linkedlistmultimap.get(...)
is invoked.


Michael Sparer wrote:
 
 but if you save the linkedlistmultimap (which isn't serializable, right?)
 in the session you'll run into problems as well ... at the latest in a
 clustered environment 
 
 
 
 TH Lim wrote:
 
 No, I didn't save the provider in the session. Just the
 LinkedListMultimap instance. As Martijn has pointed it out with the code
 snippet why $1 is not serializable, the only way is to keep the
 LinkedListMultimap  and not the List.
 
 Wicket is pretty good. It points to the exact field where the problem
 was.
 
 Thanks guys. 
 
 
 Michael Sparer wrote:
 
 you save the provider to the session? that's kind of an anti-pattern as
 it gets serialized there anyway (at least in a clustered environment).
 you should rather boil down to the field that causes the
 not-serializable exception, wicket tells you exactly which field it is
 anyway. or provide us some code to help you. but if you inherit from
 sortabledataprovider or you implement IDataProvider it shouldn't be too
 difficult to find out which field it is ;-)
 
 regards,
 Michael
 
 TH Lim wrote:
 
 I tried another method. Instead of passing the reference to my
 IDataProvider implementation, MyDataProvider, I recode MyDataProvider
 to get it from the MySession which extends Wicket Session. I don't any
 difference here but it works. I still not sure what caused
 MyDataProvider to fail to persist because of the List instance it
 contained.  
 
 Btw, 
 http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java
 LinkedListMultimap  uses the inner class Node which is also
 Serializable.
 
 
 Michael Sparer wrote:
 
 The Serlializable-check isn't sufficient. you can mark any class
 serializable if you want. what really counts is that all fields of the
 class are serializable, you should have a look at them ...
 
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034065.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: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim

No that not the reason. The reason I need to keep the items each user has
entered. I can be a List or Map but for this case linkedlistmultimap works
best for me. Do you have a better alternative? I would like to how know to
improve this.


Michael Sparer wrote:
 
 So you're putting an object into your session just because on of its
 public methods returns a not-serializable object?
 
 
 TH Lim wrote:
 
 No, linkedlistmultimap  is serializable. only $1 is not. If you look at
 the snippet the $1 class is created on the fly when
 linkedlistmultimap.get(...) is invoked.
 
 
 Michael Sparer wrote:
 
 but if you save the linkedlistmultimap (which isn't serializable,
 right?) in the session you'll run into problems as well ... at the
 latest in a clustered environment 
 
 
 
 TH Lim wrote:
 
 No, I didn't save the provider in the session. Just the
 LinkedListMultimap instance. As Martijn has pointed it out with the
 code snippet why $1 is not serializable, the only way is to keep the
 LinkedListMultimap  and not the List.
 
 Wicket is pretty good. It points to the exact field where the problem
 was.
 
 Thanks guys. 
 
 
 Michael Sparer wrote:
 
 you save the provider to the session? that's kind of an anti-pattern
 as it gets serialized there anyway (at least in a clustered
 environment). you should rather boil down to the field that causes the
 not-serializable exception, wicket tells you exactly which field it is
 anyway. or provide us some code to help you. but if you inherit from
 sortabledataprovider or you implement IDataProvider it shouldn't be
 too difficult to find out which field it is ;-)
 
 regards,
 Michael
 
 TH Lim wrote:
 
 I tried another method. Instead of passing the reference to my
 IDataProvider implementation, MyDataProvider, I recode MyDataProvider
 to get it from the MySession which extends Wicket Session. I don't
 any difference here but it works. I still not sure what caused
 MyDataProvider to fail to persist because of the List instance it
 contained.  
 
 Btw, 
 http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java
 LinkedListMultimap  uses the inner class Node which is also
 Serializable.
 
 
 Michael Sparer wrote:
 
 The Serlializable-check isn't sufficient. you can mark any class
 serializable if you want. what really counts is that all fields of
 the class are serializable, you should have a look at them ...
 
 
 
 
 
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034402.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: Does Session.getClientInfo() Always Return An Instance?

2008-07-14 Thread TH Lim

Ok understood. 

Lately, I found this exception in my log. Anyone know what are the possible
causes for this so I have a lead as to where to begin to trace the problem?
Thanks

ERROR: 2008-07-14 16:22:06,966: StandardWrapperValve: Servlet.service() for
servlet default threw exception
java.lang.NullPointerException
at org.apache.wicket.Session.getClientInfo(Session.java:555)
at com.xyz.web.MySession.init(MySession.java:48)


Ryan Gravener-3 wrote:
 
 Yes, it should always return an instance.
 
 On Fri, Jul 11, 2008 at 12:34 PM, TH Lim [EMAIL PROTECTED] wrote:
 

 Hi,

 Does Session.getClientInfo() always return a client info instance? Is it
 possible that this method will return null? If so, what is the cause to
 it?

 Thanks.

 --
 View this message in context:
 http://www.nabble.com/Does-Session.getClientInfo%28%29-Always-Return-An-Instance--tp18407471p18407471.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]


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

-- 
View this message in context: 
http://www.nabble.com/Does-Session.getClientInfo%28%29-Always-Return-An-Instance--tp18407471p18456721.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]



Does Session.getClientInfo() Always Return An Instance?

2008-07-11 Thread TH Lim

Hi,

Does Session.getClientInfo() always return a client info instance? Is it
possible that this method will return null? If so, what is the cause to it?

Thanks.

-- 
View this message in context: 
http://www.nabble.com/Does-Session.getClientInfo%28%29-Always-Return-An-Instance--tp18407471p18407471.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]



FeedbackPanel.anyErrorMessage() Strange Behavior

2008-07-08 Thread TH Lim

Hi,

My intention was to use the same feedback panel to show both info and error
messages. What I did was if there there is a mistake e.g. blank textfield,
feedback panel will display and error and expects the user to fix his
mistake and submit again. If the form is filled in accordingly, an info
message will inform him that his information is captured. The problem I
faced was, I used FeedbackPanel.anyErrorMessage() to check if any error was
attached to the panel otherwise show an acceptance message using
FeedbackPanel.info(...). However, the info message is not shown. If I didn't
invoke FeedbackPanel.anyErrorMessage() and use a boolean flag to track
errors, the info message will show. 

code
...
 if (messageModel.getObject() == null ||
messageModel.getObject().toString().length() == 0)
{
error(Message must not be empty.);
}
if (feedback.anyErrorMessage())
{
return;
}
// will not show in feedback panel when there is no error
info(Your message is  + messageModel.getObject());
...
/code

I have also included full codes to demonstrate what I mean. TQ

http://www.nabble.com/file/p18332776/TestFeedbackPanelPage.java
TestFeedbackPanelPage.java 
http://www.nabble.com/file/p18332776/TestFeedbackPanelPage.html
TestFeedbackPanelPage.html 
-- 
View this message in context: 
http://www.nabble.com/FeedbackPanel.anyErrorMessage%28%29-Strange-Behavior-tp18332776p18332776.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: Enable / Disable Container using AJAX

2008-07-03 Thread TH Lim

Thanks.

I think it will get more complicated as I wanted the effect to kick in after
the page is rendered. What I do now is enable/disable individual components
in AjaxCheckbox.onUpdate(). 


Mr Mean wrote:
 
 AFAIK there is no is such thing as isEnabledInHierarchy like there is
 for visibility.
 You can however use an IVisitor to quickly traverse all child
 components of the container and set them to enabled / disabled.
 If you do this in the onBeforeRender of the container you get pretty
 much the behavior you want.
 
 Note that if you have a listview or some other repeater this is not
 going to work since the items in the listview are created in the
 onbeforeRender of the listview which is called after the
 onbeforerender of the container. For items of listviews you need to
 check the parent yourself in onpopulate.
 
 Maurice
 
 On Thu, Jul 3, 2008 at 6:53 AM, TH Lim [EMAIL PROTECTED] wrote:

 Hi,

 I have a form with 2 address blocks where each block is a
 WebMarkupContainer. The 1st block is the home address which basic the
 block
 no, postal code, street name etc. The 2nd block is the billing address.
 So
 when a user clicks on the check box stating that his home address is the
 billing address, 2nd block will be disabled. I can do this by disabling
 each
 field in the 2nd block. Is there a way to disable this by block e.g.

 form.add(new AjaxCheckBox(sameAddressForBilling)
{
protected void onUpdate(AjaxRequestTarget target)
{
/* THIS DOES NOT WORK */
form.replace(billingAddressBlock.setEnabled(!((Boolean)
 getModelObject(;
target.addComponent(billingAddressBlock);

}
});

 What am I missing here?

 TQ

 /lim/

 --
 View this message in context:
 http://www.nabble.com/Enable---Disable-Container-using-AJAX-tp18251827p18251827.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/Enable---Disable-Container-using-AJAX-tp18251827p18255726.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]



Enable / Disable Container using AJAX

2008-07-02 Thread TH Lim

Hi,

I have a form with 2 address blocks where each block is a
WebMarkupContainer. The 1st block is the home address which basic the block
no, postal code, street name etc. The 2nd block is the billing address. So
when a user clicks on the check box stating that his home address is the
billing address, 2nd block will be disabled. I can do this by disabling each
field in the 2nd block. Is there a way to disable this by block e.g.

form.add(new AjaxCheckBox(sameAddressForBilling)
{
protected void onUpdate(AjaxRequestTarget target)
{
/* THIS DOES NOT WORK */
form.replace(billingAddressBlock.setEnabled(!((Boolean)
getModelObject(;
target.addComponent(billingAddressBlock);

}
});
 
What am I missing here?

TQ

/lim/

-- 
View this message in context: 
http://www.nabble.com/Enable---Disable-Container-using-AJAX-tp18251827p18251827.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]



POST or GET Request

2008-06-25 Thread TH Lim

Hi,

Is there a way to know if a request is a POST or GET in WebPage? 

TQ
-- 
View this message in context: 
http://www.nabble.com/POST-or-GET-Request-tp18108556p18108556.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: Deployment mode Javascript error

2008-06-03 Thread TH Lim

Why being not stripping the comments and whitespaces makes a difference in 
Effect.js i.e.
getResourceSettings().setStripJavascriptCommentsAndWhitespace(false)?

Thanks.


Matej Knopp-2 wrote:
 
 Are there still compression problems with current trunk? I've been
 testing that with YUI and DOJO and had no problem.
 
 -Matej
 
 On Nov 19, 2007 2:34 PM, Al Maw [EMAIL PROTECTED] wrote:
 Frank Bille wrote:
  The easy solution is to disable javascript cleanup:
 
  INIT:
  getResourceSettings().setStripJavascriptCommentsAndWhitespace(false);
 
  I have been too lazy to actually try to fix the problem, I'm afraid.

 :-(

 Is there a JIRA issue for this?

 Regards,

 Al


 -
 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/Deployment-mode-Javascript-error-tp13828471p17618998.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-05-07 Thread TH Lim

Check why your client variable is null. I think the problem lies there.


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-tp16558748p17098806.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: Private Homepage Redirection

2008-05-07 Thread TH Lim

+1

It's a handy class and should be put in the API.


Alex Jacoby-2 wrote:
 
 +1
 
 I did something similar but not nearly so elegant.  This would have  
 been nice to have.
 
 On May 7, 2008, at 3:22 AM, Johan Compagner wrote:
 
 add this to the api...
 Because this is the second question about this in a very short time..

 johna


 On Wed, May 7, 2008 at 7:47 AM, Martijn Dashorst
 [EMAIL PROTECTED] 
 
 wrote:

 Perhaps this one helps?

 public class RedirectToExternalException extends
 AbstractRestartResponseException
 {
  private static final long serialVersionUID = 1L;

  public RedirectToExternalException(String url)
  {

  RequestCycle rc = RequestCycle.get();
  if (rc == null)
  {
  throw new IllegalStateException(
  This exception can only be
 thrown from within request processing cycle);
  }
  else
  {
  Response r = rc.getResponse();
  if (!(r instanceof WebResponse))
  {
  throw new IllegalStateException(
  This exception can
 only be thrown when wicket is processing an
 http request);
  }

  // abort any further response processing
  rc.setRequestTarget(new  
 RedirectRequestTarget(url));
   }
  }
 }

 On 5/7/08, TH Lim [EMAIL PROTECTED] wrote:

 RestartResponseException worked but it doesn't accept external  
 URL. As
 a
 result, I have to put the redirection in the dummy Page's HTML  
 header.

 Someone in the forum mentioned using WebApplication.getHomePage() to
 get
 around but that too requires you to put up a dummy Page to  
 redirect to
 the
 external site as mentioned in previous paragraph.

 Thanks for the replies. Now I have a choice to make after becoming  
 more
 knowledgeable on this issue.



 Eelco Hillenius wrote:

 I tried both AbortException and RestartResponseException. They
 didn't
 work.
 AbortException basically causes Wicket to show a blank page  
 instead
 of
 redirecting to the external site while RestartResponseException
 caused
 stack
 overflow error. The exceptions were thrown in
 onUnauthorizedInstantiation(...) method.

 You should use the RestartResponseException, not AbortException
 directly. The stack overflow error is something you can fix  
 yourself;
 make sure you redirect to a page that won't cause these redirects  
 to
 be triggered again.

 Eelco

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





 --
 View this message in context:
 http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17093829.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]




 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.3 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

 -
 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/Private-Homepage-Redirection-tp17079231p17106174.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]



Private Homepage Redirection

2008-05-06 Thread TH Lim

Hi,

I have setup a private homepage in org.apache.wicket.WebApplication. My
intention is to redirect the user, if he not logged in, to an external site.
Once he has successfully logon using the external site, he will be
redirected back to the private homepage.  I use setRequestTarget(new
RedirectRequestTarget(...)  inside
IUnauthorizedComponentInstantiationListener.onUnauthorizedInstantiation(...)
to achieve my objective. It works and at the same time my homepage class was
instantiated in the background. My question is, is it possible to redirect
the request to the external site and avoid instantiating the homepage class
altogether. 

TQ

/lim/

-- 
View this message in context: 
http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17079231.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: Private Homepage Redirection

2008-05-06 Thread TH Lim

I tried both AbortException and RestartResponseException. They didn't work.
AbortException basically causes Wicket to show a blank page instead of
redirecting to the external site while RestartResponseException caused stack
overflow error. The exceptions were thrown in
onUnauthorizedInstantiation(...) method. 


Johan Compagner wrote:
 
 But if the right abort/restart exception is thrown then it should work
 without a complete page being created.
 
 johan
 
 
 On Tue, May 6, 2008 at 12:05 PM, Maurice Marrink [EMAIL PROTECTED]
 wrote:
 
 No, The homepage class will be (at least partially) constructed.
 Because it is the Component constructor that triggers the call to the
 listeners.

 Maurice

 On Tue, May 6, 2008 at 11:37 AM, TH Lim [EMAIL PROTECTED] wrote:
 
   Hi,
 
   I have setup a private homepage in org.apache.wicket.WebApplication.
 My
   intention is to redirect the user, if he not logged in, to an external
 site.
   Once he has successfully logon using the external site, he will be
   redirected back to the private homepage.  I use setRequestTarget(new
   RedirectRequestTarget(...)  inside
 
 
 IUnauthorizedComponentInstantiationListener.onUnauthorizedInstantiation(...)
   to achieve my objective. It works and at the same time my homepage
 class was
   instantiated in the background. My question is, is it possible to
 redirect
   the request to the external site and avoid instantiating the homepage
 class
   altogether.
 
   TQ
 
   /lim/
 
   --
   View this message in context:
 http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17079231.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/Private-Homepage-Redirection-tp17079231p17080212.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: Private Homepage Redirection

2008-05-06 Thread TH Lim

RestartResponseException worked but it doesn't accept external URL. As a
result, I have to put the redirection in the dummy Page's HTML header.

Someone in the forum mentioned using WebApplication.getHomePage() to get
around but that too requires you to put up a dummy Page to redirect to the
external site as mentioned in previous paragraph.

Thanks for the replies. Now I have a choice to make after becoming more
knowledgeable on this issue.


Eelco Hillenius wrote:
 
  I tried both AbortException and RestartResponseException. They didn't
 work.
  AbortException basically causes Wicket to show a blank page instead of
  redirecting to the external site while RestartResponseException caused
 stack
  overflow error. The exceptions were thrown in
  onUnauthorizedInstantiation(...) method.
 
 You should use the RestartResponseException, not AbortException
 directly. The stack overflow error is something you can fix yourself;
 make sure you redirect to a page that won't cause these redirects to
 be triggered again.
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17093829.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-04-14 Thread TH Lim

Yes, you can use mountBookmarkablePage method of WebApplication.


itai wrote:
 
 
 Hi!
 Thanks a lot - this works...
 
 Ill have to put the validation on the BasePage class to authenticate every
 page because in many cases (like in links that are used on facebook
 notifications) the first accessed page is an internal one.
 
 Another question, my application runs as an iframe inside facebook. I want
 all URLs in the application to point to
 http://apps.facebook.com/app-name/relative url in the app. 
 
 Can this be done using Wicket?
 
 Thanks!
 itai.
 

-- 
View this message in context: 
http://www.nabble.com/Facebook-Wicket-Integration-tp16558748p16693220.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-04-11 Thread TH Lim

Hi,

I have redeployed this application in another Tomcat server it worked. I
have no idea what's wrong.  It is a classic PEBCAK. 

However, there is a work around it which I used when the solution was not
working. I directed the home Webpage to the Facebook login page if the user
has not login yet otherwise proceed to other pages. It is not elegant and it
worked at that time. Now that it works as it should be I have reverted to
the original code. 


itai wrote:
 
 Hi Lim, 
 
 I ran into the exact same problem ...
 Did you find a solution ??
 
 Thanks, 
 Itai.
 
 
 TH Lim wrote:
 
 
 java.lang.NullPointerException
 at org.thlim.sample.wicket.Login.init(Login.java:23)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
 at java.lang.Class.newInstance0(Class.java:350)
 at java.lang.Class.newInstance(Class.java:303)
 ..
 
 I traced the code and found that the application didn't redirect as
 stipulated here,
 
 ...
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Facebook-Wicket-Integration-tp16558748p16625615.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]



Facebook Wicket Integration

2008-04-08 Thread TH Lim

Hi,
I have been following the tip in the Wiki,
http://cwiki.apache.org/WICKET/facebook-integration.html and ran into
NullPointerException. The Login class is  exactly the class mentioned in the
Wiki.

java.lang.NullPointerException
at org.thlim.sample.wicket.Login.init(Login.java:23)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
..

I traced the code and found that the application didn't redirect as
stipulated here,

   private void forceLogin(Page page)
   {
   page.getRequestCycle().setRequestTarget(new
RedirectRequestTarget(http://www.facebook.com/login.php?api_key=; + _apiKey
+ v=1.0));
   }

I presume the line of code will redirect the browser to
http://www.facebook.com/login.php?api_key=v=1.0; when I logon to the
URL http://apps.facebook.com/xxx/. It didn't and it went straight to the
Login and caused the NPE. I realized that ExceptionErrorPage page was
created after it failed to be redirected to
http://www.facebook.com/login.php?api_key=v=1.0; the 1st time.

If I logon manually e.g. point my browser to
http://www.facebook.com/login.php?api_key=v=1.0, my Facebook app will
work fine. What did I do wrong?

Thanks

/lim/

-- 
View this message in context: 
http://www.nabble.com/Facebook-Wicket-Integration-tp16558748p16558748.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]