Re: [Notice] wicketstuff-core trunk is now tracking wicket 1.5-SNAPSHOT

2010-08-17 Thread Martin Grigorov
Thank you, Mike!

On Tue, Aug 17, 2010 at 2:12 AM, Michael O'Cleirigh 
michael.ocleir...@rivulet.ca wrote:

 Hello,

 Based on the vote there were 3 votes for and none against.  All those who
 voted wanted trunk to track 1.5-SNAPSHOT versus a stable milestone.

 I have created a branch to track wicket 1.4-SNAPSHOT here:
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicketstuff-core-1.4

 I have just changed the pom.xml in trunk to wicket 1.5-SNAPSHOT so right
 now there will be errors but there is a place to commit changes to.  The
 wicketstuff-core version is now 1.5-SNAPSHOT.

 Developers that want to continue to track the 1.4 branch will have to use
 the svn switch command in their working copy to move it to the new location.

 Regards,

 Mike


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




Re: How to render Enum values as RadioGroup and set default value

2010-08-17 Thread Sven Meier


datazuul wrote:
 
 But as I have to use different models for the group and the listview,
 the default setting with user.setGender has no effect.
 

Sure, the group has a model pointing to the user's gender, the listview a
model holding all available genders.

Your code looks fine to me, userModel.bind(gender) works for setter and
getter.

Sven
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-render-Enum-values-as-RadioGroup-and-set-default-value-tp2327596p2327890.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Steve Mactaggart
Hi all,

I have a simple problem that I wanted to cast out to the wider Wicket
community for a best practice.

We try and use BookmarkablePageLinks for as much as we can, obviously so
that pages can be bookmarked.  Therefore nearly every page is constructed
via the PageParameters method.
We have a lot of pages that list items, allow a user to create a new item,
edit, delete, a pretty standard CRUD workflow.

The problem is that I want to notify the user about the the save of the save
on the next page.  If the save fails we stay on the edit page, and that
works fine.
But if the save succeeds we redirect back to another page using
setResponsePage(Class, PageParams).

What I want to do on this page (no matter what page it is) is to display a
little floating div showing the record just saved, its transaction # etc.

In the old world I would just push my saved object notification into the
Session, and then on all pages check for this value and then display and
remove it.
Is this still the best practice?

I was looking at using something like
getSession().setMetaData(MetaDataKey, Serializable) to store the the
notification details, but couldn't see a way to remove the MetaData (unless
setting to null is right)

Is this right or is there a more wicket way of doing this.

Cheers,
Steve


Re: AjaxPagingNavigator give out strange error

2010-08-17 Thread Igor Vaynberg
and yet it works just fine here: http://wicketstuff.org/wicket14/ajax/pageables

create a quickstart and attach it somewhere. that way we dont have to
grasp at straws.

-igor

On Mon, Aug 16, 2010 at 12:42 PM, btbluesky btblue...@gmail.com wrote:

 I tried to use AjaxPagingNavigator in a simple page in Eclipse Helio with WTP
 (configured tomcat6). When debug, it just gives out a raw API page of
 ExceptionErrorPage  with mismatched close tag error that reference the API
 page.

 Couple of other pages in the same app are working fine.

 I then tried to just copy pasted the original Wicket Example PageablesPage
 into my WebApplication, same thing. I commented out the AjaxPagingNavigator
 object, everything works fine.

 I step through the entire page, all components on PageablesPage are fine.
 The first Exception thrown is at Component class render :

 [code]
 org.apache.wicket.markup.MarkupException: Tag 'DT' (line 103, column 1)
 has a mismatched close tag at '/DL' (line 104, column 1)
 [markup =
 jar:file:/H:/DOCUMENTS/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/hfweb/WEB-INF/lib/wicket-1.4.10-javadoc.jar!/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.ht

 [/code]

 Which is already referring to the AjaxPagingNavigator API page (I have the
 wicket Javadoc package from Maven in the env.)

 I cannot even see the error even when I'm stepping through the whole thing
 line by line. The only error comes out is from API page markup error when
 its trying to render.

 Would really appreciate it if anyone can help.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2327360.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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



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



Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Josh Kamau
HI Steve;

When i want to maintain bookmarkable pages, i normally pass the record
primary key in the PageParameters map . Once i have the primary key on the
next page, i can use my dao to retrieve the object and may be float a div
to display the record.

On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
st...@whitesquaresoft.com wrote:

 Hi all,

 I have a simple problem that I wanted to cast out to the wider Wicket
 community for a best practice.

 We try and use BookmarkablePageLinks for as much as we can, obviously so
 that pages can be bookmarked.  Therefore nearly every page is constructed
 via the PageParameters method.
 We have a lot of pages that list items, allow a user to create a new item,
 edit, delete, a pretty standard CRUD workflow.

 The problem is that I want to notify the user about the the save of the
 save
 on the next page.  If the save fails we stay on the edit page, and that
 works fine.
 But if the save succeeds we redirect back to another page using
 setResponsePage(Class, PageParams).

 What I want to do on this page (no matter what page it is) is to display a
 little floating div showing the record just saved, its transaction # etc.

 In the old world I would just push my saved object notification into the
 Session, and then on all pages check for this value and then display and
 remove it.
 Is this still the best practice?

 I was looking at using something like
 getSession().setMetaData(MetaDataKey, Serializable) to store the the
 notification details, but couldn't see a way to remove the MetaData (unless
 setting to null is right)

 Is this right or is there a more wicket way of doing this.

 Cheers,
 Steve



Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Sven Meier

See Session#info() , it stores messages in the session.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-Practice-passing-data-between-Bookmarkable-pages-tp2327897p2328021.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: DropDownChoice does not push value into Model

2010-08-17 Thread nivs

Hi James

Point(s) noted. I have got something going here and it is working but is
this what you meant? Please see attached code and do bear with my questions.

The variable studyReference which is the one that is wrapped within a
PropertyModel, remains or maintains the same reference even if the object
model is changed. So that is the key I suppose not to change the study
reference bound to the DDC any time and we wrap this in a property model.

Still have to get to grips with Models.

Thanks for the help
Cheers
Niv

/* Form that contains the dropdown other form fields*/
public class LookupForm extends Form{

private TextFieldString studyName;
private TextFieldString chiefName;
private AjaxButton lookupButton;
private DropDownChoiceStudyStatus studyStatusDpChoices;



public LookupForm(String id,ModelStudyContainer model){
super(id,model);
}
public void initForm(){

ModelStudyContainer studyContainerModel = (Model)getModel();

//Create a propertyModel to bind the components of this form, 
the root which is StudyContainer
PropertyModelStudy pm = new 
PropertyModelStudy(studyContainerModel,study);

//Just to know what the initial study reference is
final Study studyReference  = pm.getObject();

studyName = new TextField(studyName,new 
PropertyModelString(pm,studyName));//Create another new PropertyModel of 
type Study
chiefName = new TextField(chiefName, new 
PropertyModelString(pm,chiefName));

lookupButton = new AjaxButton(search){
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form? form) {
ModelStudyContainer iModel  = 
(Model)getModel();
doLookup(target,studyReference);
}
};


ChoiceRenderer defaultChoiceRenderer = new 
ChoiceRenderer(name, studyStatusKey);

//Another PropertyModel for rendering the DropDowns and pass in 
the Property Model instance of type Study
PropertyModelStudy pmStudyStatus = new 
PropertyModelStudy(pm,studyStatus);

//Static list
ListStudyStatus studyStatusList = new 
ArrayListStudyStatus();
StudyStatus ss = new StudyStatus();
ss.setName(Active);
ss.setStudyStatusKey(new Long(1));
studyStatusList.add(ss);
ss = new StudyStatus();
ss.setName(Inactive);
ss.setStudyStatusKey(new Long(2));
studyStatusList.add(ss);

studyStatusDpChoices = new 
DropDownChoice(studyStatusDDC,pmStudyStatus,studyStatusList,defaultChoiceRenderer);

add(studyName);
add(chiefName);
add(studyStatusDpChoices);
add(lookupButton);
}

protected void doLookup(AjaxRequestTarget target, Study study){}

}



public class Lookup extends Panel{

ModelStudyContainer studyContainerModel;
public Lookup(String id) {
super(id);
}
public void initialise(){

studyContainerModel = new ModelStudyContainer( new 
StudyContainer());

LookupForm lookupForm = new LookupForm(lookupForm, 
studyContainerModel){

protected void doLookup(AjaxRequestTarget target, Study 
studyReference){


StudyContainer studyContainer  =  
(StudyContainer)this.getModelObject();

//Get the currently populates study info
Study currentStudy = studyContainer.getStudy();

System.out.println(currentStudy.getChiefName());

StudyStatus status = 
currentStudy.getStudyStatus();
System.out.println(status.getName());

//Simulate a user's select operation and reset 
the study
StudyContainer newOne = new StudyContainer();
Study selectedStudy = new Study();
selectedStudy.setChiefName(Testing);
selectedStudy.setStudyName(Testing);
newOne.setStudy(selectedStudy);

Problem with page being redirected/loaded over and over again

2010-08-17 Thread Laurentiu Trica
Hello,

I followed the
https://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs
 tutorial.
I have, since, a problem with my homepage.

It gets from / to /en and then to /en/welcome and back again to /,
then /en and /en/welcome.

The first redirect is correct as I want it to go to a locale aware URL - as
the tutorial sais. So from / to /en is perfect.
The second redirect is correct as well because it's done from the
application class.
I have the getHomePage() which returns a HomePage class which makes a
redirect (as in the following code) to a LoginPage which is mounted as
welcome.

public HomePage() {
setRedirect(true);
setResponsePage(LoginPage.class);
}

The problem is that after the second correct redirect, somehow, the chain
continues.
There is another redirect to /, which seems to have as referrer the
/en/welcome page.

Is there anything I can do about this? I spent a whole day trying to figure
out the problem but I didn't.
Thanks in advance.

-- 
Best regards,
Laurentiu Trica


Re: How to render Enum values as RadioGroup and set default value

2010-08-17 Thread datazuul


Sven Meier wrote:
 
 
 datazuul wrote:
 
 But as I have to use different models for the group and the listview,
 the default setting with user.setGender has no effect.
 
 
 Sure, the group has a model pointing to the user's gender, the listview a
 model holding all available genders.
 
As ListView wants a List in the constructor to iterate over, I unfortunately
had to extract the enum values, which breaks the binding...


Sven Meier wrote:
 
 Your code looks fine to me, userModel.bind(gender) works for setter and
 getter.
 
I am using userModel.bind(gender) for the RadioGroup to bind it to
user.set/getGender and tried to set the default value with
user.setGender(Gender.MALE);. I expected some RadioGroup-inside-mechanism
that activates the Radio-button that has this value. But this does not
happen...
Maybe I have to implement a comparison inside populateItem to set the
Radio-button to activated when it's value is equal to the userModel's
value? But how to activate a Radio-button (should I really set the
HTML-attribute checked in Java-Code)?

Finally I just want to iterate over all values of an Enum and represent them
as Radio Buttons in a RadioGroup, setting one as default.
Not so unusual, should be solved by someone else before...
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-render-Enum-values-as-RadioGroup-and-set-default-value-tp2327596p2328095.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



inmethod grid test fails

2010-08-17 Thread nino martinez wael
Hi Guys

I am having some trouble testing the inmethod grid, specifically when I
remove a row from the data list. On pagerender the grid tries to render the
deleted row, which of course does not exist anymore. This problem does not
occur running the application for real.

I try to click the column that deletes the row like this :


tester.clickLink(pilotForm:pilotGrid:form:bodyContainer:body:row:1:item:delete:delete,true);

Are it because I've failed to set some ajax specific thing up for the wicket
tester?

regards Nino


RadioGroup not selected on error

2010-08-17 Thread Bilgin Ibryam
Hi,

I have a form with few fields and a RadioGroup. The RadioGroup model is
bound like this radioGroup.setModel(model.bind(searchType));
Initally the radio options are selected correctly depending on model values.
The problem happens when I submit the form, and there are validation errors.
Then the form is displayed again, but this time none of the options are
selected (nor default values nor user selected).
All the other fields keeps the values entered by the user (text fields,
selects, date fields), but radio selections are lost.

Any ideas what might be the problem?

Bilgin


Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread MattyDE

Are there any other ways?

I need to pass a complex object-list to a BookmarkablePage for loading them
properly, but i dont want to see them in the URI (PageParameters)... and
using a Session-Variable is not multi-tasking save, i think?

Any other hints?

Thanks a lot!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-Practice-passing-data-between-Bookmarkable-pages-tp2327897p2328114.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: DropDownChoice does not push value into Model

2010-08-17 Thread James Carman
In your onSubmit() method, you're referring to the local variable
studyReference.  Why not try getting the model value while inside
the method?

On Tue, Aug 17, 2010 at 6:04 AM, nivs shravann...@gmail.com wrote:

 Hi James

 Point(s) noted. I have got something going here and it is working but is
 this what you meant? Please see attached code and do bear with my questions.

 The variable studyReference which is the one that is wrapped within a
 PropertyModel, remains or maintains the same reference even if the object
 model is changed. So that is the key I suppose not to change the study
 reference bound to the DDC any time and we wrap this in a property model.

 Still have to get to grips with Models.

 Thanks for the help
 Cheers
 Niv

 /* Form that contains the dropdown other form fields*/
 public class LookupForm extends Form{

        private TextFieldString studyName;
        private TextFieldString chiefName;
        private AjaxButton lookupButton;
        private DropDownChoiceStudyStatus studyStatusDpChoices;



        public LookupForm(String id,ModelStudyContainer model){
                super(id,model);
        }
        public void initForm(){

                ModelStudyContainer studyContainerModel = (Model)getModel();

                //Create a propertyModel to bind the components of this form, 
 the root which is StudyContainer
                PropertyModelStudy pm = new 
 PropertyModelStudy(studyContainerModel,study);

                //Just to know what the initial study reference is
                final Study studyReference  = pm.getObject();

                studyName = new TextField(studyName,new 
 PropertyModelString(pm,studyName));//Create another new PropertyModel of 
 type Study
                chiefName = new TextField(chiefName, new 
 PropertyModelString(pm,chiefName));

                lookupButton = new AjaxButton(search){
                       �...@override
                        protected void onSubmit(AjaxRequestTarget target, 
 Form? form) {
                                ModelStudyContainer iModel  = 
 (Model)getModel();
                                doLookup(target,studyReference);
                        }
                };


                ChoiceRenderer defaultChoiceRenderer = new 
 ChoiceRenderer(name, studyStatusKey);

                //Another PropertyModel for rendering the DropDowns and pass 
 in the Property Model instance of type Study
                PropertyModelStudy pmStudyStatus = new 
 PropertyModelStudy(pm,studyStatus);

                //Static list
                ListStudyStatus studyStatusList = new 
 ArrayListStudyStatus();
                StudyStatus ss = new StudyStatus();
                ss.setName(Active);
                ss.setStudyStatusKey(new Long(1));
                studyStatusList.add(ss);
                ss = new StudyStatus();
                ss.setName(Inactive);
                ss.setStudyStatusKey(new Long(2));
                studyStatusList.add(ss);

                studyStatusDpChoices = new 
 DropDownChoice(studyStatusDDC,pmStudyStatus,studyStatusList,defaultChoiceRenderer);

                add(studyName);
                add(chiefName);
                add(studyStatusDpChoices);
                add(lookupButton);
        }

        protected void doLookup(AjaxRequestTarget target, Study study){}

 }



 public class Lookup extends Panel{

        ModelStudyContainer studyContainerModel;
        public Lookup(String id) {
                super(id);
        }
        public void initialise(){

                studyContainerModel = new ModelStudyContainer( new 
 StudyContainer());

                LookupForm lookupForm = new LookupForm(lookupForm, 
 studyContainerModel){

                        protected void doLookup(AjaxRequestTarget target, 
 Study studyReference){


                                StudyContainer studyContainer  =  
 (StudyContainer)this.getModelObject();

                                //Get the currently populates study info
                                Study currentStudy = studyContainer.getStudy();

                                
 System.out.println(currentStudy.getChiefName());

                                StudyStatus status = 
 currentStudy.getStudyStatus();
                                System.out.println(status.getName());

                                //Simulate a user's select operation and reset 
 the study
                                StudyContainer newOne = new StudyContainer();
                                Study selectedStudy = new Study();
                                selectedStudy.setChiefName(Testing);
                                selectedStudy.setStudyName(Testing);
                                newOne.setStudy(selectedStudy);
                                this.setModelObject(newOne);//Set it with the 
 new model object with the study that was selected

                                //The studyReference instance always refers to 
 the original study 

Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Martijn Dashorst
How does the user request the page with your list items without page
parameters? I'm confused how you can say it should be bookmarkable
without providing the necessary information to the client needed to
reconstruct the page?

Martijn

On Tue, Aug 17, 2010 at 12:58 PM, MattyDE ufer.mar...@gmail.com wrote:

 Are there any other ways?

 I need to pass a complex object-list to a BookmarkablePage for loading them
 properly, but i dont want to see them in the URI (PageParameters)... and
 using a Session-Variable is not multi-tasking save, i think?

 Any other hints?

 Thanks a lot!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Best-Practice-passing-data-between-Bookmarkable-pages-tp2327897p2328114.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread MattyDE

I see, i didn't explain it clearly ;)

I've a Page which displays a list of objects. But in some cases i want to
preselect some elements of this list by a user-choice from a formular on
another site.

So i want the user to choice a few objects, and than i want to redirect to
my ListPage an mark this choosen objects...

Sometimes the site is called WITH this initial chosen-objects... sometimes
without.


Sorry, English is not my mother tongue. Is not as easy as it should to
explain my complicated application infrastructur in another language ;)
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Best-Practice-passing-data-between-Bookmarkable-pages-tp2327897p2328211.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: RadioGroup not selected on error

2010-08-17 Thread Bilgin Ibryam
The answer for my question was in the Radio class documentation:

 STATELESS NOTES: By default this component cannot be used inside a
stateless form. If it is desirable to use this inside a stateless form then
override #getValue() and return some stateless value to uniquely identify
this radio (eg relative component path from group to this radio)

On Tue, Aug 17, 2010 at 11:56 AM, Bilgin Ibryam bibr...@gmail.com wrote:

 Hi,

 I have a form with few fields and a RadioGroup. The RadioGroup model is
 bound like this radioGroup.setModel(model.bind(searchType));
 Initally the radio options are selected correctly depending on model
 values.
 The problem happens when I submit the form, and there are validation
 errors. Then the form is displayed again, but this time none of the options
 are selected (nor default values nor user selected).
 All the other fields keeps the values entered by the user (text fields,
 selects, date fields), but radio selections are lost.

 Any ideas what might be the problem?

 Bilgin




Re: DropDownChoice does not push value into Model

2010-08-17 Thread Nivedan Nadaraj
Hi James

protected void doLookup(AjaxRequestTarget target, Study studyReference);

I really do not need this studyReference. That was just a test I wanted to
do. It is the study reference that is used to populate the dropdown. I
wanted to see if it gets changed with each submit. I noticed that it does
not change.

I do get the ModelObject -
   StudyContainer studyContainer  =  (StudyContainer)this.getModelObject();

So yeah it works with this change, using PropertyModel. Wanted to get your
feedback if I have used it correctly.
Cheers
Niv



On Tue, Aug 17, 2010 at 7:48 PM, James Carman ja...@carmanconsulting.comwrote:

 In your onSubmit() method, you're referring to the local variable
 studyReference.  Why not try getting the model value while inside
 the method?

 On Tue, Aug 17, 2010 at 6:04 AM, nivs shravann...@gmail.com wrote:
 
  Hi James
 
  Point(s) noted. I have got something going here and it is working but is
  this what you meant? Please see attached code and do bear with my
 questions.
 
  The variable studyReference which is the one that is wrapped within a
  PropertyModel, remains or maintains the same reference even if the object
  model is changed. So that is the key I suppose not to change the study
  reference bound to the DDC any time and we wrap this in a property model.
 
  Still have to get to grips with Models.
 
  Thanks for the help
  Cheers
  Niv
 
  /* Form that contains the dropdown other form fields*/
  public class LookupForm extends Form{
 
 private TextFieldString studyName;
 private TextFieldString chiefName;
 private AjaxButton lookupButton;
 private DropDownChoiceStudyStatus studyStatusDpChoices;
 
 
 
 public LookupForm(String id,ModelStudyContainer model){
 super(id,model);
 }
 public void initForm(){
 
 ModelStudyContainer studyContainerModel =
 (Model)getModel();
 
 //Create a propertyModel to bind the components of this
 form, the root which is StudyContainer
 PropertyModelStudy pm = new
 PropertyModelStudy(studyContainerModel,study);
 
 //Just to know what the initial study reference is
 final Study studyReference  = pm.getObject();
 
 studyName = new TextField(studyName,new
 PropertyModelString(pm,studyName));//Create another new PropertyModel of
 type Study
 chiefName = new TextField(chiefName, new
 PropertyModelString(pm,chiefName));
 
 lookupButton = new AjaxButton(search){
 @Override
 protected void onSubmit(AjaxRequestTarget target,
 Form? form) {
 ModelStudyContainer iModel  =
 (Model)getModel();
 doLookup(target,studyReference);
 }
 };
 
 
 ChoiceRenderer defaultChoiceRenderer = new
 ChoiceRenderer(name, studyStatusKey);
 
 //Another PropertyModel for rendering the DropDowns and
 pass in the Property Model instance of type Study
 PropertyModelStudy pmStudyStatus = new
 PropertyModelStudy(pm,studyStatus);
 
 //Static list
 ListStudyStatus studyStatusList = new
 ArrayListStudyStatus();
 StudyStatus ss = new StudyStatus();
 ss.setName(Active);
 ss.setStudyStatusKey(new Long(1));
 studyStatusList.add(ss);
 ss = new StudyStatus();
 ss.setName(Inactive);
 ss.setStudyStatusKey(new Long(2));
 studyStatusList.add(ss);
 
 studyStatusDpChoices = new
 DropDownChoice(studyStatusDDC,pmStudyStatus,studyStatusList,defaultChoiceRenderer);
 
 add(studyName);
 add(chiefName);
 add(studyStatusDpChoices);
 add(lookupButton);
 }
 
 protected void doLookup(AjaxRequestTarget target, Study study){}
 
  }
 
 
 
  public class Lookup extends Panel{
 
 ModelStudyContainer studyContainerModel;
 public Lookup(String id) {
 super(id);
 }
 public void initialise(){
 
 studyContainerModel = new ModelStudyContainer( new
 StudyContainer());
 
 LookupForm lookupForm = new LookupForm(lookupForm,
 studyContainerModel){
 
 protected void doLookup(AjaxRequestTarget target,
 Study studyReference){
 
 
 StudyContainer studyContainer  =
  (StudyContainer)this.getModelObject();
 
 //Get the currently populates study info
 Study currentStudy =
 studyContainer.getStudy();
 
 
  System.out.println(currentStudy.getChiefName());
 
 StudyStatus status =
 currentStudy.getStudyStatus();
 

Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Steve Mactaggart
We do pass params for the actual page's content, but this is transient
information that I don't want leaking into my URLs.  Its usually a simple
text message, so I'll look into Session#info(), but I have had some success
with my earlier ideas of setMetaData.

Is there a true purpose for setMetaData? or am I using it a dodgy way?

I can forsee (fairly soon) a need to render more complex items than just a
simple string and it seems that (as long as its Serializable) I can put
anything in MetaData.

Steve

On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the record
 primary key in the PageParameters map . Once i have the primary key on the
 next page, i can use my dao to retrieve the object and may be float a div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider Wicket
  community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can, obviously so
  that pages can be bookmarked.  Therefore nearly every page is constructed
  via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save of the
  save
  on the next page.  If the save fails we stay on the edit page, and that
  works fine.
  But if the save succeeds we redirect back to another page using
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to display
 a
  little floating div showing the record just saved, its transaction # etc.
 
  In the old world I would just push my saved object notification into the
  Session, and then on all pages check for this value and then display and
  remove it.
  Is this still the best practice?
 
  I was looking at using something like
  getSession().setMetaData(MetaDataKey, Serializable) to store the the
  notification details, but couldn't see a way to remove the MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 



Re: Re Wicket Web Beans

2010-08-17 Thread Nivedan Nadaraj
Hi

Thanks for that Nick. I guess I will investigate more on this, actually i
did get to lookup Dynamic Forms and then linked to WWB.
I will do some homework on this topic and bounce any questions. Thanks for
that
Niv

On Tue, Aug 17, 2010 at 11:11 AM, Nick Heudecker nheudec...@gmail.comwrote:

 It sounds like what you're after is a dynamic form.  This has been
 discussed
 several times on the list and used to be detailed in the wiki.  It's pretty
 straightforward to implement.  Hopefully this gives you an implementation
 option.


 On Mon, Aug 16, 2010 at 7:17 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi Daniel
 
  Thank you for getting back so quickly.
 
  I used Hibernate that maps to entities in the table.
 
 
  Fields are defined by an administrator when he creates a new entity like
  Study(Hibernate entity for Study). There is a standard table called Study
  however if the administrator feels this new study he is creating requires
  additional fields he then will do the following
 
  Create Scenario:
 
  1. Click a button to add new field
  2. Provides the Field Name (either types it in or selects from  a list of
  data dictionary fields)
  3. Selects a data type from a drop down ( I have created this table with
  required data types so this can be sourced)
  4. Enters a value for the new field.
  5. Optionally, he must be able to provide the type of control this field
  will be linkedf to ( guess #4 and 5 are inter-related) or can WWB infer
  this? Not sure about this part.
  6. On Save - The New field meta data is stored along with the data in
  another table that links to this meta data table.
 
  View/Edit Scenario:
 
  When a user reads or looks up this entity, it should bring back the
 general
  fields and the custom fields that were defined. Now, the UI should be
  rendered.
  Will I be able to use WWB in this scenario?
 
 
  I guess if I don't use WWB then, i have to stored field UI meta data
 along
  with values in separate tables and infer this when the UI is rendered.
 Will
  be quite a task.
 
  Thanks for your time Dan, I was planning on playing with WWB and see if
 my
  requirements can be met using WWB.
 
  Reg
  Niv
 
 
 
 



Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Martijn Dashorst
It's a good usecase for metadata. No problem there.

Martijn

On Tue, Aug 17, 2010 at 2:59 PM, Steve Mactaggart
st...@whitesquaresoft.com wrote:
 We do pass params for the actual page's content, but this is transient
 information that I don't want leaking into my URLs.  Its usually a simple
 text message, so I'll look into Session#info(), but I have had some success
 with my earlier ideas of setMetaData.

 Is there a true purpose for setMetaData? or am I using it a dodgy way?

 I can forsee (fairly soon) a need to render more complex items than just a
 simple string and it seems that (as long as its Serializable) I can put
 anything in MetaData.

 Steve

 On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the record
 primary key in the PageParameters map . Once i have the primary key on the
 next page, i can use my dao to retrieve the object and may be float a div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider Wicket
  community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can, obviously so
  that pages can be bookmarked.  Therefore nearly every page is constructed
  via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save of the
  save
  on the next page.  If the save fails we stay on the edit page, and that
  works fine.
  But if the save succeeds we redirect back to another page using
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to display
 a
  little floating div showing the record just saved, its transaction # etc.
 
  In the old world I would just push my saved object notification into the
  Session, and then on all pages check for this value and then display and
  remove it.
  Is this still the best practice?
 
  I was looking at using something like
  getSession().setMetaData(MetaDataKey, Serializable) to store the the
  notification details, but couldn't see a way to remove the MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



Re: Re Wicket Web Beans

2010-08-17 Thread Nivedan Nadaraj
Hi Daniel

It is more of a dynamic form thinking of it I might investigate more on this
in Wicket. But here is a link and is pretty much what we want to achieve
using wicket

https://redcap.vanderbilt.edu/consortium/videoplayer.php?video=form_editor_fields01.flvtitle=The+Online+Form+Editor+-+in+depth+%285+min%29text=referer=REDCAP_PUBLIC

If you have done either using Wicket or WWB please let me know.

Thanks
Niv

On Tue, Aug 17, 2010 at 11:32 AM, Daniel Toffetti dto...@yahoo.com.arwrote:


 Hi Niv,

I'm not sure if I just get your domain model right, the closest I think
 you can get is something like this:


 http://jweekend.com/wicketwebbeans-examples-1.1/WebBeans/?wicket:interface=:0:2:
 ::

Where you can have a list (a table) of fields, each with a name, a
 datatype and a value. But all values in each column will be represented
 with
 one single type of input field.
Perhaps you can attempt to create a custom field for the value
 property, that renders a different input for each datatype, but I'm not
 sure
 if this can be done at all.
One problem is, how to re-render the input if the datatype changes ?
 Don't think WWB allows that easily.

 Cheers,

 Daniel

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-Web-Beans-tp2326481p2327733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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




Re: BrowserInfoPage and HelloBrowser on Firefox

2010-08-17 Thread Dirk Forchel

I still got no solution for the problem mentioned above.

I assume the detection of JavaScript with the following line of code does
not work for Firefox even if JavaScript support is enabled:

((WebClientInfo)Session.get().getClientInfo()).getProperties().isJavaEnabled();

This works for IE but not for Firefox!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/BrowserInfoPage-and-HelloBrowser-on-Firefox-tp2306399p2328440.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



AjaxFormSubmitBehavior causes serialization issues inside onBeforeRender()

2010-08-17 Thread allgo

Hi fellow wicket users,
I am a  user of Wicket 1.4.8
I am trying to use a TabbedPanel inside which there are several individual
Panels. Now one of the Panel has a form with quite a few RadioChoices and
DropDownChoice objects. I am updating a top level flag whenevr there is any
change on any form element to trigger a pop-up asking the user to save
un-saved changes on the page when they try to move away from that tabbed
panel to soem other page.

Since there are multiple form elements I am using a onBeforeRender() method
in the ChildPanel class and applying AjaxFormBehaviour on all child elements
at one place to avoid redundancy of code for each radio element or dropdown
element as follows -

protected void onBeforeRender() {

if (!behaviorAssigned) {
behaviorAssigned = true;

visitChildren(new IVisitorComponent() {

public Object component(Component component) {
if (component instanceof RadioChoice) {
component.add(new 
AjaxFormSubmitBehavior(onclick) {

@Override
protected void 
onError(AjaxRequestTarget target) {
// TODO 
Auto-generated method stub

}

@Override
protected void 
onSubmit(AjaxRequestTarget target) {

parent.setPageChanged(Boolean.TRUE);

}


});
}
if (component instanceof 
DropDownChoice?) {
component.add(new 
AjaxFormComponentUpdatingBehavior(
onchange) {
protected void 
onUpdate(AjaxRequestTarget target) {

parent.setPageChanged(Boolean.TRUE);
}
});
}
return null;
}

});
super.onBeforeRender();
}

Problem is whenever the Panel is loaded I am getting loads of
WicketNotSerializableExceptions -



org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class: com.mycompany.test.calendar.ChildPanel$7
Field hierarchy is:
  5 [class=com.mycompany.test.HomeBasePage, path=5]
private java.lang.Object org.apache.wicket.MarkupContainer.children
[class=[Ljava.lang.Object;]
  java.lang.Object org.apache.wicket.Component.data[10]
[class=com.mycompany.test.HomeBasePage$6, path=5:tabs]
private java.lang.Object org.apache.wicket.MarkupContainer.children
[class=[Ljava.lang.Object;]
  private org.apache.wicket.markup.html.link.PopupSettings
org.apache.wicket.markup.html.link.Link.popupSettings[1]
[class=com.mycompany.test.settings.SettingsLazyPanel, path=5:tabs:panel]
private java.lang.Object
org.apache.wicket.MarkupContainer.children
[class=com.mycompany.test.settings.SettingsLazyPanel$1,
path=5:tabs:panel:grid]
  private java.lang.Object
org.apache.wicket.MarkupContainer.children
[class=com.mycompany.test.settings.SettingBasePanel,
path=5:tabs:panel:grid:content]
private java.lang.Object
org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
  private
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow$WindowClosedCallback
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.windowClosedCallback[1]
[class=com.mycompany.test.settings.SettingBasePanel$6,
path=5:tabs:panel:grid:content:tabs]
private java.lang.Object
org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
  private
org.apache.wicket.markup.html.link.PopupSettings
org.apache.wicket.markup.html.link.Link.popupSettings[1]
[class=com.mycompany.test.calendar.ChildPanel,
path=5:tabs:panel:grid:content:tabs:panel]
private java.lang.Object
org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
  java.lang.Object
org.apache.wicket.Component.data[2]

Re: using cometd with threads

2010-08-17 Thread fachhoch

I wan to inject  Bayeaux service  in a  pojo  initialized by spring , please
sugest me how  can I get servlet context in a spring bean ?
 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-cometd-with-threads-tp2310323p2328511.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: using cometd with threads

2010-08-17 Thread Rodolfo Hansen
You may use a servlet context listener...

Get the spring applicationContext and add the Bayuex Service been to it
when it context is initialized

http://www.java-tips.org/java-ee-tips/java-servlet/how-to-work-with-servletcontextlistener.html



On Tue, 2010-08-17 at 08:06 -0700, fachhoch wrote:

 I wan to inject  Bayeaux service  in a  pojo  initialized by spring , please
 sugest me how  can I get servlet context in a spring bean ?
  




Re: using cometd with threads

2010-08-17 Thread jcgarciam

I haven't tried this myself, but take a look into the Spring interface
ServletContextAwarehttp://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/ServletContextAware.htmlit
may shed some light to achieve what you want.
*
*
*
*
On Tue, Aug 17, 2010 at 12:06 PM, fachhoch [via Apache Wicket] 
ml-node+2328511-1648896416-65...@n4.nabble.comml-node%2b2328511-1648896416-65...@n4.nabble.com
 wrote:

 I wan to inject  Bayeaux service  in a  pojo  initialized by spring ,
 please sugest me how  can I get servlet context in a spring bean ?


 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/using-cometd-with-threads-tp2310323p2328511.html
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-cometd-with-threads-tp2310323p2328532.html
Sent from the Wicket - User mailing list archive at Nabble.com.


Re: DynamicWebResource duplicate request

2010-08-17 Thread DmitryM

Missed an obvious thing (use the source, Luke) - there is the getLength()
method on the resourcestate (which also needs to load the data).
So, needed more accurate implementation of the getResourceState.

Closing the topic.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DynamicWebResource-duplicate-request-tp2327741p2328645.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
On Tue, Aug 17, 2010 at 7:02 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 In case of  wiQuery, many behaviors wicket AJAX is used (not jquery
 AJAX) so it seem natural to use AbstractDefaultAjaxBehavior. In other
 cases probably  you are right and it is over killing. Is that what you
 are asking?


Well I imagine it is nice to be able to combine a custom framework using
wicket ajax as that would probably allow someone to perform the custom AJAX
behavior together with rendering wicketcomponents when the behavior is
triggered.

I am just trying to understand how this works. Right now I understand the
simple method of AbstractAjaxBehavior.]

I am now just wondering how the approach using wicket ajax works. Is there
documentation explaining how to hook in custom client side behavior using
wicket ajax. In other words, re-rendering wicket components AND reading a
custom payload from the message, and returning a custom payload to be
processed by the custom javascript. Both the wicket XML request and response
must carry somehow the other information transparently.

In the AutocompletBehavior of wiquery they are just getting the response and
writing directly to it, ignoring the request target, whereas as I understand
it now the request target is the interface towards the response so bypassing
it is risky.


Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
Thanks to wicket's clean code I am a bit further now. It looks like it is
possible to add custom javascript to be executed just before and after
rendering the components. This can be done using
AjaxRequestTarget.append/prependJavascript(). So in other words, using this
method it is possible to pass data (even behavior) back to the client.

It is still not clear to me how it would be possible to pass additional data
from the web browser to the server in the AbstractDefaultAjaxBehavior and
then read it in the respond() method of the behavior.


Re: Custom AJAX component...

2010-08-17 Thread Ernesto Reinaldo Barreiro
1-use the behavior to generate a URL.
2-use that URL on client side to call the behavior
3-use the behavior to produce the content you want to stream (XML).
4-do what ever you want with that contents.

That's more or less what the jqgrid example does. Does that approach
fit your use case?

Ernesto

On Tue, Aug 17, 2010 at 10:07 PM, Erik Brakkee erik.brak...@gmail.com wrote:
 Thanks to wicket's clean code I am a bit further now. It looks like it is
 possible to add custom javascript to be executed just before and after
 rendering the components. This can be done using
 AjaxRequestTarget.append/prependJavascript(). So in other words, using this
 method it is possible to pass data (even behavior) back to the client.

 It is still not clear to me how it would be possible to pass additional data
 from the web browser to the server in the AbstractDefaultAjaxBehavior and
 then read it in the respond() method of the behavior.


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



Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
I have found this page
https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html
which talks about wicketAjaxGet() and wicketAjaxPost(), but again no mention
of how to access the body that is sent using wicketAjaxPost(). Only request
parameters are discussed.

Is accessing the body simply a matter of using the basic HttpServletRequest
APIs?

Cheers
  Erik


RE: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Alex Rass
I may be missing smth simple, but usually to pass data within a session, I
override Session and add whatever holders I need there.
You can add a generic set/getMetaObject one if you want - it's your class.
Wicket should be able to manage the session objects happily.

- Alex 


-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
Sent: Tuesday, August 17, 2010 9:11 AM
To: users@wicket.apache.org
Subject: Re: Best Practice passing data between Bookmarkable pages

It's a good usecase for metadata. No problem there.

Martijn

On Tue, Aug 17, 2010 at 2:59 PM, Steve Mactaggart
st...@whitesquaresoft.com wrote:
 We do pass params for the actual page's content, but this is transient
 information that I don't want leaking into my URLs.  Its usually a simple
 text message, so I'll look into Session#info(), but I have had some
success
 with my earlier ideas of setMetaData.

 Is there a true purpose for setMetaData? or am I using it a dodgy way?

 I can forsee (fairly soon) a need to render more complex items than just a
 simple string and it seems that (as long as its Serializable) I can put
 anything in MetaData.

 Steve

 On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the record
 primary key in the PageParameters map . Once i have the primary key on
the
 next page, i can use my dao to retrieve the object and may be float a
div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider Wicket
  community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can, obviously
so
  that pages can be bookmarked.  Therefore nearly every page is
constructed
  via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save of the
  save
  on the next page.  If the save fails we stay on the edit page, and that
  works fine.
  But if the save succeeds we redirect back to another page using
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to
display
 a
  little floating div showing the record just saved, its transaction #
etc.
 
  In the old world I would just push my saved object notification into
the
  Session, and then on all pages check for this value and then display
and
  remove it.
  Is this still the best practice?
 
  I was looking at using something like
  getSession().setMetaData(MetaDataKey, Serializable) to store the the
  notification details, but couldn't see a way to remove the MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

-
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: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread James Carman
You mean metadata on the session?

On Tue, Aug 17, 2010 at 9:11 AM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 It's a good usecase for metadata. No problem there.

 Martijn

 On Tue, Aug 17, 2010 at 2:59 PM, Steve Mactaggart
 st...@whitesquaresoft.com wrote:
 We do pass params for the actual page's content, but this is transient
 information that I don't want leaking into my URLs.  Its usually a simple
 text message, so I'll look into Session#info(), but I have had some success
 with my earlier ideas of setMetaData.

 Is there a true purpose for setMetaData? or am I using it a dodgy way?

 I can forsee (fairly soon) a need to render more complex items than just a
 simple string and it seems that (as long as its Serializable) I can put
 anything in MetaData.

 Steve

 On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the record
 primary key in the PageParameters map . Once i have the primary key on the
 next page, i can use my dao to retrieve the object and may be float a div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider Wicket
  community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can, obviously so
  that pages can be bookmarked.  Therefore nearly every page is constructed
  via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save of the
  save
  on the next page.  If the save fails we stay on the edit page, and that
  works fine.
  But if the save succeeds we redirect back to another page using
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to display
 a
  little floating div showing the record just saved, its transaction # etc.
 
  In the old world I would just push my saved object notification into the
  Session, and then on all pages check for this value and then display and
  remove it.
  Is this still the best practice?
 
  I was looking at using something like
  getSession().setMetaData(MetaDataKey, Serializable) to store the the
  notification details, but couldn't see a way to remove the MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

 -
 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: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread Alex Rass
No.
I mean:
You can getSession() to get to the session object.
(I saw you use that so I know you know about it)
But in your Application class, you can create whatever session object you
want as long as it overrides the right class (there's a method for creating
the session you'd override).
Then you add your setters and getters to that session class of yours and use
them when you need to.

- Alex 


-Original Message-
From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On
Behalf Of James Carman
Sent: Tuesday, August 17, 2010 4:58 PM
To: users@wicket.apache.org
Subject: Re: Best Practice passing data between Bookmarkable pages

You mean metadata on the session?

On Tue, Aug 17, 2010 at 9:11 AM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 It's a good usecase for metadata. No problem there.

 Martijn

 On Tue, Aug 17, 2010 at 2:59 PM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:
 We do pass params for the actual page's content, but this is 
 transient information that I don't want leaking into my URLs.  Its 
 usually a simple text message, so I'll look into Session#info(), but 
 I have had some success with my earlier ideas of setMetaData.

 Is there a true purpose for setMetaData? or am I using it a dodgy way?

 I can forsee (fairly soon) a need to render more complex items than 
 just a simple string and it seems that (as long as its Serializable) 
 I can put anything in MetaData.

 Steve

 On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com
wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the 
 record primary key in the PageParameters map . Once i have the 
 primary key on the next page, i can use my dao to retrieve the object
and may be float a div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart  
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider 
  Wicket community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can, 
  obviously so that pages can be bookmarked.  Therefore nearly every 
  page is constructed via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a 
  new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save 
  of the save on the next page.  If the save fails we stay on the 
  edit page, and that works fine.
  But if the save succeeds we redirect back to another page using 
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to 
  display
 a
  little floating div showing the record just saved, its transaction #
etc.
 
  In the old world I would just push my saved object notification 
  into the Session, and then on all pages check for this value and 
  then display and remove it.
  Is this still the best practice?
 
  I was looking at using something like 
  getSession().setMetaData(MetaDataKey, Serializable) to store the 
  the notification details, but couldn't see a way to remove the 
  MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com 
 Apache Wicket 1.4 increases type safety for web applications Get it 
 now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



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



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



Re: BrowserInfoPage and HelloBrowser on Firefox

2010-08-17 Thread Igor Vaynberg
javaEnabled=true

for me with firefox on wicketstuff.org/wicket14

-igor

On Tue, Aug 17, 2010 at 7:18 AM, Dirk Forchel dirk.forc...@exedio.com wrote:

 I still got no solution for the problem mentioned above.

 I assume the detection of JavaScript with the following line of code does
 not work for Firefox even if JavaScript support is enabled:

 ((WebClientInfo)Session.get().getClientInfo()).getProperties().isJavaEnabled();

 This works for IE but not for Firefox!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/BrowserInfoPage-and-HelloBrowser-on-Firefox-tp2306399p2328440.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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



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



Re: Best Practice passing data between Bookmarkable pages

2010-08-17 Thread James Carman
Notice my reply wasn't to your email.  It was to Martijn's. :)

On Tue, Aug 17, 2010 at 5:09 PM, Alex Rass a...@itbsllc.com wrote:
 No.
 I mean:
 You can getSession() to get to the session object.
 (I saw you use that so I know you know about it)
 But in your Application class, you can create whatever session object you
 want as long as it overrides the right class (there's a method for creating
 the session you'd override).
 Then you add your setters and getters to that session class of yours and use
 them when you need to.

 - Alex


 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On
 Behalf Of James Carman
 Sent: Tuesday, August 17, 2010 4:58 PM
 To: users@wicket.apache.org
 Subject: Re: Best Practice passing data between Bookmarkable pages

 You mean metadata on the session?

 On Tue, Aug 17, 2010 at 9:11 AM, Martijn Dashorst
 martijn.dasho...@gmail.com wrote:
 It's a good usecase for metadata. No problem there.

 Martijn

 On Tue, Aug 17, 2010 at 2:59 PM, Steve Mactaggart
 st...@whitesquaresoft.com wrote:
 We do pass params for the actual page's content, but this is
 transient information that I don't want leaking into my URLs.  Its
 usually a simple text message, so I'll look into Session#info(), but
 I have had some success with my earlier ideas of setMetaData.

 Is there a true purpose for setMetaData? or am I using it a dodgy way?

 I can forsee (fairly soon) a need to render more complex items than
 just a simple string and it seems that (as long as its Serializable)
 I can put anything in MetaData.

 Steve

 On Tue, Aug 17, 2010 at 7:23 PM, Josh Kamau joshnet2...@gmail.com
 wrote:

 HI Steve;

 When i want to maintain bookmarkable pages, i normally pass the
 record primary key in the PageParameters map . Once i have the
 primary key on the next page, i can use my dao to retrieve the object
 and may be float a div
 to display the record.

 On Tue, Aug 17, 2010 at 10:57 AM, Steve Mactaggart 
 st...@whitesquaresoft.com wrote:

  Hi all,
 
  I have a simple problem that I wanted to cast out to the wider
  Wicket community for a best practice.
 
  We try and use BookmarkablePageLinks for as much as we can,
  obviously so that pages can be bookmarked.  Therefore nearly every
  page is constructed via the PageParameters method.
  We have a lot of pages that list items, allow a user to create a
  new
 item,
  edit, delete, a pretty standard CRUD workflow.
 
  The problem is that I want to notify the user about the the save
  of the save on the next page.  If the save fails we stay on the
  edit page, and that works fine.
  But if the save succeeds we redirect back to another page using
  setResponsePage(Class, PageParams).
 
  What I want to do on this page (no matter what page it is) is to
  display
 a
  little floating div showing the record just saved, its transaction #
 etc.
 
  In the old world I would just push my saved object notification
  into the Session, and then on all pages check for this value and
  then display and remove it.
  Is this still the best practice?
 
  I was looking at using something like
  getSession().setMetaData(MetaDataKey, Serializable) to store the
  the notification details, but couldn't see a way to remove the
  MetaData
 (unless
  setting to null is right)
 
  Is this right or is there a more wicket way of doing this.
 
  Cheers,
  Steve
 





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications Get it
 now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



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



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



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



Re: Problem with page being redirected/loaded over and over again

2010-08-17 Thread Igor Vaynberg
is your homepage mounted on /welcome? maybe you did not correctly
implement the url coding strategy, make sure it encodes your homepage
as /en/welcome and not as /

just guessing since you didnt show any code. feel free to create a
quickstart that reproduces the issue and attach it to a jira ticket.

-igor

On Tue, Aug 17, 2010 at 3:43 AM, Laurentiu Trica
laurentiu.tr...@finalfolder.biz wrote:
 Hello,

 I followed the
 https://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs
  tutorial.
 I have, since, a problem with my homepage.

 It gets from / to /en and then to /en/welcome and back again to /,
 then /en and /en/welcome.

 The first redirect is correct as I want it to go to a locale aware URL - as
 the tutorial sais. So from / to /en is perfect.
 The second redirect is correct as well because it's done from the
 application class.
 I have the getHomePage() which returns a HomePage class which makes a
 redirect (as in the following code) to a LoginPage which is mounted as
 welcome.

 public HomePage() {
    setRedirect(true);
    setResponsePage(LoginPage.class);
 }

 The problem is that after the second correct redirect, somehow, the chain
 continues.
 There is another redirect to /, which seems to have as referrer the
 /en/welcome page.

 Is there anything I can do about this? I spent a whole day trying to figure
 out the problem but I didn't.
 Thanks in advance.

 --
 Best regards,
 Laurentiu Trica


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



Re: AjaxFormSubmitBehavior causes serialization issues inside onBeforeRender()

2010-08-17 Thread Igor Vaynberg
because your behavior is an anonymous class it keeps a reference to
its parent - the visitor. visitors are not serializable. the easiest
way to fix it is to make the behavior you are adding an inner class of
the page.

-igor

On Tue, Aug 17, 2010 at 8:05 AM, allgo soumya_...@yahoo.co.in wrote:

 Hi fellow wicket users,
 I am a  user of Wicket 1.4.8
 I am trying to use a TabbedPanel inside which there are several individual
 Panels. Now one of the Panel has a form with quite a few RadioChoices and
 DropDownChoice objects. I am updating a top level flag whenevr there is any
 change on any form element to trigger a pop-up asking the user to save
 un-saved changes on the page when they try to move away from that tabbed
 panel to soem other page.

 Since there are multiple form elements I am using a onBeforeRender() method
 in the ChildPanel class and applying AjaxFormBehaviour on all child elements
 at one place to avoid redundancy of code for each radio element or dropdown
 element as follows -

 protected void onBeforeRender() {

                if (!behaviorAssigned) {
                        behaviorAssigned = true;

                        visitChildren(new IVisitorComponent() {

                                public Object component(Component component) {
                                        if (component instanceof RadioChoice) {
                                                component.add(new 
 AjaxFormSubmitBehavior(onclick) {

                                                       �...@override
                                                        protected void 
 onError(AjaxRequestTarget target) {
                                                                // TODO 
 Auto-generated method stub

                                                        }

                                                       �...@override
                                                        protected void 
 onSubmit(AjaxRequestTarget target) {
                                                                
 parent.setPageChanged(Boolean.TRUE);

                                                        }


                                                });
                                        }
                                        if (component instanceof 
 DropDownChoice?) {
                                                component.add(new 
 AjaxFormComponentUpdatingBehavior(
                                                                onchange) {
                                                        protected void 
 onUpdate(AjaxRequestTarget target) {
                                                                
 parent.setPageChanged(Boolean.TRUE);
                                                        }
                                                });
                                        }
                                        return null;
                                }

                        });
                        super.onBeforeRender();
                }

 Problem is whenever the Panel is loaded I am getting loads of
 WicketNotSerializableExceptions -



 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class: com.mycompany.test.calendar.ChildPanel$7
 Field hierarchy is:
  5 [class=com.mycompany.test.HomeBasePage, path=5]
    private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
      java.lang.Object org.apache.wicket.Component.data[10]
 [class=com.mycompany.test.HomeBasePage$6, path=5:tabs]
        private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
          private org.apache.wicket.markup.html.link.PopupSettings
 org.apache.wicket.markup.html.link.Link.popupSettings[1]
 [class=com.mycompany.test.settings.SettingsLazyPanel, path=5:tabs:panel]
            private java.lang.Object
 org.apache.wicket.MarkupContainer.children
 [class=com.mycompany.test.settings.SettingsLazyPanel$1,
 path=5:tabs:panel:grid]
              private java.lang.Object
 org.apache.wicket.MarkupContainer.children
 [class=com.mycompany.test.settings.SettingBasePanel,
 path=5:tabs:panel:grid:content]
                private java.lang.Object
 org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
                  private
 org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow$WindowClosedCallback
 org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.windowClosedCallback[1]
 [class=com.mycompany.test.settings.SettingBasePanel$6,
 path=5:tabs:panel:grid:content:tabs]
                    private java.lang.Object
 org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
                      private
 org.apache.wicket.markup.html.link.PopupSettings
 org.apache.wicket.markup.html.link.Link.popupSettings[1]
 [class=com.mycompany.test.calendar.ChildPanel,
 path=5:tabs:panel:grid:content:tabs:panel]
                 

Delegate loading of wicket-event.js?

2010-08-17 Thread bht
Hi,

I get two instances of wicket-event.js and other resources in the
browser cache due to the probing for client cookie suport on the first
page in the browser session. One with jsessionid in the URl and one
without.

Can Wicket delegate the loading of these (extracted from the jar file)
files to outside the path of the wicket servlet filter eg ../scripts
same as static css files, images?

Example:

script type=text/javascript
src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83/script

Many thanks,

Bernard

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



Re: Delegate loading of wicket-event.js?

2010-08-17 Thread Igor Vaynberg
you should file this as a bug, packagedresourcereference urls should
not be encoded with the session id

-igor

On Tue, Aug 17, 2010 at 6:30 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I get two instances of wicket-event.js and other resources in the
 browser cache due to the probing for client cookie suport on the first
 page in the browser session. One with jsessionid in the URl and one
 without.

 Can Wicket delegate the loading of these (extracted from the jar file)
 files to outside the path of the wicket servlet filter eg ../scripts
 same as static css files, images?

 Example:

 script type=text/javascript
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83/script

 Many thanks,

 Bernard

 -
 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



dialog

2010-08-17 Thread james yong

Hi,

Is there any suggestion on creating a dialog?

I have look at the following:
1. wiquery has little documentation on creating dialog, and no source codes
for the example war file.
2. visural-wicket isn't working for me at 1st try. Maybe due to some
javascript conflict with my existing scripts.
3. wicketstuff-dojo-1.1 is only for wicket 1.3...according to the site.
4. jwicket svn project at wicketstuff is empty!

Regards,
James


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

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



Re: dialog

2010-08-17 Thread Martin Makundi
http://wicketstuff.org/wicket14/nested/?wicket:bookmarkablePage=:org.apache.wicket.examples.ajax.builtin.modal.ModalWindowPage

2010/8/18 james yong i_yon...@yahoo.com.sg:

 Hi,

 Is there any suggestion on creating a dialog?

 I have look at the following:
 1. wiquery has little documentation on creating dialog, and no source codes
 for the example war file.
 2. visural-wicket isn't working for me at 1st try. Maybe due to some
 javascript conflict with my existing scripts.
 3. wicketstuff-dojo-1.1 is only for wicket 1.3...according to the site.
 4. jwicket svn project at wicketstuff is empty!

 Regards,
 James


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

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



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



Re: Delegate loading of wicket-event.js?

2010-08-17 Thread bht
Thanks Igor.
https://issues.apache.org/jira/browse/WICKET-2999

Regards,

Bernard


On Tue, 17 Aug 2010 18:31:50 -0700, you wrote:

you should file this as a bug, packagedresourcereference urls should
not be encoded with the session id

-igor

On Tue, Aug 17, 2010 at 6:30 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I get two instances of wicket-event.js and other resources in the
 browser cache due to the probing for client cookie suport on the first
 page in the browser session. One with jsessionid in the URl and one
 without.

 Can Wicket delegate the loading of these (extracted from the jar file)
 files to outside the path of the wicket servlet filter eg ../scripts
 same as static css files, images?

 Example:

 script type=text/javascript
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83/script

 Many thanks,

 Bernard

 -
 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