Re: Url parameters: removed onClick + wrong url encoding

2010-09-21 Thread Martin Grigorov
On Mon, Sep 20, 2010 at 8:57 PM, Peter Karich peat...@yahoo.de wrote:

 Hi Martin!

  Martin,
 
  thanks for the support in the tickets btw :-)
 
 
  We thank you for testing the framework and blogging about it! ;-)
 

 ;-)

  Interesting.
  How exactly looks the URL for such request?

 E.g. try it with the quickstart at:
 https://issues.apache.org/jira/browse/WICKET-3053

 http://localhost:8080/jetwick/?test
 (it seems that 'test' can anything)

 Directory: /jetwick/
 WEB-INF/  http://localhost:8080/jetwick/WEB-INF/  4096 bytes
 16.09.2010 22:18:08

 Looks like a bug in HomePageMapper.
I'll create the ticket.
Thanks !


 luckily clicking the WEB-INF doesn't show its content and maybe this
 issue is as well a jetty one.

  StringValue is a clever class ;-)
  It can handle null value for you.
  It has isNull(), isEmpty()

 oh noo, that simple ... :-)

 Regards,
 Peter.



ChoiceRender and many property expressions

2010-09-21 Thread Andrea Del Bene
Hi,

I need to render options in a MultipleSelectList using more then one field from
a POJO. Is possible to use ChoiceRender selecting more then one property (for
example passing it more then one property expression)?  

Thank you, Andrea.


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



Re: updating page version after an ajax request

2010-09-21 Thread Josh Kamau
May be you could provide the developer with access to the page history
utilities such that i can update the version of the current page at will or
leave things to work normally if i dont want to break anything.  something
like thisPage.getVersion().increment() ;

regards.

On Fri, Sep 17, 2010 at 6:03 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 On Fri, Sep 17, 2010 at 3:04 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
  I wont say this is a bug.
  Actually it is by design.
  When the page renders all links' href url points to specific page
 version.
  So when the user clicks on any link the page is properly resolved and the
  click processed.
  If you change the page id with Ajax then there is a chance to leave
 broken
  links/forms in the page. Clicking on those will result in either using
 old
  version of the page or even worse PageExpiredException.

 Couldn't we use a cookie to keep the current version/tab/window? we
 could update it serverside and clientside to our liking... Not sure
 how we could hook into the back button for that though...

 One thing is sure: when using ajax, javascript works...

 Martijn

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




Re: palette problem

2010-09-21 Thread luigi.brandolini

Hi, thank you very much for your suggestion and help guys: getting always an
empty selected list, i solved the problem providing all the choices to that
model.

Regards!

Luis
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/palette-problem-tp1869353p2548267.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



FeedbackPanel does not clean up after displaying error messages using Ajax

2010-09-21 Thread droitbarg

Hello everyone!

I am experiencing a problem whenever submiting a form using an
AjaxSubmitLink. I have tried using wicket from version 1.4.9 to 1.4.12
If the form fields are properly filled the first time( and validation
succeeds) my AjaxSubmitLink calls onSubmit and everything goes straight.
If any required field is missing the proper error message is displayed in
the feedback panel
But if I got an error message and I fill the required field in a second
round,  the error message keeps on coming.
After the first validation failure I always get calls to
AjaxSubmitLink.onError() even though the fields are properly filled.

Could anybody tell me what am I doing wrong?

Here is my code


In my home page I have the following:

HomePage.xml

form wicket:id=mainform 
div wicket:id=feedbackPanel/
div wicket:id=newClientPanel/

/form
div wicket:id=buttonsPanel/


newClientPanel.xml

wicket:panel
form wicket:id=newClient 

table
tr
tdwicket:message
key=newclient.title[newclient.title]/wicket:message/td
/tr
tr
tdwicket:message key=name[name]/wicket:message/td
tdinput type=text wicket:id=name //td
/tr

tr
tdwicket:message
key=surname[surname]/wicket:message/td
tdinput type=text wicket:id=surname //td
/tr
tr
tdwicket:message
key=phoneNumber[phoneNumber]/wicket:message/td
tdinput type=text wicket:id=phoneNumber //td
/tr
tr
tdwicket:message
key=email[email]/wicket:message/td
tdinput type=text wicket:id=email //td
/tr

/table

/form
/wicket:panel

newClientPanel.java

private void addComponents() {
clientForm = new FormClient(newClient);

clientForm.setModel(new CompoundPropertyModelClient(client));
clientForm.add(new RequiredTextFieldString(name));
clientForm.add(new RequiredTextFieldString(surname));
clientForm.add(new RequiredTextFieldString(phoneNumber));
clientForm.add(new
RequiredTextFieldString(email).add(EmailAddressValidator.getInstance()));
add(clientForm);
}


buttonsPanel.java


saveLink = new AjaxSubmitLink(save, mainform) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form)
{
//Saving data here

}

@Override
protected void onError(final AjaxRequestTarget target,  Form?
form) {
super.onError(target, form);
target.addComponent(getFeedBackPanel());

}

};
add(saveLink);

 TIA

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-does-not-clean-up-after-displaying-error-messages-using-Ajax-tp2548394p2548394.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: FeedbackPanel does not clean up after displaying error messages using Ajax

2010-09-21 Thread Alexander Morozov

What about feedback markup ID ? Is it present on the page ? 
It seems that you forgot to invoke setOutputMarkupPlaceholderTag(true) on
FeedbackPanel instance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-does-not-clean-up-after-displaying-error-messages-using-Ajax-tp2548394p2548415.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: FeedbackPanel does not clean up after displaying error messages using Ajax

2010-09-21 Thread droitbarg

Alexander: thanks for your quick answer!
I have done as you said but I still get the same problem.

My HomePage.java code is:

public HomePage(final PageParameters parameters) {
getSession().setHomePage(this);

Form form = new Form(primaryform);
FeedbackPanel feedbackPanel = new FeedbackPanel(feedbackPanel);
feedbackPanel.setOutputMarkupPlaceholderTag(true);
form.add(feedbackPanel);

DetailPanel detailPanel = new NewClientPanel(newClientPanel);
form.add(detailPanel);
add(new ButtonsPanel(buttonsPanel, detailPanel, feedbackPanel,
form));
add(form);

headerContributions(); 
}

I still get the error messages but they never go away
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-does-not-clean-up-after-displaying-error-messages-using-Ajax-tp2548394p2548477.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: FeedbackPanel does not clean up after displaying error messages using Ajax

2010-09-21 Thread droitbarg

I made a small mistake:

Where it says 
add(new ButtonsPanel(buttonsPanel, detailPanel, feedbackPanel,
form)); 
it should be:

add(new ButtonsPanel(buttonsPanel, detailPanel, feedbackPanel,
primaryform)); 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-does-not-clean-up-after-displaying-error-messages-using-Ajax-tp2548394p2548480.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: FeedbackPanel does not clean up after displaying error messages using Ajax

2010-09-21 Thread Alexander Morozov

  saveLink = new AjaxSubmitLink(save, mainform) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form)
{
/* do not forget to refresh feedback panel on successful
submit */
info(Request processed successfully!);
target.addComponent(getFeedBackPanel());
}

@Override
protected void onError(final AjaxRequestTarget target,  Form?
form) {
super.onError(target, form);
target.addComponent(getFeedBackPanel());   
}

};
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FeedbackPanel-does-not-clean-up-after-displaying-error-messages-using-Ajax-tp2548394p2548537.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



setDefaultButton works in all browsers?

2010-09-21 Thread Anna Simbirtsev
I am using setDefaultButton to submit the form using enter key. It
seems to be working ok, but I have read on the internet that people
are having problems in some browsers. Does anybody have any
recommendations?

Thanks

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



Palette model changing problem

2010-09-21 Thread Java Programmer
Hello,
I have a problem with Palette component - I try to retain model
objects which were selected in Pallete, and update the list od choices
same time (in other word you have one set of available choices takes
2, than press some ajax button and get different set of choices, than
takes 3, so you should have 2+3 selected choices, but every time after
updating Pallete I got empty selected list).
Maybe you can look at the code:

private void addKeywordPalette() {
final IChoiceRenderer renderer = new IChoiceRenderer() { /not
important/ };
keywordPallete = new Palette(Keyword.KEYWORDS, new
Model(selectedKeywordCategories), new PropertyModel(this,
categories), renderer, 10, true) {
protected Recorder newRecorderComponent() {
final Recorder recorder = super.newRecorderComponent();
recorder.add(new AjaxFormComponentUpdatingBehavior(onchange) {
@Override
protected void onUpdate(AjaxRequestTarget
ajaxRequestTarget) {
// here I save model
selectedKeywordCategories =
(ArrayListKeywordCategory) keywordPallete.getModelCollection();
LOG.info(selectedKeywordCategories:  +
selectedKeywordCategories);
}
});
return recorder;
}

};

keywordPallete.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true);
add(keywordPallete);
}
The button which updates Palette component looks like:

private void addGetKeywordsButton() {
final AjaxButton getKeywordsButton = new
AjaxButton(GET_KEYWORDS_BUTTON) {

@Override
protected void onSubmit(AjaxRequestTarget
ajaxRequestTarget, Form? form) {
//this updates available choices which and renders
palette component via ajax
final SetKeywordCategory categorySet =
keywordService.someServiceWhichReturnsKeywordAndCategory();
categories = new ArrayListKeywordCategory(categorySet);
ajaxRequestTarget.addComponent(keywordPallete);
}
};
getKeywordsButton.add(new Image(IMAGE, ADD_IMAGE));
selectKeywordsForm.add(getKeywordsButton);
}

What could be wrong that new model isn't used (I use log4j and the
selectedKeywordCategories have selected objects, but Palette doesn't
use them)? Is there made a copy of that array, or something?

-- 
Best regards,
Adrian

http://www.codeappeal.com/

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



Error on constructor call

2010-09-21 Thread Benedikt Schlegel
Hy folks,

im trying to set up an DataTable with FilterToolbar but now im stuck. I want
to use the GoAndClearFilter, and that for i have to add an additional column
to the DataTable.

Im not quiet sure, which implementation is the right one for that, but as
far as i dont want to populate any data or something i guess the
FilteredAbstractColumn is the one to go with.

So i added an FilteredAbstractColumn, auto-generated the unimplemented
methods and tried to run it, still without GoAndClearFilter, which wouldve
been the next step.
But i got following exception:

java.lang.ArrayStoreException: de.wicketgarden.table1.Table1Page$1
 at de.wicketgarden.table1.Table1Page.init(Table1Page.java:46)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 ...

Heres line 46 of Table1Page.java:

columnArray[4] = new FilteredAbstractColumnDocumentLink(new
ModelString()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(ItemICellPopulatorDocumentLink
cellItem, String componentId, IModelDocumentLink rowModel) {
// no-op
}
@Override
public Component getFilter(String componentId, FilterForm form)
{
return null;
}
};



Any suggestions on this? Does anyone know what this is caused by?


Automatic submit of form (AjaxFormSubmitBehavior)

2010-09-21 Thread Gast, Thorsten
Hi,

I have a form with a AjaxFormSubmitBehavior. Is it possible to submit this form 
automatically after the rendering of the page is finished.

Regards

Thorsten


Re: Error on constructor call

2010-09-21 Thread Martin Grigorov
columnArray[4] = new FilteredAbstractColumn

what is the type of columnArray ?
you are trying to put value of a wrong type

On Tue, Sep 21, 2010 at 4:18 PM, Benedikt Schlegel 
codecab.dri...@googlemail.com wrote:

 Hy folks,

 im trying to set up an DataTable with FilterToolbar but now im stuck. I
 want
 to use the GoAndClearFilter, and that for i have to add an additional
 column
 to the DataTable.

 Im not quiet sure, which implementation is the right one for that, but as
 far as i dont want to populate any data or something i guess the
 FilteredAbstractColumn is the one to go with.

 So i added an FilteredAbstractColumn, auto-generated the unimplemented
 methods and tried to run it, still without GoAndClearFilter, which wouldve
 been the next step.
 But i got following exception:

 java.lang.ArrayStoreException: de.wicketgarden.table1.Table1Page$1
 at de.wicketgarden.table1.Table1Page.init(Table1Page.java:46)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 ...

 Heres line 46 of Table1Page.java:

 columnArray[4] = new FilteredAbstractColumnDocumentLink(new
 ModelString()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(ItemICellPopulatorDocumentLink
 cellItem, String componentId, IModelDocumentLink rowModel) {
// no-op
}
@Override
public Component getFilter(String componentId, FilterForm form)
 {
return null;
}
};



 Any suggestions on this? Does anyone know what this is caused by?



Re: Automatic submit of form (AjaxFormSubmitBehavior)

2010-09-21 Thread Thomas Götz

On 21.09.2010 17:01, Gast Thorsten wrote:

I have a form with a AjaxFormSubmitBehavior. Is it possible to submit
this form automatically after the rendering of the page is finished.


Just curious:
why do you want to submit a form without any manually input/changed data?

   -Tom


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



Re: ChoiceRender and many property expressions

2010-09-21 Thread Igor Vaynberg
you can always implement your own that merges

-igor

On Tue, Sep 21, 2010 at 1:56 AM, Andrea Del Bene
andrea.on@libero.it wrote:
 Hi,

 I need to render options in a MultipleSelectList using more then one field 
 from
 a POJO. Is possible to use ChoiceRender selecting more then one property (for
 example passing it more then one property expression)?

 Thank you, Andrea.


 -
 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: updating page version after an ajax request

2010-09-21 Thread Igor Vaynberg
the problem with updating the version of the page is that all urls
in the page, be in hrefs or in javascript, have to be rewritten with
the new page version...

-igor

On Tue, Sep 21, 2010 at 2:19 AM, Josh Kamau joshnet2...@gmail.com wrote:
 May be you could provide the developer with access to the page history
 utilities such that i can update the version of the current page at will or
 leave things to work normally if i dont want to break anything.  something
 like thisPage.getVersion().increment() ;

 regards.

 On Fri, Sep 17, 2010 at 6:03 PM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 On Fri, Sep 17, 2010 at 3:04 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
  I wont say this is a bug.
  Actually it is by design.
  When the page renders all links' href url points to specific page
 version.
  So when the user clicks on any link the page is properly resolved and the
  click processed.
  If you change the page id with Ajax then there is a chance to leave
 broken
  links/forms in the page. Clicking on those will result in either using
 old
  version of the page or even worse PageExpiredException.

 Couldn't we use a cookie to keep the current version/tab/window? we
 could update it serverside and clientside to our liking... Not sure
 how we could hook into the back button for that though...

 One thing is sure: when using ajax, javascript works...

 Martijn

 -
 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



Dynamic Column Datatable - Example

2010-09-21 Thread Shelli Orton
Hi,

 

I think what I need to do is fairly common.  I have a number of
checkboxes that users can select to determine which columns they want
displayed in a datatable.

 

I've been searching for an example of a dynamic datatable and haven't
been able to find one.  I've seen references to a solution in 2008 mail
archives that suggest it might be implemented in 1.4
(http://www.mail-archive.com/users@wicket.apache.org/msg10528.html).
Can anyone confirm that it has been or not?  In either case, is there an
example that someone can point me to?

 

Thanks in advance!

 

Shelli



Preventing warnAboutFormComponentInsideEnclosure log entries

2010-09-21 Thread Ian Marshall

I make moderate use of the wicket:enclosure/ tag in my Wicket HTML. I
notice now that (in development mode) I get log entries of the form

  21-Sep-2010 11:04:04 org.apache.wicket.markup.html.internal.Enclosure
  warnAboutFormComponentInsideEnclosure
  WARNING: Found a form component RadioChoice/frmForm:rcWebSiteMode inside
an enclosure.
  Form components do not work well inside wicket:enclosure tags, use
EnclosureContainer instead

whereas a while before now I did not.

To prevent such log entries being made without changing my
logging.properties file, I change my code as per my example below, using
instances of org.apache.wicket.markup.html.basic.EnclosureContainer instead
of wicket:enclosure/ tags.

Since I am aware of no problem with my wicket:enclosure/ tags, can I just
silence these new log messages, or am I condemned to replace all my
wicket:enclosure/ tags which enclose form components with
EnclosureContainer instances (with all the HTML and Java code changes that
this will require)?


  Old HTML code
  -
wicket:enclosure child=rcWebSiteMode
tr
td
br/
/td
/tr

tr
td
Web sites to search:
nbsp;nbsp;nbsp;nbsp;
/td
td
sp_an wicket:id=rcWebSiteMode tabindex=5
input type=radio/Option 1br/
input type=radio/Option 2br/
/sp_an
/td
/tr
/wicket:enclosure

  Old Java code
  -
Form frmForm = new Form(...);
add(frmForm);

RadioChoiceListChoiceItem rcWebSiteMode =
 new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);
frmForm.add(rcWebSiteMode);




  New HTML code
  -
wicket:container wicket:id=enclAddItem
tr
td
br/
/td
/tr

tr
td
Web sites to search:
nbsp;nbsp;nbsp;nbsp;
/td
td
sp_an wicket:id=rcWebSiteMode tabindex=5
input type=radio/Option 1br/
input type=radio/Option 2br/
/sp_an
/td
/tr
/wicket:container


  New Java code
  -
  import org.apache.wicket.markup.html.basic.EnclosureContainer;

Form frmForm = new Form(...);
add(frmForm);

RadioChoiceListChoiceItem rcWebSiteMode =
 new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);

EnclosureContainer enclAddItem = new EnclosureContainer(enclAddItem,
 rcWebSiteMode);
enclAddItem.add(rcWebSiteMode);
frmForm.add(enclAddItem);
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2549176.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: ChoiceRender and many property expressions

2010-09-21 Thread Mathias Nilsson

Let's say your POJO is a store class

new IChoiceRendererStore(){
private static final long serialVersionUID = 1L;

// Implement dispay here
public Object getDisplayValue(Store object) {
return object.getName() +   + object.getId();
}

public String getIdValue(Store object, int index) {
return object.getId().toString();
}

};
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ChoiceRender-and-many-property-expressions-tp2548227p2549286.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: Preventing warnAboutFormComponentInsideEnclosure log entries

2010-09-21 Thread Igor Vaynberg
if it works fine for your particular usecase then you can silence the warning.

-igor

On Tue, Sep 21, 2010 at 11:33 AM, Ian Marshall ianmarshall...@gmail.com wrote:

 I make moderate use of the wicket:enclosure/ tag in my Wicket HTML. I
 notice now that (in development mode) I get log entries of the form

  21-Sep-2010 11:04:04 org.apache.wicket.markup.html.internal.Enclosure
  warnAboutFormComponentInsideEnclosure
  WARNING: Found a form component RadioChoice/frmForm:rcWebSiteMode inside
 an enclosure.
  Form components do not work well inside wicket:enclosure tags, use
 EnclosureContainer instead

 whereas a while before now I did not.

 To prevent such log entries being made without changing my
 logging.properties file, I change my code as per my example below, using
 instances of org.apache.wicket.markup.html.basic.EnclosureContainer instead
 of wicket:enclosure/ tags.

 Since I am aware of no problem with my wicket:enclosure/ tags, can I just
 silence these new log messages, or am I condemned to replace all my
 wicket:enclosure/ tags which enclose form components with
 EnclosureContainer instances (with all the HTML and Java code changes that
 this will require)?


  Old HTML code
  -
        wicket:enclosure child=rcWebSiteMode
                tr
                        td
                                br/
                        /td
                /tr

                tr
                        td
                                Web sites to search:
                                nbsp;nbsp;nbsp;nbsp;
                        /td
                        td
                                sp_an wicket:id=rcWebSiteMode tabindex=5
                                        input type=radio/Option 1br/
                                        input type=radio/Option 2br/
                                /sp_an
                        /td
                /tr
        /wicket:enclosure

  Old Java code
  -
        Form frmForm = new Form(...);
        add(frmForm);

        RadioChoiceListChoiceItem rcWebSiteMode =
         new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, 
 crRenderer);
        rcWebSiteMode.setRequired(true);
        if (...)
                rcWebSiteMode.setVisible(false);
        frmForm.add(rcWebSiteMode);




  New HTML code
  -
        wicket:container wicket:id=enclAddItem
                tr
                        td
                                br/
                        /td
                /tr

                tr
                        td
                                Web sites to search:
                                nbsp;nbsp;nbsp;nbsp;
                        /td
                        td
                                sp_an wicket:id=rcWebSiteMode tabindex=5
                                        input type=radio/Option 1br/
                                        input type=radio/Option 2br/
                                /sp_an
                        /td
                /tr
        /wicket:container


  New Java code
  -
  import org.apache.wicket.markup.html.basic.EnclosureContainer;

        Form frmForm = new Form(...);
        add(frmForm);

        RadioChoiceListChoiceItem rcWebSiteMode =
         new RadioChoiceListChoiceItem(rcWebSiteMode, lciItems, 
 crRenderer);
        rcWebSiteMode.setRequired(true);
        if (...)
                rcWebSiteMode.setVisible(false);

        EnclosureContainer enclAddItem = new EnclosureContainer(enclAddItem,
         rcWebSiteMode);
        enclAddItem.add(rcWebSiteMode);
        frmForm.add(enclAddItem);
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2549176.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: JavaOne in San Francisco

2010-09-21 Thread Craig Tataryn
Any Wicket peeps here? Figured we'd just hang out by the beer in Mason tent
and bump into somebody but alas...

On Sep 18, 2010 8:07 PM, Craig Tataryn crai...@tataryn.net wrote:
 Hey folks, The Basement Coders will be at JavaOne and doing a podcast
 right from the Mason street tent Tuesday at 10am! We would love to
 meet some Wicket peeps throughout the week!

 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 twitter: craiger

 On Tue, Sep 14, 2010 at 8:03 AM, shetc sh...@bellsouth.net wrote:

 JavaOne starts on Sunday. Will any other Wicket fans be attending?
 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/JavaOne-in-San-Francisco-tp1876070p2538954.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





 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 twitter: craiger


Default unauthorized access handling

2010-09-21 Thread Mike Dee

I am using wicket-auth and it gets me just about everything I need. I would
like the default handling of an unauthenticated user.  When a page is
accessed by someone who is not logged in, I'd like them directed to the
login page, BUT I'd like a message to appear stating that their session has
timed out or they need to log in.

The default behavior of AuthenticatedWebApplication redirects the user to
the sign-in page if they are not logged in.  Can that behavior be modified
easily (to pass info to the sign-in page) so the sign-in page could show an
extra message like for security reasons your session has timed out?

The handling of an unauthorized user is shown below (taken from
AuthenticatedWebApplication).  I would simply like to override this method,
BUT it is FINAL.  I guess I could just duplicate the
AuthenticatedWebApplication class, modify the onUnauthorizedInstantiation()
method, and inherit from it.  But hoping one of the Wicket-heads out there
has an easier way to do this.

Also, why is the method FINAL?

public final void onUnauthorizedInstantiation(final Component component)
{
// If there is a sign in page class declared, and the 
unauthorized
// component is a page, but it's not the sign in page
if (component instanceof Page)
{
if (!AuthenticatedWebSession.get().isSignedIn())
{
// Redirect to intercept page to let the user 
sign in
throw new 
RestartResponseAtInterceptPageException(getSignInPageClass());
}
else
{
onUnauthorizedPage((Page)component);
}
}
else
{
// The component was not a page, so throw an exception
throw new 
UnauthorizedInstantiationException(component.getClass());
}
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Default-unauthorized-access-handling-tp2549533p2549533.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: Trouble with ProxyPass and Wicket

2010-09-21 Thread Adam Bender

That seemed to do the trick, thank you very much for your help!

Adam
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Trouble-with-ProxyPass-and-Wicket-tp2539851p2549555.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: Using WicketTester to verify table content refreshed by AJAX event

2010-09-21 Thread Alec Swan
Any thoughts on this?

I remember reading somewhere that using AJAX to refresh a component
generated using repeater may cause some problems. Is this what I am
against here with WicketTester? (Keep in mind that the table does get
refreshed correctly in production.)

Thanks

On Mon, Sep 20, 2010 at 6:24 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 I have a page which contains a DropDownChoice menu and a table. The
 menu has AjaxFormComponentUpdatingBehavior which causes the table to
 refresh. The page is actually working correctly, but I am having
 problems with a test.

 The test does the following:
 1. Renders the page
 2. Verifies that the first table row has the right data using
 tester.getComponentFromLastRenderedPage(referralsForm:referrals:1)
 3, Selects an item in the menu and calls executeAjaxEvent(menuId,
 onchange)
 4. Verifies that the first row of the table contains the right data
 the same way step 2 does

 The last step fails indicating that referralsForm:referrals:1 does
 not exist. However, referralsForm:referrals exists and its model
 data contains the rows I expect it to contain.

 What am I doing wrong?

 Thanks



announcing Granite - a Wicket-Scala-DB4O web application stack

2010-09-21 Thread Sam Stainsby
Today we officially announced our project to provide a Wicket-DB4O-Scala 
web application stack:

http://sustainablesoftware.com.au/blog/?p=77

I’m pleased to announce a new web application framework, called Granite, 
and an associated set of reusable libraries, called Uniscala. Please note 
that this is a work in progress: we are not announcing a release yet, or 
even a beta. A number people have started asking about the project, and 
so I felt it would be helpful to let the wider world know what is going 
on.

Granite is a lightweight framework for the rapid development of web 
applications. It is based on the very cool and richly featured Apache 
Wicket web framework. Granite uses an embedded object database that 
avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the 
Wicket tradition, is proud of, if not smug about, its distinct lack of 
external XML configuration files.


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



Re: Using WicketTester to verify table content refreshed by AJAX event

2010-09-21 Thread Juan I Felice
2010/9/21 Alec Swan alecs...@gmail.com

 Any thoughts on this?

 I remember reading somewhere that using AJAX to refresh a component
 generated using repeater may cause some problems. Is this what I am
 against here with WicketTester? (Keep in mind that the table does get
 refreshed correctly in production.)

 Thanks

 On Mon, Sep 20, 2010 at 6:24 PM, Alec Swan alecs...@gmail.com wrote:

  Hello,
 
  I have a page which contains a DropDownChoice menu and a table. The
  menu has AjaxFormComponentUpdatingBehavior which causes the table to
  refresh. The page is actually working correctly, but I am having
  problems with a test.
 
  The test does the following:
  1. Renders the page
  2. Verifies that the first table row has the right data using
  tester.getComponentFromLastRenderedPage(referralsForm:referrals:1)
  3, Selects an item in the menu and calls executeAjaxEvent(menuId,
  onchange)
  4. Verifies that the first row of the table contains the right data
  the same way step 2 does
 
  The last step fails indicating that referralsForm:referrals:1 does
  not exist. However, referralsForm:referrals exists and its model
  data contains the rows I expect it to contain.
 
  What am I doing wrong?
 
  Thanks
 



chrome + wicket ajax + back button = problem?

2010-09-21 Thread Ryan Crumley
All,

I ran into strange behavior involving wicket ajax updates + chrome + back
button. I am pretty sure the issue is not caused by wicket but I am hoping
the problem might sound familiar to someone and they can point me in the
right direction. The scenario goes like this:

- An ajax request is made that updates the DOM.
- The user navigates to another page by clicking on a link.
- The user uses the browser back button to go back to the original page.

After clicking back Google Chrome shows the page as it was originally
rendered (before the DOM update). All other browsers show the page as it was
when the user left the page (with the DOM update). Besides the possibility
of showing stale data the other problem is that the page state has been
altered by the ajax request and links that were originally rendered may no
longer be valid.

I found a few links where people are having similar issues:

http://www.maintaino.com/nuts-and-bolts/2010/04/08/teaching-chrome-not-to-cache-your-rails-pages/

Possibly related to using jQuery and/or window.onUnload() and bfcache:

http://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button
https://developer.mozilla.org/En/Using_Firefox_1.5_caching

In addition to using Wicket 1.4.12 I am also using jQuery 1.4.2 and google
analytics on these pages. I don't think any unload handlers have been added
however my only check was looking at all the attributes on the window
object via the inspector.

Has anyone else seen similar behavior? Even better, anyone else have a
solution? You may be seeing errors like this one in your logs:

org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException: component wid1:wid2:1:wid3 not
found on page com.foo.xxx


Thanks!

Ryan


Re: Default unauthorized access handling

2010-09-21 Thread Alexander Morozov

Hi!

I think you can use interface IUnauthorizedComponentInstantiationListener
and push necessary information message to Session object. On SignInPage -
check the session and render the message.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Default-unauthorized-access-handling-tp2549533p2549690.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: Default unauthorized access handling

2010-09-21 Thread Igor Vaynberg
wicket auth roles is meant as an example, not as a library for you to
use. feel free to copy/paste the code into your codebase and hack away
as needed.

-igor

On Tue, Sep 21, 2010 at 4:09 PM, Mike Dee mdichiapp...@cardeatech.com wrote:

 I am using wicket-auth and it gets me just about everything I need. I would
 like the default handling of an unauthenticated user.  When a page is
 accessed by someone who is not logged in, I'd like them directed to the
 login page, BUT I'd like a message to appear stating that their session has
 timed out or they need to log in.

 The default behavior of AuthenticatedWebApplication redirects the user to
 the sign-in page if they are not logged in.  Can that behavior be modified
 easily (to pass info to the sign-in page) so the sign-in page could show an
 extra message like for security reasons your session has timed out?

 The handling of an unauthorized user is shown below (taken from
 AuthenticatedWebApplication).  I would simply like to override this method,
 BUT it is FINAL.  I guess I could just duplicate the
 AuthenticatedWebApplication class, modify the onUnauthorizedInstantiation()
 method, and inherit from it.  But hoping one of the Wicket-heads out there
 has an easier way to do this.

 Also, why is the method FINAL?

        public final void onUnauthorizedInstantiation(final Component 
 component)
        {
                // If there is a sign in page class declared, and the 
 unauthorized
                // component is a page, but it's not the sign in page
                if (component instanceof Page)
                {
                        if (!AuthenticatedWebSession.get().isSignedIn())
                        {
                                // Redirect to intercept page to let the user 
 sign in
                                throw new 
 RestartResponseAtInterceptPageException(getSignInPageClass());
                        }
                        else
                        {
                                onUnauthorizedPage((Page)component);
                        }
                }
                else
                {
                        // The component was not a page, so throw an exception
                        throw new 
 UnauthorizedInstantiationException(component.getClass());
                }
        }

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Default-unauthorized-access-handling-tp2549533p2549533.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



Removing jsessionid from URl

2010-09-21 Thread Ayodeji Aladejebi
Hi,

I have been tryin to figure out what to do to remove jsessionid from the URL

I have mount(new QueryStringUrlCodingStrategy(/home, AppHomePage.class));

All my links are BookmarkablePageLinks.

am using wicket 1.4.8 on Apache Tomcat/6.0.29


Re: Removing jsessionid from URl

2010-09-21 Thread Jeremy Thomerson
On Tue, Sep 21, 2010 at 11:13 PM, Ayodeji Aladejebi aladej...@gmail.comwrote:

 Hi,

 I have been tryin to figure out what to do to remove jsessionid from the
 URL

 I have mount(new QueryStringUrlCodingStrategy(/home, AppHomePage.class));

 All my links are BookmarkablePageLinks.

 am using wicket 1.4.8 on Apache Tomcat/6.0.29


Search the list.  This has been covered a bajillion times.  This is a
feature of the servlet container, not Wicket.

-- 
Jeremy Thomerson
http://www.wickettraining.com