Re: PageReference as page parameter?

2012-09-17 Thread Nelson Segura
That is what I thought, but PageReference constructor is not public,
so I cannot do that, unless I am missing something?
But I could do

(Page)Session.get().getPageManager().getPage(pageId)

As PageReference does internally, correct?

- Nelson

On Mon, Sep 17, 2012 at 3:11 PM, Igor Vaynberg  wrote:
> you can pass in the page id obtained from page#getpageid() as a
> bookmarkable url, then to navigate back to the original page you can
> do setResponsePage(new PageReference(pageid).getPage())
>
> this will, however, leave you on a nonbookmarkable url when you come back.
>
> if you want bookmarkable urls all the way around then you need to do
> what stateless frameworks do, pass the return url to the detail page
> as a parameter.
>
> -igor
>
> On Mon, Sep 17, 2012 at 3:07 PM, Nelson Segura  wrote:
>> Hello,
>> I have a very common pattern in which from a list, I can to detail of
>> an element in the list.
>> In the detail page I have a reference back to the page list.
>> The page list can be different, several list might point to the same detail.
>> Until now I have been using page reference to return to the previous
>> page, and it works well.
>> However, passing the page reference to the constructor of the detail
>> page, means that page is not bookmarkable (unless I am mistaking
>> something)
>>
>> Is there a way a can pass the page reference as a request parameter,
>> and so make the page bookmarkable? (ex. by using id, page map, etc).
>> Of course if no page reference can be retraced from the map, then we
>> just ignore the back reference.
>>
>> Any ideas?
>>
>> - Nelson
>>
>> -
>> 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
>

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



PageReference as page parameter?

2012-09-17 Thread Nelson Segura
Hello,
I have a very common pattern in which from a list, I can to detail of
an element in the list.
In the detail page I have a reference back to the page list.
The page list can be different, several list might point to the same detail.
Until now I have been using page reference to return to the previous
page, and it works well.
However, passing the page reference to the constructor of the detail
page, means that page is not bookmarkable (unless I am mistaking
something)

Is there a way a can pass the page reference as a request parameter,
and so make the page bookmarkable? (ex. by using id, page map, etc).
Of course if no page reference can be retraced from the map, then we
just ignore the back reference.

Any ideas?

- Nelson

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



Re: urlFor in wicket 1.5

2012-04-20 Thread Nelson Segura
Ah, got it.
In my case, it is a return link passed to a non wicket page that sits
in a different path (but same app context, root in my case). So the
browser cannot solve it directly. I.e. it seems that can be safely
emitted in the same page for which is obtained (or other pages in the
same path)

-Nelson

On Fri, Apr 20, 2012 at 1:49 PM, Igor Vaynberg  wrote:
> it can be stored in the browser. but you first need to let the browser
> resolve it.
>
> when you are on /fts/foo and you have search you
> can right click search in the browser and add  it as a bookmark. the
> browser will correctly resolve it against the current url and store
> /fts/search.
>
> -igor
>
>
> On Fri, Apr 20, 2012 at 1:48 PM, Nelson Segura  wrote:
>> :)
>>
>> Maybe in one sense, but not as the API/javadoc for Wicket 1.5 written
>> for urlFor()
>>
>> "Returns a bookmarkable URL that references a given page class using a
>> given set of page parameters. Since the URL which is returned contains
>> all information necessary to instantiate  and render the page, it can
>> be stored in a user's browser as a stable bookmark."
>>
>> As returned by urlFor() the URL cannot be stored in the user's browser
>> as a bookmark.
>>
>> It might be a semantic issue, but if the user has been using that to
>> store URLs, it cannot do it anymore.
>>
>> -Nelson
>>
>>
>> On Fri, Apr 20, 2012 at 1:42 PM, Igor Vaynberg  
>> wrote:
>>> bookmarkable just means the url contains no session-state. it doesnt
>>> mean that it is absolute.
>>>
>>> -igor
>>>
>>> On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura  wrote:
>>>> Except that is not fully bookmarkable as per the API, is it?
>>>> How can I produce a fully bookmarkable URL that can be printed?
>>>>
>>>> I tried to follow this:
>>>>
>>>> RequestCycle.get().getUrlRenderer().renderFullUrl(
>>>>   Url.parse(urlFor(MyPage.class,null).toString()));
>>>>
>>>> from here
>>>> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>>>>
>>>> but the URL is still is printed as
>>>>
>>>> http://localhost/search instead of http://localhos/fts/search
>>>>
>>>> -Nelson
>>>>
>>>>
>>>> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg  
>>>> wrote:
>>>>> if you are currently on a /fts/ url, then "search" is correct
>>>>> because relative to /fts/ it will produce /fts/search.
>>>>>
>>>>> -igor
>>>>>
>>>>>
>>>>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura  wrote:
>>>>>> Using Wicket 1.5.4
>>>>>>
>>>>>> Have the following mountedPage()
>>>>>>
>>>>>> mountPage("/fts/search", FTSResultsPage.class);
>>>>>>
>>>>>>
>>>>>> In a panel inside that page I have
>>>>>>
>>>>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>>>>
>>>>>> I expect this to be (as in wicket 1.4)
>>>>>>
>>>>>> "/fts/search"
>>>>>>
>>>>>> But instead it is rendered as
>>>>>>
>>>>>> "search"
>>>>>>
>>>>>> Is there any explanation for this?
>>>>>>
>>>>>> -Nelson Segura
>>>>>>
>>>>>> -
>>>>>> 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
>>>>>
>>>>
>>>> -
>>>> 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
>>>
>>
>> -
>> 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
>

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



Re: urlFor in wicket 1.5

2012-04-20 Thread Nelson Segura
:)

Maybe in one sense, but not as the API/javadoc for Wicket 1.5 written
for urlFor()

"Returns a bookmarkable URL that references a given page class using a
given set of page parameters. Since the URL which is returned contains
all information necessary to instantiate  and render the page, it can
be stored in a user's browser as a stable bookmark."

As returned by urlFor() the URL cannot be stored in the user's browser
as a bookmark.

It might be a semantic issue, but if the user has been using that to
store URLs, it cannot do it anymore.

-Nelson


On Fri, Apr 20, 2012 at 1:42 PM, Igor Vaynberg  wrote:
> bookmarkable just means the url contains no session-state. it doesnt
> mean that it is absolute.
>
> -igor
>
> On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura  wrote:
>> Except that is not fully bookmarkable as per the API, is it?
>> How can I produce a fully bookmarkable URL that can be printed?
>>
>> I tried to follow this:
>>
>> RequestCycle.get().getUrlRenderer().renderFullUrl(
>>   Url.parse(urlFor(MyPage.class,null).toString()));
>>
>> from here
>> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>>
>> but the URL is still is printed as
>>
>> http://localhost/search instead of http://localhos/fts/search
>>
>> -Nelson
>>
>>
>> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg  
>> wrote:
>>> if you are currently on a /fts/ url, then "search" is correct
>>> because relative to /fts/ it will produce /fts/search.
>>>
>>> -igor
>>>
>>>
>>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura  wrote:
>>>> Using Wicket 1.5.4
>>>>
>>>> Have the following mountedPage()
>>>>
>>>> mountPage("/fts/search", FTSResultsPage.class);
>>>>
>>>>
>>>> In a panel inside that page I have
>>>>
>>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>>
>>>> I expect this to be (as in wicket 1.4)
>>>>
>>>> "/fts/search"
>>>>
>>>> But instead it is rendered as
>>>>
>>>> "search"
>>>>
>>>> Is there any explanation for this?
>>>>
>>>> -Nelson Segura
>>>>
>>>> -
>>>> 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
>>>
>>
>> -
>> 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
>

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



Re: urlFor in wicket 1.5

2012-04-20 Thread Nelson Segura
I think that mapUrlFor() seems to produce the results as urlFor() used
to in Wicket 1.5.5

-nelson

On Fri, Apr 20, 2012 at 1:31 PM, Nelson Segura  wrote:
> Except that is not fully bookmarkable as per the API, is it?
> How can I produce a fully bookmarkable URL that can be printed?
>
> I tried to follow this:
>
> RequestCycle.get().getUrlRenderer().renderFullUrl(
>   Url.parse(urlFor(MyPage.class,null).toString()));
>
> from here
> https://cwiki.apache.org/WICKET/getting-a-url-for-display.html
>
> but the URL is still is printed as
>
> http://localhost/search instead of http://localhos/fts/search
>
> -Nelson
>
>
> On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg  
> wrote:
>> if you are currently on a /fts/ url, then "search" is correct
>> because relative to /fts/ it will produce /fts/search.
>>
>> -igor
>>
>>
>> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura  wrote:
>>> Using Wicket 1.5.4
>>>
>>> Have the following mountedPage()
>>>
>>> mountPage("/fts/search", FTSResultsPage.class);
>>>
>>>
>>> In a panel inside that page I have
>>>
>>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>>
>>> I expect this to be (as in wicket 1.4)
>>>
>>> "/fts/search"
>>>
>>> But instead it is rendered as
>>>
>>> "search"
>>>
>>> Is there any explanation for this?
>>>
>>> -Nelson Segura
>>>
>>> -
>>> 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
>>

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



Re: urlFor in wicket 1.5

2012-04-20 Thread Nelson Segura
Except that is not fully bookmarkable as per the API, is it?
How can I produce a fully bookmarkable URL that can be printed?

I tried to follow this:

RequestCycle.get().getUrlRenderer().renderFullUrl(
   Url.parse(urlFor(MyPage.class,null).toString()));

from here
https://cwiki.apache.org/WICKET/getting-a-url-for-display.html

but the URL is still is printed as

http://localhost/search instead of http://localhos/fts/search

-Nelson


On Fri, Apr 20, 2012 at 1:27 PM, Igor Vaynberg  wrote:
> if you are currently on a /fts/ url, then "search" is correct
> because relative to /fts/ it will produce /fts/search.
>
> -igor
>
>
> On Fri, Apr 20, 2012 at 1:25 PM, Nelson Segura  wrote:
>> Using Wicket 1.5.4
>>
>> Have the following mountedPage()
>>
>> mountPage("/fts/search", FTSResultsPage.class);
>>
>>
>> In a panel inside that page I have
>>
>> String pageUrl = urlFor(FTSResultsPage.class,null).toString();
>>
>> I expect this to be (as in wicket 1.4)
>>
>> "/fts/search"
>>
>> But instead it is rendered as
>>
>> "search"
>>
>> Is there any explanation for this?
>>
>> -Nelson Segura
>>
>> -
>> 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
>

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



urlFor in wicket 1.5

2012-04-20 Thread Nelson Segura
Using Wicket 1.5.4

Have the following mountedPage()

mountPage("/fts/search", FTSResultsPage.class);


In a panel inside that page I have

String pageUrl = urlFor(FTSResultsPage.class,null).toString();

I expect this to be (as in wicket 1.4)

"/fts/search"

But instead it is rendered as

"search"

Is there any explanation for this?

-Nelson Segura

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



Re: Page Map versions and Ajax Requests

2012-04-11 Thread Nelson Segura
Sorry, you dont have to refresh 4 times, just once :p
-Nelson

On Wed, Apr 11, 2012 at 6:08 PM, Nelson Segura  wrote:
> This is easily reproduceable in the wicket sample pages:
>
> http://www.wicket-library.com/wicket-examples/ajax/links
>
> 1. Click on the increment link for Counter 2 for times. Counter shows 4.
> 2. CTRL-R/refresh 4 times, the counter still shows 4.
> 3. Click on link 4 more times. Counter shows 8
> 4.CTRL-R/refresh once more, the counter shows 4!
>
> I don't know exactly what is making the page dirty in this case.
>
> Can you confirm this behavior in the sample page?
>
> -Nelson

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



Re: Page Map versions and Ajax Requests

2012-04-11 Thread Nelson Segura
This is easily reproduceable in the wicket sample pages:

http://www.wicket-library.com/wicket-examples/ajax/links

1. Click on the increment link for Counter 2 for times. Counter shows 4.
2. CTRL-R/refresh 4 times, the counter still shows 4.
3. Click on link 4 more times. Counter shows 8
4.CTRL-R/refresh once more, the counter shows 4!

I don't know exactly what is making the page dirty in this case.

Can you confirm this behavior in the sample page?

-Nelson

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



Re: Page Map versions and Ajax Requests

2012-04-11 Thread Nelson Segura
I found the same problem, in my case it is page reload. I have a
simple QS that has a button that increments a counter using ajax. When
the user refreshes the page, the counter shows the correct number of
clicks. More clicks, and a new refresh, the counter shows as expected.
However, if I add an unrelated ListView to the same page, then page
refreshes do not reflect the clicks/ajax updates. This is because the
Ajax requests are going to a different version of the page as that one
being displayed. The list view is making the page dirty on each
refresh.
-nelson

On Fri, Dec 9, 2011 at 12:20 PM, Mark Lichtenberg
 wrote:
> I'm seeing requests logged when the RequestLogger is enabled during page 
> reloads and when the back button is used. The same code under 1.4 does not. I 
> assumed the extra request was to fetch the latest render of the page if it 
> was updated via ajax.
>
> On Friday, December 9, 2011 at 1:59 PM, Dan Retzlaff wrote:
>
>> I wouldn't say there are extra requests, just extra page versions due to
>> re-population of the list view. Seems like the re-population process should
>> be engineered in a way that doesn't advance the page number. But I'll leave
>> that to the experts. :)
>>
>> On Fri, Dec 9, 2011 at 11:50 AM, Mark Lichtenberg <
>> mlichtenb...@machenergy.com (mailto:mlichtenb...@machenergy.com)> wrote:
>>
>> > That's exactly what I'm experiencing. In 1.5 it appears there's a few
>> > extra requests during a reload that I assume are retrieving the latest page
>> > version. I'll create a bug report. Thanks for your help.
>> >
>> > Mark
>> >
>> > On Friday, December 9, 2011 at 1:26 PM, Dan Retzlaff wrote:
>> > > I confirmed this behavior in our application. Simply reloading a page
>> >
>> > with
>> > > a ListView a few times advances the page ID but not the URL. AJAX links
>> > > know to target the new page ID, but any updates they make get lost if the
>> > > page gets reloaded from the URL. Sounds like a bug to me. Wicket 1.4
>> > >
>> >
>> > didn't
>> > > behave this way.
>> > >
>> > > On Fri, Dec 9, 2011 at 10:26 AM, Dan Retzlaff > > > (mailto:dretzl...@gmail.com)(mailto:
>> > dretzl...@gmail.com (mailto:dretzl...@gmail.com))> wrote:
>> > >
>> > > > Without reusing the ListView items, the "item.add(...)" will get called
>> > > > with each render. I expect that'll cause
>> > > >
>> > >
>> > >
>> >
>> > MarkupContainer#addedComponent()
>> > > > to WebPage#componentAdded() to WebPage#dirty() which sets a new page
>> > >
>> >
>> > ID.
>> > > > Sorry I don't have time to test the theory at the moment.
>> > > >
>> > > >
>> > > > On Fri, Dec 9, 2011 at 8:27 AM, Mark Lichtenberg <
>> > > > mlichtenb...@machenergy.com (mailto:mlichtenb...@machenergy.com)>
>> > > >
>> > >
>> >
>> > wrote:
>> > > >
>> > > > > 1.5.3.
>> > > > >
>> > > > > I've narrowed the problem to a ListView being present on the page.
>> > > > > Whenever there's a ListView with setReuseItems set to false (the
>> > > > >
>> > > >
>> > > >
>> > >
>> >
>> > default)
>> > > > > the Page ID gets incremented whenever the back button is used to
>> > > >
>> > >
>> >
>> > return to
>> > > > > the page. I confirmed this with a call to getPage().getPageId() in an
>> > > > > onComponentTag method. After returning via the back button the URL
>> > > > >
>> > > >
>> > >
>> >
>> > is still
>> > > > > at the original Page ID while there's a newer version in the page
>> > > >
>> > >
>> >
>> > map.
>> > > > >
>> > > > > Without a ListView present on the page using the back button does not
>> > > > > increment the Page ID and everything works as expected.
>> > > > >
>> > > > > I have a quickstart app that illustrates the problem. Here is the
>> > page
>> > > > > with the applicable code: http://pastebin.com/jn9czHK8
>> > > > >
>> > > > > Mark
>> > > > >
>> > > > >
>> > > > > On Friday, December 9, 2011 at 9:56 AM, Nazaret Kazarian wrote:
>> > > > > > Which version of Wicket are you using?
>> > > > > >
>> > > > > >
>> > > > > > 2011/12/7 Lichtenberg, Mark > > > > > > (mailto:mlichtenb...@machenergy.com) (mailto:
>> > mlichtenb...@machenergy.com (mailto:mlichtenb...@machenergy.com)) (mailto:
>> > > > > mlichtenb...@machenergy.com (mailto:mlichtenb...@machenergy.com))>:
>> > > > > > > I have a page containing a number of AjaxLinks that when clicked
>> > > > > >
>> > > > >
>> > > > >
>> > > > > fetch data
>> > > > > > > and update some panels. When a user leaves one of these pages and
>> > > > > >
>> > > > >
>> > > > >
>> > > > > returns
>> > > > > > > via the back button the state of the page isn't always how they
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> > left
>> > > > > >
>> > > > >
>> > > > >
>> > > > > it.
>> > > > > > > However, this behavior happens only when the page is returned to
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> > the
>> > > > > >
>> > > > >
>> > > > >
>> > > > > second
>> > > > > > > time. Using the the request logger I've been able to partially
>> > > > > >
>> > > > >
>> > > > >
>> > > > > explai

Re: Set Wicket User Session to Servlet's HttpSession

2012-02-10 Thread Nelson Segura
So this means that wicket session cannot be accessed from non wicket
request? I tried to call Session.get().bind() before doing anything
with the session, but it gives me the same error. Notice this is
called in Session.get(), so I cant really call bind.
This was working with no problems in Wicket 1.5.3


java.lang.IllegalArgumentException: Argument 'requestCycle' may not be null.
at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
at 
org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:1524)
at org.apache.wicket.Session.get(Session.java:156)


On Mon, Feb 6, 2012 at 2:07 AM, Martin Grigorov  wrote:
> Hi,
>
> As I answered in the ticket - RequestCycle is not created for
> non-Wicket requests. It will be always 'null'.
>
> On Mon, Feb 6, 2012 at 11:15 AM, Kayode Odeyemi  wrote:
>> On Mon, Feb 6, 2012 at 7:18 AM, Martin Grigorov wrote:
>>
>>> Hi,
>>>
>>> On Sat, Feb 4, 2012 at 3:25 PM, Kayode Odeyemi  wrote:
>>> > Hi, thanks.
>>> >
>>> > On Fri, Feb 3, 2012 at 8:05 PM, Serban.Balamaci >> >wrote:
>>> >
>>> >> Hello,
>>> >> It's not really clear what you mean and maybe you need to tell us what
>>> you
>>> >> want to do.
>>> >>
>>> >
>>> > I want to use servlet session object for user authentication and not
>>> > wickets'.
>>> >
>>> >>
>>> >> A Wicket session stores it's attributes into an implementation of the
>>> >> ISessionStore interface, but the default the store is HttpSessionStore,
>>> so
>>> >> the HttpSession. On the other hand, the wicket session can exist in a
>>> >> temporary state for the duration of the request and not have a
>>> HttpSession
>>> >> created. See bind(...) method in HttpSessionStore and you can see the
>>> >> Wicket
>>> >> session object being stored in a  httpsession attribute when the Wicket
>>> >> session needs to be persistent.
>>> >> setAttribute(request, Session.SESSION_ATTRIBUTE_NAME, newSession);
>>> >>
>>> >
>>> > But from what you've just explained, does that mean a wicket session is
>>> > HttpSession? Hence, I can just concentrate on implementing wicket session
>>> > and then retrieve it whenever its required even within a servlet - alas,
>>> > the HelloWorldServlet example which makes use of WicketSessionFilter?
>>>
>>> Yes, Wicket's Session is saved as an attribute in the HttpSession.
>>> And yes, using WicketSessionFilter you can read it in servlets.
>>>
>>>
>> Thanks. I tried this but I keep getting  java.lang.IllegalArgumentException:
>> Argument 'requestCycle' may not be null.
>>
>> This is the reason why I wanted to know if this is a bug that is fixed in a
>> different branch but not yet on the official release.
>>
>> Thanks for the time.
>>
>>> >
>>> >>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://apache-wicket.1842946.n4.nabble.com/Set-Wicket-User-Session-to-Servlet-s-HttpSession-tp4355593p4355644.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
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > Odeyemi 'Kayode O.
>>> > http://www.sinati.com. t: @charyorde
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Odeyemi 'Kayode O.
>> http://www.sinati.com. t: @charyorde
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: ModalWindow does not close cleanly

2012-01-02 Thread Nelson Segura
I noticed also that if I add a dummy window closed call back to my page:

1) In the modal window, calling window.close() sets the "shown" flag to false
2) My dummy callback causes ModalWindow.WindowClosedBehavior to
respond. The current value of this shown flag is still true! Then the
behavior sets it to false again.

I believed that calling "window.close()" from inside a window that
uses page does not close the window cleanly.

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



Re: ModalWindow does not close cleanly

2012-01-02 Thread Nelson Segura
:) A patch will be nice, but ... I think this has to do with my modal
window using page instead of panel. Could it be?

The window clears up the "shown" flag correctly if I press in the "x"
for the modal window, because the CloseButtonBehavior gets called, but
then the Ajax Target being used is in the context of the parent page.
The "x" icon sits outside the window.

My close/cancel button is calling window.close() directly, but that is
being executed inside the context of the modal page. The "shown" flag
is set up to false by window.close(), but it stays as true in the
context of the parent page. This prevents the page from being opened a
second time. Maybe something similar to how you cannot pass pages
directly to a modal, but instead should pass a page reference.
If I provide a dummy WindowClosedCallback, then the flag gets clear in
the context of the parent page.

I don't know if what I am saying is clear or correct, but I don't
exactly know where to start to fix this :(

-nelson

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



Re: Can't open modal popups in ie8 or under

2012-01-02 Thread Nelson Segura
I applied the patch to my local version of 1.5.3, and it seems to
solve this issue.

On Fri, Dec 30, 2011 at 12:09 AM, northar  wrote:
> Yes, tested with 1.5-snapshot now (not extensively), and it seems to work. My
> project manager will be glad
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Can-t-open-modal-popups-in-ie8-or-under-tp4241461p4245134.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: ModalWindow does not close cleanly

2012-01-02 Thread Nelson Segura
Any hope this can be fixed for 1.5.4? I will hate having to change all
our modals to have a dummy call back to get it to work :(
-Nelson

On Wed, Dec 21, 2011 at 2:59 PM, Nelson Segura  wrote:
> I have created a ticket, and attached a quick start to it
>
> https://issues.apache.org/jira/browse/WICKET-4311
>
> Notice that if you uncomment the dummy callback code, you will be able
> to reopen the modal.

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



Re: Can't open modal popups in ie8 or under

2011-12-28 Thread Nelson Segura
Sorry, this could be a dupped of WICKET-4241.
-Nelson

On Wed, Dec 28, 2011 at 5:02 PM, Nelson Segura  wrote:
> I think this is a bug in Wicket 1.5.3.
>
> You cannot open a modal window when using ie8 (possible ie7) if the
> context of the page you are opening from has more than one level.
>
> Example,
>
> if your parent page is http://localhost/modaltest, then wicket will
> correctly open the modal window in IE, because it will generate a call
> to 'wicket/page'
> if your parent page is http://localhost/test/modal test, then a 404
> error will be shown in the modal window, because the requested URL for
> the page will be 'test/wicket/page'
>
> I have created a quick start for it, and could create a bug, unless
> someone thinks I am missing something obvious.

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



Can't open modal popups in ie8 or under

2011-12-28 Thread Nelson Segura
I think this is a bug in Wicket 1.5.3.

You cannot open a modal window when using ie8 (possible ie7) if the
context of the page you are opening from has more than one level.

Example,

if your parent page is http://localhost/modaltest, then wicket will
correctly open the modal window in IE, because it will generate a call
to 'wicket/page'
if your parent page is http://localhost/test/modal test, then a 404
error will be shown in the modal window, because the requested URL for
the page will be 'test/wicket/page'

I have created a quick start for it, and could create a bug, unless
someone thinks I am missing something obvious.

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



Re: ModalWindow does not close cleanly

2011-12-21 Thread Nelson Segura
I have created a ticket, and attached a quick start to it

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

Notice that if you uncomment the dummy callback code, you will be able
to reopen the modal.

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



Re: ModalWindow does not close cleanly

2011-12-19 Thread Nelson Segura
Sorry, I meant respond() ...


On Mon, Dec 19, 2011 at 11:46 AM, Igor Vaynberg  wrote:
> WindowClosedBehavior does not have render()...?
>
> -igor
>
> On Mon, Dec 19, 2011 at 11:40 AM, Nelson Segura  wrote:
>> I found that if you have a modal window, and then you close it, it is
>> not possible to reopen it anymore unless you have set a
>> WindowClosedCallback. This is because WindowClosedBehavior.render()
>> does not get called.
>>
>> -
>> 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
>

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



ModalWindow does not close cleanly

2011-12-19 Thread Nelson Segura
I found that if you have a modal window, and then you close it, it is
not possible to reopen it anymore unless you have set a
WindowClosedCallback. This is because WindowClosedBehavior.render()
does not get called.

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



Re: Apache Wicket is a Flawed Framework

2011-11-17 Thread Nelson Segura
You might/might not be right about documentation. This is usually true
of most frameworks when you move from the "Hello World" program to a
real life app.

The original message said little to nothing about documentations. It
is basically comparing Wicket to JSPs, and saying JSP are better. It
might be true for some people. For me, that have been working in JSPs
for a long while, it is very humorous :D

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



Re: Exception Handling in 1.5

2011-11-17 Thread Nelson Segura
Hey, any idea how can I get the page/page class of the page that was
being rendered when the exception happened?
I was depending on that in 1.4 to determine the type of page I needed
to return, for example if I am in the context of a modal window, I was
showing a message in the window, and a close button. If I was in a
normal page, I was showing the full error page with errors et all.
I tried

Class pageClass =
((IPageClassRequestHandler)cycle.getActiveRequestHandler()).getPageClass();

But that throws an NPE

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



Re: Apache Wicket is a Flawed Framework

2011-11-17 Thread Nelson Segura
I am just a user of Wicket, but this make me laugh, since we are
desperately trying to get out of the JSP nightmare and have found
Wicket a quite nice framework. Nice.

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



Re: Exception Handling in 1.5

2011-11-16 Thread Nelson Segura
Great. Thanks for your help.

On Mon, Nov 14, 2011 at 7:06 PM, Igor Vaynberg  wrote:
> application.getrequestcyclelisteners().add(new abstractrequestcyclelistener() 
> {
>  irequsthandler onexception(e) {
>       Throwable cause = e;
>       if (cause instanceof WicketRuntimeException) {
>           cause = cause.getCause();
>       }
>
>       if (cause instanceof InvocationTargetException) {
>           cause = cause.getCause();
>       }
>
>       if (cause instanceof WicketResourceGoneException
>               || cause instanceof ResourceGoneException) {
>           return new renderpagerequesthandler(new
> ResourceGonePage((WicketResourceGoneException)cause));
>       }
>
>       if (cause instanceof ResourceNotFoundException) {
>           return new renderpagerequesthandler(new
> NotFoundPage((ResourceNotFoundException)cause));
>       }
> });
>
> -igor
>
> On Mon, Nov 14, 2011 at 3:34 PM, Nelson Segura  wrote:
>> Hello,
>> I am starting to migrate from 1.4 to 1.5.
>> I am having problems trying to figure out exactly what is the best way
>> to do the following.
>>
>> I have some custom exception and some custom pages for when the code
>> throws those exception. In 1.4 this seemed trivial. For example
>>
>>
>> ..
>>
>> public class MyRequestLifecycle extends WebRequestCycle {
>>
>>    public MyRequestLifecycle(org.apache.wicket.protocol.http.WebApplication
>> application,
>>                                         WebRequest request,
>>                                         Response response) {
>>        super(application, request, response);
>>    }
>>
>>    @Override
>>    public Page onRuntimeException(Page page, RuntimeException e) {
>>        Throwable cause = e;
>>        if (cause instanceof WicketRuntimeException) {
>>            cause = cause.getCause();
>>        }
>>
>>        if (cause instanceof InvocationTargetException) {
>>            cause = cause.getCause();
>>        }
>>
>>        if (cause instanceof WicketResourceGoneException
>>                || cause instanceof ResourceGoneException) {
>>            return new ResourceGonePage((WicketResourceGoneException)cause);
>>        }
>>
>>        if (cause instanceof ResourceNotFoundException) {
>>            return new NotFoundPage((ResourceNotFoundException)cause);
>>        }
>>        return super.onRuntimeException(page, e);
>>    }
>>
>> }
>>
>>
>> But I can't figure out a clean / easy way to do this in 1.5. I seems
>> that I need to write a lot of code to accomplish this.
>>
>> I am looking at the following links:
>>
>> https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
>> https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html
>>
>> Problems are:
>> - Which class should I be extend or implementing.
>> AbstractRequestCycleListener? IExceptionMapper? IRequestHandler?
>> - How do I get access to the current page?
>> If I return a IRequestHandler, how do I create one. Do I need to
>> create one? Can I use the current one? do I need to worry if this is
>> part of an AjaxRequest? I have looked at code in
>> AbstractRequestCycleListener, SystemMapper, CompoundRequestMapper,
>> DefaultExceptionMapper, etc. It all seems too low level compared to
>> other Wicket APIs, that makes me think I am missing something.
>>
>> What should I do?
>>
>> -Nelson
>>
>> -
>> 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
>
>

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



Exception Handling in 1.5

2011-11-14 Thread Nelson Segura
Hello,
I am starting to migrate from 1.4 to 1.5.
I am having problems trying to figure out exactly what is the best way
to do the following.

I have some custom exception and some custom pages for when the code
throws those exception. In 1.4 this seemed trivial. For example


..

public class MyRequestLifecycle extends WebRequestCycle {

public MyRequestLifecycle(org.apache.wicket.protocol.http.WebApplication
application,
 WebRequest request,
 Response response) {
super(application, request, response);
}

@Override
public Page onRuntimeException(Page page, RuntimeException e) {
Throwable cause = e;
if (cause instanceof WicketRuntimeException) {
cause = cause.getCause();
}

if (cause instanceof InvocationTargetException) {
cause = cause.getCause();
}

if (cause instanceof WicketResourceGoneException
|| cause instanceof ResourceGoneException) {
return new ResourceGonePage((WicketResourceGoneException)cause);
}

if (cause instanceof ResourceNotFoundException) {
return new NotFoundPage((ResourceNotFoundException)cause);
}
return super.onRuntimeException(page, e);
}

}


But I can't figure out a clean / easy way to do this in 1.5. I seems
that I need to write a lot of code to accomplish this.

I am looking at the following links:

https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html

Problems are:
- Which class should I be extend or implementing.
AbstractRequestCycleListener? IExceptionMapper? IRequestHandler?
- How do I get access to the current page?
If I return a IRequestHandler, how do I create one. Do I need to
create one? Can I use the current one? do I need to worry if this is
part of an AjaxRequest? I have looked at code in
AbstractRequestCycleListener, SystemMapper, CompoundRequestMapper,
DefaultExceptionMapper, etc. It all seems too low level compared to
other Wicket APIs, that makes me think I am missing something.

What should I do?

-Nelson

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



Re: ModalWindow, IFrame and source

2011-10-13 Thread Nelson Segura
Hey, thanks. I am planning to upgrade to 1.5.x in our .next release.

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



ModalWindow, IFrame and source

2011-10-12 Thread Nelson Segura
Hello everyone:

Looking back at issue:

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

I noticed that the fix was done against certain version of IE. In
other cases, like firefox, a request to http://:/ is still performed.
I have got some complains from users that their proxies are blocking
that particular call as invalid/suspicious, causing a blocked content
page to show instead of the modal window. I cannot reproduce this
myself, by have seen it in at least one of our QA machines.

My question is, is there a reason why this was not changed other than
certain versions of IE? Having the "src" of the iframe for modal
windows be "//:" still causes random problem for us in other browsers.

-Nelson Segura

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



Re: Is it possible to turn off page serialization in 1.5?

2011-10-05 Thread Nelson Segura
We dont use clustering either. Most of our objects are serializable,
but I am thinking on turning off the page store. What will the effects
of turning off versioning in the IPageManager. I never had conscious
use for the page store. What will I miss?

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



Re: On component added to ajax request target

2011-10-04 Thread Nelson Segura
I did something in the order of what you suggested:
Created a new AjaxRequestTarget sub class

public class MyAjaxRequestTarget extends AjaxRequestTarget {

public void addComponent(Component component) {
super.addComponent(component);
// see if this component has related components that are
interesting in being
// ajax refreshed when this component is refreshed.
if (component instanceof IHasRelatedAjaxComponent) {
List relatedComponentList =
((IHasRelatedAjaxComponent) component).getRelatedAjaxComponents();
if (relatedComponentList != null &&
!relatedComponentList.isEmpty()) {
for (Component c : relatedComponentList) {
// add only if the new component is not in the hierarchy
if (!getComponents().contains(c)) {
addComponent(c);
}
}
}
}

}

Any feedback from the list is welcome!

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



Re: Wicket Dynamic Navigation

2011-10-03 Thread Nelson Segura
To be fair, there is code in the web site he pointed at. Look under
"Beispielcode" link. I don't speak a lick of german, but it is not
hard to figure out that is the code, and under the web apps directory
there is some code that can be useful

wicket-praxis-code\de.wicketpraxis--webapp\src\main\java\de\wicketpraxis\web\components\paging\OffsetPagePanel.java

There is a lot more code there too.

-Nelson

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



On component added to ajax request target

2011-09-30 Thread Nelson Segura
I wonder if anyone has ideas on how to add a component to an
AjaxRequestTarget if another related component is added to it.
I am thinking about my Ajax List, there are several ways it can be
added to a request target: sorting, filtering, paging, etc.
I have another components that displays data related to the list, but
displayed outside the list. Is there a way I can detect that the list
is being refreshed using Ajax, and add those other components to the
target?

-Nelson

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



Re: Basement Coders Meetup at JavaOne 2011

2011-09-16 Thread Nelson Segura
Can you explain how does it work? I am thinking on going to java one
just to check this out.
-nelson

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



Storing component state information in session

2011-09-12 Thread Nelson Segura
Hello,

Our app has several components that "retain" their state during a user
session. Examples like:

1. Number of results per page in a pageable component.
2. State of a collapsible container.
3. Which tab is selected in a tabbed panel.

In old JSP world this will be tracked in the user session as an
attribute with the page name + the component id. This attribute has a
default value if not present.
What is the recommended way to handle this in the new Wicket World?
Does anyone have any experience handle similar problems? I was
planning to integrate this in the components themselves so they would
be transparent to the developer using the components. (Still using
wicket 1.4.x)

-Nelson Segura

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



Re: Apache Wicket releases Wicket 1.5

2011-09-08 Thread Nelson Segura
Woohoo! Thanks to all involved in making this happen. Now I can start
working in our migration!

-Nelson Segura

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



Re: Bigger sites running on wicket?

2011-07-21 Thread Nelson Segura
I stumbled by accident on Coldwell banker's web site, which is using
wicket. I don't know if that is known.  It is a pretty big
corporation.
-Nelson

On Thu, Jul 21, 2011 at 8:32 PM, Horacio Natyural
 wrote:
> we have used wicket extensively in several banking applications . both retail 
> and internal apps. we have very large amounts of transactions. mostly using 
> 1.4 version.
>
> On Jul 22, 2011, at 1:24 AM, dryajov  wrote:
>
>> 1.4
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Bigger-sites-running-on-wicket-tp2197500p3684371.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: component rendering order

2011-06-21 Thread Nelson Segura
On Mon, Jun 20, 2011 at 9:59 AM, Igor Vaynberg  wrote:
> components are rendered in the same order they are in markup. how does
> your component know now if the table is empty or not?
>

Igor,
It does not. The way it works is that if the table detects thespecial
data during rendering (onBeforeRender) , it informs the page about it
(by calling a page method).
Any component, either table or other, that detects that data informs
the page about it.
Then the page renders the header component, using the data it received
from the rest of the components of the page).
That is why I need to change the rendering order, because the
rendering of that header component depends on the presence of that
special data in the page (which could be in the table)
-Nelson

> -igor
>
> On Mon, Jun 20, 2011 at 9:37 AM, Nelson Segura  wrote:
>> On Thu, Jun 16, 2011 at 10:23 PM, Igor Vaynberg  
>> wrote:
>>> give your component the dataprovider that the datatable has and use
>>> that to calc visibility.
>>>
>>> -igor
>>
>> This does not work for me because:
>>
>> a) my pages might have multiple providers, and each one of them might
>> change the state of the header component, depending on data on the
>> list
>> b) my header does not know what lists are on the page,  as it is
>> shared between different pages. I might be none, one, or multiple.
>> c) providers are not the only elements that can cause the header
>> component to change.
>>
>> It seems to me that I need to force the component to be rendered last,
>> after all the providers/tables have had a change to analyze its data.
>>
>> I have worked around this by adding the header component after the
>> page onBeforeRender(), and then calling the components
>> onBeforeRender(), like this
>>
>> BasePage.java
>>
>> public void onBeforeRender() {
>>  super.onBeforeRender();
>>  addOrReplace(new MyComponent());
>>  component.onBeforeRender()
>> }
>>
>> It is not pretty, but I dont know other way to force a change in the
>> rendering sequence of the components.
>>
>> -Nelson
>>
>>
>>>
>>> On Thu, Jun 16, 2011 at 9:22 PM, Nelson Segura  wrote:
>>>> I might mention that I am still using a version of wicket where
>>>> onConfigure is not available,and we are not due to upgrade until after
>>>> I need to finish this component.
>>>> -Nelson
>>>>
>>>> On Thu, Jun 16, 2011 at 9:21 PM, Nelson Segura  wrote:
>>>>> Is there a way to force components to be rendered in different order
>>>>> than in which they were added?
>>>>> I have the following dilemma:
>>>>>
>>>>> I have component on the header of my pages whose behavior
>>>>> (visibility/content) depends on the results displayed in a data table.
>>>>> Since the header of my pages is added in the base page, before the
>>>>> tables are added, and the results are only known during the rendering
>>>>> of the rows, I have no access to the information I need.
>>>>>
>>>>> Is there any pattern solutions you guys can suggest for solving these
>>>>> type of problems?
>>>>>
>>>>> Help is greatly appreciated.
>>>>>
>>>>> -Nelson
>>>>>
>>>>
>>>> -
>>>> 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
>>>
>>>
>>
>> -
>> 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
>
>

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



Re: Preserving user input on ajax changes

2011-06-20 Thread Nelson Segura
I forgot to reply to this.
Your observations are absolutely correct.
I realized that I was using the ListView incorrectly, and  recreating
it on each refresh.
No wonder I was losing my values. Now it works like a charm.
Thanks.

-Nelson


On Mon, Jun 6, 2011 at 1:29 PM, Pedro Santos  wrote:
> Hi Nelson, ListView recreate its items every render, so it looses
> their raw input. You can set reuse items flag - ListView.setReuseItems
> and prevent this problem. Also notify the list view about changes in
> the list to make it recreate its items by invoking ListView#removeAll
>
> Also you may want to read an article about this problem and another
> solution: 
> http://wicketinaction.com/2008/10/building-a-listeditor-form-component/
>
> About the rejected message, try to send the message as plain text
> rather than HTML, it gives you a better span score.
>
> On Mon, Jun 6, 2011 at 5:06 PM, Nelson Segura  wrote:
>> I think that my problem is that I am not reusing the models/ recreating
>> models on refresh. Is that a possible cause?
>>
>> I have ListView that display the data, and the list itself is dynamic,
>> depending on what the users selects (that is the reason I need to refresh
>> the whole form)
>> I noticed input outside the ListView preserves the input, so It is very
>> possible that is my problem.
>>
>> Should I try another type of repeater? I am looking at the refreshing view
>> instead.
>>
>> (for some reason my previous two responses were rejected by the list server)
>>
>> -Nelson
>>
>> On Thu, Jun 2, 2011 at 7:23 PM, Igor Vaynberg  
>> wrote:
>>>
>>> default processing = false means do not validate, etc. but, inputs are
>>> preserved. make sure your ajaxsubmitlink is inside the correct form.
>>> you can specify one in its constructor.
>>>
>>> -igor
>>>
>>> On Thu, Jun 2, 2011 at 4:22 PM, Nelson Segura  wrote:
>>> > On the AjaxSubmitLink, correct?
>>> > When I do that, the input of the other fields is lost (which has not been
>>> > previously submitted).
>>> > How does wicket exactly decides whether to show the model value or the 
>>> > user
>>> > raw input?
>>> > My Ajax links is refreshing the whole panel.
>>> > -Nelson
>>> >
>>> >
>>> > On Thu, Jun 2, 2011 at 4:14 PM, Igor Vaynberg 
>>> > wrote:
>>> >
>>> >> you want setDefaultFormProcessing(false)
>>> >>
>>> >> -igor
>>> >>
>>> >> On Thu, Jun 2, 2011 at 3:41 PM, Nelson Segura  wrote:
>>> >> > I have a form to which I need to add dynamic fields using ajax, 
>>> >> > whenever
>>> >> the
>>> >> > user clicks on the "add new input" link.
>>> >> > I need to preserve the current user input, without actually updating 
>>> >> > the
>>> >> > backing models (or at least preserve input that is not completely 
>>> >> > valid,
>>> >> or
>>> >> > do not show errors if the user as not entered a required field)
>>> >> >
>>> >> > I am using an AjaxSubmitLink to submit the current user input, but
>>> >> >
>>> >> > (a) I am not able to preserve the input (if I use
>>> >> > setDefaultFormProcessing(true))
>>> >> > (b) I get validation errors, or lose invalid input if I try to mock 
>>> >> > with
>>> >> the
>>> >> > onError() method of the AjaxSubmitLink
>>> >> >
>>> >> > What is the correct way to do this?
>>> >> >
>>> >> > -Nelson
>>> >> >
>>> >>
>>> >> -
>>> >> 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
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: component rendering order

2011-06-20 Thread Nelson Segura
On Thu, Jun 16, 2011 at 10:23 PM, Igor Vaynberg  wrote:
> give your component the dataprovider that the datatable has and use
> that to calc visibility.
>
> -igor

This does not work for me because:

a) my pages might have multiple providers, and each one of them might
change the state of the header component, depending on data on the
list
b) my header does not know what lists are on the page,  as it is
shared between different pages. I might be none, one, or multiple.
c) providers are not the only elements that can cause the header
component to change.

It seems to me that I need to force the component to be rendered last,
after all the providers/tables have had a change to analyze its data.

I have worked around this by adding the header component after the
page onBeforeRender(), and then calling the components
onBeforeRender(), like this

BasePage.java

public void onBeforeRender() {
 super.onBeforeRender();
 addOrReplace(new MyComponent());
 component.onBeforeRender()
}

It is not pretty, but I dont know other way to force a change in the
rendering sequence of the components.

-Nelson


>
> On Thu, Jun 16, 2011 at 9:22 PM, Nelson Segura  wrote:
>> I might mention that I am still using a version of wicket where
>> onConfigure is not available,and we are not due to upgrade until after
>> I need to finish this component.
>> -Nelson
>>
>> On Thu, Jun 16, 2011 at 9:21 PM, Nelson Segura  wrote:
>>> Is there a way to force components to be rendered in different order
>>> than in which they were added?
>>> I have the following dilemma:
>>>
>>> I have component on the header of my pages whose behavior
>>> (visibility/content) depends on the results displayed in a data table.
>>> Since the header of my pages is added in the base page, before the
>>> tables are added, and the results are only known during the rendering
>>> of the rows, I have no access to the information I need.
>>>
>>> Is there any pattern solutions you guys can suggest for solving these
>>> type of problems?
>>>
>>> Help is greatly appreciated.
>>>
>>> -Nelson
>>>
>>
>> -
>> 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
>
>

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



Re: component rendering order

2011-06-16 Thread Nelson Segura
I might mention that I am still using a version of wicket where
onConfigure is not available,and we are not due to upgrade until after
I need to finish this component.
-Nelson

On Thu, Jun 16, 2011 at 9:21 PM, Nelson Segura  wrote:
> Is there a way to force components to be rendered in different order
> than in which they were added?
> I have the following dilemma:
>
> I have component on the header of my pages whose behavior
> (visibility/content) depends on the results displayed in a data table.
> Since the header of my pages is added in the base page, before the
> tables are added, and the results are only known during the rendering
> of the rows, I have no access to the information I need.
>
> Is there any pattern solutions you guys can suggest for solving these
> type of problems?
>
> Help is greatly appreciated.
>
> -Nelson
>

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



component rendering order

2011-06-16 Thread Nelson Segura
Is there a way to force components to be rendered in different order
than in which they were added?
I have the following dilemma:

I have component on the header of my pages whose behavior
(visibility/content) depends on the results displayed in a data table.
Since the header of my pages is added in the base page, before the
tables are added, and the results are only known during the rendering
of the rows, I have no access to the information I need.

Is there any pattern solutions you guys can suggest for solving these
type of problems?

Help is greatly appreciated.

-Nelson

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



Re: Preserving user input on ajax changes

2011-06-06 Thread Nelson Segura
I think that my problem is that I am not reusing the models/ recreating
models on refresh. Is that a possible cause?

I have ListView that display the data, and the list itself is dynamic,
depending on what the users selects (that is the reason I need to refresh
the whole form)
I noticed input outside the ListView preserves the input, so It is very
possible that is my problem.

Should I try another type of repeater? I am looking at the refreshing view
instead.

(for some reason my previous two responses were rejected by the list server)

-Nelson

On Thu, Jun 2, 2011 at 7:23 PM, Igor Vaynberg  wrote:
>
> default processing = false means do not validate, etc. but, inputs are
> preserved. make sure your ajaxsubmitlink is inside the correct form.
> you can specify one in its constructor.
>
> -igor
>
> On Thu, Jun 2, 2011 at 4:22 PM, Nelson Segura  wrote:
> > On the AjaxSubmitLink, correct?
> > When I do that, the input of the other fields is lost (which has not been
> > previously submitted).
> > How does wicket exactly decides whether to show the model value or the user
> > raw input?
> > My Ajax links is refreshing the whole panel.
> > -Nelson
> >
> >
> > On Thu, Jun 2, 2011 at 4:14 PM, Igor Vaynberg 
> > wrote:
> >
> >> you want setDefaultFormProcessing(false)
> >>
> >> -igor
> >>
> >> On Thu, Jun 2, 2011 at 3:41 PM, Nelson Segura  wrote:
> >> > I have a form to which I need to add dynamic fields using ajax, whenever
> >> the
> >> > user clicks on the "add new input" link.
> >> > I need to preserve the current user input, without actually updating the
> >> > backing models (or at least preserve input that is not completely valid,
> >> or
> >> > do not show errors if the user as not entered a required field)
> >> >
> >> > I am using an AjaxSubmitLink to submit the current user input, but
> >> >
> >> > (a) I am not able to preserve the input (if I use
> >> > setDefaultFormProcessing(true))
> >> > (b) I get validation errors, or lose invalid input if I try to mock with
> >> the
> >> > onError() method of the AjaxSubmitLink
> >> >
> >> > What is the correct way to do this?
> >> >
> >> > -Nelson
> >> >
> >>
> >> -
> >> 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
>

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



Re: Preserving user input on ajax changes

2011-06-02 Thread Nelson Segura
On the AjaxSubmitLink, correct?
When I do that, the input of the other fields is lost (which has not been
previously submitted).
How does wicket exactly decides whether to show the model value or the user
raw input?
My Ajax links is refreshing the whole panel.
-Nelson


On Thu, Jun 2, 2011 at 4:14 PM, Igor Vaynberg wrote:

> you want setDefaultFormProcessing(false)
>
> -igor
>
> On Thu, Jun 2, 2011 at 3:41 PM, Nelson Segura  wrote:
> > I have a form to which I need to add dynamic fields using ajax, whenever
> the
> > user clicks on the "add new input" link.
> > I need to preserve the current user input, without actually updating the
> > backing models (or at least preserve input that is not completely valid,
> or
> > do not show errors if the user as not entered a required field)
> >
> > I am using an AjaxSubmitLink to submit the current user input, but
> >
> > (a) I am not able to preserve the input (if I use
> > setDefaultFormProcessing(true))
> > (b) I get validation errors, or lose invalid input if I try to mock with
> the
> > onError() method of the AjaxSubmitLink
> >
> > What is the correct way to do this?
> >
> > -Nelson
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Preserving user input on ajax changes

2011-06-02 Thread Nelson Segura
I have a form to which I need to add dynamic fields using ajax, whenever the
user clicks on the "add new input" link.
I need to preserve the current user input, without actually updating the
backing models (or at least preserve input that is not completely valid, or
do not show errors if the user as not entered a required field)

I am using an AjaxSubmitLink to submit the current user input, but

(a) I am not able to preserve the input (if I use
setDefaultFormProcessing(true))
(b) I get validation errors, or lose invalid input if I try to mock with the
onError() method of the AjaxSubmitLink

What is the correct way to do this?

-Nelson


Re: Sending to a new page from Iframe

2011-05-16 Thread Nelson Segura
Excellent!
thanks for the help.
-Nelson

On Fri, May 13, 2011 at 5:24 PM, Igor Vaynberg wrote:

> use an ajaxbutton/link instead
> and in response do
>
>
> target.appendjavascript("window.top.location='"+urlFor(MyPage.class)+"');");
>
> -igor
>
>
> On Fri, May 13, 2011 at 4:11 PM, Nelson Segura  wrote:
> > I have a JSP page which has a small wicket "mini" page embedded in an
> > IFrame.
> > The small wicket page has wicket button that when preset should take the
> > user to a full Wicket page.
> > My problem is that when Using setResponsePage from the onclick event in
> the
> > mini page, the Iframe gets refreshed.
> > Instead I would like the whole JSP to be replaced by the wicket response
> > page.
> > Any ideas on this can be accomplished without having to rewrite the JSP
> into
> > wicket (it is in the header of all JSP pages)
> > and without having to rewrite the wicket code into JSP?
> > -Nelson
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Sending to a new page from Iframe

2011-05-13 Thread Nelson Segura
I have a JSP page which has a small wicket "mini" page embedded in an
IFrame.
The small wicket page has wicket button that when preset should take the
user to a full Wicket page.
My problem is that when Using setResponsePage from the onclick event in the
mini page, the Iframe gets refreshed.
Instead I would like the whole JSP to be replaced by the wicket response
page.
Any ideas on this can be accomplished without having to rewrite the JSP into
wicket (it is in the header of all JSP pages)
and without having to rewrite the wicket code into JSP?
-Nelson


Re: Calling wicket modal popup from non-wicket

2011-01-20 Thread Nelson Segura
That sounds like a good solution. Thanks!
-nelson

On Wed, Jan 19, 2011 at 3:53 PM, Igor Vaynberg wrote:

> your best bet is to use a non-wicket modal and iframe a wicket page into
> it.
>
> -igor
>
> On Wed, Jan 19, 2011 at 3:12 PM, Nelson Segura  wrote:
> > We are slowly migrating a JSP app to wicket. Parts of our app are written
> in
> > Wicket, but most of it is still JSP.
> > We need to integrate some of the new wicket functionality into old JSP
> > pages, as fragments or modal popups. There is a lot of functionality in
> that
> > page using JSP, so rewriting everything in wicket is not feasible.
> > I would like to know if it is possible to call a wicket modal popup
> window
> > from the JSP (using the windows that map to a page), and how to do it. I
> did
> > look at the "herebebeasties" site already, and did not get much from
> there
> > regarding integrating wicket into JSP.
> > -Nelson
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Calling wicket modal popup from non-wicket

2011-01-19 Thread Nelson Segura
We are slowly migrating a JSP app to wicket. Parts of our app are written in
Wicket, but most of it is still JSP.
We need to integrate some of the new wicket functionality into old JSP
pages, as fragments or modal popups. There is a lot of functionality in that
page using JSP, so rewriting everything in wicket is not feasible.
I would like to know if it is possible to call a wicket modal popup window
from the JSP (using the windows that map to a page), and how to do it. I did
look at the "herebebeasties" site already, and did not get much from there
regarding integrating wicket into JSP.
-Nelson


Re: AbstractAjaxTimerBehavior and getPreconditionScript

2011-01-11 Thread Nelson Segura
Thanks Igor, that is exactly what I wanted to know!
-Nelson

On Tue, Jan 11, 2011 at 4:37 PM, Igor Vaynberg wrote:

> this is not a bug. if precondition check fails the server call is not
> made. it is the server calls that schedules the next firing of the
> timer, so no server call no timer so to speak. you can write your own
> version of the timer behavior that works the way you want.
>
> -igor
>
> On Tue, Jan 11, 2011 at 4:32 PM, Nelson Segura  wrote:
> > Can anyone provide an answer whether returning false in the
> > getPreconditionScript() method is supposed to stop the AJAX timer
> behaviour,
> > or should I be looking for a bug?
> > -Nelson
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: AbstractAjaxTimerBehavior and getPreconditionScript

2011-01-11 Thread Nelson Segura
Can anyone provide an answer whether returning false in the
getPreconditionScript() method is supposed to stop the AJAX timer behaviour,
or should I be looking for a bug?
-Nelson


Re: AbstractAjaxTimerBehavior and getPreconditionScript

2011-01-10 Thread Nelson Segura
Yes, and no. For now it is attached to a component that accepts large
amounts of formatted text (a rich text editor). Once I get this working I
will change it to ensure that only one is active per page/form.
As I said before, keeping the page alive if the user has entered data in the
last X minutes seems to work well, except in the part when the precondition
script returns false, the timer seems to stop.
I just wanted to know if that is the normal behavior of the
AbstractAjaxTimerBehavior.getPreconditionScript() method, or is it a bug in
my code.
If it is the normal behavior, I will look for an alternative.
-nelson

On Fri, Jan 7, 2011 at 6:34 PM, Jeremy Thomerson
wrote:

> On Fri, Jan 7, 2011 at 4:56 PM, Nelson Segura  wrote:
>
> > I am writing code that checks whether the user has typed something in the
> > page, and if so, goes an AJAX call to keep the user session alive.
> > For this I am using AbstractAjaxTimerBehavior to ping the server every
> > certain time, and overriding its getPreconditionScript() method to call a
> > JS
> > function that knows if the user has typed something since the last AJAX
> > call.
> >
> > This works well as long as the user types something between the time
> calls,
> > but if ever the getPreconditionScript() determines the user has not typed
> > anything, then the timer will stop.
> > I would expect the AJAX call not to be made, but the timer to continue to
> > run for the next time, so if the user types something, then the call will
> > be
> > done in the next run.
> >
> > What is the correct behavior in this case? Do I have a bug, or is it
> > working
> > as written? If the second, then any ideas how to avoid the timer from
> > stopping?
> >
> > Code is below. Thanks for your help.
> >
> > -Nelson
> >
> > -
> >   add(new AbstractAjaxTimerBehavior(Duration.seconds(20)) {
> >private static final long serialVersionUID =
> > -4426283634345968585L;
> >
> >@Override
> >protected void onTimer(AjaxRequestTarget target) {
> >target.focusComponent(null);
> >}
> >
> >@Override
> >protected CharSequence getPreconditionScript() {
> >StringBuilder sb = new StringBuilder();
> >sb.append("if
> > (checkKeyPress('").append(getMarkupId()).append("')) { return true } else
> {
> > return false }");
> >return sb;
> >}
> >
> >});
> >
>
> Are you adding this to *every* component that you want to track?  It's hard
> to tell, but the method signature of your checkKeyPress makes me think you
> might be.
>
> Although not directly answering your question, I'd actually do it the other
> way around:
>
> 1 - use an ajax behavior (not a timer) and wrap it in a custom function
> like
> "startKeepAliveTimer()".
> 1b - in the onRespond of this behavior, simply add a new ajax timer to the
> page and let it run continuously
> 2 - then any component that can accept key presses that should trigger a
> keep alive timer can have a normal (non-ajax) behavior attached to them
> that
> appends onkeypress="startKeepAliveTimer()" to their tag.  (this could even
> be done automagically via component instantiation listener, or IVisitor,
> etc)
>
> This is an easy way to have a single AJAX keep-alive timer for all of your
> components on the page.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>


AbstractAjaxTimerBehavior and getPreconditionScript

2011-01-07 Thread Nelson Segura
I am writing code that checks whether the user has typed something in the
page, and if so, goes an AJAX call to keep the user session alive.
For this I am using AbstractAjaxTimerBehavior to ping the server every
certain time, and overriding its getPreconditionScript() method to call a JS
function that knows if the user has typed something since the last AJAX
call.

This works well as long as the user types something between the time calls,
but if ever the getPreconditionScript() determines the user has not typed
anything, then the timer will stop.
I would expect the AJAX call not to be made, but the timer to continue to
run for the next time, so if the user types something, then the call will be
done in the next run.

What is the correct behavior in this case? Do I have a bug, or is it working
as written? If the second, then any ideas how to avoid the timer from
stopping?

Code is below. Thanks for your help.

-Nelson

-
   add(new AbstractAjaxTimerBehavior(Duration.seconds(20)) {
private static final long serialVersionUID =
-4426283634345968585L;

@Override
protected void onTimer(AjaxRequestTarget target) {
target.focusComponent(null);
}

@Override
protected CharSequence getPreconditionScript() {
StringBuilder sb = new StringBuilder();
sb.append("if
(checkKeyPress('").append(getMarkupId()).append("')) { return true } else {
return false }");
return sb;
}

});


Re: Invalid html rendered with DataTable [ex. empty tfoot element]

2010-12-10 Thread Nelson Segura
The same problem is visible in the Wicket examples for data table

http://wicketstuff.org/wicket14/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.DataTablePage

The tfoot tags are empty, which is invalid HTML.

Any ideas on how to fix this?

-Nelson

On Thu, Nov 25, 2010 at 6:51 PM, Poko Booth  wrote:

> I'm using 1.4.12
>
> Regards,
> Poko
>
> On Nov 25, 2010, at 9:28 PM, Igor Vaynberg wrote:
>
> > mind specifying which wicket version you are using?
> >
> > -igor
> >
> > On Thu, Nov 25, 2010 at 5:17 AM, Poko Booth 
> wrote:
> >> Hi all,
> >> If you use DataTables, when the bottomToolBars view has no items to
> render,
> >> the markup exported is invalid:
> >>
> >> 
> >>   
> >>   
> >>  
> >>   ...
> >>   ...
> >>  
> >> 
> >>
> >> I suppose the same happens with the thead.
> >>
> >> thead and tfoot tags can't be empty.
> >>
> >> I have overridden the class and manually added in the markup file
> >> 
> >> in both thead and tfoot of the source file above the  ...>
> >> tags.
> >>
> >> Works but you knowNot elegant.
> >>
> >> Enclosure containers should be used on the thead/tfoot tags defining
> their
> >> children as the top/bottom toolbar repeating views.
> >>
> >> Regards,
> >> Poko
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Displaying update error in Wizard step, need ideas

2010-11-01 Thread Nelson Segura
Just to clarify, I try setting then setComplete(false), but that creates an
internal error message added by the wizard. I am thinking of creating the
feedback panel for my wizard with a filter to accept only my messages, but I
am not sure if that is the best approach,
-nelson

On Mon, Nov 1, 2010 at 4:24 PM, Nelson Segura  wrote:

> Hello,
> I am using the wicket-extensions wizard. On applyState() of a wizard step,
> I am calling my back end to update some data.
> There is a corner condition under which the update might fail, and we would
> like to stay in the current step and display a message.
>
> I thought about overriding the onClick() method of the NextButton(), but it
> is declared as final.
>
> Any ideas on how I can abort applyState() and go back to the current step?
>
> - Nelson
>


Displaying update error in Wizard step, need ideas

2010-11-01 Thread Nelson Segura
Hello,
I am using the wicket-extensions wizard. On applyState() of a wizard step, I
am calling my back end to update some data.
There is a corner condition under which the update might fail, and we would
like to stay in the current step and display a message.

I thought about overriding the onClick() method of the NextButton(), but it
is declared as final.

Any ideas on how I can abort applyState() and go back to the current step?

- Nelson


Re: ApacheCon 2010

2010-10-06 Thread Nelson Segura
Jeremy,
Thanks for your answer. Please let me know next time you offer training, so
we can have some people attend :D
-Nelson

On Wed, Oct 6, 2010 at 12:34 PM, Jeremy Thomerson  wrote:

> It was canceled due to a scheduling conflict - I have to be on-site at one
> of my large clients that week. Sorry :)
>
> Jeremy Thomerson
> http://wickettraining.com
> -- sent from my "smart" phone, so please excuse spelling, formatting, or
> compiler errors
>
> On Oct 6, 2010 11:53 AM, "Nelson Segura"  wrote:
>
> According to this link <http://na.apachecon.com/c/acna2010/schedule/grid>,
> there will be Wicket training in the ApacheCon NA 2010.
> But I can't find a way to register for it. Is the training really on or is
> it just a mistake on scheduling?
> -Nelson
>


ApacheCon 2010

2010-10-06 Thread Nelson Segura
According to this link ,
there will be Wicket training in the ApacheCon NA 2010.
But I can't find a way to register for it. Is the training really on or is
it just a mistake on scheduling?
-Nelson


Re: Refreshing modal window

2010-06-30 Thread Nelson Segura
To execute javascript after AJAX, do the following

ajaxRequestTarget.appendJavascript("alert('hello');");


To jump to a section using javascript use

window.location.hash = '#idname';


You can put a #top anchor on top of your window, and then jump to it
using the combination of code above.
I have not tried this myself, though :)

ajaxRequestTarget.appendJavascript("window.location.hash = '#top';");

-Nelson

On Wed, Jun 30, 2010 at 1:54 PM, Anna Simbirtsev  wrote:
>
> I need to scroll to the top on ajax response. Would you have an example on
> how to do it?
>
>
> On Wed, Jun 30, 2010 at 4:27 PM, Nelson Segura  wrote:
>
> > Are you refreshing the whole window or just the feedback panel?
> > You can try to refresh the whole window, or you can include some java
> > script
> > that scrolls your window to the top on the ajax response.
> > -Nelson
> >
> > On Wed, Jun 30, 2010 at 12:22 PM, Anna Simbirtsev  > >wrote:
> >
> > > Hi,
> > >
> > > My problem is that after the user clicks AjaxSubmit button, and the
> > > confirmation message is displayed in feedback panel, the window does not
> > > refresh, so if the user scrolled to the bottom of the model window,
> > he/she
> > > does not see the confirmation message.
> > >
> > > How can I get the modal window to refresh, so the top part of the window
> > is
> > > visible?
> > >
> > > Thanks,
> > > Anna
> > >
> >
>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331

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



Re: Refreshing modal window

2010-06-30 Thread Nelson Segura
Are you refreshing the whole window or just the feedback panel?
You can try to refresh the whole window, or you can include some java script
that scrolls your window to the top on the ajax response.
-Nelson

On Wed, Jun 30, 2010 at 12:22 PM, Anna Simbirtsev wrote:

> Hi,
>
> My problem is that after the user clicks AjaxSubmit button, and the
> confirmation message is displayed in feedback panel, the window does not
> refresh, so if the user scrolled to the bottom of the model window, he/she
> does not see the confirmation message.
>
> How can I get the modal window to refresh, so the top part of the window is
> visible?
>
> Thanks,
> Anna
>


Re: Links in DataTable

2010-06-30 Thread Nelson Segura
Thanks for your answers.

I set the multi window support settings to true, and that did not make a
difference. Interestingly, the javadoc shows that multiwindow support is
true by default. I also tried setting it to false, with no luck.

However, setting the response to a new page on click seems to conserve the
original page usability. My guess is because a new page is then created, so
the current page is still valid, and the elements on it are still valid.

I am trying a bookmarkable page link instead of the onclick event, which
seems to work, except that the AJAX actions (example paging) in the original
page return an expired page message.

Still investigating, if anyone has more information it will be greatly
appreciated.
I am working in migrating an existing large JSP/Servlet/Struts app to
Wicket, and the pattern, that is open new detail windows or tabs from a AJAX
list, is heavily used by our customers. So I have to find a way to solve
this issue without limiting existing functionality. Sadly, I am pretty new
to wicket, so I dont know the internals of why a page should loses its
containers or expires in this cases.

-Nelson

On Wed, Jun 30, 2010 at 11:14 AM, Branislav Kalas  wrote:

> and i forgot this in the onclick handler :
> @Override
> protected void onClick() {
> setResponsePage(new HomePage(parameters));
>
> System.out.println("clicked on link");
> }
>
> On 06/30/2010 07:59 PM, Branislav Kalas wrote:
>
>> Put this into WicketApplication.java
>>  @Override
>>protected void init() {
>>super.init();
>>getPageSettings().setAutomaticMultiWindowSupport(true);
>>}
>>
>> Problem was, that you opened new windows in same page map.
>> I cannot explain it better cause, i don't understand page maps very
>> well...
>>
>> On 06/30/2010 07:40 PM, Nelson Segura wrote:
>>
>>> I am attaching a Quickstart project to help reproduce the problem.
>>> On the home page, middle click in the email address shown (usually this
>>> will take a user to a detail page, but in this case it just prints a
>>> message). After that, any click on a link in the page will cause a component
>>> not found exception.
>>>
>>> Thanks for all your help.
>>>
>>> -Nelson
>>>
>>>
>>>
>>> On Wed, Jun 30, 2010 at 9:18 AM, Nelson Segura >> nsegu...@gmail.com>> wrote:
>>>
>>>Can anyone explain to me why this does not work with
>>>AjaxFallbackDefaultDataTable, but does with DefaultDataTable.
>>>Does anyone know of a solution for this problem?
>>>
>>>
>>>On Mon, Jun 28, 2010 at 6:18 PM, Nelson Segura
>>>mailto:nsegu...@gmail.com>> wrote:
>>>
>>>Since AjaxLink is AJAX and not a proper link, then it does
>>>behave as a normal link, i.e. middle click (open link in new
>>>    tab or new window) does not trigger the AJAX click even,
>>>which means you cannot chose to open the link in a new page.
>>>
>>>back to square one, except that know I know is a problem with
>>>AjaxFallbackDefaultDataTable, not with DataTable.
>>>
>>>
>>>-Nelson
>>>
>>>
>>>On Mon, Jun 28, 2010 at 5:47 PM, Nelson Segura
>>>mailto:nsegu...@gmail.com>> wrote:
>>>
>>>Jeremy, the code is below.
>>>
>>>I did notice something while researching/testing more.
>>>The LinkPanel solution DOES work for a DataTable. The
>>>problem starts when changed to a
>>>AjaxFallbackDefaultDataTable.
>>>I did testing based in the datatable example in the
>>>wicket examples.
>>>Maybe using an AjaxLink instead of a normal link in the
>>>table is the right answer.
>>>
>>>
>>>Code is mostly taken from the page linked in the original
>>>email
>>>
>>>public abstract class LinkPanel extends Panel {
>>>
>>>private static final long serialVersionUID =
>>>2062173455224348354L;
>>>
>>>public LinkPanel(final Item item, final String
>>>componentId,
>>>final IModel model, final String property) {
>>>super(componentId, model);
>>>
>>>AjaxLink link = new AjaxLink("linkCell") {
>>>
>>>priv

Re: Links in DataTable

2010-06-30 Thread Nelson Segura
Can anyone explain to me why this does not work with
AjaxFallbackDefaultDataTable, but does with DefaultDataTable.
Does anyone know of a solution for this problem?

On Mon, Jun 28, 2010 at 6:18 PM, Nelson Segura  wrote:

> Since AjaxLink is AJAX and not a proper link, then it does behave as a
> normal link, i.e. middle click (open link in new tab or new window) does not
> trigger the AJAX click even, which means you cannot chose to open the link
> in a new page.
>
> back to square one, except that know I know is a problem with
> AjaxFallbackDefaultDataTable, not with DataTable.
>
>
> -Nelson
>
>
> On Mon, Jun 28, 2010 at 5:47 PM, Nelson Segura  wrote:
>
>> Jeremy, the code is below.
>>
>> I did notice something while researching/testing more.
>> The LinkPanel solution DOES work for a DataTable. The problem starts when
>> changed to a AjaxFallbackDefaultDataTable.
>> I did testing based in the datatable example in the wicket examples.
>> Maybe using an AjaxLink instead of a normal link in the table is the right
>> answer.
>>
>>
>> Code is mostly taken from the page linked in the original email
>>
>> public abstract class LinkPanel extends Panel {
>>
>> private static final long serialVersionUID = 2062173455224348354L;
>>
>> public LinkPanel(final Item item, final String componentId,
>> final IModel model, final String property) {
>> super(componentId, model);
>>
>> AjaxLink link = new AjaxLink("linkCell") {
>>
>> private static final long serialVersionUID =
>> 2574434147588617330L;
>>
>> @Override
>> public void onClick(AjaxRequestTarget target) {
>> LinkPanel.this.onClick();
>> }
>>
>>
>> };
>> add(link);
>> link.add(new Label("label", new PropertyModel(model,property)));
>> }
>>
>> protected abstract void onClick();
>> }
>>
>> - Usage ---
>>
>> public class LinkPanelPage extends WebPage {
>>
>> public LinkPanelPage() {
>> Form form = new Form("form");
>> final LinkPanelListProvider provider = new
>> LinkPanelListProvider();
>> List columnList = new ArrayList(3);
>> //columnList.add(new PropertyColumn(new
>> Model("eMailAddress"),"eMailAddress"));
>> columnList.add(new AbstractColumn(new Model("eMailAddress"),
>> "eMailAddress") {
>> private static final long serialVersionUID =
>> -1822504503325964706L;
>>
>> @Override
>> @SuppressWarnings("unchecked")
>> public void populateItem(Item cellItem, String componentId,
>> final IModel rowModel) {
>> cellItem.add(new LinkPanel(cellItem, componentId,
>> rowModel, getSortProperty()) {
>>
>> private static final long serialVersionUID =
>> -4615958634366803506L;
>>
>> @Override
>> protected void onClick() {
>> System.out.println("clicked on link");
>> }
>> });
>> }
>>
>> });
>>
>> columnList.add(new PropertyColumn(new
>> Model("firstName"),"firstName"));
>> columnList.add(new PropertyColumn(new
>> Model("lastName"),"lastName"));
>> AjaxFallbackDefaultDataTable table = new
>> AjaxFallbackDefaultDataTable("link-panel-table", columnList, provider, 3);
>> form.add(table);
>> add(form);
>> }
>> }
>>
>> -Nelson
>>
>>
>> On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson <
>> jer...@wickettraining.com> wrote:
>>
>>> please show some code
>>>
>>> On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura 
>>> wrote:
>>>
>>> > I am trying to create a table based on DataTable, in which one of the
>>> > columns has links on it.
>>> > I tried to use the strategy described here (LinkPanel):
>>> >
>>> >
>>> https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
>>> >
>>> > But this has a problem: clicking in the links in succession soon causes
>>> > "component not found exceptions", or opening the link in a new window
>>> or
>>> > ta

Re: Links in DataTable

2010-06-28 Thread Nelson Segura
Since AjaxLink is AJAX and not a proper link, then it does behave as a
normal link, i.e. middle click (open link in new tab or new window) does not
trigger the AJAX click even, which means you cannot chose to open the link
in a new page.

back to square one, except that know I know is a problem with
AjaxFallbackDefaultDataTable, not with DataTable.


-Nelson

On Mon, Jun 28, 2010 at 5:47 PM, Nelson Segura  wrote:

> Jeremy, the code is below.
>
> I did notice something while researching/testing more.
> The LinkPanel solution DOES work for a DataTable. The problem starts when
> changed to a AjaxFallbackDefaultDataTable.
> I did testing based in the datatable example in the wicket examples.
> Maybe using an AjaxLink instead of a normal link in the table is the right
> answer.
>
>
> Code is mostly taken from the page linked in the original email
>
> public abstract class LinkPanel extends Panel {
>
> private static final long serialVersionUID = 2062173455224348354L;
>
> public LinkPanel(final Item item, final String componentId,
> final IModel model, final String property) {
> super(componentId, model);
>
> AjaxLink link = new AjaxLink("linkCell") {
>
> private static final long serialVersionUID =
> 2574434147588617330L;
>
> @Override
> public void onClick(AjaxRequestTarget target) {
> LinkPanel.this.onClick();
> }
>
>
> };
> add(link);
> link.add(new Label("label", new PropertyModel(model,property)));
> }
>
> protected abstract void onClick();
> }
>
> - Usage ---
>
> public class LinkPanelPage extends WebPage {
>
> public LinkPanelPage() {
> Form form = new Form("form");
> final LinkPanelListProvider provider = new LinkPanelListProvider();
> List columnList = new ArrayList(3);
> //columnList.add(new PropertyColumn(new
> Model("eMailAddress"),"eMailAddress"));
> columnList.add(new AbstractColumn(new Model("eMailAddress"),
> "eMailAddress") {
> private static final long serialVersionUID =
> -1822504503325964706L;
>
> @Override
> @SuppressWarnings("unchecked")
> public void populateItem(Item cellItem, String componentId,
> final IModel rowModel) {
> cellItem.add(new LinkPanel(cellItem, componentId, rowModel,
> getSortProperty()) {
>
> private static final long serialVersionUID =
> -4615958634366803506L;
>
> @Override
> protected void onClick() {
> System.out.println("clicked on link");
> }
> });
> }
>
> });
>
> columnList.add(new PropertyColumn(new
> Model("firstName"),"firstName"));
> columnList.add(new PropertyColumn(new
> Model("lastName"),"lastName"));
> AjaxFallbackDefaultDataTable table = new
> AjaxFallbackDefaultDataTable("link-panel-table", columnList, provider, 3);
> form.add(table);
> add(form);
> }
> }
>
> -Nelson
>
>
> On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson <
> jer...@wickettraining.com> wrote:
>
>> please show some code
>>
>> On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura 
>> wrote:
>>
>> > I am trying to create a table based on DataTable, in which one of the
>> > columns has links on it.
>> > I tried to use the strategy described here (LinkPanel):
>> >
>> > https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
>> >
>> > But this has a problem: clicking in the links in succession soon causes
>> > "component not found exceptions", or opening the link in a new window or
>> > tab
>> > renders the current page unusable, with the same exception.
>> >
>> > rg.apache.wicket.WicketRuntimeException: component . not found on
>> page
>> > ...
>> > at
>> >
>> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
>> > at
>> >
>> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
>> > at
>> >
>> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
>> > at org.apache.wicket.RequestCycle.step(Reques

Re: Links in DataTable

2010-06-28 Thread Nelson Segura
Jeremy, the code is below.

I did notice something while researching/testing more.
The LinkPanel solution DOES work for a DataTable. The problem starts when
changed to a AjaxFallbackDefaultDataTable.
I did testing based in the datatable example in the wicket examples.
Maybe using an AjaxLink instead of a normal link in the table is the right
answer.


Code is mostly taken from the page linked in the original email

public abstract class LinkPanel extends Panel {

private static final long serialVersionUID = 2062173455224348354L;

public LinkPanel(final Item item, final String componentId,
final IModel model, final String property) {
super(componentId, model);

AjaxLink link = new AjaxLink("linkCell") {

private static final long serialVersionUID =
2574434147588617330L;

@Override
public void onClick(AjaxRequestTarget target) {
LinkPanel.this.onClick();
}


};
add(link);
link.add(new Label("label", new PropertyModel(model,property)));
}

protected abstract void onClick();
}

- Usage ---

public class LinkPanelPage extends WebPage {

public LinkPanelPage() {
Form form = new Form("form");
final LinkPanelListProvider provider = new LinkPanelListProvider();
List columnList = new ArrayList(3);
//columnList.add(new PropertyColumn(new
Model("eMailAddress"),"eMailAddress"));
columnList.add(new AbstractColumn(new Model("eMailAddress"),
"eMailAddress") {
private static final long serialVersionUID =
-1822504503325964706L;

@Override
@SuppressWarnings("unchecked")
public void populateItem(Item cellItem, String componentId,
final IModel rowModel) {
cellItem.add(new LinkPanel(cellItem, componentId, rowModel,
getSortProperty()) {

private static final long serialVersionUID =
-4615958634366803506L;

@Override
protected void onClick() {
System.out.println("clicked on link");
}
});
}

});

columnList.add(new PropertyColumn(new
Model("firstName"),"firstName"));
columnList.add(new PropertyColumn(new
Model("lastName"),"lastName"));
AjaxFallbackDefaultDataTable table = new
AjaxFallbackDefaultDataTable("link-panel-table", columnList, provider, 3);
form.add(table);
add(form);
}
}

-Nelson

On Mon, Jun 28, 2010 at 5:14 PM, Jeremy Thomerson  wrote:

> please show some code
>
> On Mon, Jun 28, 2010 at 6:39 PM, Nelson Segura  wrote:
>
> > I am trying to create a table based on DataTable, in which one of the
> > columns has links on it.
> > I tried to use the strategy described here (LinkPanel):
> >
> > https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
> >
> > But this has a problem: clicking in the links in succession soon causes
> > "component not found exceptions", or opening the link in a new window or
> > tab
> > renders the current page unusable, with the same exception.
> >
> > rg.apache.wicket.WicketRuntimeException: component . not found on
> page
> > ...
> > at
> >
> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
> > at
> >
> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
> > at
> >
> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
> > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
> > ...
> >
> > I believe this is due to the fact that a new LinkPanel is created when
> > rendering each column cell, and that when the click happens, the current
> > LinkPanels are replaced by new ones, and so the original page is not
> usable
> > anymore, because it is referring to the original LinkPanels.
> >
> > Our users make heavy use of opening links in a list in new pages or tabs,
> > so
> > this is a big deal for us :(
> >
> > Is there any solution for this problem? The only one I can think of is to
> > use AjaxLink instead, but I am not sure whether that is correct, or if it
> > could cause even more problems.
> >
> > Any help?
> >
> > -Nelson
> >
>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>


Links in DataTable

2010-06-28 Thread Nelson Segura
I am trying to create a table based on DataTable, in which one of the
columns has links on it.
I tried to use the strategy described here (LinkPanel):

https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html

But this has a problem: clicking in the links in succession soon causes
"component not found exceptions", or opening the link in a new window or tab
renders the current page unusable, with the same exception.

rg.apache.wicket.WicketRuntimeException: component . not found on page ...
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
...

I believe this is due to the fact that a new LinkPanel is created when
rendering each column cell, and that when the click happens, the current
LinkPanels are replaced by new ones, and so the original page is not usable
anymore, because it is referring to the original LinkPanels.

Our users make heavy use of opening links in a list in new pages or tabs, so
this is a big deal for us :(

Is there any solution for this problem? The only one I can think of is to
use AjaxLink instead, but I am not sure whether that is correct, or if it
could cause even more problems.

Any help?

-Nelson


Re: Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Nelson Segura
OK, so this means replacing all the
AjaxFallBackDefaultDataTable/AjaxNavigationToolbar/AjaxPaginNavigator/etc
and the AjaxFallbackHeadersToolbar/etc classes with my own classes that
mimic them? Correct?

-Nelson


On Thu, Jun 3, 2010 at 11:02 AM, Igor Vaynberg wrote:

> see how AjaxFallbackDefaultDataTable  replaces the navigator links
> with AjaxFallbackLinks...
>
> -igor
>
> On Thu, Jun 3, 2010 at 8:18 AM, Nelson Segura  wrote:
> > Hello,
> >
> > I am new to Wicket, and I am writing a listing component based on the
> > phonebook app that uses AjaxFallbackDefaultDataTable and is able to
> retain
> > checkbox status across pages.
> > I searched the forums, and reading around, I was able to get the status
> > being retained on submits.
> >
> > What I am missing is to convert my paging and sorting links to
> > AjaxSubmitLinks, so my checkbox status gets send to the server. I have
> > searched around and found that this is needed, but how no pointers on how
> to
> > do the job. Can someone provide a quick outline / sample code on how this
> > replacement can be done?
> >
> > -Nelson
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Nelson Segura
Hello,

I am new to Wicket, and I am writing a listing component based on the
phonebook app that uses AjaxFallbackDefaultDataTable and is able to retain
checkbox status across pages.
I searched the forums, and reading around, I was able to get the status
being retained on submits.

What I am missing is to convert my paging and sorting links to
AjaxSubmitLinks, so my checkbox status gets send to the server. I have
searched around and found that this is needed, but how no pointers on how to
do the job. Can someone provide a quick outline / sample code on how this
replacement can be done?

-Nelson