Re: AutoCompleteTextField Stateless

2017-06-29 Thread Pedro Santos
Hi Marieke,

in a similar situation I chose to send the components that should be
presented in the modal window in the markup, hidden by the page CSS, and to
create a modal window to show them using purely javascript.

cheers

Pedro Santos

On Thu, Jun 29, 2017 at 11:33 AM, Marieke Vandamme <marieke.vanda...@tvh.com
> wrote:

> Hi,
>
> ​This is working. Thanks !
> Do you also have a solution for the ModalWindow, or isn't that possible. ​
>
>
> 2017-06-29 16:06 GMT+02:00 Andrea Del Bene <an.delb...@gmail.com>:
>
> > Hi,
> >
> > try to override getStatelessHint also for the internal behavior used by
> > AutoCompleteTextField. you have to override
> > AutoCompleteTextField#newAutoCompleteBehavior and make it return
> something
> > like this:
> >
> > return new AutoCompleteBehavior(renderer, settings)
> > {
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected Iterator getChoices(final String input)
> > {
> > return AutoCompleteTextField.this.getChoices(input);
> > }
> >
> > @Override
> > protected void updateAjaxAttributes(AjaxRequestAttributes
> > attributes)
> > {
> > super.updateAjaxAttributes(attributes);
> >
> > AutoCompleteTextField.this.updateAjaxAttributes(
> > attributes);
> > }
> >
> > @Override
> > protected boolean getStatelessHint(Component component)
> >{
> >return true;
> >}
> > };
> >
> > On Thu, Jun 29, 2017 at 12:19 PM, Marieke Vandamme <
> > marieke.vanda...@tvh.com
> > > wrote:
> >
> > > And maybe even a more difficult one, is it possible to make ModalWindow
> > > stateless?
> > > Thanks again !
> > >
> > >
> > > Met vriendelijke groeten, Salutations distinguées, Kind Regards,
> > >
> > >
> > > *MARIEKE VANDAMMECORPORATE SERVICES* • *Domain Coordinator*
> > > T +32 56 43 42 45 <+3256434245> • F +32 56 43 44 46 •
> > > marieke.vanda...@tvh.com
> > >
> > > *TVH GROUP NV*
> > > Brabantstraat 15 • BE-8790 WAREGEM
> > > T +32 56 43 42 11 <+3256434211> • F +32 56 43 44 88 • www.tvh.com
> > > View our company movies via downloads on our website.
> > >
> > > 2017-06-29 12:05 GMT+02:00 Marieke Vandamme <marieke.vanda...@tvh.com
> >:
> > >
> > > > ​Hi,
> > > >
> > > > I'm using Apache Wicket 7.7.0.
> > > > Is it possible to make  AutoCompleteTextField Stateless?
> > > > ​I'm using StatelessChecker in my application and @StatelessComponent
> > on
> > > > my Panel.
> > > > I've overridden getStatelessHint for the AutoCompleteTextField to
> > return
> > > > true.
> > > > But the StatelessChecker is complaining:
> > > > java.lang.IllegalArgumentException: '[CategorySearchPanel [Component
> > id
> > > =
> > > > searchPanel]]' claims to be stateless but isn't. Offending component:
> > > > [AutoCompleteTextField [Component id = searchTxt]]
> > > >
> > > > Thanks ! Kind Regards, Marieke
> > > >
> > >
> > > --
> > >
> > >
> > >  DISCLAIMER 
> > >
> > > http://www.tvh.com/glob/en/email-disclaimer
> > >
> > > "This message is delivered to all addressees subject to the conditions
> > > set forth in the attached disclaimer, which is an integral part of this
> > > message."
> > >
> >
>
> --
>
>
>  DISCLAIMER 
>
> http://www.tvh.com/glob/en/email-disclaimer
>
> "This message is delivered to all addressees subject to the conditions
> set forth in the attached disclaimer, which is an integral part of this
> message."
>


Re: wicket:link doesn't work on srcset attribute

2017-02-23 Thread Pedro Santos
Hi Brosich, it's true. I think Wicket's wicket:link tag handler can be
improved to cover this attribute.

Cheers

Pedro Santos

On Thu, Feb 23, 2017 at 11:11 AM, Brosich, Alberto <abros...@inogs.it>
wrote:

> Hello to all,
>
> I'm using the srcset attribute of a source tag inside a picture tag.
> It seems that wicket:link doesn't convert static links inside srcset
> attribute.
> (Wicket version 8.0.0-M3)
>
> Is it true?
>
> Regards
>
> Alberto
>


Re: Java Wickets Dynamic DataView

2017-02-07 Thread Pedro Santos
You can change your ListDataProvider to load data at each request like:

new ListDataProvider(){
List getData() { if (list == null)  list =
manageUserStoreDomain.findUsers(domain.getDomainname()); return list;
}
void detach(){ list = null;}
}

or to use any IDataProvider implementation that is affected by you transaction.

Cheers
Pedro Santos


On Tue, Feb 7, 2017 at 2:31 PM, ASHU_JAVA <ashu@gmail.com> wrote:
> Thanks Padro for your response.
> I'm a newbie to Java Wickets, so can you please share some more insights
> regarding this.
>
> I'm using below code:-
>
>
>
>
> I'm able to add user to database, but unable to refresh the list with new
> list entry.
>
> Kindly provide your inputs.
>
> Thanks in advance.
>
>
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Dynamic-DataView-tp4676976p4677010.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: Can @Inject annotation be used instead of @SpringBean to inject Spring beans?

2017-02-04 Thread Pedro Santos
@Inject, it would make it easier to migrate to CDI as well

cheers
Pedro Santos


On Tue, Jan 31, 2017 at 5:26 AM, Martin Grigorov <mgrigo...@apache.org> wrote:
> Hi,
>
> I use @SpringBean in my applications.
> The only reason one to switch to @Inject is if your application may use
> Guice in the future. Using @Inject will make it easier to migrate.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jan 31, 2017 at 4:36 AM, James Selvakumar <ja...@mcruncher.com>
> wrote:
>
>> Hi all,
>>
>> I've always used @SpringBean annotation to inject Spring beans in my Wicket
>> components.
>> We found that we could also use the standard @Inject annotation in Wicket
>> components.
>> Is it advisable to use @Inject instead of @SpringBean?
>> Or should we continue to use @SpringBean?
>>
>> --
>> Thanks & regards
>> James
>>

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



Re: Java Wickets Dynamic DataView

2017-02-04 Thread Pedro Santos
Hi Ashu,

just make sure the the add button inside the modal re-renders the
DataView. If the input data was correctly add to the database, the
DataView's IDataProvider should correctly start to provide them and
they will show up in the response.

cheers
Pedro Santos


On Thu, Feb 2, 2017 at 4:29 PM, ASHU_JAVA <ashu@gmail.com> wrote:
> Hello All,
>
> I'm trying to have a dynamic list view which will get updated dynamically on
> a button click.
> I've to implement the functionality like below:-
>
> <http://apache-wicket.1842946.n4.nabble.com/file/n4676976/Sample.png>
>
> So, the user will pass either a single name or upload a file containing many
> names, an addition in database is performed in the background by clicking
> the button "ADD".
> On success, the DataView should update the list of names as shown in tabular
> form in above image with the newly added one.
>
> I'm using a model window that contain this form and would like to update the
> list (DataView) section on clicking the ADD button.
>
> Kindly suggest your inputs/code sample to achieve this.
>
> Thanks in advance.
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Dynamic-DataView-tp4676976.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: Christmas / new year [NON-BIZ]

2016-12-31 Thread Pedro Santos
Thank you!

Feliz ano novo! (portuguese :)

Cheers

Pedro Santos
Pedro Santos


On Sat, Dec 24, 2016 at 9:33 AM, Tobias Soloschenko
<tobiassolosche...@googlemail.com> wrote:
> Hi all,
>
> I wish you a merry christmas and happy new year. :-)
>
> kind regards
>
> Tobias
>
> -
> 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



[ANNOUNCE] CVE-2016-6793 Apache Wicket deserialization vulnerability

2016-12-30 Thread Pedro Santos
CVE-2016-6793: Apache Wicket deserialization vulnerability

Severity: Low

Vendor: The Apache Software Foundation

Versions Affected: Apache Wicket 6.x and 1.5.x

Description: Depending on the ISerializer set in the Wicket application,
it's possible that a Wicket's object deserialized from an untrusted source
and utilized by the application to causes the code to enter in an
infinite loop. Specifically, Wicket's DiskFileItem class, serialized by
Kryo, allows an attacker to hack its serialized form to put a client on an
infinite loop if the client attempts to write on the
DeferredFileOutputStream attribute.

Mitigation: Upgrade to Apache Wicket 6.25.0 or 1.5.17

Credit: This issue was discovered by Jacob Baines, Tenable Network Security and
Pedro Santos

References: https://wicket.apache.org/news


Re: How allow select from a disabled field

2016-12-02 Thread Pedro Santos
After reading the thread on Isis's mailing list, I'm under the impression
that the best solution is to offer an API enabling users to configure how
the disabled text field will be shown. My suggestion is to add the method
TextField.showDisabledAsReadOnly(boolean) and to keep the current
"disabled" attribute as the default presentation of a disabled text field.

Cheers


Pedro Santos

On Fri, Dec 2, 2016 at 7:07 AM, Dan Haywood <d...@haywood-associates.co.uk>
wrote:

> The Apache Isis project [1] uses Wicket for its main viewer, and we
> recently had this question [2] on our mailing list is:
>
> I believe it was mentioned once in another thread that selecting text
> (and so copying) from a disabled field doesn't work in Firefox on
> Windows. Since a week or two it's not possible on a lot of Chrome
> installations of our users either, probably due to a Chrome update. This
> really is a big problem for our users because we share a lot of
> configuration data for internet access and telephony services and
> copying data makes sure they don't make mistakes while configuring their
> systems.
>
> Would it be a problem to use the read only attribute instead of the
> disabled attribute? That would be an easy fix.
>
>
> Martin G suggested a possible fix using CSS, but unfortunately to no
> avail.  Since this presumably could impact all Wicket users, the suggestion
> [3] was to re-raise the question here.
>
> So, are there any thoughts on this?  Is there any way to enable select text
> for a disabled input field for both latest Chrome and Firefox?
>
> Thx
> Dan
>
> [1] http://isis.apache.org/
> [2]
> https://lists.apache.org/thread.html/354ff5bb35c3dd60fbe643f824951c
> 9665aa7546d79562cf15e014f7@%3Cusers.isis.apache.org%3E
> [3]
> https://lists.apache.org/thread.html/566709f02cc6a4607d1f86d98e19ec
> 1e7d39a2a255dc9895d5800635@%3Cusers.isis.apache.org%3E
>


Re: Wicket 6 - How to fill form based on listview selected row

2016-09-18 Thread Pedro Santos
Hi,

you can construct a link using both a reference to ListView item's model
and the form, so when clicked it gets the new form value from the selected
item.

cheers

e.g.

populateItem(item){
  item.add(new SelectItemLink("id", item.getDefaultModel(), form));
}

class SelectItemLink{
  onClick(){
form.setDefaultModelObject(itemModel.getObject());
  }
}


Pedro Santos

On Sat, Sep 17, 2016 at 3:05 PM, Iamuser <superbiss...@gmail.com> wrote:

> Hello,
>
> I have a page with a :
> 1. a listview
> 2. an input form
>
> When first entering the page, the listview displays all the rows from a
> table, and the input form is empty.
> One of the columns inside the listview is a link component, that when
> clicked should refresh the model of the form and show the data for that row
> in order to be able to edit it.
>
> Could you please give me some guidance on how to refresh the model of the
> form and show the data for the selected row?
>
> Thank you.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-6-How-to-fill-form-based-on-listview-
> selected-row-tp4675519.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: wicketAjaxGet in 1.6

2012-06-28 Thread Pedro Santos
Oh, also the best place to address this question is in the Wicket users
list, redirecting...

Pedro Santos



2012/6/29 Pedro Santos pedros...@gmail.com

 Hi Daniel,

 if you want to call back a AJAX behaviour, you can also check the method
 AbstractDefaultAjaxBehavior#getCallbackScript()

 cheers,

 Pedro Santos



 2012/6/20 Martin Dilger martin.dil...@googlemail.com

 Check the wiki to see what changed

 https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax

 , there method names have been aligned, wicketajaxget now is
 wicket.ajax.get.

 regard

 Martin Dilger
 Am 19.06.2012 22:58 schrieb Daniel Simons daniel.simo...@gmail.com:

  I recently upgraded to 6.0.0-beta2 and it appears that wicketAjaxGet
  function has been removed from the API.
 
  Uncaught ReferenceError: wicketAjaxGet is not defined
 
 
  Is there a new way to get back to the server from javascript in 1.6?
 
  Thanks,
  Daniel Simons
 





Re: JavaScript noJavaScript Navigation

2011-12-14 Thread Pedro Santos
Hi, you can add the body as a WebMarkupContainer, set it to output its
markup id, and replace it by decorating the AJAX response with the
transition effect JS. If the client is using IE you just redirect it him to
the target page.

Pedro Henrique Oliveira dos Santos


2011/12/14 daslicht dasli...@ansolas.de

 Hello,
 is it possible that I could create a website which consists of multiple
 pages with dynamic content, such as tables/lists of products. This would
 ensure that the website could be easily crawled by a Search Engine without
 any extra efford.

 If a visitor has JavaScript enabled I just like to read the content (body)
 of the aquired page and replace the current content with it while using
 fades to craete smooth transitions. To update the URLS I would use the
 HTML5
 Session History API.(IE9 would get the non AJAX version:) Is this possible
 ?

 This way the designer could visually layout all things and we still could
 have a single-page AJAX style website.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/JavaScript-noJavaScript-Navigation-tp4194864p4194864.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Hi Thomas, encoding the page ID in the URL would respond an expired page.

Pedro Henrique Oliveira dos Santos


2011/12/14 Thomas Götz t...@decoded.de

 The situation:

 I have a mounted page containing several AJAX components. Whenever the
 session expires and an AJAX request is triggered afterwards, a new instance
 of the page is (silently) created which is normal behavior I suppose (when
 looking at PageProvider.resolvePageInstance(…)).

 Can I hook into that somehow? I'd like to show some custom
 please-restart-you-session-by-clicking-here ExpiredPage, but there's no
 PageExpiredException thrown (which is a good thing), but nevertheless I'd
 prefer to show something to the user.

 Can someone point me into the right direction?

 Cheers,
   -Tom



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




Re: Suppress page serialization

2011-12-14 Thread Pedro Santos
Hi Stefan, does it makes sense to move this object to the session?
Make sure you make your page instance manager touching each affected page
after to change the object. e.g. Session.get().touch(affectedPage);

Pedro Henrique Oliveira dos Santos


2011/12/14 Stefan Lindner lind...@visionet.de

 Given is a Page 0 with an object. The object has a given value X;

 On the Page 0 resides an AjaxLink that opens a new Page 1 in a Wicket
 ModalWindow. The Content is a Page, not a Panel.
 Page 1 knows the object, the object is a parameter in page constructor.

 Modifying object to Y and closing page 1 lets the object's value to be Y
 in Page 0. Fine.

 Now I Place an AjaxLink on Page 1 that opens a new Page 2. Page 2 knows
 the object as well.
 Page 0 - klick - Page 1 - klick - Page 2 - set object to Z - close
 Page 2 - close Page 1 - back on Page 0
 Now the value is still X. The object tzat was passed to Page 1 and the to
 Page 2 an that was modified in Page 2 lost ists modification back on Page 0.

 All Pages are set to versioned(false).

 We use Wicket 1.4.19.

 Any idea?

 Stefan




Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Bleh, my bad, PageProvider will give you a fresh page since the
MountedMapper were able to resolve the target page class.
You can customize PageProvider to throw a StalePageException based on
custom rules. Don't know if it's the best option.

Pedro Henrique Oliveira dos Santos


2011/12/14 Thomas Götz t...@decoded.de

 Can you give an example? AFAIK the pageId *is* already encoded in the URL
 bei Wicket, i.e. the URL changes to http://my.domain/foobar?0 when the
 page is rendered. Doing AJAX requests on the page does not change the URL
 though …

 Cheers,
   -Tom


 Pedro Santos wrote:

  Hi Thomas, encoding the page ID in the URL would respond an expired page.
 
  Pedro Henrique Oliveira dos Santos
 
 
  2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
 
   The situation:
  
   I have a mounted page containing several AJAX components. Whenever the
   session expires and an AJAX request is triggered afterwards, a new
 instance
   of the page is (silently) created which is normal behavior I suppose
 (when
   looking at PageProvider.resolvePageInstance(…)).
  
   Can I hook into that somehow? I'd like to show some custom
   please-restart-you-session-by-clicking-here ExpiredPage, but there's no
   PageExpiredException thrown (which is a good thing), but nevertheless
 I'd
   prefer to show something to the user.
  
   Can someone point me into the right direction?
  
   Cheers,
   -Tom
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org)
   For additional commands, e-mail: users-h...@wicket.apache.org (mailto:
 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: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
You can override the PageProvider#getPageInstance method and test for the
target page class. If there are no instance for its page id and it is one
of those pages you want to reply to user a page expired message rather than
reply a fresh instance you throw a PageExpiredException exception (not
a StalePageException, StalePageException is for another case ).

Pedro Henrique Oliveira dos Santos


2011/12/14 Thomas Götz t...@decoded.de

 Don't know either, but since I don't have any other idea at the moment:
 how would I do this?

 Cheers,
   -Tom


 Pedro Santos wrote:

  Bleh, my bad, PageProvider will give you a fresh page since the
  MountedMapper were able to resolve the target page class.
  You can customize PageProvider to throw a StalePageException based on
  custom rules. Don't know if it's the best option.
 
  Pedro Henrique Oliveira dos Santos
 
 
  2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
 
   Can you give an example? AFAIK the pageId *is* already encoded in the
 URL
   bei Wicket, i.e. the URL changes to http://my.domain/foobar?0 when the
   page is rendered. Doing AJAX requests on the page does not change the
 URL
   though …
  
   Cheers,
   -Tom
  
  
   Pedro Santos wrote:
  
Hi Thomas, encoding the page ID in the URL would respond an expired
 page.
   
Pedro Henrique Oliveira dos Santos
   
   
2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
   
 The situation:

 I have a mounted page containing several AJAX components. Whenever
 the
 session expires and an AJAX request is triggered afterwards, a new

   
   
  
  
   instance
 of the page is (silently) created which is normal behavior I
 suppose
   
  
  
   (when
 looking at PageProvider.resolvePageInstance(…)).

 Can I hook into that somehow? I'd like to show some custom
 please-restart-you-session-by-clicking-here ExpiredPage, but
 there's no
 PageExpiredException thrown (which is a good thing), but
 nevertheless

   
  
  
   I'd
 prefer to show something to the user.

 Can someone point me into the right direction?

 Cheers,
 -Tom




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org(mailto:
 users-unsubscr...@wicket.apache.org) (mailto:

   
  
  
   users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org))
 For additional commands, e-mail: users-h...@wicket.apache.org(mailto:
 users-h...@wicket.apache.org) (mailto:
   
  
  
   users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org))
   
  
  
  
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org)
   For additional commands, e-mail: users-h...@wicket.apache.org (mailto:
 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: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Hi Thomas,

I was looking at the code, there isn't a central place creating a
PageProvider, which makes sense since it is designed to be created in
multiple ways. I had another idea and I think it is best to create a custom
MountedMapper that overrides the mapRequest method to implement your logic.

Pedro Henrique Oliveira dos Santos


2011/12/14 Thomas Götz t...@decoded.de

 Yes, that was what I had in mind. But where can I configure my custom
 PageProvider (i.e. that Wicket knows that my PageProvider implementation
 should be used)?

 Cheers,
   -Tom


 Pedro Santos wrote:

  You can override the PageProvider#getPageInstance method and test for the
  target page class. If there are no instance for its page id and it is one
  of those pages you want to reply to user a page expired message rather
 than
  reply a fresh instance you throw a PageExpiredException exception (not
  a StalePageException, StalePageException is for another case ).
 
  Pedro Henrique Oliveira dos Santos
 
 
  2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
 
   Don't know either, but since I don't have any other idea at the moment:
   how would I do this?
  
   Cheers,
   -Tom
  
  
   Pedro Santos wrote:
  
Bleh, my bad, PageProvider will give you a fresh page since the
MountedMapper were able to resolve the target page class.
You can customize PageProvider to throw a StalePageException based on
custom rules. Don't know if it's the best option.
   
Pedro Henrique Oliveira dos Santos
   
   
2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
   
 Can you give an example? AFAIK the pageId *is* already encoded in
 the
   URL
 bei Wicket, i.e. the URL changes to http://my.domain/foobar?0when the
 page is rendered. Doing AJAX requests on the page does not change
 the
   
  
  
   URL
 though …

 Cheers,
 -Tom


 Pedro Santos wrote:

  Hi Thomas, encoding the page ID in the URL would respond an
 expired
   page.
 
  Pedro Henrique Oliveira dos Santos
 
 
  2011/12/14 Thomas Götz t...@decoded.de (mailto:t...@decoded.de)
 
   The situation:
  
   I have a mounted page containing several AJAX components.
 Whenever
   the
   session expires and an AJAX request is triggered afterwards, a
 new
 




 instance
   of the page is (silently) created which is normal behavior I
 

   
  
  
   suppose




 (when
   looking at PageProvider.resolvePageInstance(…)).
  
   Can I hook into that somehow? I'd like to show some custom
   please-restart-you-session-by-clicking-here ExpiredPage, but
 

   
  
  
   there's no
   PageExpiredException thrown (which is a good thing), but
 

   
  
  
   nevertheless
 




 I'd
   prefer to show something to the user.
  
   Can someone point me into the right direction?
  
   Cheers,
   -Tom
 

   
  
  
   -
   To unsubscribe, e-mail: 
   users-unsubscr...@wicket.apache.org(mailto:
 users-unsubscr...@wicket.apache.org)(mailto:
 

   
  
  
   users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org)) (mailto:
 




 users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org) (mailto:
   users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org)))
   For additional commands, e-mail: 
   users-h...@wicket.apache.org(mailto:
 users-h...@wicket.apache.org)(mailto:
 

   
  
  
   users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org))
 (mailto:




 users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org
 ))









 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org(mailto:
 users-unsubscr...@wicket.apache.org) (mailto:
   
  
  
   users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org))
 For additional commands, e-mail: users-h...@wicket.apache.org(mailto:
 users-h...@wicket.apache.org) (mailto:
   
  
  
   users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org))
   
  
  
  
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org (mailto:
 users-unsubscr...@wicket.apache.org)
   For additional commands, e-mail: users-h...@wicket.apache.org (mailto:
 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: Stateful pages without page Id in the url

2011-09-15 Thread Pedro Santos
Hi, yes you can, but F5 will instance the page again and its state will get
lost.
I think the problem is related to
https://issues.apache.org/jira/browse/WICKET-4014
Can you open a ticket so we can track it?

2011/9/15 hok ivanvasi...@gmail.com

 Hello,
 I have an application where all the pages are stateful (have ajax
 components
 in them). However, most of the pages are also bookmarkable and can be fully
 restored via the PageParameters. In addition to this, some of pages with
 input forms contain unmanaged hibernate entities (unmanaged, because they
 can be modified via ajax) and I would prefer to refresh every time the page
 is requested from the server, instead of retrieving the page from the page
 store. When wicket 1.5 was released I created the following class:

 public class NoPageIdMountedMapper extends MountedMapper {

...

@Override
protected void encodePageComponentInfo(Url url, PageComponentInfo info)
 {
super.encodePageComponentInfo(url, null);
}
 }

 which removed the page Id from the url and this didn't result in any other
 change in the behavior. However in the latest wicket revisions (currently
 in
 1.5-SNAPSHOT) this technique doesn't work anymore - the ajax in the pages
 using NoPageIdMountedMapper is not working, because the ajax request url
 doesn't contain the page id anymore.

 Is it still possible to have stateful pages without having the page id in
 the url? Thanks in advance.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816663.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




-- 
Pedro Henrique Oliveira dos Santos


Re: stateless page + click on stateless link = stateful page

2011-09-13 Thread Pedro Santos
Yes, otherwise the F5 would not work. It can be prevented by redirecting to
a stateless page, even if it was the last accessed one.

2011/9/13 Bertrand Guay-Paquet ber...@step.polymtl.ca

 Hello,

 I have a stateless page with a stateless link on it. The stateless link is
 used to set the session locale and nothing more. In particular, it does not
 redirect to another page when clicked.

 On first access to the page, the url is: localhost/servlet/login
 After clicking on the stateless link, the url becomes something like:
 localhost/servlet/login?8-1.**ILinkListener-userPanel-en

 At this point, the page is now stateful. This is caused by the constructor
 PageProvider(IRequestablePage page) which has the following code:
if (pageInstance instanceof Page)
{
((Page)pageInstance).**setStatelessHint(false);
}

 I don't understand why this is done. Is it because Wicket needs to make the
 page stateful since the URL now contains an action listener parameter?

 Is there a way to prevent the stateless page from becoming stateful?

 Cheers,
 Bertrand

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Updates on model of FormComponents not being displayed after Ajax call

2011-08-31 Thread Pedro Santos
Hi Jonas, you need to notify those form components about their model value
change.
e.g.
formComponent.modelChanged();
target.add(formComponent);

2011/8/31 Jonas Pohlandt jonas.pohla...@lbi.com

 Hello everyone,

 in an AjaxFormComponentUpdatingBehavior callback I make some changes to the
 object which is the target of the CompundPropertyModel of a form. After the
 changes are made, I add the FormComponents (RequiredTextFields) that are
 mapped to the changed properties of the model object to the
 AjaxRequestTarget. If I log the property values to the console, I can see
 that have the expected (changed) values. Unfortunately, the FormComponents
 do not show the updates after the Ajax call returns. Interestingly, the form
 validation uses the expected/changed values after the click on a submit
 button, even though the FormComponents still show the wrong (unchanged)
 values.

 Is there something besides the adding of the respective components to the
 AjaxRequestTarget that I am missing here?

 Any help highly appreciated,
 Jonas

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Updates on model of FormComponents not being displayed after Ajax call

2011-08-31 Thread Pedro Santos
FormComponent overrides internalOnModelChanged. I guess the problem is the
raw input cache in the form component. Since you changed the model value,
you also needs to make sure that this user input cache will be discarded.
Try FormComponent#clearInput before add it in the target.

2011/8/31 Jonas Pohlandt jonas.pohla...@lbi.com

 Hi Pedro,

 just tried that. Unfortunately it did not work.
 I checked the source:
public final void modelChanged()
{
// Call user code
internalOnModelChanged();
onModelChanged();
}

 Both internalOnModelChanged and onModelChanged are empty in their default
 implementation by Component (which is not overwritten by RequiredTextField
 or any of its superclasses).

 Jonas

 -Ursprüngliche Nachricht-
 Von: Pedro Santos [mailto:pedros...@gmail.com]
 Gesendet: Mittwoch, 31. August 2011 16:12
 An: users@wicket.apache.org
 Betreff: Re: Updates on model of FormComponents not being displayed after
 Ajax call

 Hi Jonas, you need to notify those form components about their model value
 change.
 e.g.
 formComponent.modelChanged();
 target.add(formComponent);

 2011/8/31 Jonas Pohlandt jonas.pohla...@lbi.com

  Hello everyone,
 
  in an AjaxFormComponentUpdatingBehavior callback I make some changes to
 the
  object which is the target of the CompundPropertyModel of a form. After
 the
  changes are made, I add the FormComponents (RequiredTextFields) that are
  mapped to the changed properties of the model object to the
  AjaxRequestTarget. If I log the property values to the console, I can see
  that have the expected (changed) values. Unfortunately, the
 FormComponents
  do not show the updates after the Ajax call returns. Interestingly, the
 form
  validation uses the expected/changed values after the click on a submit
  button, even though the FormComponents still show the wrong (unchanged)
  values.
 
  Is there something besides the adding of the respective components to the
  AjaxRequestTarget that I am missing here?
 
  Any help highly appreciated,
  Jonas
 
  -
  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




-- 
Pedro Henrique Oliveira dos Santos


Re: nested table

2011-08-25 Thread Pedro Santos
Hi, you can nestle repeater components like:
new ListView(id, listOfClass2){
   onPopulate( item){
  item.add( ... );
  item.add(new ListView(id, listOfClass1OfThisClass2){
  onPopulate( innerItem ){
innerItem.add( ... );
  }
  });
  }
}

2011/8/25 preben p...@dr.dk

 Hi

 My wicket experience is quit rusty so forgive me if this is a simple
 question, but I have not been able to find any example of this.

 I want to render at table with a nested table in one of the cells.

 eg.



 MyClass1
   String attribute1;
   String attribute2;

 MyClass2
   String attribute1
   String attribute2
   ListMyClass1 listOfMyClass1


 MyListToRender = ListMyClass2


 How would i render MyListToRender using repeaters with a nested List ?
 Any example would be helpfull.

 Thanks.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/nested-table-tp3769047p3769047.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Problem with Android and ajax?

2011-08-25 Thread Pedro Santos
Hi Palmer, it is possible related to
https://issues.apache.org/jira/browse/WICKET-3820 , upgrade to 1.4.18

2011/8/25 PALMER, THOMAS C (ATTCORP) tp3...@att.com

 We have a problem with a mobile site on an Android.  Basically, we're
 updating select options via ajax with one option that should be selected
 after the update completes.  On an iPhone this works fine and the selected
 option shows in the list as selected.  On Android we get nothing in the
 dropdown at all until the page is refreshed (reloading the complete state).

 The Android user agent we're seeing (Mozilla/5.0 (Linux; U; Android
 2.1-update1; en-us; HTC-A6366/1.0 Build/ERE27) AppleWebKit/530.17 (KHTML,
 like Gecko) Version/4.0 Mobile Safari/530.17) will be treated as Safari
 based on the browser recognition code in wicket-event.js.  It appears the
 code in wicket-ajax.js in Wicket.replaceOuterHtmlSafari isn't doing the
 right thing for Android, despite them both being Webkit based.

 Any thoughts on a way to address this?  This is wicket 1.4.14.

 Thanks much -

 Tom Palmer
 Director, Strategic Technology Services
 ATT Hosting  Application Services | 2000 Perimeter Park Drive, Suite 140
 | Morrisville, NC 27560
 Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431
 thomas.pal...@att.commailto:thomas.pal...@att.com

 Confidentiality Notice and Disclaimer: This e-mail transmission may contain
 confidential and/or proprietary information of ATT that is intended only
 for the individual or entity named in the e-mail address. If you are not the
 intended recipient, you are hereby notified that any disclosure, copying,
 distribution, or reliance upon the contents of this e-mail is strictly
 prohibited. If you have received this e-mail transmission in error, please
 reply to the sender, so that ATT can arrange for proper delivery, and then
 please delete the message from your inbox. Thank you.




-- 
Pedro Henrique Oliveira dos Santos


Re: Wicket 1.5: Question (or feature request) afterOnInitialize()

2011-08-10 Thread Pedro Santos
Hi Armando, the problem #1 is rather about not have the entire
component tree connected already. onInitialize is called when the
component is aware of its path to page, at this moment, a triggered
even will not reach new nodes addition in the component tree.

On Wed, Aug 10, 2011 at 7:23 AM, armandoxxx armando@dropchop.com wrote:
 Hey guys ...

 With wicket 1.5 we got events. So far so good but I got a case where i'm
 missing after on initialize method call.

 I have lot's of panels on my page, and I create them in onInitialize() code.
 But I need to send a 1 time event after all components are initialized.
 - problem #1: If I send an event from onInitialize():  not sure that all
 components are initialized !
 - problem #2: If is send an event from onConfigure() or onBeforeRender(),
 the event get send everytime component is rendered ...

 So current solution is to create a flag in my panels that sendEventOnInit()
 method was allready called ..

 but it would be better  to have a method onInitialized() |
 afterInitialized() (pick your favorite name).

 If someone has better approach, please let me know about it !

 Kind regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Question-or-feature-request-afterOnInitialize-tp3732520p3732520.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: 1.5 - wicket module build question

2011-08-07 Thread Pedro Santos
wicket module under trunk is there just to be an agregator of the main
dependencies needed to run Wicket for maven users.

On Sun, Aug 7, 2011 at 5:53 PM, Kaz C kaz@gmail.com wrote:
 I checked out Wicket (all modules) from trunk and executed mvn install.
 Build was successful.
 So, if I check my local maven repository and look
 under .m2/repository/org/apache/wicket/wicket/1.5-SNAPSHOT shouldn't I see
 a wicket-1.5-SNAPSHOT.jar ?

 Currently this is what I see:
 $ ls
 maven-metadata-local.xml  wicket-1.5-SNAPSHOT.pom

 Thanks,
 - Kaz




-- 
Pedro Henrique Oliveira dos Santos

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



Re: DataViw double clickable rows and ModalWindow

2011-08-03 Thread Pedro Santos
looks like a bug

On Wed, Aug 3, 2011 at 2:46 PM, Decebal Suiu decebal.s...@asf.ro wrote:
 Hello

 I have a panel with a DataTable and, in newRowItem() I added an
 AjaxEventBehavior(ondblclick).
 Everything works fine if I add the panel in a WebPage but doesn't work in a
 ModalWindow. It's a bug or I do something wrong?

 Any advice it's welcome.
 Thanks, Decebal

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/DataViw-double-clickable-rows-and-ModalWindow-tp3716333p3716333.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Using IResourceCachingStrategy with context relative resources(non PackageResource)

2011-08-02 Thread Pedro Santos
Yes, it is there for package resources. Better would be write a
javax.servlet.Filter with the described logic.

On Tue, Aug 2, 2011 at 11:46 AM, Serban.Balamaci thespamtr...@gmail.com wrote:
 Hello all,
 I'm using Wicket 1.5RC5.1.

 It seems that IResourceCachingStrategy can only be used on
 PackageResource(in BasicResourceReferenceMapper
 getCachingStrategy().decorateUrl() if reference instanceof
 PackageResourceReference), is that right?

 Could I obtain the benefits for resources that are under /webapp/js,
 /webapp/css?

 Because I want to use wro4j to compact js and css files and  write under js
 and css at /webapp/wro, but also have the benefits of
 FilenameWithVersionResourceCachingStrategy, so everytime the application is
 redeployed I want the users to receive the new compacted .js and .css files.

 Is there another approach?

 Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-IResourceCachingStrategy-with-context-relative-resources-non-PackageResource-tp3712574p3712574.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Disabling Entire Page, and Redirecting to Page in N Seconds

2011-08-02 Thread Pedro Santos
Hi, Jquery UI has a nice css to overlay components. You can try to
present one protecting the page and presenting some message.
e.g.

Overlay = {
show : function() {
var w = $('body').width();
var h = $('body').height();
var markup = 'div class=ui-widget-overlay style=width: ' + w
+ 'px; height: ' + h + 'px; z-index: 
1001;some message/div';
$('body').prepend(markup);
}
}

at the server side:

target.appendJavaScript(  'Overlay.show(); waitSomeMoment(); redirect(); ');


On Tue, Aug 2, 2011 at 1:46 PM, eugenebalt eugeneb...@yahoo.com wrote:
 I need to disable an entire page, with all its components, and display a
 message (possibly in the FeedbackPanel) saying, Operation successful. You
 will be redirected in N seconds (e.g. 5). After N seconds, I will do a
 setRedirectPage(..) to a different page.

 The point is that the user should see the Success message but doesn't have
 to do anything else to be re-directed to the main page, just wait a few
 seconds. In the meantime, he should be prevented from manipulating the
 current form in any way.

 Is there a way to quickly implement this? Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Disabling-Entire-Page-and-Redirecting-to-Page-in-N-Seconds-tp3712976p3712976.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Manually Rendering a DataGridView

2011-08-01 Thread Pedro Santos
I don't think you can because page carries some renderer state. What
do you think about use a transient page? one with just one component
slot available to you plug any component you want, visit children,
extract the info you need to assemble the JavaScript, and discard its
instance to be garbage collected latter.

On Mon, Aug 1, 2011 at 9:54 AM, Matt Schmidt mschmid...@gmail.com wrote:
 Gotcha. Is there a way to do this without adding the DGV to the page? In my
 case, I just want to add an empty table/ tag and pass the would-be
 rendered HTML of the DGV to a jQuery function that populates the table.

 Specifically, I am trying to dynamically instantiate a jQuery DataTables
 using the JavaScript array method (
 http://datatables.net/examples/data_sources/js_array.html).

 On Sun, Jul 31, 2011 at 10:40 PM, Pedro Santos pedros...@gmail.com wrote:

 The char sequence is returned by mockResponse.getText()
 Sure, there are no public methods and would be a good idea to
 refectory the code and move the mock response logic to other place.
 You can use an IVisitor to visit cells in you component tree,  create
 a mock response to render them and use its text, i.e.
 mockResponse.getText(), to fit your needs

 On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com
 wrote:
  So after calling tableParser.parse(myDataGridView), how do I get the the
  char sequence? Or iterate over each row to get the char sequence for each
  cell? I don't see any public methods for that.
 
  On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
  Hi, I had a similar need and used the code at TableParser[1] to render
  the component tree to a mock response and later get its char sequence.
 
  1 -
 
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java
 
  On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
  wrote:
  Is there any way to access the HTML of each cell that would be rendered
  in a
  DataGridView without adding it to the page and actually rendering it?
 
  Ultimately, I am trying to add all of the inner HTML of the cells of
 the
  DataGridView to a JavaScript array.
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
  -
  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






-- 
Pedro Henrique Oliveira dos Santos

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



Re: Manually Rendering a DataGridView

2011-07-31 Thread Pedro Santos
Hi, I had a similar need and used the code at TableParser[1] to render
the component tree to a mock response and later get its char sequence.

1 - 
https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java

On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com wrote:
 Is there any way to access the HTML of each cell that would be rendered in a
 DataGridView without adding it to the page and actually rendering it?

 Ultimately, I am trying to add all of the inner HTML of the cells of the
 DataGridView to a JavaScript array.




-- 
Pedro Henrique Oliveira dos Santos

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



Re: Manually Rendering a DataGridView

2011-07-31 Thread Pedro Santos
The char sequence is returned by mockResponse.getText()
Sure, there are no public methods and would be a good idea to
refectory the code and move the mock response logic to other place.
You can use an IVisitor to visit cells in you component tree,  create
a mock response to render them and use its text, i.e.
mockResponse.getText(), to fit your needs

On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com wrote:
 So after calling tableParser.parse(myDataGridView), how do I get the the
 char sequence? Or iterate over each row to get the char sequence for each
 cell? I don't see any public methods for that.

 On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
 Hi, I had a similar need and used the code at TableParser[1] to render
 the component tree to a mock response and later get its char sequence.

 1 -
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java

 On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
 wrote:
 Is there any way to access the HTML of each cell that would be rendered
 in a
 DataGridView without adding it to the page and actually rendering it?

 Ultimately, I am trying to add all of the inner HTML of the cells of the
 DataGridView to a JavaScript array.




 --
 Pedro Henrique Oliveira dos Santos

 -
 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



Re: DropDownChoice updates onchange event.

2011-07-27 Thread Pedro Santos
The DropDownChoice should respect the list sequence, show some code so
we can track the source of the problem.

On Wed, Jul 27, 2011 at 3:16 PM, Archana
archanaacharya.adhik...@gmail.com wrote:
 I mean to say before the onUpdate was executed the DropDownChoice contains in
 the order of (A, B, C, D).
 But after the execution of onUpdate() the DropDownChoice contains in the
 order of (D, B, A, C) which is totally a new order. I have not updated the
 sequence of the elements. But still the order changed. How can I make the
 DropDownChoice to diaplay the elements in the order of (A, B, C, D).

 -
 Thanks  Regards,
 Archana
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-updates-onchange-event-tp3699271p3699383.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: How can i get inline styles of div in runtime?

2011-07-27 Thread Pedro Santos
I guess the simplest way is to encode the property you want in the
AJAX callback URL.
e.g.

someComponent.add(new AjaxEventBehavior(someEvent)
{
protected void onEvent(AjaxRequestTarget target)
{
String encodedPropertyValue =
getRequest().getQueryParameters().getParameterValue(parameter).toString();
}

public CharSequence getCallbackUrl()
{
return super.getCallbackUrl() + parameter='+Wicket.$(\ +
someComponent.getMarkupId() + \).someProperty+';
}
});

On Wed, Jul 27, 2011 at 11:57 AM, accord vuacc...@gmail.com wrote:
 Hi,

 For example, i did something with my div by javascripts and changed it's
 width, height, left, top or others attributes.
 So, how can i get this values in wicket : width=x .. ? for example by click
 button or when it's some event come: onmouseup, but the event not of this
 div, the event from some other component.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-can-i-get-inline-styles-of-div-in-runtime-tp3698773p3698773.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Textfield to keep the value after being refreshed

2011-07-20 Thread Pedro Santos
Hi Anna, use an submit component like AjaxLink or AjaxButton to
interact with server. Even if you skip the default form processing by
set submitComponent.setDefaultFormProcessing(false) the input in the
fieldName will be kept.

On Wed, Jul 20, 2011 at 11:37 AM, Anna Simbirtsev asimbirt...@gmail.com wrote:
 Hi,

 I refresh the page using target.addComponent(fieldName);
 The value that was entered in the text field is cleared. How can I get it to
 keep the value?

 Thanks
 Anna




-- 
Pedro Henrique Oliveira dos Santos

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



Re: Form Component models not updating .. why ?

2011-07-04 Thread Pedro Santos
Hi Armando, form still shows values inside of text field because you
code it to do that in the last line:

public cleanUp(){
  (...)
  this.updateFormComponentModels();  --
Form#updateFormComponentModels updates all form fields based on field
sent in request, ignoring anything you set before.
}


On Mon, Jul 4, 2011 at 10:23 AM, armandoxxx armando@dropchop.com wrote:
 Hi guys need a little help with my form and form component models ...





 public class GroupFormT extends UserGroup extends FormT {

        private static final Logger     LOG = 
 LoggerFactory.getLogger(GroupForm.class);
        private static final long       serialVersionUID = 
 5581378542894937666L;

        private RequiredTextFieldString       groupNameField;
        private FieldFeedbackPanel                      groupNameErrorPanel;

        private AjaxFallbackButton                      submitButton;
        private AjaxFallbackButton                      resetButton;

        public GroupForm(final String theId, IModelT theModel) {
                super(theId, theModel);
        }



        @Override
        protected void onInitialize() {
                super.onInitialize();
                this.setOutputMarkupId(true);

                if (this.theNotifiable == null) {
                        throw new IllegalArgumentException(The notifiable 
 panel cannot be
 null);
                }

                this.groupNameField                     = new 
 RequiredTextFieldString(name);
                this.groupNameErrorPanel        = new 
 FieldFeedbackPanel(groupNameErrorPanel,
 this.groupNameField);

                this.submitButton       = new 
 AjaxFallbackButton(submitButton, this) {

                        private static final long serialVersionUID = 
 -4104483939487007113L;


                        @Override
                        protected void onSubmit(final AjaxRequestTarget 
 theTarget, final Form?
 theForm) {
                                UserDao userDao = 
 ((SystemPage)this.getPage()).getUserDao();
                                User    user    = 
 ((SystemPage)this.getPage()).getUser();
                                T               group   = 
 (T)theForm.getDefaultModelObject();
                                try {
                                        userDao.storeUserGroup(user, group);
                                } catch (Exception e) {
                                        LOG.error(Cannot store user group!, 
 e);
                                        throw new RuntimeException(e);
                                }
                                ((GroupFormT)theForm).cleanUp();
                                theTarget.addComponent(theForm);

                        }

                        protected void onError(final AjaxRequestTarget 
 theTarget, final Form?
 theForm) {
                                theTarget.addComponent(theForm);
                        };
                };

                this.resetButton = new AjaxFallbackButton(resetButton, this) 
 {

                        private static final long serialVersionUID = 
 3649778402022830666L;

                        @Override
                        protected void onSubmit(final AjaxRequestTarget 
 theTarget, final Form?
 theForm) {
                                GroupForm.this.cleanUp();
                                theTarget.addComponent(theForm);
                        }
                };

                this.resetButton.setDefaultFormProcessing(false);

                this.add(this.groupNameField);
                this.add(this.submitButton);
                this.add(this.resetButton);
                this.add(this.groupNameErrorPanel);
        }


        public GroupFormT cleanUp() {
                UserGroup group = new UserGroup();
                this.clearInput();
                this.modelChanging();
                this.setModelObject((T)group);
                this.modelChanged();
                this.updateFormComponentModels();

                return this;
        }
 }



 this is how i create this form on a panel

 UserGroup group = new UserGroup();
  new GroupFormUserGroup(groupEditForm, new
 CompoundPropertyModelUserGroup(group)));


 I want to know why my form still shows values inside of text field even thou
 cleanUp() method is called
 and why on reset button (which is not a RESET button in markup) form is
 cleared ... I don't get it .. :(

 Please help

 Regards

 Armando


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Form-Component-models-not-updating-why-tp3643631p3643631.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





-- 
Pedro Henrique Oliveira dos Santos

-
To 

Re: jsp check AuthenticatedWebSession.get().isSignedIn()

2011-06-30 Thread Pedro Santos
Hi, you can share this info in the HttpServletSession.

On Tue, Jun 28, 2011 at 4:57 PM, fachhoch fachh...@gmail.com wrote:
 I have very few jsp pages and for these pages I want to check that user is
 authenticated. I tried calling

 AuthenticatedWebSession.get().isSignedIn()   and I getting this exception

  java.lang.IllegalStateException: you can only locate or create sessions in
 the context of a request cycle
        at org.apache.wicket.Session.findOrCreate(Session.java:208)
        at org.apache.wicket.Session.get(Session.java:252)
        at
 org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:40)
        at
 gov.hhs.acf.web.filter.JspSecurityFilter.doFilter(JspSecurityFilter.java:29)
        at
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        at
 org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
        at
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at
 org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at
 org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:421)
        at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:493)
        at
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:924)
        at
 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
        at
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
        at
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:860)
        at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at
 org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
        at
 org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
        at
 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
        at org.eclipse.jetty.server.Server.handle(Server.java:335)
        at
 org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:588)
        at
 org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1029)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:549)
        at 
 org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:211)
        at 
 org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:418)
        at
 org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:476)
        at
 org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
        at java.lang.Thread.run(Thread.java:619)


 please suggest me how check if user is authenticated in case of jsp pages ?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/jsp-check-AuthenticatedWebSession-get-isSignedIn-tp3631307p3631307.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Override modal.js functionality because of issue with form inside form

2011-06-27 Thread Pedro Santos
On Mon, Jun 27, 2011 at 6:06 AM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 Either way, if I wanted to override that functionality.  What is a way to do 
 so?

 I am going to try adding the modal-override.js javascript
OK, just add the following lines to the new model-override.js

Wicket.Window.getMarkup = function(...){
   return 'custon markup';
}
it is importante to load modal.js before.


 And then getting rid of the inner form:


 Wicket.Window.getMarkup = ...
 CustomModal extends ModalWindow
 this.add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT));

 With certain browsers, the way we are using browsers does not allow the 
 submit.   Works with IE but not in Chrome or Firefox.

 form
   modalWindow
     submitButton /
 /form

The modal window markup are turn visible as a body's child, so it is
not true that it will to be inside a form tag.


 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: Sunday, June 26, 2011 11:27 PM
 To: users@wicket.apache.org
 Subject: Re: Override modal.js functionality because of issue with form 
 inside form

 Hi Brown, submit a form inside a modal window should be fine, just make sure 
 you have an outer form higher in hierarchy. Nested forms inside a modal 
 window works nice even in old versions. It is important because it prevents 
 invalid markup like form tag inside form tag.
 About improvements in modal window, it is already planned to Wicket 1.6.


 On Sun, Jun 26, 2011 at 9:24 PM, Brown, Berlin [GCG-PFS] 
 berlin.br...@primerica.com wrote:
 Related bug:
 https://issues.apache.org/jira/browse/WICKET-3146

 

 From: Brown, Berlin [GCG-PFS]
 Sent: Sunday, June 26, 2011 8:23 PM
 To: 'users@wicket.apache.org'
 Subject: Override modal.js functionality because of issue with form
 inside form


 I am using a dated version of wicket.  I don't know if this is fixed
 but I wanted to override the functionality in the modal.js from
 wicket-extensions.

 Basically, I need to remove the inner form that is created by the
 javascript.  Some of the browsers we are using, the user cannot submit
 the form from a modal window (maybe our page layout is at fault).

 What is a non-invasive way of doing this (least amount of code changes)?

 It looks like a lot of the methods in the ModalWindow class are
 private or static, I was thinking of just overriding that class or
 reimplementing that class and passing my own javascript with modified
 functionality.

 Here is the javascript I needed to change:

 ...
 res/modal.js
 div class=\wicket-modal\ id=\+idWindow+\ style=\top: 10px;
 left: 10px; width: 100px;\form
 style='background-color:transparent;padding:0px;margin:0px;border-width:
 0px;position:static'+




 --
 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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Override modal.js functionality because of issue with form inside form

2011-06-26 Thread Pedro Santos
Hi Brown, submit a form inside a modal window should be fine, just
make sure you have an outer form higher in hierarchy. Nested forms
inside a modal window works nice even in old versions. It is important
because it prevents invalid markup like form tag inside form tag.
About improvements in modal window, it is already planned to Wicket 1.6.


On Sun, Jun 26, 2011 at 9:24 PM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 Related bug:
 https://issues.apache.org/jira/browse/WICKET-3146

 

 From: Brown, Berlin [GCG-PFS]
 Sent: Sunday, June 26, 2011 8:23 PM
 To: 'users@wicket.apache.org'
 Subject: Override modal.js functionality because of issue with form
 inside form


 I am using a dated version of wicket.  I don't know if this is fixed but
 I wanted to override the functionality in the modal.js from
 wicket-extensions.

 Basically, I need to remove the inner form that is created by the
 javascript.  Some of the browsers we are using, the user cannot submit
 the form from a modal window (maybe our page layout is at fault).

 What is a non-invasive way of doing this (least amount of code changes)?

 It looks like a lot of the methods in the ModalWindow class are private
 or static, I was thinking of just overriding that class or
 reimplementing that class and passing my own javascript with modified
 functionality.

 Here is the javascript I needed to change:

 ...
 res/modal.js
 div class=\wicket-modal\ id=\+idWindow+\ style=\top: 10px;
 left: 10px; width: 100px;\form
 style='background-color:transparent;padding:0px;margin:0px;border-width:
 0px;position:static'+




-- 
Pedro Henrique Oliveira dos Santos

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



Re: Page serialization filling up disc space

2011-06-10 Thread Pedro Santos
Hi Johan, DiskDataStore writes cyclic in data file storing pages, it
will never exceed the defined limit. It also delete the file when
session expires.
In which Wicket version did you find this issue? Can you fill a ticket
with a quickstart?

On Fri, Jun 10, 2011 at 6:26 AM,  johan.evel...@tieto.com wrote:
 Hi,

 My wicket application is filling up my temporary directory, which causes the 
 application to finally crash due to no space available.
 I have been looking for a setting in Wicket to clean old serializations, but 
 haven't found it.

 Does wicket contain a cleanup system of old page serializations? If so, how 
 do I configure it?

 Best Regards,
 Johan Evelönn




-- 
Pedro Henrique Oliveira dos Santos

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



Re: Expanding tree and scrolling to item

2011-06-06 Thread Pedro Santos
Hi Christian, the appended JavaScript with
AjaxReuqestTarget#appendJavascript already will be called after tree
DOM update. Try to postpone your scroll JavaScript wrapping it in an
function to setTimeout method.

On Mon, Jun 6, 2011 at 10:38 AM, Christian Mader
christian.ma...@univie.ac.at wrote:
 Hello,

 I have an ajax link and a tree located at the same page. When I click on the
 link I want the tree to expose a specific item and scroll the item into
 view.
 Exposing the item works well using getTreeState().expandNode(childNode); and
 after adding the tree component to the AjaxRequestTarget it displays
 properly.
 I append javascript code to the AjaxRequestTarget to scroll to the expanded
 item, but this only works if the tree is already completely expanded.
 Otherwise, the scroll location is not correct.

 I assume this is because the scroll js command is issued before the tree is
 completely expanded. Is there any possiblity to wait for the tree to be
 displayed and then issue the scroll command? Would overriding
 onAfterRender() help on this issue? How can I get an AjaxRequestTarget in
 onAfterRender()?

 I would be happy for any reply that points me into the right direction to
 solve this problem.

 Best,
 Christian

 -
 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



Re: OnChange Ajax inside form within form?

2011-06-06 Thread Pedro Santos
Hi Neil, already Wicket prevents nested form tag by changing inner
form tag by div one. I guess you need to change the
AjaxFormSubmitBehavior to AjaxFormComponentUpdatingBehavior to handle
the onchange event.

On Mon, Jun 6, 2011 at 4:43 PM, Neil Curzon neil.cur...@gmail.com wrote:
 Hi users!

 Using wicket 1.4.17. I have a relatively large form. Inside this form,
 there's going to be a readonly text field that is actually populated by
 using a popup dialog, which opens a div with an ajax interface to navigate
 some entities in our system.

 The thing is, inside the entity navigation form, there are drown down
 choices (selects) which need to refresh other drop down choices via ajax.
 The way I know how to do this is by using an AjaxFormSubmitBehavior on the
 drop down choices. The thing is, that this entity navigation form starts out
 invisible, becomes visible when clicking on an AjaxLink, and both Chrome and
 Firefox just don't put the form tag into the dom (despite it appearing in
 the wicket debug panel). I guess this is because html doesn't allow nested
 forms. So everything works up to the point where the AjaxFormSubmitBehavior
 on the selects fails to submit the form because the generated JS in the
 onchange handler in the selects looks for a form ID that doesn't exist (the
 navigation widget's form id, the form that wasn't actually put in the dom).

 Any ideas for how to make something like this work?

 Thanks
 Neil




-- 
Pedro Henrique Oliveira dos Santos

-
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 Pedro Santos
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 nsegu...@gmail.com 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 igor.vaynb...@gmail.com 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 nsegu...@gmail.com 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 
  igor.vaynb...@gmail.comwrote:
 
  you want setDefaultFormProcessing(false)
 
  -igor
 
  On Thu, Jun 2, 2011 at 3:41 PM, Nelson Segura nsegu...@gmail.com 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



Re: WicketTester and clicking a tree node

2011-06-02 Thread Pedro Santos
Hi Mohammad, nice you created the test case. I just would recommend to
don't make any reference from your domains objects (TreeNode) to view
ones (AjaxLink) because they are usually packaged in different places.
Take a look at how I created a similar test:

http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4.17/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/tree/MoveChildToParentNodeMarkedForRecreationTest.java

On Thu, Jun 2, 2011 at 1:53 PM, msalman mohammad_sal...@yahoo.com wrote:
 Pedro, thanks for your response.

 I solved my problem in the following way:


 For my derived DefaultMutableTreeNode class I added an Ajax link element:


 public class CheckBoxSelectableTreeItem
 extends DefaultMutableTreeNode
 {
   
   protected AjaxLink clickLink;  // for testing the expand/collapse link

        public AjaxLink getClickLink() {
                return clickLink;
        }




        public void setClickLink(AjaxLink clickLink) {
                this.clickLink = clickLink;
        }

   

 }



 For my tree class I overrode the newJunctionLink  method like this:


 public class CheckBoxTree extends LinkTree
 {
  .

        @Override
        protected Component newJunctionLink(MarkupContainer parent, final 
 String
 id, final Object node)
        {
                AjaxLink link = (AjaxLink) super.newJunctionLink(parent, id, 
 node);


                ((CheckBoxSelectableTreeItem)node).setClickLink(link);

                return link;
        }
  

 }



 So in the test when you have the node you can open (expand) it this way:

                CheckBoxSelectableTreeItem node=  get Node

                AjaxLink nodeLink = node.getClickLink();

                tester.executeAjaxEvent(nodeLink, onclick);







 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/WicketTester-and-clicking-a-tree-node-tp3556724p3568831.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





-- 
Pedro Henrique Oliveira dos Santos

-
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 Pedro Santos
Hi Nelson, the raw input has preference and it remains in the form
component until be converted and set in the form component model. For
your use case you can use a simple AjaxLink targeting just the dynamic
fields panel, not the whole form.

On Thu, Jun 2, 2011 at 8:22 PM, Nelson Segura nsegu...@gmail.com 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 igor.vaynb...@gmail.comwrote:

 you want setDefaultFormProcessing(false)

 -igor

 On Thu, Jun 2, 2011 at 3:41 PM, Nelson Segura nsegu...@gmail.com 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






-- 
Pedro Henrique Oliveira dos Santos

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



Re: 1.5 rc 4.2 ajax radiochoice bug?

2011-05-31 Thread Pedro Santos
Hi, using in cojuction with the ldm should be fine.

On Tue, May 31, 2011 at 8:15 AM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Ok I have it replicated with a quickstart.. Seems the cause are
 because I am using an ldm in conjunction with the form is it wrong
 todo so?

 2011/5/31 nino martinez wael nino.martinez.w...@gmail.com:
 hmm it does also occur when not using ajax..

 2011/5/30 nino martinez wael nino.martinez.w...@gmail.com:
 Hi Guys

 I've hit yet another possible bug. I'll fill in the jira if necessary
 heres how it is affecting our application.

 I have a form that has a propertylistview, in that list view theres a
 couple of different components where some are conditionally displayed
 depending on one of the formcomponents(componentA) which also has a
 ajaxformchoiceupdating behavior. If the radiochoice( componentB)
 starts by not being shown and then altered to get shown if the user
 clicks the right option on componentA, componentB gets redrawn by the
 ajaxupdate but then when the form are submitted I've debugged it and
 can see that somehow it's getting set to null instead of the selected
 choice. If componentB starts by being shown theres no problems...

 Hmm I probably need to provide a quickstart or are this sounding
 familiar to somebody?

 -N



 -
 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



Re: adding style to multiple form fields on validaton

2011-05-30 Thread Pedro Santos
Hi Rebecca, you can add the same behavior - ValidationStyleBehavior -
in the field B.

On Mon, May 30, 2011 at 7:14 AM, rebecca rivka.shis...@gmail.com wrote:
 Hello friends,

 I have form with fields A and B. When field A is invalid - it is colored in
 red (by adding ValidationStyleBehavior  to it - see code below)

 How can I color field B when field A is invalid?

 class ValidationStyleBehavior extends AbstractBehavior {

  public void onComponentTag(final Component component,
    final ComponentTag tag) {
   FormComponent comp = (FormComponent) component;
   if (comp.isValid()  comp.getConvertedInput() != null) {
    tag.getAttributes().put(class, valid);
   } else if (!comp.isValid()) {
    tag.getAttributes().put(class, invalid);
   }
  }
  };

 Thanks
 Rebecca



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/adding-style-to-multiple-form-fields-on-validaton-tp3560363p3560363.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Expandable row in datatable

2011-05-30 Thread Pedro Santos
Hi, I easily achieved it using nested ListView components and one line
of JavaScript:

$('.expandableLine').click(function() { $(this).next().toggle(); });

On Mon, May 30, 2011 at 4:47 AM, ramlael grambab...@gmail.com wrote:
 Is any one know the solution?.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Expandable-row-in-datatable-tp1883838p3560106.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: WicketTester and clicking a tree node

2011-05-27 Thread Pedro Santos
You can use the ITreeState API to manipulate the expand/collapsed node
state. Put your code inside a link or a button and call it from Wicket
tester.

On Fri, May 27, 2011 at 10:21 PM, msalman mohammad_sal...@yahoo.com wrote:
 Hi,

 I am trying to simulate/test clicking and expanding tree nodes.  My Tree is
 based off LinkTree class.

 Can some one please provide me the solution or ideas.

 Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/WicketTester-and-clicking-a-tree-node-tp3556724p3556724.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: How to check markup attributes?

2011-05-24 Thread Pedro Santos
You can create an behavior doing the check in the
Behavior#onComponentTag. At this point you will have access to the
final ComponentTag object.
The test case would look like:

testSomePageOrComponet(){
  CollectMissingAttributes theBehaviorITalkedAbout = new (...);
  MyPageOrComponentType pageOrComponentUnderTest = (...);
  pageOrComponentUnderTest.visit(
new visitor(component){ component.add(theBehaviorITalkedAbout); }
  );
  assertEmpty(theBehaviorITalkedAbout.getComponentsMissingSomeAttribute());
}


On Tue, May 24, 2011 at 5:12 PM, Craig Pardey
craig.par...@intelliware.ca wrote:
 The IMarkupFilter approach only detects attributes coded into the HTML.

 Is there any way to get it to work for attributes created using the 
 SimpleAttributeModifier or AttributeAppender? See code.

 FWIW I also tried the onComponentTag approach documented on the wiki
 https://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html

 Craig

 public class MyTextFieldT extends TextF;ieldT {
        
        public MyTextFieldT setAttribute(String name, String value){
                this.add(new SimpleAttributeModifier(name, value));
                return this;
        }
        
 }

 public class MarkupRuleFilter extends AbstractMarkupFilter {
        
        @Override
        public MarkupElement nextTag() throws ParseException {
                ComponentTag tag = nextComponentTag();
                String attrVal = tag.getAttribute(maxlength);
                if( StringUtils.isBlank(attrVal)){
                        throw new IllegalStateException(No maxlength defined 
 for  + tag.getId());
                }
                return tag;
        }
        
 }

 Craig

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: May-13-11 5:02 PM
 To: users@wicket.apache.org
 Subject: Re: How to check markup attributes?

 if you are doing validation you can use imarkupfilter to check the attrs.

 -igor


 On Fri, May 13, 2011 at 1:57 PM, Craig Pardey
 craig.par...@intelliware.ca wrote:
 I'd like to check that particular markup attributes have been set on a 
 component.
 My first instinct was to use component.getMarkupAttributes(), but the 
 JavaDoc quite clearly suggests that it shouldn't be used.

 For example, all TextFields should have a 'maxlength' defined:

 public class MyTextFieldT extends TextFieldT {
      @Override
      public void onAfterRender(){
            super.onAfterRender();
            ValueMap attrs = getMarkupAttributes();
            if( !attrs.containsKey(maxlength)){
                  throw new IllegalStateException(No maxlength defined for  
 + getId());
            }
      }
 }

 Is there a better way to achieve this?
 Ideally I'd like to do it in a unit test rather than at runtime.

 Craig



 -
 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



Re: How to check markup attributes?

2011-05-24 Thread Pedro Santos
ops, invoke the tester.startPageOrComponent before the assert line.

On Tue, May 24, 2011 at 5:25 PM, Pedro Santos pedros...@gmail.com wrote:
 You can create an behavior doing the check in the
 Behavior#onComponentTag. At this point you will have access to the
 final ComponentTag object.
 The test case would look like:

 testSomePageOrComponet(){
  CollectMissingAttributes theBehaviorITalkedAbout = new (...);
  MyPageOrComponentType pageOrComponentUnderTest = (...);
  pageOrComponentUnderTest.visit(
    new visitor(component){ component.add(theBehaviorITalkedAbout); }
  );
  assertEmpty(theBehaviorITalkedAbout.getComponentsMissingSomeAttribute());
 }


 On Tue, May 24, 2011 at 5:12 PM, Craig Pardey
 craig.par...@intelliware.ca wrote:
 The IMarkupFilter approach only detects attributes coded into the HTML.

 Is there any way to get it to work for attributes created using the 
 SimpleAttributeModifier or AttributeAppender? See code.

 FWIW I also tried the onComponentTag approach documented on the wiki
 https://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html

 Craig

 public class MyTextFieldT extends TextF;ieldT {
        
        public MyTextFieldT setAttribute(String name, String value){
                this.add(new SimpleAttributeModifier(name, value));
                return this;
        }
        
 }

 public class MarkupRuleFilter extends AbstractMarkupFilter {
        
        @Override
        public MarkupElement nextTag() throws ParseException {
                ComponentTag tag = nextComponentTag();
                String attrVal = tag.getAttribute(maxlength);
                if( StringUtils.isBlank(attrVal)){
                        throw new IllegalStateException(No maxlength defined 
 for  + tag.getId());
                }
                return tag;
        }
        
 }

 Craig

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: May-13-11 5:02 PM
 To: users@wicket.apache.org
 Subject: Re: How to check markup attributes?

 if you are doing validation you can use imarkupfilter to check the attrs.

 -igor


 On Fri, May 13, 2011 at 1:57 PM, Craig Pardey
 craig.par...@intelliware.ca wrote:
 I'd like to check that particular markup attributes have been set on a 
 component.
 My first instinct was to use component.getMarkupAttributes(), but the 
 JavaDoc quite clearly suggests that it shouldn't be used.

 For example, all TextFields should have a 'maxlength' defined:

 public class MyTextFieldT extends TextFieldT {
      @Override
      public void onAfterRender(){
            super.onAfterRender();
            ValueMap attrs = getMarkupAttributes();
            if( !attrs.containsKey(maxlength)){
                  throw new IllegalStateException(No maxlength defined for 
  + getId());
            }
      }
 }

 Is there a better way to achieve this?
 Ideally I'd like to do it in a unit test rather than at runtime.

 Craig



 -
 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




-- 
Pedro Henrique Oliveira dos Santos

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



Re: JavaScript onClick Handler Stops Form Submit

2011-05-18 Thread Pedro Santos
Hi, if you are using an AJAX submit button then you can't simple
change the onclick tag attribute that is already changed by the
component. Prepend your alert script in the attribute rather than
modify it.
e.g.
submitComponent.add( new Behavior(){
  onComponentTat(tag){
tag.put(onclick, alert('some alert')+ tag.getAttribute(onclick));
  }
}

On Wed, May 18, 2011 at 5:04 PM, eugenebalt eugeneb...@yahoo.com wrote:
 Hi,

 My SubmitButton has an onClick JavaScript handler. Let's say the handler is
 something simple, like

 onclick=alert('Test')

 There are no JS errors when I run. But the problem is, the form submit flow
 stops. The flow doesn't go into Form.onSubmit() as it should.

 I tried returning true and false in the handler, but it doesn't help, the
 flow stops. Any ideas?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/JavaScript-onClick-Handler-Stops-Form-Submit-tp3533771p3533771.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Using SigInPage with IE9

2011-05-16 Thread Pedro Santos
related ideed, reopening the ticket

On Mon, May 16, 2011 at 10:35 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Can be related to https://issues.apache.org/jira/browse/WICKET-3566

 On Mon, May 16, 2011 at 3:09 PM, Zhubin Salehi zhooz...@yahoo.com wrote:

 Hi,

 I'm using org.apache.wicket.authroles.authentication.pages.SignInPage in my
 application to provide a simple way for the users to sign in. It works
 perfectly fine in FF4 but I get this error in IE9:

 The XML page cannot be displayed
 Cannot view XML input using XSL style sheet. Please correct the error and
 then click the Refresh button, or try again later.



 

 The operation completed successfully. Error processing resource
 'http://192.168.30.76:8080/VDIClientHttp-0.0.1/wicket/bookm...

    wicket:panel
 --^

 Any idea how I can fix this?

 By the way I'm using Wicket 1.5 RC4.2.

 Thanks,
 Zhubin

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Using-SigInPage-with-IE9-tp3526179p3526179.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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/




-- 
Pedro Henrique Oliveira dos Santos

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



Re: How to turn off the ModificationWatcher Task?

2011-05-16 Thread Pedro Santos
Set null in application resource poll frequency.
e.g.
class Application{
  init(){
application.initApplication();
application.getResourceSettings().setResourcePollFrequency(null);
  }
}

On Mon, May 16, 2011 at 11:21 AM, eugenebalt eugeneb...@yahoo.com wrote:
 I recently started getting constant debug output on my console, like this:


 Run the job: org.apache.wicket.util.watch.ModificationWatcher$1@11dd1
 1dd
 [5/16/11 10:18:34:454 EDT] 001c SystemOut     O 1641041
 [ModificationWatcher Task] DEBUG org.apa
 che.wicket.util.thread.Task  - Finished with job:
 org.apache.wicket.util.watch.ModificationWatcher$1
 @11dd11dd


 Does anyone know how to turn off this ModificationWatcher task? Is this an
 automated debug mode?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-turn-off-the-ModificationWatcher-Task-tp3526322p3526322.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: How to prevent browser from caching pages

2011-05-16 Thread Pedro Santos
You can decorate applicaiton's root request mapper to set in the
anticache parameter in the mapped URL. You can also add a listener
invoking WebResponse#disableCaching for all your responses.

On Mon, May 16, 2011 at 10:20 AM, Martin Makundi
martin.maku...@koodaripalvelut.com wrote:
 Hi!

 We are disabling versioning and this results in problems with browsers
 (chrome) which seems to load pages from cache.

 We would like to add something similar as in NonCachingImage to each url.

 How can this be done centrally for whole application with minimal change?

 Something like:
        url = url + wicket:antiCache= + System.currentTimeMillis();


 **
 Martin

 -
 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



Re: How to prevent browser from caching pages

2011-05-16 Thread Pedro Santos
I pasted an AnticacheDecorator here: http://pastebin.com/NDePsj0F

you can use as:
class Application {
  init(){
 setRootRequestMapper(new AnticacheDecorator(getRootRequestMapper()));
  }
}


On Mon, May 16, 2011 at 11:36 AM, Martin Makundi
martin.maku...@koodaripalvelut.com wrote:
 Hi!

 Sounds nice, how exactly?

 **
 Martin

 2011/5/16 Pedro Santos pedros...@gmail.com:
 You can decorate applicaiton's root request mapper to set in the
 anticache parameter in the mapped URL. You can also add a listener
 invoking WebResponse#disableCaching for all your responses.

 On Mon, May 16, 2011 at 10:20 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 Hi!

 We are disabling versioning and this results in problems with browsers
 (chrome) which seems to load pages from cache.

 We would like to add something similar as in NonCachingImage to each url.

 How can this be done centrally for whole application with minimal change?

 Something like:
        url = url + wicket:antiCache= + System.currentTimeMillis();


 **
 Martin

 -
 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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Grouping DataView

2011-05-15 Thread Pedro Santos
Hi Marcus, it is very usual to nestle repeater components to present
groups and its details.

On Sun, May 15, 2011 at 11:46 AM, Marcus Breier mlist.mbre...@gmx.net wrote:
 Dear all,

 sorry for this newbie question, but I need a component to group Items
 within a DataView for display.

 Since I 've been working a lot with Apple's WebObjects and Project
 WOnder, I am wondering that there might be no component like good old
 ERXGroupingRepetition out there. Possibly I missed something, but I
 cannot find something like that on the net.

 Can you please give me a hint how to solve this problem with Wicket?

 Best regards

 -
 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



Re: TextField not getting the value after a validation eror

2011-05-13 Thread Pedro Santos
Hi Mohammad, make sure of notify the textfield about the model change
by invoking the Component#modelChanged method, inside the Link#onClick
implementation after set the new value.
e.g. field.modelChanged()

On Friday, May 13, 2011, msalman mohammad_sal...@yahoo.com wrote:
 I have a text field that is required to have a value.  I also have a link
 that on being clicked inserts a value into the text field.  It all works
 fine   except   if the user submits the form without setting the value for
 the text field.  Once the form has been submitted without the required
 value, and the form has generated the error, the text field does seem to
 get/show the value that the link is trying to enter.

 I just hope that I am not doing something right and that some one will
 kindly point out the error.  I am attaching a quickstart.

 Thanks.
 http://apache-wicket.1842946.n4.nabble.com/file/n3521252/TextFieldTest.zip
 TextFieldTest.zip

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/TextField-not-getting-the-value-after-a-validation-eror-tp3521252p3521252.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



-- 
Pedro Henrique Oliveira dos Santos

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



Re: [Announce] Wicket Stuff Core 1.5-RC4.2 Released

2011-05-12 Thread Pedro Santos
Hi Phil, I'm about to upload a quickstart to this ticket proving it is
not a Wicket related problem. The container is always reading the
entire input stream regardless of the application doing it or not.
I talked about in IRC and Igor suggested me to close the stream if it
exceed the max limit, but by doing so the client gets no response and
browser shows a page saying that the connection to server are lost.


On Thu, May 12, 2011 at 3:39 AM, Phil Franken phil.fran...@gmail.com wrote:
 Are there any plans to include a fix for this in 1.14.18?

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

 -
 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



Re: FeedbackPanel with Hierarchical DT/DD (Definition List Tags)?

2011-05-12 Thread Pedro Santos
ListView is a good component to present lists.

e.g.

class MyFeedbackPanel extends Panel implements IFeedback{
onInitialize(){
  super.onInitialize();
  HashMapString,List messagesByCategory = getModelObject();
  add(new ListView(messagesByCategory.keySet()){
populateItem(){
  item.add(new Label(category));
  item.add(new ListView(messagesByCategory.get(catetory)){
populateItem(){
   nestedItem.add(new Label(errorMessage));
}
  });
}
  });
}
}

On Thu, May 12, 2011 at 10:04 AM, eugenebalt eugeneb...@yahoo.com wrote:
 But what is responsible for actually presenting (listing) the items?

 My Model can be a HashMapString,List that maps a category to a list
 of errors in that category. But what do I have to override to make the
 feedback panel present that hierarchical list based on the HashMap?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-with-Hierarchical-DT-DD-Definition-List-Tags-tp3515696p3517279.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: FeedbackPanel with Hierarchical DT/DD (Definition List Tags)?

2011-05-12 Thread Pedro Santos
Hi, the code I sent was only to give you an idea of how to use
ListView. I understood by your previous mails that you already have a
HashMapString,List.

On Thu, May 12, 2011 at 10:41 AM, eugenebalt eugeneb...@yahoo.com wrote:
 Do I also have to override getModelObject()? If so, how?

 I'm getting an error in your code on the line
 HashMapString,List messagesByCategory = getModelObject();

 the error is that getModelObject() is undefined for the custom class. Thanks

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-with-Hierarchical-DT-DD-Definition-List-Tags-tp3515696p3517407.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: New Website up using wicket

2011-05-12 Thread Pedro Santos
Cool! The site runs pretty fast here, congrats.

On Thu, May 12, 2011 at 11:20 AM, Henrique Boregio hbore...@gmail.com wrote:
 Hey, just wanted to let you guys know that with the help of this
 community, I was able to build my first real website using wicket.

 Thanks everyone for the support in always trying answering the
 questions I've answered. I look forward to using wicket in other
 projects.

 Oh, its spekios.com if anyone is interested. Thanks once again :)

 -
 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



Re: [Announce] Wicket Stuff Core 1.5-RC4.2 Released

2011-05-12 Thread Pedro Santos
You can setup a firewall to prevent DOS attacks, I'm not sure if
Wicket needs to read the input stream regardless of its HTTP header
specifying that the upload exceed the limit just to close the stream.

On Thu, May 12, 2011 at 1:52 PM, Phil Franken phil.fran...@gmail.com wrote:
 Thanks for the update Pedro.  I concur with your assesment based on what
 I've seen, but this makes me worry.  Does this mean if I set a file size
 limit of 1MB and someone uploads a 2GB file the container will read the
 entire 2GB?  Not good, with or without progress bar.  Anyone suggestions on
 how to handle this?

 On 5/12/2011 7:47 AM, Pedro Santos wrote:

 Hi Phil, I'm about to upload a quickstart to this ticket proving it is
 not a Wicket related problem. The container is always reading the
 entire input stream regardless of the application doing it or not.
 I talked about in IRC and Igor suggested me to close the stream if it
 exceed the max limit, but by doing so the client gets no response and
 browser shows a page saying that the connection to server are lost.


 On Thu, May 12, 2011 at 3:39 AM, Phil Frankenphil.fran...@gmail.com
  wrote:

 Are there any plans to include a fix for this in 1.14.18?

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

 -
 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



Re: [Announce] Wicket Stuff Core 1.5-RC4.2 Released

2011-05-12 Thread Pedro Santos
Hi Phil, I replied in the ticket. Just realize it is not the right
thread to talk about.

On Thu, May 12, 2011 at 2:10 PM, Phil Franken phil.fran...@gmail.com wrote:
 Firewall not really an option (no budget).  Ok so instead of closing the
 stream can you at least make sure the progress bar is invisible and let the
 container do its thing?  I'm using Tomcat do you know of any way to set a
 max file size in Tomcat?


 On 5/12/2011 1:02 PM, Pedro Santos wrote:

 You can setup a firewall to prevent DOS attacks, I'm not sure if
 Wicket needs to read the input stream regardless of its HTTP header
 specifying that the upload exceed the limit just to close the stream.

 On Thu, May 12, 2011 at 1:52 PM, Phil Frankenphil.fran...@gmail.com
  wrote:

 Thanks for the update Pedro.  I concur with your assesment based on what
 I've seen, but this makes me worry.  Does this mean if I set a file size
 limit of 1MB and someone uploads a 2GB file the container will read the
 entire 2GB?  Not good, with or without progress bar.  Anyone suggestions
 on
 how to handle this?

 On 5/12/2011 7:47 AM, Pedro Santos wrote:

 Hi Phil, I'm about to upload a quickstart to this ticket proving it is
 not a Wicket related problem. The container is always reading the
 entire input stream regardless of the application doing it or not.
 I talked about in IRC and Igor suggested me to close the stream if it
 exceed the max limit, but by doing so the client gets no response and
 browser shows a page saying that the connection to server are lost.


 On Thu, May 12, 2011 at 3:39 AM, Phil Frankenphil.fran...@gmail.com
  wrote:

 Are there any plans to include a fix for this in 1.14.18?

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

 -
 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



Re: FeedbackPanel with Hierarchical DT/DD (Definition List Tags)?

2011-05-11 Thread Pedro Santos
FeedbackPanel is just a panel implementing IFeedback interface and
presenting messages in session. You can write a completely different
panel implementing IFeedback with custom presentation. It is nothing
special.


On Wed, May 11, 2011 at 4:59 PM, eugenebalt eugeneb...@yahoo.com wrote:
 I have a FeedbackPanel in my form that displays errors.

 Rather than a regular FeedbackPanel that lists LI items, this one is a
 2-level hierarchy which uses Definition Lists (DD/DT tags).

 Example from http://www.w3.org/TR/html401/struct/lists.html ,

 DL
  DTCategory 1/DT
   DDItem 1/DD
   DDItem 2/DD
  /DT
 /DL

 Does the FeedbackPanel support categorized, hierarchical lists like that?
 Does anything special need to be done? If there is an error, I'd have to add
 it to the FeedbackPanel based on its DT category.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-with-Hierarchical-DT-DD-Definition-List-Tags-tp3515696p3515696.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: FeedbackPanel with Hierarchical DT/DD (Definition List Tags)?

2011-05-11 Thread Pedro Santos
By implementing IFeedback you are just comunicating about your type
goal: be a feedback. Imagine that one can visit a page adding
components implementing IFeedback to an AJAX request target.
About handle messages, FeedbackPanel is just presenting messages in
session, take a look at FeedbackMessagesModel.

On Wed, May 11, 2011 at 5:14 PM, eugenebalt eugeneb...@yahoo.com wrote:
 So I need to write my own class that extends Panel and implements IFeedback?

 I just looked in the IFeedback javadoc, it doesn't have any methods, it's
 just a marker. So how would I handle my messages?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-with-Hierarchical-DT-DD-Definition-List-Tags-tp3515696p3515733.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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Children components

2011-05-09 Thread Pedro Santos
Hi Vitor, use an IVisitor

On Mon, May 9, 2011 at 3:50 PM, Vitor Granzinoli Vellozo
vitor.vell...@cpmbraxis.com wrote:


 Wicketers,



 How can I get a list of children components, for example, I need modify
 some things

 on the children components of a Form.



 Debuging I saw an attribute children but I've not found a method that
 can list

 that components for me.



 How can I do that?



 Thanks

 Vitor



 PS: My Wicket version is 1.4.15.





-- 
Pedro Henrique Oliveira dos Santos

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



Re: Monitoring progress of business layer service in presentation layer

2011-05-03 Thread Pedro Santos
I Mathias, you can add an AbstractAjaxTimerBehavior in the page plus
an component presenting the service status.
e.g.
page{
add(new Label(id, new abstractreadyonlymodel(){
 getobject(){
  return service.getStatus();
 }
}));
add(new AbstractAjaxTimerBehavior (){
 onTimer(target){
  target.add(label);
  if(service.ended()){this.sto();}
 }
});

On Tue, May 3, 2011 at 5:27 AM, Mathias Nilsson
wicket.program...@gmail.com wrote:

 // Service
 public class Service implements IService{
   public ListAnyObject getObjects(){
     // return list from dao or whatever
   }
 }

 // wicket class
 public MyPage extends WebPage{
   @SpringBean( name = service )
   private IService service;

   public MyPage(){

     // in some component
    ListAnyObject objs = service.getObjects();
    for( AnyObject obj : objs ){
       // Update progressbar or whatever
    }
  }
 }

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Monitoring-progress-of-business-layer-service-in-presentation-layer-tp3490683p3491996.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




--
Pedro Henrique Oliveira dos Santos

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



Re: SubmitLink with confirmation dialog

2011-05-01 Thread Pedro Santos
Hi, SubmitLink already write some JavaScript in the onclick handler, so you
need to prepend the confirmation JavaScript in order to maintain the default
behavior. e.g.

submitLink.add(new Behavior() {
onComponentTag() {
tag.put(onclick, if(!confirm('c')) return false; +
tag.getAttribute(onclick));
}
});

In Wicket 1.5 RC4 you can also use the AttributeAppender to prepend the
confirmation JavaScript.

On Sun, May 1, 2011 at 4:03 PM, scorpio2002 d.capite...@gmail.com wrote:

 Dear Martin,
 thank you for answering. I tried something like this:

 --
 SubmitLink link = new SubmitLink(link) {
public void onSubmit() { /* my stuff */}
 }

 link.add(new SimpleAttributeModifier(onclick, return confirm('are you
 sure?');));
 --

 However, weather I click 'Cancel' or 'OK', the code in the onSubmit()
 method
 never gets executed.

 I'm stuck, I can't believe such a framework does not support this basic
 feature O_o I must be missing something obvious ^^
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/SubmitLink-with-confirmation-dialog-tp3487505p3488329.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Forcing parent CSS to be contributed after all child CSS

2011-04-26 Thread Pedro Santos
See if you can implement your contribution sequence rule by decorating the
IHeaderResponse e.g. [1] [2]

1 -
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-rc2/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java?av=f
2 - http://wicketstuff.org/wicket/resourceaggregation


On Tue, Apr 26, 2011 at 7:05 PM, Alec Swan alecs...@gmail.com wrote:

 Even though using very specific CSS selectors works it makes it a lot
 harder to write that CSS.

 Is there a way to force Wicket to write parent CSS contribution after
 the children's CSS contribution?

 Thanks,

 Alec

 On Sat, Apr 23, 2011 at 8:06 PM, Alec Swan alecs...@gmail.com wrote:
  Thanks for the ideas, Clint. The child components do not know about
  parent CSS, so I decided to use more specific CSS selectors in the
  parent CSS to accomplish what I needed.
 
  Alec
 
  On Sat, Apr 23, 2011 at 4:35 PM, Clint Checketts checke...@gmail.com
 wrote:
  I recall reading an article once noting that you could contribute the
 CSS
  file noted in the parent class again in the child component and Wicket
 is
  smart enough to not duplicate the contribution, but it still forces the
 CSS
  file to appear later.
 
  You also may consider changing the parent CSS rules to be more specific
 or
  generic (depending on your intentions), to allow them to cascade.
 
  -Clint
 
  On Sat, Apr 23, 2011 at 5:05 PM, Alec Swan alecs...@gmail.com wrote:
 
  Hello,
 
  I have a component tree where some components contribute CSS. I have
  inline CSS for the parent component that should be contributed last in
  order to override CSS of child components.
 
  Children components contribute their CSS in their constructors using
  add(new StyleSheetReference(cssId, getClass(), /css/styles.css)).
  I have to use this approach because other approaches don't work with
  panel swapping (I have yet to create a JIRA issue for this).
 
  The parent component is contributing CSS by calling
  response.renderString(body {background-color:red}) from
  IHeaderContributor#renderHead(IHeaderResponse).
 
  I tried contributing parent CSS in parents onInitialize() and
  onBeforeRender(), but children's CSS always get written last.
 
  Is there any way to force parent's CSS to be contributed last?
 
  Thanks,
 
  Alec
 
  -
  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


Re: Specific redirect after session timeout

2011-04-25 Thread Pedro Santos
Tracking the last visited page with a cookie would do the trick, but IMO the
browser back button is enough. You can even use it with some JavaScript and
move the user back to the last page.

On Mon, Apr 25, 2011 at 4:51 AM, Peter Karich peat...@yahoo.de wrote:

  Hi there,

 is it possible to grab the parameters (and the path) of the url and
 redirect the
 user automatically back to that page if he hits a session timeout?

 At the moment I'm using in my app.init() method

 getApplicationSettings().setPageExpiredErrorPage(SessionTimeout.class);

 and

 public SessionTimeout(final PageParameters oldParams) {
 setResponsePage(HomePage.class, oldParams);
 }

 But the oldParams variable does not contain the parameters the user had
 when he hits the session timeout.

 Or do I need to store that in a separate cookie?

 Regards,
 Peter.

 --
 http://jetwick.com open twitter search


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




-- 
Pedro Henrique Oliveira dos Santos


Re: formComponentPanel with content generated by RepeatingView

2011-04-23 Thread Pedro Santos
On Sat, Apr 23, 2011 at 2:45 PM, kamiseq kami...@gmail.com wrote:

 heh i thought I was smart :] as each component in FormComponentPanel is
 converted and validated so it would be easy to intercept value set on
 components model and add it to List (which is model of whole FCPanel)
 because Im not really converting components value to something bigger.

 the only problem is getting value for each component as interface is only
 getObject and setObject so there is no information model could decide which
 value goes to which component


Use a ListView instead of RepeatingView, it recreate its list item
components each render and it already resolve which value goes to which
component.


 ;]

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __




-- 
Pedro Henrique Oliveira dos Santos


Re: formComponentPanel with content generated by RepeatingView

2011-04-22 Thread Pedro Santos
You can set any model in your form component panel. But its value will be
set during the form processing, after the validation step.
FormComponent#convertInput is invoked before the validation step, and it
only sets the converted input in the FormComponent (see
FormComponent#setConvertedInput). It don't set the model already.

On Fri, Apr 22, 2011 at 4:12 AM, kamiseq kami...@gmail.com wrote:

 hej,
 on the second thought I can implement (in this simple case) a model
 backuped
 by List or Set and then let Form (or FormComponentPanel) to process all
 fields.

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __




-- 
Pedro Henrique Oliveira dos Santos


Re: [MIGRATE 1.5] NPE trying to use JavaScriptTemplate

2011-04-22 Thread Pedro Santos
Move to 1.5-RC3, if this problem remains report in
https://issues.apache.org/jira/browse/WICKET-3187

On Fri, Apr 22, 2011 at 7:26 PM, Alexandros Karypidis akary...@yahoo.grwrote:

 Hi,

 I've just started preparing for 1.5 and have been modifying my code in
 order to conform with the new API. I've managed to get my application to
 compile and launch, but in my first attempt to render a page I get an NPE as
 follows:

 java.lang.NullPointerException
 at
 org.apache.wicket.util.template.TextTemplateDecorator.setLastModified(TextTemplateDecorator.java:195)
 at
 org.apache.wicket.util.resource.AbstractStringResourceStream.init(AbstractStringResourceStream.java:76)
 at
 org.apache.wicket.util.resource.AbstractStringResourceStream.init(AbstractStringResourceStream.java:62)
 at
 org.apache.wicket.util.template.TextTemplate.init(TextTemplate.java:42)
 at
 org.apache.wicket.util.template.TextTemplateDecorator.init(TextTemplateDecorator.java:52)
 at
 org.apache.wicket.util.template.JavaScriptTemplate.init(JavaScriptTemplate.java:42)
 at assets.wicket.ovimaps.OviMap.renderHead(OviMap.java:46)
 at org.apache.wicket.Component.renderHead(Component.java:2644)

 Now this part of the code is an adaptation of what used to be a
 template-based javascript header contribution as follows:

 add(TextTemplateHeaderContributor.forJavaScript(OviMap.class,
 OviMap.js, model));

 The above has been removed from the component constructor (where it used to
 be) and replaced with the following in code inside my component:

 @Override
 public void renderHead(IHeaderResponse response) {
  super.renderHead(response);
  JavaScriptTemplate template = new JavaScriptTemplate(
   new PackagedTextTemplate(OviMap.class, OviMap.js));
   response.renderString(template.asString(model.getObject()));
 }

 What am I doing wrong?

 P.S. I am using 1.5-rc2.

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




-- 
Pedro Henrique Oliveira dos Santos


Re: formComponentPanel with content generated by RepeatingView

2011-04-21 Thread Pedro Santos
Override convertInput is a good option. Keep in mind that at this point of
the form processing (converting input), component models will not be updated
yet. So you need to rely on children converted data
(see FormComponet#getConvertedInput) in order to assemble the
FormComponentPanel converted input.
In order to access your children components, you can use the visitor API,
e.g. MarkupContainer#visitChildren

On Thu, Apr 21, 2011 at 6:17 PM, kamiseq kami...@gmail.com wrote:

 hi,
 Im trying to implement a simple form component that accepts List of Strings

 *public class AccountsPanel extends FormComponentPanelListString
 {
 ****public AccountsPanel(String id, ArrayListString accounts) {
 ******super(id, new Model(accounts));
buildComponents();
}
 }

 *and I am using RepeatingView to create as many TextField as many Strings
 are in the List, and this is fine but how then convert each edited value of
 the TextField back to List of Strings???

 using convertInput would be a good choice I guess but I have no idea how to
 iterate over panel's components and read value
 *
 @Override
 protected void convertInput()
 {
ListString accounts = getModelObject();*

*setConvertedInput(accounts);
 }*

 or maybe this is happening automagically :D 

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __




-- 
Pedro Henrique Oliveira dos Santos


Re: Dynamically injecting CSS on panel swap

2011-04-17 Thread Pedro Santos
Sounds like a bug. The expected behavior is to have the selected panel CSS
dynamically injected. Please send us a quickstart reproducing the problem.

On Mon, Apr 18, 2011 at 12:00 AM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 I have a page with multiple tabs which I implemented using AJAX-based
 panel-swapping approach. The CSS files are injected in the constructor
 of each panel using
 add(CSSPackageResource.getHeaderContribution(resourceRef, media)).
 This works for the first tab rendered. However, when another tab is
 selected the CSS file for that tab does not get dynamically injected
 and the tab uses the CSS file of the previous tab.

 What is the best way to swap CSS files in this situation?

 Thanks,

 Alec

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




-- 
Pedro Henrique Oliveira dos Santos


Re: image in java script

2011-04-14 Thread Pedro Santos
In a similar use case I assembled the JavaScript in an
IHeaderContributor#renderHead implementation and written it in response
using IHeaderResponse#renderOnDomReadyJavascript
e.g.:
class SetupDatepicker extends Behavior{
@Override
public void renderHead(IHeaderResponse response) {
response.renderJavascriptReference(new
ResourceReference(JQueryReferences.class, jquery/jquery-1.5.1.min.js));
response.renderJavascriptReference(new
ResourceReference(JQueryReferences.class, ui/jquery-ui-1.8.11.custom.min.js));

 response.renderCSSReference(new ResourceReference(JQueryReferences.class,
path));
String js = String.format($(\ + getSelector() +
\).datepicker({dateFormat: '%s'});, parsedPattern);
response.renderOnDomReadyJavascript(js);
}
}

On Thu, Apr 14, 2011 at 12:24 PM, Andrea Del Bene adelb...@ciseonweb.itwrote:

 Hi fachhoch,

 I had a similar problem with a custom date component (called
 JQueryDateField) which uses JQuery UI Datapicker.  The problem was relative
 to the icon trigger  next to the input field which should open Datapicker.
 When we initialize Datapicker we needs to know icon's URL,  for example:

 |$(function() {
$( #datepicker ).datepicker({
showOn: button,
buttonImage: images/calendar.gif,
buttonImageOnly: true
});
});|


 I solved problem using Wicket package resources. I've put calendar icon
 (calendar.jpg) and javascript (JQDatePicker.js) into the same package of
 JQueryDateField. In JQDatePicker.js I substituted buttonImage value with a
 variable called ${calendarIcon}, i.e.


 |$(function() {
$( #datepicker ).datepicker({
showOn: button,
buttonImage: *${calendarIcon}*,
buttonImageOnly: true
});
});|



 Now in constructor I loaded javascript as PackageTextTemplate and put
 icon's URL into JavaScript like this:

PackageTextTemplate textTemplate = new
 PackageTextTemplate(getClass(), JQDatePicker.js);

MapString,Object variables = new HashMapString, Object();
PackageResourceReference resourceReference = new
 PackageResourceReference(getClass(), calendar.jpg);
variables.put(calendarIcon,  urlFor(resourceReference, new
 PageParameters()));


String jQueryCalendar = textTemplate.asString(variables);


 Finally  I added jQueryCalendar as render head in method renderHead


 public void renderHead(IHeaderResponse response) {
response.renderOnDomReadyJavaScript(jQueryCalendar);
}


 That is all. With this code you don't need to hardcode url in your code.

  I have a simple jquery  function   and it needs an image , right now I
 placed
 the image in webapp root and hadcoded the image  in jquery function

 including context root  , please advice me how to use images in jquery
 functions ?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/image-in-java-script-tp3449390p3449390.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







-- 
Pedro Henrique Oliveira dos Santos


Re: How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Pedro Santos
Hi, you can set a cookie in the Button#onSubmit implementation,

new Button(){
public void onSubmit() {
//at this point all validations are tested
((WebResponse)RequestCycle.get().getResponse()).addCookie(new
Cookie(name, value));
}
}

On Thu, Apr 14, 2011 at 1:25 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 I have a button on a page which submits a Wicket form by calling
 form.submit() using straight JavaScript. If the form submitted without
 errors, then the JavaScript code should set a cookie. I am looking for
 some ideas on how to detect if the form was submitted successfully or
 not in JavaScript?

 Thanks,

 Alec

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Form composed of Panel components

2011-04-11 Thread Pedro Santos
Simply nestle sub Panel contain form components is fine if you make sure
that there are a form component higher in hierarchy. FormComponentPanel is
useful if you want the panel itself participating in form processing, I
don't think this is the case.

On Mon, Apr 11, 2011 at 10:08 AM, Chris Colman chr...@stepaheadsoftware.com
 wrote:

 I have a complex form that I choose to break down into logical sub Panel
 components and then add them as children to the Form.

 The sub Panels themselves then have FormComponents like text fields and
 DropDownChoice components added to them. Will the normal validate/update
 mechanism simply work like that or do I need to override some methods in
 my Panel classes or make the Panel classes implement certain interfaces
 (eg., IFormVisitorParticipant etc.,)?

 Chris Colman




-- 
Pedro Henrique Oliveira dos Santos


Re: Form composed of Panel components

2011-04-11 Thread Pedro Santos
Form will process nested form components regardless of the web markup
container component you used to group them.

On Mon, Apr 11, 2011 at 10:46 AM, Chris Colman chr...@stepaheadsoftware.com
 wrote:

 I can't derive my Panels from FormComponentPanel because a strict
 inheritance hierarchy of Panels is already in place. I've started
 playing around with the Panels in question implementing
 IFormVisitorParticipant and IFormModelUpdateListener and this seems to
 be at least calling the validate and updateModel methods in my Panels
 now - I think plain vanilla Panels are ignored by the Form processing
 mechanism unless they implement these interfaces?

 -Original Message-
 From: Wilhelmsen Tor Iver [mailto:toriv...@arrive.no]
 Sent: Monday, 11 April 2011 11:11 PM
 To: users@wicket.apache.org
 Subject: RE: Form composed of Panel components
 
 Look into org.apache.wicket.markup.html.form.FormComponentPanelT
 
 - Tor Iver
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: 11. april 2011 15:08
 To: users@wicket.apache.org
 Subject: Form composed of Panel components
 
 I have a complex form that I choose to break down into logical sub
 Panel
 components and then add them as children to the Form.
 
 The sub Panels themselves then have FormComponents like text fields and
 DropDownChoice components added to them. Will the normal
 validate/update
 mechanism simply work like that or do I need to override some methods
 in
 my Panel classes or make the Panel classes implement certain interfaces
 (eg., IFormVisitorParticipant etc.,)?
 
 Chris Colman
 
 
 -
 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


Re: Form composed of Panel components

2011-04-11 Thread Pedro Santos
Yes if you implement IFormModelUpdateListener and add a form validator in
form.

On Mon, Apr 11, 2011 at 11:01 AM, Chris Colman chr...@stepaheadsoftware.com
 wrote:

 What if I want the Panel containers to have their own updateModel and
 validate methods? Will those methods be called on a class I derive from
 Panel?

 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: Monday, 11 April 2011 11:54 PM
 To: users@wicket.apache.org
 Subject: Re: Form composed of Panel components
 
 Form will process nested form components regardless of the web markup
 container component you used to group them.
 
 On Mon, Apr 11, 2011 at 10:46 AM, Chris Colman
 chr...@stepaheadsoftware.com
  wrote:
 
  I can't derive my Panels from FormComponentPanel because a strict
  inheritance hierarchy of Panels is already in place. I've started
  playing around with the Panels in question implementing
  IFormVisitorParticipant and IFormModelUpdateListener and this seems
 to
  be at least calling the validate and updateModel methods in my Panels
  now - I think plain vanilla Panels are ignored by the Form processing
  mechanism unless they implement these interfaces?
 
  -Original Message-
  From: Wilhelmsen Tor Iver [mailto:toriv...@arrive.no]
  Sent: Monday, 11 April 2011 11:11 PM
  To: users@wicket.apache.org
  Subject: RE: Form composed of Panel components
  
  Look into org.apache.wicket.markup.html.form.FormComponentPanelT
  
  - Tor Iver
  
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: 11. april 2011 15:08
  To: users@wicket.apache.org
  Subject: Form composed of Panel components
  
  I have a complex form that I choose to break down into logical sub
  Panel
  components and then add them as children to the Form.
  
  The sub Panels themselves then have FormComponents like text fields
 and
  DropDownChoice components added to them. Will the normal
  validate/update
  mechanism simply work like that or do I need to override some
 methods
  in
  my Panel classes or make the Panel classes implement certain
 interfaces
  (eg., IFormVisitorParticipant etc.,)?
  
  Chris Colman
  
  
 
 -
  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




-- 
Pedro Henrique Oliveira dos Santos


Re: Wicket 1.5 PageParameters vs IRequestParameters question.

2011-04-11 Thread Pedro Santos
IRequestParameters interface has PageParameters correspondent API to access
page parameters. Can be accessed like:
RequestCycle.get().getRequest().getQueryParameters()

If you want to recreate page parameters for some request, you can use the
PageParametersEncoder.


On Mon, Apr 11, 2011 at 12:06 PM, Serban Balamaci serban.balam...@asf.rowrote:

 Hello everybody, I''m in the process of migrating an app from 1.4 to
 1.5-RC3

 I see that the PageParameters and IRequestParameters are pretty separate
 things now. Any reason why it's done this way and why they not extend a
 Common Interface that exposes methods like getParameterNames
 getParameterValue.

 Because I  have this usecase: I try to keep a stateless page by heavily
 encoding state in the pageParameters, so on different actions I'm resending
 parameters that I initially received on this page.
 In 1.4 there was no difference in handling parameters that came from
 constructor WebPage(final PageParameters parameters) and those that were
 received in the request( RequestCycle.get().getPageParameters()) and there
 was very easy to reuse the same parameters received in the request - clone

 Is it an easy method to create PageParameters from IRequestParameters(which
 I get from RequestCycle.get().getRequest().getRequestParameters()), or
 iterating and adding them to PageParameters is the way to go?

 Thank you.

 -
 http://balamaci.wordpress.com
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-PageParameters-vs-IRequestParameters-question-tp3442239p3442239.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Pre-Select CheckBox in CheckBoxMultipleChoice?

2011-04-05 Thread Pedro Santos
add X in the CheckBoxMultipleChoice model collection. e.g.

IModelCollection multipleChoiceModel = (...);
checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
multipleChoiceModel.getObject().add( X );


On Tue, Apr 5, 2011 at 2:57 PM, eugenebalt eugeneb...@yahoo.com wrote:

 I have a CheckBoxMultipleChoice with some checkboxes.

 I also have a String, X. If there is a checkbox in the list whose title
 matches X, then I have to pre-select it (select it in the model).

 Any idea how to do that? Thanks

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428739.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Wicket For Mobile

2011-04-04 Thread Pedro Santos
I don't remember of Wicket JavaScript mobile compatibility thread. I tested
Wicket aplicaitons using AJAX on IE and Safari mobile versions, in both
works nice.

On Sun, Apr 3, 2011 at 11:33 AM, Ayodeji Aladejebi aladej...@gmail.comwrote:

 Hi,
 I like to find out the compatibility of wicket on mobile phones? especially
 the wicket javascript
 Have there been any publication or any project discussing wicket
 compatibility on Mobile Devices

 Thanks




-- 
Pedro Henrique Oliveira dos Santos


Re: UploadProgressBar Possible Bug

2011-04-04 Thread Pedro Santos
Please open a ticket, I will try to reproduce and upload a quickstart. I
remember of it taking some time to be hidden, but just the time of form
submit process (maybe your form do heavy processing, easily reproducible on
quickstart).

On Mon, Apr 4, 2011 at 12:43 PM, mzem...@osc.state.ny.us wrote:

 Sorry but I do not have the time/resources to create a quickstart (I don't
 use Maven) but I wanted to alert the group to an issue I had in case
 anyone wanted to test/fix it.

 Using the following;

 Wicket 1.4.16
 UploadWebRequest in App object
 Form with setMaxSize() (I'm using 1MB)
 FileUploadField
 AjaxSubmitButton
 UploadProgressBar

 When the form max size exception is hit, the progress bar stays visible
 and refreshes many times showing no progress, then eventually disappears.
 If I manually call error on a component the form stops processing and the
 progress bar disappears as expected.  I'm not sure if the bug is in the
 progress bar or the form processing.  There also seems to be some
 difference between Wicket 1.4.16 and 1.4.15.  Using 1.4.15 the progress
 bar disappeared but the page continued to refresh repeatedly.  After
 upgrading to 1.4.16 the progress bar remains visible and continues to
 refresh erroneously.



 Notice: This communication, including any attachments, is intended solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.




-- 
Pedro Henrique Oliveira dos Santos


Re: UploadProgressBar Possible Bug

2011-04-04 Thread Pedro Santos
we already have a quickstart :)
https://issues.apache.org/jira/browse/WICKET-3594

On Mon, Apr 4, 2011 at 6:10 PM, mzem...@osc.state.ny.us wrote:

 The form does not process anything besides the file upload, and everything
 works fine until the UploadProgressBar is introduced (and yes I set
 mutlipart to true).  I will open a jira if/when time permits, if you have
 the appropriate credentials please create a jira on my behalf, I am not
 currently an account holder.




 From:   Pedro Santos pedros...@gmail.com
 To: users@wicket.apache.org
 Date:   04/04/2011 04:59 PM
 Subject:Re: UploadProgressBar Possible Bug



 Please open a ticket, I will try to reproduce and upload a quickstart. I
 remember of it taking some time to be hidden, but just the time of form
 submit process (maybe your form do heavy processing, easily reproducible
 on
 quickstart).

 On Mon, Apr 4, 2011 at 12:43 PM, mzem...@osc.state.ny.us wrote:

  Sorry but I do not have the time/resources to create a quickstart (I
 don't
  use Maven) but I wanted to alert the group to an issue I had in case
  anyone wanted to test/fix it.
 
  Using the following;
 
  Wicket 1.4.16
  UploadWebRequest in App object
  Form with setMaxSize() (I'm using 1MB)
  FileUploadField
  AjaxSubmitButton
  UploadProgressBar
 
  When the form max size exception is hit, the progress bar stays visible
  and refreshes many times showing no progress, then eventually
 disappears.
  If I manually call error on a component the form stops processing and
 the
  progress bar disappears as expected.  I'm not sure if the bug is in the
  progress bar or the form processing.  There also seems to be some
  difference between Wicket 1.4.16 and 1.4.15.  Using 1.4.15 the progress
  bar disappeared but the page continued to refresh repeatedly.  After
  upgrading to 1.4.16 the progress bar remains visible and continues to
  refresh erroneously.
 
 
 
  Notice: This communication, including any attachments, is intended
 solely
  for the use of the individual or entity to which it is addressed. This
  communication may contain information that is protected from disclosure
  under State and/or Federal law. Please notify the sender immediately if
  you have received this communication in error and delete this email from
  your system. If you are not the intended recipient, you are requested
 not
  to disclose, copy, distribute or take any action in reliance on the
  contents of this information.




 --
 Pedro Henrique Oliveira dos Santos





 Notice: This communication, including any attachments, is intended solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.




-- 
Pedro Henrique Oliveira dos Santos


Re: [VOTE] Behavior of CheckBox With Respect to setRequired(true)

2011-04-02 Thread Pedro Santos
By nature of checkbox you mean nature of HTTP. As setRequired is Wicket
API,  IMO it should abstract the empty info about false input from framework
users, in benefit of those who are deliberately sending a 'false' value in
their form input.

On Sat, Apr 2, 2011 at 12:30 PM, Bruno Borges bruno.bor...@gmail.comwrote:

 No problem. :-)

 setRequired means what you said: please, provide a value.

 In case of a Checkbox, if setRequired is false, it means: you don't have
 to
 provide a value which in other words means you have the choice to do
 nothing about it which in other words means you don't have to check it.
 Which by the nature of a checkbox, means 'false'. Now, if setRequired true,
 then it means you have to provide a value which means you don't have the
 choice to ignore it wich means you must check it, which by the nature of
 the checkbox, means 'true'.

 Now, if setRequired of checkboxes happens to do nothing (at the worse
 throws
 an UnsupportedException; but I think setRequired is final), then it would
 break *a lot* of things. Even if you state that this change is only 1.5 and
 people should migrate... that is complicate.

 I'm deploying Wicket for a huge healthcare/life/auto ensurance company in
 Brazil, and I'm sure they won't like the idea of having to migrate 300 apps
 to 1.5, with this kind of API change. Until now, most of the changes can be
 fixed (from 1.4 to 1.5) in a higher level, not having to look at every and
 single Form. With this, it would be a nightmare.

 just my 2 cents


 Bruno Borges
 www.brunoborges.com.br
 +55 21 76727099

 The glory of great men should always be
 measured by the means they have used to
 acquire it.
  - Francois de La Rochefoucauld



 On Sat, Apr 2, 2011 at 5:47 AM, Maarten Billemont lhun...@gmail.com
 wrote:

 
  On 02 Apr 2011, at 01:01, Maarten Billemont wrote:
 
  
   On 02 Apr 2011, at 00:13, Bruno Borges wrote:
  
   [] Please, check this box if you agree with EULA
   [ x ] Please, uncheck this box if you don't want to receive
  notifications
  
  
   In this case, I would set the first checkbox as required, and leave
 the
   later as optional.
  
   Vote for (1) +1
  
   Please don't pretend a checkbox is a Radio component.  This is
 irrelevant
  to this discussion.
 
  I totally missed that you have two different questions here, apologies.
 
  Nevertheless, you're disregarding my earlier statements.  You're asking
 us
  to make setRequired do something that's completely different from what
  it's supposed to do.  If you require a certain value, that's what
 validators
  are for.  If you require a value to be given, you use setRequired.
   Checkboxes ALWAYS give a value.  There is no I choose not to choose
  option with a checkbox.  That is what setRequired is for.  It forces you
 to
  make a *choice*.  It does not force you to make a specific choice.
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Pedro Henrique Oliveira dos Santos


Re: How to display time for page generation ?

2011-04-02 Thread Pedro Santos
Hi, the RequestLogger API can help you.
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/RequestLogger.html

On Sat, Apr 2, 2011 at 5:21 PM, Isammoc OFF isam...@gmail.com wrote:

 Hi all,

 I would like to display a footer with the time spent to generate the page.

 How can I do something like generated in 0.123s ?

 Timestamp difference between start and end of the Page constructor is
 obviously not the solution.
 And I didn't find anything in Nabble... (815 answer for time page
 generation)

 If the discussion already happened, please send me a link.

 Thanks,

 --
 Isammoc

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Detach on ldm?

2011-04-01 Thread Pedro Santos
yep

On Fri, Apr 1, 2011 at 2:02 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Shouldnt a call to detach on a cpm targeting a ldm chain detach so that it
 will reload?




-- 
Pedro Henrique Oliveira dos Santos


Re: [VOTE] Behavior of CheckBox With Respect to setRequired(true)

2011-04-01 Thread Pedro Santos
I vote for 2, checkbox needs always to satisfy the required requirement. As
pointed, there are no parameter in the HTTP request reader for false inputs,
we can't distinguish 'false' from 'null', so we can't consider that user
isn't meeting the required condition.

On Fri, Apr 1, 2011 at 2:34 PM, James Carman ja...@carmanconsulting.comwrote:

 This has been discussed before
 (https://issues.apache.org/jira/browse/WICKET-1221), but I can't find
 the old vote thread to see what folks think.  The problem is that a
 checkbox is a weird bird when it comes to HTTP.  If it's unchecked, it
 doesn't send a value which makes Wicket think you haven't provided a
 value for that input field.  Right now, if you call setRequired(true)
 on a CheckBox, it's going to require the user to actually check the
 box.  What do folks think the desired behavior should be?

 1.  The current approach is correct, requiring a checkbox means
 requiring that it be checked.

 2.  A checkbox shouldn't be able to be required.  You can't *not*
 provide a value (it's binary) for a checkbox, so therefore it always
 should satisfy the required requirement.

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




-- 
Pedro Henrique Oliveira dos Santos


Re: ModalWindow detach/serialize crashes wicket app

2011-04-01 Thread Pedro Santos
looks like your page is referencing session or pagemap somehow

On Fri, Apr 1, 2011 at 4:15 PM, Russell Morrisey 
russell.morri...@missionse.com wrote:

 Guys,

 I'm having an intermittent issue in development where use of a ModalWindow
 on a page completely crashes wicket.

 I don't know of the ModalWindow is the root cause. I am hoping that someone
 with intimate knowledge of wicket's page store can help me narrow it down.
 Hints appreciated. =)

 The X button and other ajax controls within the ModalWindow's content
 page stop responding to user input. When I try to hit the same bookmarkable
 URL again for the containing page, wicket seems to have stopped running
 entirely, and I get a Tomcat HTTP 404 error.

 The JVM outputs a StackOverflowError which looks like it happens during
 page serialization.
 Apr 1, 2011 2:53:14 PM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet default threw exception
 java.lang.StackOverflowError
 The two blocks below occur multiple times, each, within a single trace:
 ...
   at
 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1130)
   at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
   at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.prepareForSerialization(DiskPageStore.java:1190)
   at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(SecondLevelCacheSessionStore.java:386)
 ...
   at
 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
   at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1130)
   at
 org.apache.wicket.protocol.http.pagestore.AbstractPageStore$PageSerializer.getPageReplacementObject(AbstractPageStore.java:288)
   at org.apache.wicket.Page.writeReplace(Page.java:1383)

 In our application's init() method, we have this setting:

 Objects.setObjectStreamFactory(null); // jdk serialization

 I have tried to reproduce the problem in a quickstart; but, I have not had
 much luck, so far.

 We don't really have any custom code in our app that deals with object
 serialization. Any help would be appreciated. We are currently using wicket
 1.4.9; if you guys think this might be fixed in a later version, we'd be
 happy to upgrade. I searched briefly through the JIRA, and nothing popped
 out at me.

 

 RUSSELL E. MORRISEY
 Programmer Analyst Professional
 Mission Solutions Engineering, LLC

 | russell.morri...@missionse.com | www.missionse.com
 http://www.missionse.com/
 304 West Route 38, Moorestown, NJ 08057-3212


 
 This is a PRIVATE message. If you are not the intended recipient, please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery.
 NOTE: Regardless of content, this e-mail shall not operate to bind MSE to
 any order or other contract unless pursuant to explicit written agreement or
 government initiative expressly permitting the use of e-mail for such
 purpose.




-- 
Pedro Henrique Oliveira dos Santos


Re: Strange behaviour in WicketTester when Ajax-clicking on a deselected checkbox

2011-03-31 Thread Pedro Santos
Hi David, looks like a bug, please create a ticket + upload the quickstart.
As a side note, wicket tester do not encode the form state between requests.
If you submit a form a second time, the request parameters for fields you
didn't set will be empty, and will look like the user had cleared the form.
https://issues.apache.org/jira/browse/WICKET-1826

On Thu, Mar 31, 2011 at 6:41 PM, David Hendrix wicket-us...@unbewaff.netwrote:

 Hi there,

 I'm experiencing some weird behaviour in WicketTester. Running the code in
 jetty gives the expected results.

 I've got an AjaxCheckbox with a PropertyModel. When ajax-clicking in in
 WicketTester, when the model is true, everything works as expected but
 ajax-clicking it when the model is false doesn't result in a call of the
 model's setter even in onUpdate is executed (Breakpoints and jUnit-Asserts)

 Is this some known issue or am I doing something wrong?

 I created a quickstart replicating this for Wicket 1.4.15, didn't try
 another version yet...

 Thanks for your help
 David

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Error during headers validation since migration to 1.5

2011-03-28 Thread Pedro Santos
Hi adrien, yes, with a quickstart reproducing the error please.

On Sun, Mar 27, 2011 at 8:54 PM, adriclad adrien.che...@gmail.com wrote:

 No answer...

 May I write a Jira ticket for 1.5-RC3 to inform this bug ?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Error-during-headers-validation-since-migration-to-1-5-tp3355890p3409851.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




-- 
Pedro Henrique Oliveira dos Santos


Re: [1.5RC2] impossible to add cookies

2011-03-28 Thread Pedro Santos
Hi, just tested http://wicketstuff.org/wicket/authentication2 and the
example set the cookie in response without problems.
Open a ticket + quickstart reproducing the problem please.

On Sun, Mar 27, 2011 at 8:48 PM, adriclad adrien.che...@gmail.com wrote:

 Anybody had the same problem ?

 May I have to refer the bug in a jira ticket for the 1.5-RC3 ?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/1-5RC2-impossible-to-add-cookies-tp3380554p3409846.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




-- 
Pedro Henrique Oliveira dos Santos


Re: HTML comment tag

2011-03-28 Thread Pedro Santos
An reusable behavior can be archived using the MarkupComponentBorder.
On a side note, why do you want to write commented model values in markup?

On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 This is simple code and works, do you think this is a way to add dynamic
 HTML comments that use some Wicket model?
 Or have you done something else?

 I am not as familiar with onComponentTagBody.

 public class HtmlComment extends Label {

/**
 * @see
 org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
 MarkupStream,
 *  org.apache.wicket.markup.ComponentTag)
 */
@Override
protected void onComponentTagBody(final MarkupStream markupStream,
 final ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, !--  +
 getDefaultModelObjectAsString() +  --);
}

 }

 and the output will be in the final HTML output:

 !-- DATA --




-- 
Pedro Henrique Oliveira dos Santos


Re: just having another question how to clear form fields

2011-03-28 Thread Pedro Santos
Set a null/empty value in their model plus notify the component about
changed models e.g. Component#modelChanged.
e.g.
form = new Form(new CompoundPropertyModel(new Bean())
form.add(new Field(someProperty);
(...)
form.add(new SubmitComponent(id){
 onSubmit(){
form.setDefaultModelObject(new Bean());//set empty values
also calls Component#modelChanged method
}});

On Mon, Mar 28, 2011 at 1:29 PM, hariharansrc hariharan...@gmail.comwrote:

 after clicking submit button the values are still there in field itself how
 to clear the field values

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/how-to-call-javascript-function-on-form-submission-tp3408147p3412291.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Ajax modal window does not allow submit form under open browsers

2011-03-21 Thread Pedro Santos
The modal window's content is rendered into a set of new elements into the
page body directly, this set include a form tag. If you add a root form
inside the modal window content, the HTML for the opened window will be
invalid because of nested form tags. I don't remember of any change in this.

On Mon, Mar 21, 2011 at 8:15 AM, Sven Meier s...@meiers.net wrote:

 Yes, the extra form in modal window is no longer needed.

 This works because a modal window's content is 'just' rendered into a new
 element in the page body directly.

 Sven


 Brown, Berlin [GCG-PFS] wrote:
 
  OK, so the patch just scraps the form in the modal window.
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Sunday, March 20, 2011 8:36 AM
  To: users@wicket.apache.org
  Subject: RE: Ajax modal window does not allow submit form under open
  browsers
 
  gt;.. and please vote for WICKET-3404 if you think the need for this
  gt;additional form is just annoying.
 
  +1 from me!
 
  I find having to wrap a modal in a form quite annoying.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393166.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Ajax modal window does not allow submit form under open browsers

2011-03-21 Thread Pedro Santos
The patch look good, but will force all current nested forms inside some
modal window to override the Form#isRootForm to return true
A possible way of avoid is to flag the mismatch in hierarchy. Join us in the
dev mail list to discuss, there is even a thread already:

http://markmail.org/search/?q=wicket#query:wicket%20list%3Aorg.apache.wicket.dev%20date%3A201102%20from%3A%22Pedro%20Santos%22+page:1+mid:lrhm4gcg7cxoskgm+state:results



On Mon, Mar 21, 2011 at 10:01 AM, Sven Meier s...@meiers.net wrote:

 Hi Pedro,

 modal window renders its content into its own tag's body before moving it
 into new tags on the top level.
 In the proposed patch this intermediate step is skipped, thus keeping the
 markup valid even in case of a form in the dialog's content.


 Pedro Santos wrote:
 
  I don't remember of any change in this.
 

 The patch was not accepted for 1.5.

 Best regards

 Sven

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393492.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Best way to remove content from a close Modal Window?

2011-03-21 Thread Pedro Santos
modalWindow.replace(new WebMarkupContainer(modalWindow.getContentId()));

On Mon, Mar 21, 2011 at 3:36 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 I open a form in a ModalWindow. Even after the form is closed the
 content seems to remain because the form contents are serialized out
 with the page.

 What is the best way to remove the content from the ModalWindow after
 the window is closed? I tried calling setContent(null) but that causes a
 subsequent NPE.




-- 
Pedro Henrique Oliveira dos Santos


Re: Caching Streamed Images on browser

2011-03-19 Thread Pedro Santos
Browser respect cache control headers of the HTTP response, u can set your
caching rules there.

On Sat, Mar 19, 2011 at 5:39 AM, Arjun Dhar dhar...@yahoo.com wrote:

 Hi,
  I have a resource (an Image which exists on the File System outside the
 Web
 Context).
 I stream the image resource. The problem really is that while the speed to
 download an image within web-context and outside is the same  the one
 within Web-Context is always cached by the browser.

 Am not sure this is a pure wicket question, but anyone know the rules for
 browser caching images? As long as the src link is the same and
 independent of session why would the browser not cache it?

 I also created a simple DownloadServlet and same result. URL --
 /DownloadServlet?file=abc.


 -
 Don't take life too seriously, your'e not getting out it alive anyway!
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Caching-Streamed-Images-on-browser-tp3389269p3389269.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Pedro Santos
To submit a form inside a modal window you must enclose it by a form in the
main panel and use an AJAX submit component. Please open a ticket +
quickstart if the issue remains.

On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 When I use the ajax modal window and under Firefox/Chrome/Safari, the
 ajax form submit does not happen.  When I open the ajax debug window, it
 looks like a request is made.

 Has anyone had issues with modal windows, form submission and firefox?

 Internet Explorer 7 works fine.

 Version of Wicket: 1.4.13

 Here is the error in the debug window:

 RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
 'calloutForm449' that is not in document.
 ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
 'calloutForm449' that is not in

 Pseduo Code:

 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 ...


 final ModalWindow modalWindow = new ModalWindow( modalWindow);
 final Panel basicPanel = new BasicPanel( modalWindow.getContentId());

 modalWindow.setInitialWidth( 600 );
 mainPanel.add(modalWindow);
 modalWindow.setContent(basicPanel);


 ...

 public class BasicPanel extends Panel {

  public BasicPanel(final String id) {
...
final Form form = new Form(calloutForm);
add(form);
  }
 }

 ** Panel for Modal Window Markup:

 form wicket:id=calloutForm
  ...
 /form


 ** Output from ajax debug window.

 The form looks like it is available.

 div id=feedback4d7 style=display:none/div
 form id=calloutForm4d8 method=post
 action=?wicket:interface=:10:contentPanelContainer:contentPanel:panel:m
 odalWindow:content:calloutForm::IFormSubmitListener:: div
 style=width:0px;height:0px;position:absolute;left:-100px;top:-100px;ove
 rflow:hiddeninput type=hidden name=calloutForm4d8_hf_0
 id=calloutForm4d8_hf_0 //div
  fieldset
table cellspacing=0 cellpadding=0 style=width: auto;
 class=content_panel_table
 tbody
  ...
  
 /form
 /div






-- 
Pedro Henrique Oliveira dos Santos


Re: Ajax modal window does not allow submit form under open browsers

2011-03-19 Thread Pedro Santos
On Sat, Mar 19, 2011 at 10:00 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 You mean?

 Markup, main panel:

 form
  div wicket:id=thePanelForModalWindow/div
 /form


the markup will look like:

form wicket:id=formComponentId
 div wicket:id=modalWindow/div
/form

wicket:panel
  form wicket:id=formInsideThePanelForModalWindow/form
/wicket:panel

OK, but why does it work with Internet Explorer 7.  Strange.


If you add a root form component inside the modal window the generated
markup will have 2 nested form tags which is illegal. Each browser have its
own tolerance for illegal HTML



 -Original Message-
 From: Pedro Santos [mailto:pedros...@gmail.com]
 Sent: Saturday, March 19, 2011 8:02 PM
 To: users@wicket.apache.org
 Subject: Re: Ajax modal window does not allow submit form under open
 browsers

 To submit a form inside a modal window you must enclose it by a form in
 the main panel and use an AJAX submit component. Please open a ticket +
 quickstart if the issue remains.

 On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] 
 berlin.br...@primerica.com wrote:

  When I use the ajax modal window and under Firefox/Chrome/Safari, the
  ajax form submit does not happen.  When I open the ajax debug window,
  it looks like a request is made.
 
  Has anyone had issues with modal windows, form submission and firefox?
 
  Internet Explorer 7 works fine.
 
  Version of Wicket: 1.4.13
 
  Here is the error in the debug window:
 
  RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
  'calloutForm449' that is not in document.
  ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
  'calloutForm449' that is not in
 
  Pseduo Code:
 
  import
  org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
  ...
 
 
  final ModalWindow modalWindow = new ModalWindow( modalWindow); final

  Panel basicPanel = new BasicPanel( modalWindow.getContentId());
 
  modalWindow.setInitialWidth( 600 );
  mainPanel.add(modalWindow);
  modalWindow.setContent(basicPanel);
 
 
  ...
 
  public class BasicPanel extends Panel {
 
   public BasicPanel(final String id) {
 ...
 final Form form = new Form(calloutForm);
 add(form);
   }
  }
 
  ** Panel for Modal Window Markup:
 
  form wicket:id=calloutForm
   ...
  /form
 
 
  ** Output from ajax debug window.
 
  The form looks like it is available.
 
  div id=feedback4d7 style=display:none/div form
  id=calloutForm4d8 method=post
  action=?wicket:interface=:10:contentPanelContainer:contentPanel:panel
  :m odalWindow:content:calloutForm::IFormSubmitListener:: div
  style=width:0px;height:0px;position:absolute;left:-100px;top:-100px;o
  ve rflow:hiddeninput type=hidden name=calloutForm4d8_hf_0
  id=calloutForm4d8_hf_0 //div
   fieldset
 table cellspacing=0 cellpadding=0 style=width: auto;
  class=content_panel_table
  tbody
   ...
   
  /form
  /div
 
 
 
 


 --
 Pedro Henrique Oliveira dos Santos


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




-- 
Pedro Henrique Oliveira dos Santos


  1   2   3   4   5   >