Is there anyway to get a bookmarkable url from calling setResponsePage?

2011-02-09 Thread Wayne W
Hi,

I love using wicket (1.4) its by far the best web framework for java I
have used. However the one thing that really is hard work is the url
handling for me.

Our users all the time want to copy and paste the url of a given page
in to an email or use in a comment to link to something in the app.
We've tried making as many links bookmarkable as possible but this
only works until they click on another link/action and then the url is
lost.

I have 2 questions:

1 - is there a way to have a bookmarkable url from using a
setResponsePage? Basically we have a tree view, and when one of the
nodes is click via ajax I want to redirect them to a given page.
However I want that page's URL in the browser to be bookmarkable so
they can copy and paste the url. Is there any way of doing this? I've
mounted the page using MixedParamUrlCodingStrategy but this doesn't
work.

2- is there a better strategy to having all url's bookmarkable
(providing the page supports pageparamters)? Are there any changes in
wicket 1.5 to make life more easy?

thanks

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



Re: Is there anyway to get a bookmarkable url from calling setResponsePage?

2011-02-09 Thread Martijn Dashorst
setResponsePage(Page.class, new PageParameters());

On Wed, Feb 9, 2011 at 9:37 AM, Wayne W waynemailingli...@gmail.com wrote:
 Hi,

 I love using wicket (1.4) its by far the best web framework for java I
 have used. However the one thing that really is hard work is the url
 handling for me.

 Our users all the time want to copy and paste the url of a given page
 in to an email or use in a comment to link to something in the app.
 We've tried making as many links bookmarkable as possible but this
 only works until they click on another link/action and then the url is
 lost.

 I have 2 questions:

 1 - is there a way to have a bookmarkable url from using a
 setResponsePage? Basically we have a tree view, and when one of the
 nodes is click via ajax I want to redirect them to a given page.
 However I want that page's URL in the browser to be bookmarkable so
 they can copy and paste the url. Is there any way of doing this? I've
 mounted the page using MixedParamUrlCodingStrategy but this doesn't
 work.

 2- is there a better strategy to having all url's bookmarkable
 (providing the page supports pageparamters)? Are there any changes in
 wicket 1.5 to make life more easy?

 thanks

 -
 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

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



Re: Is there anyway to get a bookmarkable url from calling setResponsePage?

2011-02-09 Thread Martijn Dashorst
On Wed, Feb 9, 2011 at 9:37 AM, Wayne W waynemailingli...@gmail.com wrote:
 2- is there a better strategy to having all url's bookmarkable
 (providing the page supports pageparamters)? Are there any changes in
 wicket 1.5 to make life more easy?

Default constructor or constructor with pageparameters: you can take a
look at wicket-annot from wicketstuff core

Martijn

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



Re: Is there anyway to get a bookmarkable url from calling setResponsePage?

2011-02-09 Thread Wayne W
thanks Martijn,
I was looking at someone's else code and it was :
params.add(PROJECTID, info.getId().toString());
setResponsePage(new =ProjectPage(params));


rather than:
params.add(PROJECTID, info.getId().toString());
setResponsePage(ProjectPage.class, params);


Need coffee.
Sorry about that. Thanks for the pointer to wicket-annot - looks interesting

Another question if you don't mind? Quite often we have a bookmarkable
page with a form or link on it. This form/link will update the model
and redisplay the current page. When this happens we loose the
bookmarkable url. At the end of the onSubmit, or onClick we don't call
setResponsePage. Should be call setResponsePage to get the
bookmarkable url?


On Wed, Feb 9, 2011 at 10:10 AM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 On Wed, Feb 9, 2011 at 9:37 AM, Wayne W waynemailingli...@gmail.com wrote:
 2- is there a better strategy to having all url's bookmarkable
 (providing the page supports pageparamters)? Are there any changes in
 wicket 1.5 to make life more easy?

 Default constructor or constructor with pageparameters: you can take a
 look at wicket-annot from wicketstuff core

 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



Re: Is there anyway to get a bookmarkable url from calling setResponsePage?

2011-02-09 Thread Martijn Dashorst
On Wed, Feb 9, 2011 at 10:20 AM, Wayne W waynemailingli...@gmail.com wrote:
 Another question if you don't mind? Quite often we have a bookmarkable
 page with a form or link on it. This form/link will update the model
 and redisplay the current page. When this happens we loose the
 bookmarkable url. At the end of the onSubmit, or onClick we don't call
 setResponsePage. Should be call setResponsePage to get the
 bookmarkable url?

Yes.

Martijn

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



StatelessForm growing url when there is errorvalidation

2011-02-09 Thread Olivier Dutrieux

Hello,

I have a strange problem with statelessForm :

I would like a stateless application with 2 statelessForm and with somes
required validators on form :

public class HomePage extends WebPage {

private static final long serialVersionUID = 1L;

public HomePage(final PageParameters parameters) {
super(parameters);
setVersioned(false);
Form form1 = new StatelessForm(form1) {
@Override
protected void onSubmit() {
setResponsePage(ResultPage.class);
}
};
form1.add(new TextFieldString(input1).setRequired(true));
add(form1);

Form form2 = new StatelessForm(form2) {
@Override
protected void onSubmit() {
setResponsePage(ResultPage.class);
}
};
form2.add(new TextFieldString(input1).setRequired(true));
add(form2);
}
}

The problem is when I submit alternatively each form (I don't fill the
Textfield required intentionally), the url growing like this :

1st submit :
http://localhost:8080/Wicket-Test/HomePage.html?wicket:interface=:0:form2::IFormSubmitListener::
2nd submit :
http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=wicket:interface=:0:form1::IFormSubmitListener::
3th submit :
http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=form12_hf_0=wicket:interface=:0:form2::IFormSubmitListener::
4th submit :
http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=form22_hf_0=form12_hf_0=wicket:interface=:0:form1::IFormSubmitListener::
...

Is there a solution to solve this problem ?

Best regards

I use wicket 1.4.15 

http://apache-wicket.1842946.n4.nabble.com/file/n3296950/Wicket-test.rar
Wicket-test.rar 

-
Duto
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-growing-url-when-there-is-errorvalidation-tp3296950p3296950.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: cleanup form values and feedback messages

2011-02-09 Thread Hans Lesmeister 2

Hi, 


hrbaer wrote:
 
 
 ...
   try {
 pm.makePersistent( ent );
 modal.show( target );
 target.add(feedback);   === I guess this was missing
   } 
 
 -
 

You need to add the feedback to the target on success as well 

Cheers
Hans

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/cleanup-form-values-and-feedback-messages-tp3275588p3297033.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: Question about Unit Testing with custom Session

2011-02-09 Thread Dmitriy Neretin
Thank you for reply,

yes! And I get then another exception :)

Cannot resolve ServletContextResource without ServletContext

Does andybody know how can I get/set the servletContext?

Dmitriy

On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 did you call context.refresh() ? like the error message said?

 -igor

 On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hi,
 
  my complete setUp looks like this:
 
  @Before
 public void setUp() {
 MworldWicketApplication wicketWebApp = new
 MworldWicketApplication()
  {
 
 ApplicationContext ctx = new XmlWebApplicationContext();
 
 @Override
 public void init() {
 addComponentInstantiationListener(new
  SpringComponentInjector(this, ctx, true));
 }
 };
 
 tester = new WicketTester(wicketWebApp);
 pageParams = new HashMapString, String();
 }
 
  So the wickettester instance is created after the Appllication class is
  overriden. Even if I extract the wickettester creation from setup and
 will
  make it in each test (it is actually the same) I have the same problem.
 
  After debuggin the tests I have seen that my appcontext instance was
 created
  and the .xml file was correctly recognized :( But I still get the
  exception...
 
  On 8 February 2011 07:37, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 
  make sure your setup() code runs before wicket tester instance is
 created.
 
  -igor
 
  On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
 
 
 

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




When 1.4.16 going to be released

2011-02-09 Thread Przemek Kubicki

Hi folks,

anyone know when 1.4.16 will get released?

Cheers

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



Re: AjaxCheckBox not Disabling Checkbox on call to onUpdate

2011-02-09 Thread sheadley3228

I have found a solution to my first problem which was Disabling my checkbox.
I did it by changing my listView to a RefreshingView and then using
AjaxEventBehavior on my checkbox like so:

final RefreshingView rv = new RefreshingView(mychanges) {

@Override
protected Iterator getItemModels() {
return new ModelIteratorAdapter(userSearchResults.iterator()) {

@Override
protected IModel model(Object arg0) {
return new CompoundPropertyModel ((UserSearchResult) 
arg0);
}

   };
}

@Override
protected void populateItem(Item arg1) {

 final CheckBox ajaxCheck = new CheckBox(verifyflag, new
PropertyModel(SearchResultPage.this, checkFalse));
ajaxCheck.add(new AjaxEventBehavior(onclick) {   
@Override
protected void onEvent(AjaxRequestTarget arg0) {

ajaxCheck.setEnabled(false);
arg0.addComponent(ajaxCheck);   


 }  
});
   }


My question is that I need to have the ability that once my checkbox is
selected to update 2 labels that are part of the Item I am populating:

arg1.add(new Label(verifyby, model.getVRFD_BY_USR_ID()));
arg1.add(new Label(verifydt, DateUtil.formatDate(model.getVRFD_DT(;

How could this be accomplished?

regards,

Sheadley
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxCheckBox-not-Disabling-Checkbox-on-call-to-onUpdate-tp3264816p3297061.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: Question about Unit Testing with custom Session

2011-02-09 Thread Attila Király
Hi,

Try this in your application's #init() method (before calling #refresh() on
ctx)

ctx.setServletContext(getServletContext());

Attila

2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com

 Thank you for reply,

 yes! And I get then another exception :)

 Cannot resolve ServletContextResource without ServletContext

 Does andybody know how can I get/set the servletContext?

 Dmitriy

 On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com wrote:

  did you call context.refresh() ? like the error message said?
 
  -igor
 
  On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
  dmitriy.nere...@googlemail.com wrote:
   Hi,
  
   my complete setUp looks like this:
  
   @Before
  public void setUp() {
  MworldWicketApplication wicketWebApp = new
  MworldWicketApplication()
   {
  
  ApplicationContext ctx = new XmlWebApplicationContext();
  
  @Override
  public void init() {
  addComponentInstantiationListener(new
   SpringComponentInjector(this, ctx, true));
  }
  };
  
  tester = new WicketTester(wicketWebApp);
  pageParams = new HashMapString, String();
  }
  
   So the wickettester instance is created after the Appllication class is
   overriden. Even if I extract the wickettester creation from setup and
  will
   make it in each test (it is actually the same) I have the same problem.
  
   After debuggin the tests I have seen that my appcontext instance was
  created
   and the .xml file was correctly recognized :( But I still get the
   exception...
  
   On 8 February 2011 07:37, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
  
   make sure your setup() code runs before wicket tester instance is
  created.
  
   -igor
  
   On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
I would rather write programs to write programs than write programs.


Re: Question about Unit Testing with custom Session

2011-02-09 Thread Dmitriy Neretin
Hi,

thank you! Now I know how to get the ServletContext :) But it didn't solve
the main problem. This time I got following exception:

IOException parsing XML document from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/applicationContext.xml]

This is the right path. The xml file is there. It also schouldn't be a
problem with file system permissions :(

On 9 February 2011 12:57, Attila Király kiralyattila...@gmail.com wrote:

 Hi,

 Try this in your application's #init() method (before calling #refresh() on
 ctx)

 ctx.setServletContext(getServletContext());

 Attila

 2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com

  Thank you for reply,
 
  yes! And I get then another exception :)
 
  Cannot resolve ServletContextResource without ServletContext
 
  Does andybody know how can I get/set the servletContext?
 
  Dmitriy
 
  On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 
   did you call context.refresh() ? like the error message said?
  
   -igor
  
   On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
   dmitriy.nere...@googlemail.com wrote:
Hi,
   
my complete setUp looks like this:
   
@Before
   public void setUp() {
   MworldWicketApplication wicketWebApp = new
   MworldWicketApplication()
{
   
   ApplicationContext ctx = new XmlWebApplicationContext();
   
   @Override
   public void init() {
   addComponentInstantiationListener(new
SpringComponentInjector(this, ctx, true));
   }
   };
   
   tester = new WicketTester(wicketWebApp);
   pageParams = new HashMapString, String();
   }
   
So the wickettester instance is created after the Appllication class
 is
overriden. Even if I extract the wickettester creation from setup and
   will
make it in each test (it is actually the same) I have the same
 problem.
   
After debuggin the tests I have seen that my appcontext instance was
   created
and the .xml file was correctly recognized :( But I still get the
exception...
   
On 8 February 2011 07:37, Igor Vaynberg igor.vaynb...@gmail.com
  wrote:
   
make sure your setup() code runs before wicket tester instance is
   created.
   
-igor
   
On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
   
   
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 I would rather write programs to write programs than write programs.



Re: Question about Unit Testing with custom Session

2011-02-09 Thread Attila Király
The problem is that your test is not actualy running in a servlet container,
only in a wicket mocked servlet context. To access webapp resources in the
test you have to specify in the second parameter of WicketTester constructor
where your web app's root is. Like this (in a maven project):

WicketTester tester = new WicketTester(new MockApplication(),
target/my-webapp-name);
Assert.assertNotNull(tester.getServletContext().getResource(WEB-INF/web.xml));

Attila

2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com

 Hi,

 thank you! Now I know how to get the ServletContext :) But it didn't solve
 the main problem. This time I got following exception:

 IOException parsing XML document from ServletContext resource
 [/WEB-INF/applicationContext.xml]; nested exception is
 java.io.FileNotFoundException: Could not open ServletContext resource
 [/WEB-INF/applicationContext.xml]

 This is the right path. The xml file is there. It also schouldn't be a
 problem with file system permissions :(

 On 9 February 2011 12:57, Attila Király kiralyattila...@gmail.com wrote:

  Hi,
 
  Try this in your application's #init() method (before calling #refresh()
 on
  ctx)
 
  ctx.setServletContext(getServletContext());
 
  Attila
 
  2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com
 
   Thank you for reply,
  
   yes! And I get then another exception :)
  
   Cannot resolve ServletContextResource without ServletContext
  
   Does andybody know how can I get/set the servletContext?
  
   Dmitriy
  
   On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
  
did you call context.refresh() ? like the error message said?
   
-igor
   
On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hi,

 my complete setUp looks like this:

 @Before
public void setUp() {
MworldWicketApplication wicketWebApp = new
MworldWicketApplication()
 {

ApplicationContext ctx = new XmlWebApplicationContext();

@Override
public void init() {
addComponentInstantiationListener(new
 SpringComponentInjector(this, ctx, true));
}
};

tester = new WicketTester(wicketWebApp);
pageParams = new HashMapString, String();
}

 So the wickettester instance is created after the Appllication
 class
  is
 overriden. Even if I extract the wickettester creation from setup
 and
will
 make it in each test (it is actually the same) I have the same
  problem.

 After debuggin the tests I have seen that my appcontext instance
 was
created
 and the .xml file was correctly recognized :( But I still get the
 exception...

 On 8 February 2011 07:37, Igor Vaynberg igor.vaynb...@gmail.com
   wrote:

 make sure your setup() code runs before wicket tester instance is
created.

 -igor

 On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin



   
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
 
 
 
  --
  I would rather write programs to write programs than write programs.
 



Re: Question about Unit Testing with custom Session

2011-02-09 Thread Dmitriy Neretin
Thank you it finally works! :)

But what I still don't understand: the problem appeared after I inserted
following in the custom session constructor:

InjectorHolder.getInjector().inject(this);

And why it worked with only one WicketTester constructor parameter (new
MyApplication)? And after Spring integration there schould be 2 parameters?

Thank you!

P.S. My assertion for ServletContext looks like this:

Assert.assertNotNull(tester.getServletSession().getServletContext().getContext(WEB-INF/web.xml));

On 9 February 2011 14:27, Attila Király kiralyattila...@gmail.com wrote:

 The problem is that your test is not actualy running in a servlet
 container,
 only in a wicket mocked servlet context. To access webapp resources in the
 test you have to specify in the second parameter of WicketTester
 constructor
 where your web app's root is. Like this (in a maven project):

 WicketTester tester = new WicketTester(new MockApplication(),
 target/my-webapp-name);

 Assert.assertNotNull(tester.getServletContext().getResource(WEB-INF/web.xml));

 Attila

 2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com

  Hi,
 
  thank you! Now I know how to get the ServletContext :) But it didn't
 solve
  the main problem. This time I got following exception:
 
  IOException parsing XML document from ServletContext resource
  [/WEB-INF/applicationContext.xml]; nested exception is
  java.io.FileNotFoundException: Could not open ServletContext resource
  [/WEB-INF/applicationContext.xml]
 
  This is the right path. The xml file is there. It also schouldn't be a
  problem with file system permissions :(
 
  On 9 February 2011 12:57, Attila Király kiralyattila...@gmail.com
 wrote:
 
   Hi,
  
   Try this in your application's #init() method (before calling
 #refresh()
  on
   ctx)
  
   ctx.setServletContext(getServletContext());
  
   Attila
  
   2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com
  
Thank you for reply,
   
yes! And I get then another exception :)
   
Cannot resolve ServletContextResource without ServletContext
   
Does andybody know how can I get/set the servletContext?
   
Dmitriy
   
On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com
  wrote:
   
 did you call context.refresh() ? like the error message said?

 -igor

 On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hi,
 
  my complete setUp looks like this:
 
  @Before
 public void setUp() {
 MworldWicketApplication wicketWebApp = new
 MworldWicketApplication()
  {
 
 ApplicationContext ctx = new
 XmlWebApplicationContext();
 
 @Override
 public void init() {
 addComponentInstantiationListener(new
  SpringComponentInjector(this, ctx, true));
 }
 };
 
 tester = new WicketTester(wicketWebApp);
 pageParams = new HashMapString, String();
 }
 
  So the wickettester instance is created after the Appllication
  class
   is
  overriden. Even if I extract the wickettester creation from setup
  and
 will
  make it in each test (it is actually the same) I have the same
   problem.
 
  After debuggin the tests I have seen that my appcontext instance
  was
 created
  and the .xml file was correctly recognized :( But I still get the
  exception...
 
  On 8 February 2011 07:37, Igor Vaynberg igor.vaynb...@gmail.com
 
wrote:
 
  make sure your setup() code runs before wicket tester instance
 is
 created.
 
  -igor
 
  On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
 
 
 


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


   
  
  
  
   --
   I would rather write programs to write programs than write programs.
  
 



Wicket Philosophy/Best Practice

2011-02-09 Thread Brown, Berlin [GCG-PFS]
I tell people that I think you should let your Model and Model backing
object control the look and feel/display/content of your components.
Even visibility should be delegated to the model or model object and not
set by the component.   Am I wrong here?  
 
I use this approach (only work with the Model/ModelObject) as opposed to
monkeying with the wicket internal(seemingly) methods like
onComponentTag or adding javascript to control the look feel or tags?
 
 
E.g.
 
MyComponent {
  isVisible() {
getModelObject().isVisible();
  }
 isEnabled() { 
getModelObject().isEnabled();
  }
}
 
 
Berlin Brown


RE: Wicket Philosophy/Best Practice

2011-02-09 Thread Wilhelmsen Tor Iver
 I tell people that I think you should let your Model and Model backing
 object control the look and feel/display/content of your components.
 Even visibility should be delegated to the model or model object and not
 set by the component.   Am I wrong here?  
 
Yes. :)

The model should NOT care about the view, or even know one is there; a 
controller is supposed to manipulate the model, any view (if any) should just 
get the value from there and do any necessary formatting (e.g. using a 
converter to/from textual representation).

For instance, why should a Model need to know the locale of a web user to 
produce a correct representation? Separation of concerns and all that.

- Tor Iver

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



Re: Question about Unit Testing with custom Session

2011-02-09 Thread Attila Király
Hi,

2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com

 Thank you it finally works! :)


Great!


 But what I still don't understand: the problem appeared after I inserted
 following in the custom session constructor:

 InjectorHolder.getInjector().inject(this);

 And why it worked with only one WicketTester constructor parameter (new
 MyApplication)? And after Spring integration there schould be 2 parameters?


Only spring's XmlWebApplicationContext needed the real web app resources
(the WEB-INF/applicationContext.xml file) wicket itself did not. So without
injection nothing was using it.

P.S. My assertion for ServletContext looks like this:


 Assert.assertNotNull(tester.getServletSession().getServletContext().getContext(WEB-INF/web.xml));


You are right. tester.getServletContext() is only available in 1.5, not in
1.4.

Attila



 On 9 February 2011 14:27, Attila Király kiralyattila...@gmail.com wrote:

  The problem is that your test is not actualy running in a servlet
  container,
  only in a wicket mocked servlet context. To access webapp resources in
 the
  test you have to specify in the second parameter of WicketTester
  constructor
  where your web app's root is. Like this (in a maven project):
 
  WicketTester tester = new WicketTester(new MockApplication(),
  target/my-webapp-name);
 
 
 Assert.assertNotNull(tester.getServletContext().getResource(WEB-INF/web.xml));
 
  Attila
 
  2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com
 
   Hi,
  
   thank you! Now I know how to get the ServletContext :) But it didn't
  solve
   the main problem. This time I got following exception:
  
   IOException parsing XML document from ServletContext resource
   [/WEB-INF/applicationContext.xml]; nested exception is
   java.io.FileNotFoundException: Could not open ServletContext resource
   [/WEB-INF/applicationContext.xml]
  
   This is the right path. The xml file is there. It also schouldn't be a
   problem with file system permissions :(
  
   On 9 February 2011 12:57, Attila Király kiralyattila...@gmail.com
  wrote:
  
Hi,
   
Try this in your application's #init() method (before calling
  #refresh()
   on
ctx)
   
ctx.setServletContext(getServletContext());
   
Attila
   
2011/2/9 Dmitriy Neretin dmitriy.nere...@googlemail.com
   
 Thank you for reply,

 yes! And I get then another exception :)

 Cannot resolve ServletContextResource without ServletContext

 Does andybody know how can I get/set the servletContext?

 Dmitriy

 On 8 February 2011 18:01, Igor Vaynberg igor.vaynb...@gmail.com
   wrote:

  did you call context.refresh() ? like the error message said?
 
  -igor
 
  On Tue, Feb 8, 2011 at 1:31 AM, Dmitriy Neretin
  dmitriy.nere...@googlemail.com wrote:
   Hi,
  
   my complete setUp looks like this:
  
   @Before
  public void setUp() {
  MworldWicketApplication wicketWebApp = new
  MworldWicketApplication()
   {
  
  ApplicationContext ctx = new
  XmlWebApplicationContext();
  
  @Override
  public void init() {
  addComponentInstantiationListener(new
   SpringComponentInjector(this, ctx, true));
  }
  };
  
  tester = new WicketTester(wicketWebApp);
  pageParams = new HashMapString, String();
  }
  
   So the wickettester instance is created after the Appllication
   class
is
   overriden. Even if I extract the wickettester creation from
 setup
   and
  will
   make it in each test (it is actually the same) I have the same
problem.
  
   After debuggin the tests I have seen that my appcontext
 instance
   was
  created
   and the .xml file was correctly recognized :( But I still get
 the
   exception...
  
   On 8 February 2011 07:37, Igor Vaynberg 
 igor.vaynb...@gmail.com
  
 wrote:
  
   make sure your setup() code runs before wicket tester instance
  is
  created.
  
   -igor
  
   On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
  
  
  
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

   
   
   
--
I would rather write programs to write programs than write
 programs.
   
  
 



Ajax onChange but also submit all data on a form

2011-02-09 Thread Brown, Berlin [GCG-PFS]
Can you submit all of the data on a form based on an onchange event?
 
Is adding javascript the only way to submit the data?
 
Pseudo Code:
 
Panel {
 
  Form form = new Form(new CompoundPropertyModel());
  add(form);
  form.add(new TextField(val);
  form.add(childList = new DropDownChoice()); 
  childList.add( new AjaxFormComponentUpdatingBehavior(onchange) {


  protected void onUpdate( final AjaxRequestTarget target ) {

   /// Tried clearing the messages here, does not work. 

  Line12: form.getObjectModel().setVal(Hello);
target.addComponent(panel);

   target.addComponent(form);

  }

  });
 
  form.add(new MyValidator());
  form.add(new AjaxSubmitLink(form)) {
   
 onSubmit() {
save();
moveToNextScreen();
 }
   
  }
  
 
}

 
 
Berlin Brown


ajax versioning

2011-02-09 Thread Istvan De

Hi!

In case I have a bookmarkable page with some AJAX on it (form+table) and 
the user can navigate away and back to this page (using the back 
button). How can I make sure that in case of the back button, the user 
will see the state of the page after the AJAX modifications?


Best regards,
Istvan


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



Re: Ajax onChange but also submit all data on a form

2011-02-09 Thread Michael O'Cleirigh

Use AjaxFormSubmitBehavior instead of AjaxFormComponentUpdatingBehaviour.

AjaxFormComponentUpdatingBehaviour is just for updating a single field 
in a form.


AjaxButton uses AjaxFormSubmitBehaviour internally so look at that for 
an example.


Mike

Can you submit all of the data on a form based on an onchange event?

Is adding javascript the only way to submit the data?

Pseudo Code:

Panel {

   Form form = new Form(new CompoundPropertyModel());
   add(form);
   form.add(new TextField(val);
   form.add(childList = new DropDownChoice());
   childList.add( new AjaxFormComponentUpdatingBehavior(onchange) {


   protected void onUpdate( final AjaxRequestTarget target ) {

/// Tried clearing the messages here, does not work.

   Line12: form.getObjectModel().setVal(Hello);
target.addComponent(panel);

target.addComponent(form);

   }

   });

   form.add(new MyValidator());
   form.add(new AjaxSubmitLink(form)) {

  onSubmit() {
 save();
 moveToNextScreen();
  }

   }


}



Berlin Brown




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



Re: When 1.4.16 going to be released

2011-02-09 Thread Igor Vaynberg
is there anything particularly important in it that you need?

-igor

On Wed, Feb 9, 2011 at 3:18 AM, Przemek Kubicki prze...@consol.pl wrote:
 Hi folks,

 anyone know when 1.4.16 will get released?

 Cheers

 -
 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: ajax versioning

2011-02-09 Thread Igor Vaynberg
mount it with hybrid url coding strategy

-igor

On Wed, Feb 9, 2011 at 8:01 AM, Istvan De surf-ki...@freemail.hu wrote:
 Hi!

 In case I have a bookmarkable page with some AJAX on it (form+table) and the
 user can navigate away and back to this page (using the back button). How
 can I make sure that in case of the back button, the user will see the state
 of the page after the AJAX modifications?

 Best regards,
 Istvan


 -
 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: StatelessForm growing url when there is errorvalidation

2011-02-09 Thread Igor Vaynberg
hrm. i thought this was fixed a long time ago. please file a bug with
a quickstart.

-igor

On Wed, Feb 9, 2011 at 2:09 AM, Olivier Dutrieux
olivier.dutri...@pasteur.fr wrote:

 Hello,

 I have a strange problem with statelessForm :

 I would like a stateless application with 2 statelessForm and with somes
 required validators on form :

 public class HomePage extends WebPage {

        private static final long serialVersionUID = 1L;

    public HomePage(final PageParameters parameters) {
        super(parameters);
        setVersioned(false);
        Form form1 = new StatelessForm(form1) {
            @Override
            protected void onSubmit() {
                setResponsePage(ResultPage.class);
            }
        };
        form1.add(new TextFieldString(input1).setRequired(true));
        add(form1);

        Form form2 = new StatelessForm(form2) {
            @Override
            protected void onSubmit() {
                setResponsePage(ResultPage.class);
            }
        };
        form2.add(new TextFieldString(input1).setRequired(true));
        add(form2);
    }
 }

 The problem is when I submit alternatively each form (I don't fill the
 Textfield required intentionally), the url growing like this :

 1st submit :
 http://localhost:8080/Wicket-Test/HomePage.html?wicket:interface=:0:form2::IFormSubmitListener::
 2nd submit :
 http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=wicket:interface=:0:form1::IFormSubmitListener::
 3th submit :
 http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=form12_hf_0=wicket:interface=:0:form2::IFormSubmitListener::
 4th submit :
 http://localhost:8080/Wicket-Test/HomePage.html?form22_hf_0=form22_hf_0=form12_hf_0=wicket:interface=:0:form1::IFormSubmitListener::
 ...

 Is there a solution to solve this problem ?

 Best regards

 I use wicket 1.4.15

 http://apache-wicket.1842946.n4.nabble.com/file/n3296950/Wicket-test.rar
 Wicket-test.rar

 -
 Duto
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/StatelessForm-growing-url-when-there-is-errorvalidation-tp3296950p3296950.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: When 1.4.16 going to be released

2011-02-09 Thread Martin Makundi
Ajax-enclosures would be nice ;)

2011/2/9 Igor Vaynberg igor.vaynb...@gmail.com:
 is there anything particularly important in it that you need?

 -igor

 On Wed, Feb 9, 2011 at 3:18 AM, Przemek Kubicki prze...@consol.pl wrote:
 Hi folks,

 anyone know when 1.4.16 will get released?

 Cheers

 -
 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: When 1.4.16 going to be released

2011-02-09 Thread Przemek Kubicki

Hey,

WICKET-3321 https://issues.apache.org/jira/browse/WICKET-3321 is crucial 
for us.

It is already fixed.

We need to release our product version asap. Without 1.4.16 we would 
need to patch the wicket, but i'd like to avoid it.


Cheers,


W dniu 09.02.2011 17:25, Igor Vaynberg pisze:

is there anything particularly important in it that you need?

-igor

On Wed, Feb 9, 2011 at 3:18 AM, Przemek Kubickiprze...@consol.pl  wrote:

Hi folks,

anyone know when 1.4.16 will get released?

Cheers

-
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: When 1.4.16 going to be released

2011-02-09 Thread Igor Vaynberg
i may have time this weekend. may being the operative word.

you dont need to patch the version of wicket, just use the latest snapshot jar.

-igor


On Wed, Feb 9, 2011 at 8:52 AM, Przemek Kubicki prze...@consol.pl wrote:
 Hey,

 WICKET-3321 https://issues.apache.org/jira/browse/WICKET-3321 is crucial for
 us.
 It is already fixed.

 We need to release our product version asap. Without 1.4.16 we would need to
 patch the wicket, but i'd like to avoid it.

 Cheers,


 W dniu 09.02.2011 17:25, Igor Vaynberg pisze:

 is there anything particularly important in it that you need?

 -igor

 On Wed, Feb 9, 2011 at 3:18 AM, Przemek Kubickiprze...@consol.pl  wrote:

 Hi folks,

 anyone know when 1.4.16 will get released?

 Cheers

 -
 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



what doctype should I use

2011-02-09 Thread fachhoch

please suggest what doctype should I use to  make IE work  , and not cause
any new issues.
i am not sure If my application is xhtml or just html , I am not sure if
every thing is valid , in this case   what would be the right doctype for my
pages , please suggest me.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/what-doctype-should-I-use-tp3297678p3297678.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: what doctype should I use

2011-02-09 Thread Martin Makundi
Hi!

Use !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

It is not strict.

However, nothing will guarantee things will work in IE.

**
Martin

2011/2/9 fachhoch fachh...@gmail.com:

 please suggest what doctype should I use to  make IE work  , and not cause
 any new issues.
 i am not sure If my application is xhtml or just html , I am not sure if
 every thing is valid , in this case   what would be the right doctype for my
 pages , please suggest me.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/what-doctype-should-I-use-tp3297678p3297678.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: what doctype should I use

2011-02-09 Thread Daniel Soneira

This has nothing to do with Wicket.
I would recommend researching selfhtml (http://de.selfhtml.org/) since 
you seem to be from Germany.


On 09.02.2011 17:58, fachhoch wrote:

please suggest what doctype should I use to  make IE work  , and not cause
any new issues.
i am not sure If my application is xhtml or just html , I am not sure if
every thing is valid , in this case   what would be the right doctype for my
pages , please suggest me.



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



Re: StatelessForm growing url when there is errorvalidation

2011-02-09 Thread Olivier Dutrieux

I already attach on my first post a sample (quickstart) :
http://apache-wicket.1842946.n4.nabble.com/file/n3296950/Wicket-test.rar

I fill too a jira ticket : https://issues.apache.org/jira/browse/WICKET-3438

Best regards



-
Duto
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-growing-url-when-there-is-errorvalidation-tp3296950p3298027.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: Estimated number of developers in the Wicket community

2011-02-09 Thread Bruno Borges

Does anyone have an update over this?

It seems the website 

http://people.apache.org/~coar/mlists.html#wicket.apache.org

does not show anymore the Wicket dashboard.

I'm looking for a number of active members on the mailing list (also, number
of messages).


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Estimated-number-of-developers-in-the-Wicket-community-tp2717811p3298036.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: Estimated number of developers in the Wicket community

2011-02-09 Thread Jeremy Thomerson
On Wed, Feb 9, 2011 at 2:10 PM, Bruno Borges bruno.bor...@gmail.com wrote:


 Does anyone have an update over this?

 It seems the website

 http://people.apache.org/~coar/mlists.html#wicket.apache.org

 does not show anymore the Wicket dashboard.

 I'm looking for a number of active members on the mailing list (also,
 number
 of messages).


I wrote the person that generated that and asked about it since it appears
that it is way out of date and is obviously missing many lists.


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


DropDownChoice-Choose One Selected Item

2011-02-09 Thread Niv

Hi
Is there a way I can have the selected option on a DropDownChoice to be set
with  one of the items in the Model instead of ' Choose One'  as the
selected item by default? I know this has been asked around in a different
sense but I could not find a closer match to this. 
Code Snippet

ListCountry countryList =service.getCountries();
ChoiceRendererCountry defaultChoiceRenderer = new
ChoiceRendererCountry(Constants.NAME, Constants.ID);
countryChoice = new DropDownChoiceCountry(Constants.ADDRESS_COUNTRY,
countryList, defaultChoiceRenderer);

//Would like the countryChoice to be able to have the First Contry in the
countrList to be the one rendered instead of 'Choose One'.

Thanks and if it seems redundant do pardon me
Cheers



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.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: DropDownChoice-Choose One Selected Item

2011-02-09 Thread James Carman
The DDC will reflect whatever is in its model (the model for the
selected value, not the one for the list of items to choose from).
So, just set your model.

On Wed, Feb 9, 2011 at 10:52 PM, Niv nivedan.t...@gmail.com wrote:

 Hi
 Is there a way I can have the selected option on a DropDownChoice to be set
 with  one of the items in the Model instead of ' Choose One'  as the
 selected item by default? I know this has been asked around in a different
 sense but I could not find a closer match to this.
 Code Snippet

 ListCountry countryList =service.getCountries();
 ChoiceRendererCountry defaultChoiceRenderer = new
 ChoiceRendererCountry(Constants.NAME, Constants.ID);
 countryChoice = new DropDownChoiceCountry(Constants.ADDRESS_COUNTRY,
 countryList, defaultChoiceRenderer);

 //Would like the countryChoice to be able to have the First Contry in the
 countrList to be the one rendered instead of 'Choose One'.

 Thanks and if it seems redundant do pardon me
 Cheers



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.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: Best Wicket security practice

2011-02-09 Thread Nivedan Nadaraj
Apache shiro is one more  - http://shiro.apache.org/



On Wed, Feb 9, 2011 at 3:14 AM, sakthi vel vela@gmail.com wrote:

 Hello All,

 There are few security things in wicket like SWARM, Spring security with
 wicket and so on.
  Could anyone tell the best security practice in wicket and any possible
 links would be great.



Re: DropDownChoice-Choose One Selected Item

2011-02-09 Thread Martin Makundi
Hi!

You can do  defaultChoiceRenderer.setDefaultModelObject(xxx)

Or if you don't want to dirty it, you can use

  public static T extends FormComponent? void fakeRawInput(T
formComponent, T existingComponent) {
try {
  String rawInput = (String) rawInputField.get(existingComponent);
  fakeRawInput(formComponent, rawInput);
} catch (Exception e) {
  Utils.errorLog(WicketUtils.class, Fatal Error: Form field
access failed., e);
}
  }


2011/2/10 Niv nivedan.t...@gmail.com:

 Hi
 Is there a way I can have the selected option on a DropDownChoice to be set
 with  one of the items in the Model instead of ' Choose One'  as the
 selected item by default? I know this has been asked around in a different
 sense but I could not find a closer match to this.
 Code Snippet

 ListCountry countryList =service.getCountries();
 ChoiceRendererCountry defaultChoiceRenderer = new
 ChoiceRendererCountry(Constants.NAME, Constants.ID);
 countryChoice = new DropDownChoiceCountry(Constants.ADDRESS_COUNTRY,
 countryList, defaultChoiceRenderer);

 //Would like the countryChoice to be able to have the First Contry in the
 countrList to be the one rendered instead of 'Choose One'.

 Thanks and if it seems redundant do pardon me
 Cheers



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.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: DropDownChoice-Choose One Selected Item

2011-02-09 Thread Nivedan Nadaraj
@James - Thank you will try that out and get back.
@Martin - Thanks mate will get back I guess I am using 1.4.9 version and
don't have the option to setDefaultModelObject on the ChoiceRenderer anyhow
appreciate your time and thoughts to write back.

Thanks again
Nive
On Thu, Feb 10, 2011 at 12:01 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 You can do  defaultChoiceRenderer.setDefaultModelObject(xxx)

 Or if you don't want to dirty it, you can use

  public static T extends FormComponent? void fakeRawInput(T
 formComponent, T existingComponent) {
try {
  String rawInput = (String) rawInputField.get(existingComponent);
  fakeRawInput(formComponent, rawInput);
} catch (Exception e) {
  Utils.errorLog(WicketUtils.class, Fatal Error: Form field
 access failed., e);
}
  }


 2011/2/10 Niv nivedan.t...@gmail.com:
 
  Hi
  Is there a way I can have the selected option on a DropDownChoice to be
 set
  with  one of the items in the Model instead of ' Choose One'  as the
  selected item by default? I know this has been asked around in a
 different
  sense but I could not find a closer match to this.
  Code Snippet
 
  ListCountry countryList =service.getCountries();
  ChoiceRendererCountry defaultChoiceRenderer = new
  ChoiceRendererCountry(Constants.NAME, Constants.ID);
  countryChoice = new DropDownChoiceCountry(Constants.ADDRESS_COUNTRY,
  countryList, defaultChoiceRenderer);
 
  //Would like the countryChoice to be able to have the First Contry in the
  countrList to be the one rendered instead of 'Choose One'.
 
  Thanks and if it seems redundant do pardon me
  Cheers
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.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