Re: Stateless page creating session

2007-10-11 Thread Matej Knopp
Yeah, it's a bug introduced by me recently. Will look at it ASAP.

-Matej

On 10/11/07, John Patterson [EMAIL PROTECTED] wrote:
 Also,  the example application stateless is doing the same.

 When I go to this page

 http://localhost:8080/wicket-examples/stateless/public/Index/

 after restarting my browser I get this

 a session exists for this client, with session id z4zov2z9j024
 go to another stateless page
 go to a stateful page (triggers session creation if not already done so)

 Something is going on here.



 On 10 Oct 2007, at 18:24, John Patterson wrote:

  Hi,
 
  I have created a page and setStatelessHint(true) and made sure all
  the child components are stateless but an http session is still
  being created.  The method isPageStateless() returns true.
 
 
  Here is the trace where the SEssion is created:
 
  com.citikey.site.SessionListener.sessionCreated
  (SessionListener.java:29)
at org.mortbay.jetty.servlet.AbstractSessionManager.addSession
  (AbstractSessionManager.java:569)
at org.mortbay.jetty.servlet.AbstractSessionManager.newHttpSession
  (AbstractSessionManager.java:414)
at org.mortbay.jetty.Request.getSession(Request.java:1005)
at
  org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(
  AbstractHttpSessionStore.java:188)
at org.apache.wicket.Session.bind(Session.java:415)
at org.apache.wicket.Component.beforeRender(Component.java:855)
 
 
  This code in Component.beforeRenderlooks suspicious:
 
// If any of the components on page is not stateless, we need to
  bind the session
// before we start rendering components, as then jsessionid won't
  be appended
// for links rendered before first stateful component
if (isStateless()  getSession().isTemporary())
{
getSession().bind();
}
 
  Cheers,
 
  John
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DataTable FilterToolbar Shifted After AJAX Call

2007-10-11 Thread Matej Knopp
That's a problem of DataTable producing invalid markup, that the
browser is not able to replaced by ajax call (but it is able to
process it on regular request). I'm afraid there is no solution
currently for your problem. Please add a JIRA entry, possibly with a
quickstart to reproduce the problem.

-Matej

On 10/10/07, UPBrandon [EMAIL PROTECTED] wrote:

 I am working on a project that has a DataTable with a filter that uses AJAX
 to update an object on the backend and refresh the table, among other
 things.  Everything is working well so far except the columns in the filter
 toolbar row are shifted one column to the right after the AJAX refresh.
 Using Firebug to inspect the toolbar row after the update, I see that
 everything is shifted one to the right because Wicket is inserting a div
 in the tr before the td's.  So instead of

 tr
 td.../td
 td.../td
 /tr

 I have

 tr
 div/div
 td.../td
 td.../td
 /tr

 The contents of the div are:

 div id=filter-form18 wicket:id=filter-forminput type=hidden
 value= wicket:id=focus-tracker
 name=checkGroup:equipmentDataTable:topToolbars:2:toolbar:filter-form:focus-tracker
 id=queueDetailsPanel:checkForm:checkGroup:equipmentDataTable:topToolbars:2:toolbar:filter-form:focus-tracker//div

 If it makes any difference, when I do the update, I am not updating the
 DataTable directly - I am updating a higher level Panel that contains the
 DataTable.  Has anyone else had any similar problems?

 -Brandon
 --
 View this message in context: 
 http://www.nabble.com/DataTable-FilterToolbar-Shifted-After-AJAX-Call-tf4601906.html#a13139327
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket 1.3 - JVM 1.4

2007-10-11 Thread Maurice Marrink
Indeed, wasp and swarm are compiled against jdk 1.4. However, as much
i like you to use swarm, swarm is not a drop in replacement for
auth-roles. So you might want to consider the pro's and con's before
you do that. More info about swarm can be found here
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Security
http://wicketstuff.org/confluence/display/STUFFWIKI/Getting+started+with+Swarm
http://wicketstuff.org/confluence/display/STUFFWIKI/Security+Framework+Comparison

If you have any questions after reading those i will be happy to help you.

Maurice

On 10/10/07, Martijn Dashorst [EMAIL PROTECTED] wrote:
 I doubt the jar will run with jdk 1.4 - it is compiled using jdk 1.5,
 so the version will be not compatible.

 However, the auth-roles project is typically a really, really basic
 security package. If you want more, then I suggest you look at
 swarm/wasp from wicket stuff. This has the additional benefit that
 they are jdk 1.4 all the way (iirc).

 Martijn

 On 10/10/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  not sure, as long as you dont need the annotation part of it should be fine
 
  -igor
 
 
  On 10/10/07, Juan Gabriel Arias [EMAIL PROTECTED] wrote:
   Thanks for the quick answer!
  
   And what about wicket-auth-roles?
   We are using auth-roles 1.2.2 compliant with Java 1.4 and we get that from
   the users list.
  
   Thanks again!
   Juan
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0-beta3 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Scrolling browser to newly visible panel?

2007-10-11 Thread Gwyn Evans




Thanks, I've gone with

  target.appendJavascript(
  "document.getElementById('" + form.getMarkupId() + "').scrollIntoView(false);"
  );

in the onClick(), which seems to do just what I need.

/Gwyn

On Wednesday, October 10, 2007, 9:18:58 PM, Gerolf [EMAIL PROTECTED] wrote:







i found two possibilities to do this (although i haven't tried it with wicket ajax):

var el = document.getElementById('panelInsertedViaAjax');
1)
document.getElementsByTagName('body')[0].scrollTop = el.offsetTop + el.offsetHeight;
2)
el.scrollIntoView(false);
// false to position it to the bottom of the page
// true for the top

Gerolf



On 10/10/07,Gwyn Evans[EMAIL PROTECTED] wrote:
Just wondering if there was anything that might help with the
following?

In a web page design I've been given, I may need to display an
'options' form to get additional input. I'm doing this with Ajax,
but the problem is that it typically appears off the bottom of the
existing page - is there a good way of triggering the browser to do
something like scroll down, ideally to the bottom of the new form?

--
Best regards,
Gwyn mailto:[EMAIL PROTECTED]


-
To unsubscribe, e-mail:[EMAIL PROTECTED]
For additional commands, e-mail:[EMAIL PROTECTED]









/Gwyn




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoCompleteTextfield - how to populate two input fields

2007-10-11 Thread German Morales
Hi,

Sorry, i'm a little late with my response.
Did the suggestion by Nino work?

If it works, i would like to know more details about it.

If not, we already had a somehow similar problem (Swiss addresses), and we
have a different solution already working. Perhaps it can help you too.

Regards,

German


It seems that Nino Saturnino Martinez Vazquez Wael wrote:
 NP, waiting with excitement to hear if it works:)

 Oliver Lieven wrote:
 Thanks allot for your efforts and detailed answer! Sounds good, I'll
 give it
 a try.


 Nino.Martinez wrote:

 No what I meant was that when a user selects something in one  of your
 auto complete fields  they'll automatickly select something in both,
 might have been a little scares on information:

 IModel commonModel=new Model();


 AbstractModel() Text=new AbstractModel(){

 getObject{
 return commonModel.getObject.Text;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }


 AbstractModel() name=new AbstractModel(){

 getObject{
 return commonModel.getObject.name;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }



 AutoCompleteTextField phoneName = new AutoCompleteTextField(
 phoneName, name,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };


 AutoCompleteTextField phoneSeries = new AutoCompleteTextField(
 phoneName, text,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };

 And ofcourse you need to add the other completefield to the
 ajaxresponse...

 Hope this pseudo code works a little better... Was on my way out the
 door before...


 Oliver Lieven wrote:

 Hi Nino,
 thanks for your fast reply. Yes, a shared PropertyModel would help to
 keep
 both fields synchronized.

 I still can't see how this could help me to determine the value
 selected
 by
 the user.
 The AutoComplete works like

 1. getChoices() is called to populate the autocomplete list with my
 zipcode
 - city options
 2. when user selects a value from the autocomplete list, the
 corresponding
 field is set with the textvalue (e.g. the 'city' field is filled
 with
 the
 city's name)
 3. because of this update, the city-field's
 AjaxFormComponentUpdatingBehavior.onUpdate() is called
 4. in onUpdate() the getConvertedInput() method returns the city name,
 which
 is insufficient to determine the corresponding zipcode (because of the
 n:1
 relation (city may have many zipcodes)).

 So I'm still looking for a way to determine the exact combination
 selected
 by the user...

 regards,
 Oliver


 Nino.Martinez wrote:


 Quick answer, why not use property models and use both in the fiields
 you mention?

 Oliver Lieven wrote:


 Hi,

 in an address edit panel I've got the two AutoCompleteText fields
 'zipcode'
 and 'city'.

 When a users begins typing into the zipcode-field, the autocomplete
 shows
 up
 and offers valid zipcode - city combinations. After selecting a
 value
 from
 the autocomplete the 'zipcode' is set. Same for 'city' field, i.e.
 after
 selecting a zipcode - city from the city's autocomplete the
 city-field
 is set accordingly.
 (Thanks for the great autocomplete-support in Wicket which allows
 separation
 of displayvalue and textvalue!)

 Now to my question: after selection of a zipcode - city
 combination
 from
 either autocomplete list I would like to set both fields (zipcode
 and
 city).
 I already attached an AjaxFormComponentUpdatingBehavior which gets
 called
 after a selection in the autocomplete list, but it just gets the
 zipcode/city currently set.
 Since the zipcode-city relation is 1:n (e.g. Berlin has many
 zipcodes)
 I'm
 wondering if there is a way to access the full selected value (and
 not
 only
 the AbstractAutoCompleteTextRenderer.textvalue set).


 Thanks for any help and tips!
 Oliver





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]







 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]







 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Model update with Link

2007-10-11 Thread Mattijs Hoitink

hi,

i'm just starting to use wicket and i have a question regarding updating 
a model when a link is pressed. I will explain my situation.


I have a normal form, with a model attached to it and a button to submit 
it. There is also a link in the form who's only purpose is to enable or 
disable a field.
The problem is, when i  press the link to disable the field, all my data 
from the other fields is lost. It seems like wicket is loading a new 
form when i presse the link, because all the old data from the model is 
presented.


My question is: is it normal wicket loads the page again when a link is 
pressed? and if so, is there a way to update my model first?


--
Mattijs Hoitink
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model update with Link

2007-10-11 Thread Swaroop Belur
 My question is: is it normal wicket loads the page again when a link is
pressed?

- Yes - It renders the page after finishing ur onclick

 and if so, is there a way to update my model first?

Use submitlink  instead of Link if u want to show the new values

-swaroop



On 10/11/07, Mattijs Hoitink [EMAIL PROTECTED] wrote:

 hi,

 i'm just starting to use wicket and i have a question regarding updating
 a model when a link is pressed. I will explain my situation.

 I have a normal form, with a model attached to it and a button to submit
 it. There is also a link in the form who's only purpose is to enable or
 disable a field.
 The problem is, when i  press the link to disable the field, all my data
 from the other fields is lost. It seems like wicket is loading a new
 form when i presse the link, because all the old data from the model is
 presented.

 My question is: is it normal wicket loads the page again when a link is
 pressed? and if so, is there a way to update my model first?

 --
 Mattijs Hoitink
 Func. Internet Integration
 W http://www.func.nl
 T +31 20 423
 F +31 20 4223500


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Model update with Link

2007-10-11 Thread martinf

Maybe SubmitLink is your solution,

usage as an anonymous class could look like this:

add(new SubmitLink(lkjsdf, form) {
public void onSubmit() {
   //Do what you need to do here.
}
});

that way the browser will submit the form and send al the date in the input
fields.


Martin


Mattijs Hoitink wrote:
 
 hi,
 
 i'm just starting to use wicket and i have a question regarding updating 
 a model when a link is pressed. I will explain my situation.
 
 I have a normal form, with a model attached to it and a button to submit 
 it. There is also a link in the form who's only purpose is to enable or 
 disable a field.
 The problem is, when i  press the link to disable the field, all my data 
 from the other fields is lost. It seems like wicket is loading a new 
 form when i presse the link, because all the old data from the model is 
 presented.
 
 My question is: is it normal wicket loads the page again when a link is 
 pressed? and if so, is there a way to update my model first?
 
 --
 Mattijs Hoitink
 Func. Internet Integration
 W http://www.func.nl
 T +31 20 423
 F +31 20 4223500
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Model-update-with-Link-tf4607178.html#a13155954
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model update with Link

2007-10-11 Thread Mattijs Hoitink
I already tried using a SubmitLink. The problem with that is user have 
to complete the whole form (or at least the required fields) before they 
can disable the field with the link. This is because validate() is 
called when the form is submitted, and users receive a message they have 
to fill in the required fields.I want users to be able to disable the 
field even though they did not fill in all the (required) fields.


Secondly, when the form is submitted, the model is send to the database. 
I only want to send the model to the database when the user is 
completely finished with the form, and not when they want to disabled 
the second field of the form. But this can be solved by calling 
findSubmittingButton() in the onSubmit().



martinf wrote:

Maybe SubmitLink is your solution,

usage as an anonymous class could look like this:

add(new SubmitLink(lkjsdf, form) {
public void onSubmit() {
   //Do what you need to do here.
}
});

that way the browser will submit the form and send al the date in the input
fields.


Martin


Mattijs Hoitink wrote:
  

hi,

i'm just starting to use wicket and i have a question regarding updating
a model when a link is pressed. I will explain my situation.

I have a normal form, with a model attached to it and a button to submit
it. There is also a link in the form who's only purpose is to enable or
disable a field.
The problem is, when i  press the link to disable the field, all my data
from the other fields is lost. It seems like wicket is loading a new
form when i presse the link, because all the old data from the model is
presented.

My question is: is it normal wicket loads the page again when a link is
pressed? and if so, is there a way to update my model first?

--
Mattijs Hoitink
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  


--
Mattijs Hoitink
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stateless page creating session

2007-10-11 Thread John Patterson
OK Cool.  I guess I can just comment out session binding until this  
is fixed because for the next couple of weeks all of my pages are  
stateless.


On 11 Oct 2007, at 00:57, Matej Knopp wrote:


Yeah, it's a bug introduced by me recently. Will look at it ASAP.

-Matej

On 10/11/07, John Patterson [EMAIL PROTECTED] wrote:

Also,  the example application stateless is doing the same.

When I go to this page

http://localhost:8080/wicket-examples/stateless/public/Index/

after restarting my browser I get this

a session exists for this client, with session id z4zov2z9j024
go to another stateless page
go to a stateful page (triggers session creation if not already  
done so)


Something is going on here.



On 10 Oct 2007, at 18:24, John Patterson wrote:


Hi,

I have created a page and setStatelessHint(true) and made sure all
the child components are stateless but an http session is still
being created.  The method isPageStateless() returns true.


Here is the trace where the SEssion is created:

com.citikey.site.SessionListener.sessionCreated
(SessionListener.java:29)
  at org.mortbay.jetty.servlet.AbstractSessionManager.addSession
(AbstractSessionManager.java:569)
  at  
org.mortbay.jetty.servlet.AbstractSessionManager.newHttpSession

(AbstractSessionManager.java:414)
  at org.mortbay.jetty.Request.getSession(Request.java:1005)
  at
org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionI 
d(

AbstractHttpSessionStore.java:188)
  at org.apache.wicket.Session.bind(Session.java:415)
  at org.apache.wicket.Component.beforeRender(Component.java: 
855)



This code in Component.beforeRenderlooks suspicious:

  // If any of the components on page is not stateless, we  
need to

bind the session
  // before we start rendering components, as then jsessionid  
won't

be appended
  // for links rendered before first stateful component
  if (isStateless()  getSession().isTemporary())
  {
  getSession().bind();
  }

Cheers,

John






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoCompleteTextfield - how to populate two input fields

2007-10-11 Thread Oliver Lieven

Hi,

thanks for your answer.

No, solution didn't work as supposed, mainly because the AutoComplete fills
the input field in the browser with the data (in my case either zipcode or
city), but doesn't update the model.

To update the model I have to attach some Ajax...Behavior, but this is
called with the data put into the textfield (i.e. either the selected
zipcode put into the zipcode field by the autocomplete, *or* the selected
city from the city field). In the Ajax...Behavior's onUpdate()-method
neither the city nor the zipcode are enough to determine the value to use to
update the related field.

So I had two other ideas:

1. in my autocomplete-list I set the textvalue to the id of a
zipcode-city combination. When the user selects from the
autocomplete-list, this id is written into the corresponding input-field.
The attached AjaxOnChangeBehavior now gets this id, determines the
zipcode-city, and updates the city and the zipcode field. This works, but
looks a little strange to the user (e.g. selection of 71254 Ditzingen from
autocomplete-list writes the id (1223) into the zipcode-field, this issues
the Ajax-call, which updates both fields with the correct data, i.e.
zipcode=71254, city=Ditzingen). As I said, works but not pretty.

2. So I'm currently extended the AutoCompleteTextField, ...Renderer,
...Behavior, ..JavaScript to accept a second, related field in its
constructor. I then attach two attributes to the autocomplete-list entries
(say textvalue and textvalue2), and modified the JavaScript to update both
fields. This seems to me the best approach to my specific problem, and seems
to work as intended.

Hope my answer was not to confusing...
regards,
Oliver


German Morales wrote:
 
 Hi,
 
 Sorry, i'm a little late with my response.
 Did the suggestion by Nino work?
 
 If it works, i would like to know more details about it.
 
 If not, we already had a somehow similar problem (Swiss addresses), and we
 have a different solution already working. Perhaps it can help you too.
 
 Regards,
 
 German
 
 
 It seems that Nino Saturnino Martinez Vazquez Wael wrote:
 NP, waiting with excitement to hear if it works:)

 Oliver Lieven wrote:
 Thanks allot for your efforts and detailed answer! Sounds good, I'll
 give it
 a try.


 Nino.Martinez wrote:

 No what I meant was that when a user selects something in one  of your
 auto complete fields  they'll automatickly select something in both,
 might have been a little scares on information:

 IModel commonModel=new Model();


 AbstractModel() Text=new AbstractModel(){

 getObject{
 return commonModel.getObject.Text;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }


 AbstractModel() name=new AbstractModel(){

 getObject{
 return commonModel.getObject.name;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }



 AutoCompleteTextField phoneName = new AutoCompleteTextField(
 phoneName, name,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };


 AutoCompleteTextField phoneSeries = new AutoCompleteTextField(
 phoneName, text,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };

 And ofcourse you need to add the other completefield to the
 ajaxresponse...

 Hope this pseudo code works a little better... Was on my way out the
 door before...


 Oliver Lieven wrote:

 Hi Nino,
 thanks for your fast reply. Yes, a shared PropertyModel would help to
 keep
 both fields synchronized.

 I still can't see how this could help me to determine the value
 selected
 by
 the user.
 The AutoComplete works like

 1. getChoices() is called to populate the autocomplete list with my
 zipcode
 - city options
 2. when user selects a value from the autocomplete list, the
 corresponding
 field is set with the textvalue (e.g. the 'city' field is filled
 with
 the
 city's name)
 3. because of this update, the city-field's
 AjaxFormComponentUpdatingBehavior.onUpdate() is called
 4. in onUpdate() the getConvertedInput() method returns the city name,
 which
 is insufficient to determine the corresponding zipcode (because of the
 n:1
 relation (city may have many zipcodes)).

 So I'm still looking for a way to determine the exact combination
 selected
 by the user...

 regards,
 Oliver


 Nino.Martinez wrote:


 Quick answer, why not use property models and use both in the fiields
 you mention?

 Oliver Lieven wrote:


 Hi,

 in an address edit panel I've got the two AutoCompleteText fields
 'zipcode'
 and 'city'.

 When a users begins typing into the zipcode-field, the autocomplete
 shows
 up
 and offers valid zipcode - city combinations. After selecting a
 value
 from
 the autocomplete the 'zipcode' is set. Same 

Page expired upon file download + model update

2007-10-11 Thread Federico Fanton
Hi everyone!
I have a form with some fields and a submit button which says Save and print.
The button has setDefaultFormProcessing(false), and overrides onSubmit so that 
the form model object is sent to the persistence layer and printed immediately 
afterwards. The persistence layer *may* alter the object, so I have to reload 
it. My problem is that this reloading causes a page expired when I press the 
button for a second time.

My onSubmit:

if(getForm().process()){
   MyBean data=getForm().getModelObject();

   data=Persistence.save(data);

   // Create PDF and send it to the browser
   IResourceStream s = new ByteArrayResource(application/pdf, 
buildPDF(data)).getResourceStream();
   RequestCycle.get().setRequestTarget( new ResourceStreamRequestTarget(s) );

   getForm().setModelObject(data);
}

I think the page expires because sending the PDF to the browser blocks the 
request cycle, so the browser never renders the new version of the page.. Is 
there a way to do this? Am I doing Something Wrong? ^__^;
Many thanks for your time!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model update with Link

2007-10-11 Thread Igor Vaynberg
setdefaultformprocessing(false)

-igor


On 10/11/07, Mattijs Hoitink [EMAIL PROTECTED] wrote:

 I already tried using a SubmitLink. The problem with that is user have
 to complete the whole form (or at least the required fields) before they
 can disable the field with the link. This is because validate() is
 called when the form is submitted, and users receive a message they have
 to fill in the required fields.I want users to be able to disable the
 field even though they did not fill in all the (required) fields.

 Secondly, when the form is submitted, the model is send to the database.
 I only want to send the model to the database when the user is
 completely finished with the form, and not when they want to disabled
 the second field of the form. But this can be solved by calling
 findSubmittingButton() in the onSubmit().


 martinf wrote:
  Maybe SubmitLink is your solution,
 
  usage as an anonymous class could look like this:
 
add(new SubmitLink(lkjsdf, form) {
public void onSubmit() {
 //Do what you need to do here.
}
});
 
  that way the browser will submit the form and send al the date in the
 input
  fields.
 
 
  Martin
 
 
  Mattijs Hoitink wrote:
 
  hi,
 
  i'm just starting to use wicket and i have a question regarding
 updating
  a model when a link is pressed. I will explain my situation.
 
  I have a normal form, with a model attached to it and a button to
 submit
  it. There is also a link in the form who's only purpose is to enable or
  disable a field.
  The problem is, when i  press the link to disable the field, all my
 data
  from the other fields is lost. It seems like wicket is loading a new
  form when i presse the link, because all the old data from the model is
  presented.
 
  My question is: is it normal wicket loads the page again when a link is
  pressed? and if so, is there a way to update my model first?
 
  --
  Mattijs Hoitink
  Func. Internet Integration
  W http://www.func.nl
  T +31 20 423
  F +31 20 4223500
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 

 --
 Mattijs Hoitink
 Func. Internet Integration
 W http://www.func.nl
 T +31 20 423
 F +31 20 4223500


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DataTable FilterToolbar Shifted After AJAX Call

2007-10-11 Thread UPBrandon

Oh, well that's good to hear.  My team and I are using the last major
release, beta 3.  I will see if a more recent build fixes the problem and
add a Jira ticket if it doesn't.  Are nightly stable builds available
anywhere?

-Brandon


Evan Chooly wrote:
 
 What version of wicket are you using?  I saw this with beta3 but later
 snapshots fixed it for me.  So if you're not on a recent snapshot, you
 might
 consider trying that and seeing if that helps.
 
 On 10/10/07, UPBrandon [EMAIL PROTECTED] wrote:


 I am working on a project that has a DataTable with a filter that uses
 AJAX
 to update an object on the backend and refresh the table, among other
 things.  Everything is working well so far except the columns in the
 filter
 toolbar row are shifted one column to the right after the AJAX refresh.
 Using Firebug to inspect the toolbar row after the update, I see that
 everything is shifted one to the right because Wicket is inserting a
 div
 in the tr before the td's.  So instead of

 tr
 td.../td
 td.../td
 /tr

 I have

 tr
 div/div
 td.../td
 td.../td
 /tr

 The contents of the div are:

 div id=filter-form18 wicket:id=filter-forminput type=hidden
 value= wicket:id=focus-tracker

 name=checkGroup:equipmentDataTable:topToolbars:2:toolbar:filter-form:focus-tracker

 id=queueDetailsPanel:checkForm:checkGroup:equipmentDataTable:topToolbars:2:toolbar:filter-form:focus-tracker//div

 If it makes any difference, when I do the update, I am not updating the
 DataTable directly - I am updating a higher level Panel that contains the
 DataTable.  Has anyone else had any similar problems?

 -Brandon
 --
 View this message in context:
 http://www.nabble.com/DataTable-FilterToolbar-Shifted-After-AJAX-Call-tf4601906.html#a13139327
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable-FilterToolbar-Shifted-After-AJAX-Call-tf4601906.html#a13160984
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ModalWindow bug in IE6?

2007-10-11 Thread Russell Morrisey
Hello again,

I am having a problem with fields not being editable after I close a 
ModalWindow.  I pared the problem down to the bare minimum, and created a 
JIRA issue with a quickstart:
https://issues.apache.org/jira/browse/WICKET-1061
Please let me know if any more info is needed.

Thanks,
Russell Morrisey

Computer Sciences Corporation 
Registered Office: 2100 East Grand Avenue, El Segundo California 90245, 
USA
Registered in USA No: C-489-59


NOTE: Regardless of content, this e-mail shall not operate to bind CSC to 
any order or other contract unless pursuant to explicit written agreement 
or government initiative expressly permitting the use of e-mail for such 
purpose.



Re: TabbedPanel with image tabs - how to contribute ?

2007-10-11 Thread Erik van Oosten

Easy!

Go to http://cwiki.apache.org/WICKET/, click on Edit page, get yourself 
an account. After you've logged in go back to the main page, then find 
the page called 'Reference Library', with at the bottom 'Wicket 
Reference'. Find a suitable place there to describe the TabbedPanel.


Good work!
   Erik.


Stefan Simik wrote:

very good idea :)
How can I contribute ? ..or where can I send example with full sources ?
  


--
Erik van Oosten
http://2008.rubyenrails.nl/
http://day-to-day-stuff.blogspot.com/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validating a NonZero Values and Validators Project in General

2007-10-11 Thread Francisco Diaz Trepat - gmail
Hi, I am using Apache Wicket 1.3.0-beta2 and want to have a nonzero positive
validator, a nonzero negative, and a nonzero positive or negative.

I saw that wicket comes with the NumberValidator.minimum maximun etc.

Will there be more validators added to the framework?

Is there a stuff project or smaller project in which to contribute?

Could I have these validators without implementing my own?

f(t)


Apache Wicket 1.3.0-beta4 released!

2007-10-11 Thread Frank Bille
This is the fourth beta for Apache Wicket we have prepared for your
pleasure. It contains over 120 fixes to issues with previous releases and
todo items we have cleared.

In this announcement:

* Apache Wicket
* This release
** Portlet support
* Migrating from 1.2
* Downloading the release
* Validating the release
* Reporting bugs

Eager people click here to download the distribution, others can read
further:

http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

We thank you for your patience and support. Given the current list of
remaining issues and the fact that we have just accepted portlet support
back in, we think a fifth beta release is necessary. But that is no excuse
for not giving this fourth installment a test drive!

The Wicket Team

-= Apache Wicket =-

Apache Wicket is a component oriented Java web application framework
currently undergoing incubation at the Apache Software foundation. With
proper mark-up/logic separation, a POJO data model, and a refreshing lack of
XML, Apache Wicket makes developing web-apps simple and enjoyable again.
Swap the boilerplate, complex debugging and brittle code for powerful,
reusable components written with plain Java and HTML.

Our migration to a top level project is now completed and you can find our
website and documentation here:

http://wicket.apache.org

-= This release =-

This release is the fourth in a series of beta releases until we feel
confident to finalize Wicket 1.3. This is called a beta because we don't
have fixed all bugs, and probably haven't found them all either.

-- Portlet support --

A new feature in this beta4 release is the merge of Ate Douma's portlet
branch into trunk. This reintroduces portlet support in Wicket.

http://cwiki.apache.org/WICKET/portal-howto.html

-= Migrating from 1.2 =-

If you are coming from Wicket 1.2, you really want to read our migration
guide, found on the wiki:

http://cwiki.apache.org/WICKET/migrate-13.html

-= Downloading the release =-

You can download the release from the official Apache mirror system, and you
can find it through the following link:

http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

For the Maven and Ivy fans out there: update your pom's to the following,
and everything will be downloaded automatically:

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket/artifactId
version1.3.0-beta4/version
/dependency

Substitute the artifact ID with the projects of your liking to get the other
projects.

Please note that we don't prescribe a Logging implementation for SLF4J. You
need to specify yourself which one you prefer. Read more about SLF4J here:
http://slf4j.org

-= Validating the release =-

The release has been signed by Frank Bille, your release manager for today.
The public key can be found in the KEYS file in the download area. Download
the KEYS file only from the Apache website.

http://www.apache.org/dist/wicket/1.3.0-beta4/KEYS

Instructions on how to validate the release can be found here:

http://www.apache.org/dev/release-signing.html#check-integrity

-= Reporting bugs =-

In case you do encounter a bug, we would appreciate a report in our JIRA:

http://issues.apache.org/jira/browse/WICKET

-= The distribution =-

In the distribution you will find a README. The README contains instructions
on how to build from source yourself and a list of all things that have been
fixed, added and/or removed since the first beta release.


-= Release Notes - Wicket - Version 1.3.0-beta4 =-

** Bug
* [WICKET-349] - ListView can't undo changes to model
* [WICKET-470] - AjaxFormComponentUpdatingBehavior won't work for
RadioChoices
* [WICKET-497] - For stateless mounted page incorrect url is generated
* [WICKET-520] - Escape doesn't work for AjaxEditableLabel in Firefox
* [WICKET-572] - replacing tr using ajax does not work in safari
* [WICKET-611] - AbstractRequestTargetUrlCodingStrategy ignores query
parameters if there is no parameter in the path
* [WICKET-631] - Resource.getParameters() empty when resource is mounted
* [WICKET-635] - FormTester Does Not Properly Handle DropDownChoice With
Null Model
* [WICKET-640] - modal window close button does not cancel the event
after closing the window
* [WICKET-685] - ReloadingWicketFilter not working with markup
inheritance
* [WICKET-705] - StringValue javadoc incorrect regrading conversion to
checked exception
* [WICKET-707] - Invoking a request listener on a page returns an
Expired Error page
* [WICKET-722] - IndicatingAjaxFallbackLink does not remove indicator if
the link itself is added via ajax
* [WICKET-728] - WicketTester could not handle Multipart form without
upload
* [WICKET-735] - SqlTimestampConverter and it's Date and Time friends
die on null and other breakage.
* [WICKET-745] - AbstractAjaxTimerBehavior triggered more than expected
after a new Ajax rendering
* [WICKET-756] - FormComponent.getValue uses equals instead of 

Re: AutoCompleteTextfield - how to populate two input fields

2007-10-11 Thread German Morales
Hi again,

Yes, we have something similar to what you describe in your point 2.

The only difference is that we have other structure. What we have is the
following:

-Each locality has an internal ID, a Zip Code, a City and a (swiss) kanton.

-in the html we have a Hidden, which stores the internal ID, and 1 (only)
TextField, which shows Zip Code + City + Canton (For example: 8052
Seebach, ZH).

-then we have an extension as you mention (AutoCompleteTextField,
Renderer, Behavior, JavaScript), which is already working with this
schema. It also contains many fixes over the original
autocompletetextfield (perhaps originated from the extra behavior?).

If this approach is good for you, i can send you our version, plus some
example usages.

Regards,

German


It seems that Oliver Lieven wrote:

 Hi,

 thanks for your answer.

 No, solution didn't work as supposed, mainly because the AutoComplete
 fills
 the input field in the browser with the data (in my case either zipcode or
 city), but doesn't update the model.

 To update the model I have to attach some Ajax...Behavior, but this is
 called with the data put into the textfield (i.e. either the selected
 zipcode put into the zipcode field by the autocomplete, *or* the selected
 city from the city field). In the Ajax...Behavior's onUpdate()-method
 neither the city nor the zipcode are enough to determine the value to use
 to
 update the related field.

 So I had two other ideas:

 1. in my autocomplete-list I set the textvalue to the id of a
 zipcode-city combination. When the user selects from the
 autocomplete-list, this id is written into the corresponding input-field.
 The attached AjaxOnChangeBehavior now gets this id, determines the
 zipcode-city, and updates the city and the zipcode field. This works, but
 looks a little strange to the user (e.g. selection of 71254 Ditzingen
 from
 autocomplete-list writes the id (1223) into the zipcode-field, this
 issues
 the Ajax-call, which updates both fields with the correct data, i.e.
 zipcode=71254, city=Ditzingen). As I said, works but not pretty.

 2. So I'm currently extended the AutoCompleteTextField, ...Renderer,
 ...Behavior, ..JavaScript to accept a second, related field in its
 constructor. I then attach two attributes to the autocomplete-list entries
 (say textvalue and textvalue2), and modified the JavaScript to update both
 fields. This seems to me the best approach to my specific problem, and
 seems
 to work as intended.

 Hope my answer was not to confusing...
 regards,
 Oliver


 German Morales wrote:

 Hi,

 Sorry, i'm a little late with my response.
 Did the suggestion by Nino work?

 If it works, i would like to know more details about it.

 If not, we already had a somehow similar problem (Swiss addresses), and
 we
 have a different solution already working. Perhaps it can help you too.

 Regards,

 German


 It seems that Nino Saturnino Martinez Vazquez Wael wrote:
 NP, waiting with excitement to hear if it works:)

 Oliver Lieven wrote:
 Thanks allot for your efforts and detailed answer! Sounds good, I'll
 give it
 a try.


 Nino.Martinez wrote:

 No what I meant was that when a user selects something in one  of
 your
 auto complete fields  they'll automatickly select something in both,
 might have been a little scares on information:

 IModel commonModel=new Model();


 AbstractModel() Text=new AbstractModel(){

 getObject{
 return commonModel.getObject.Text;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }


 AbstractModel() name=new AbstractModel(){

 getObject{
 return commonModel.getObject.name;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }



 AutoCompleteTextField phoneName = new AutoCompleteTextField(
 phoneName, name,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };


 AutoCompleteTextField phoneSeries = new AutoCompleteTextField(
 phoneName, text,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };

 And ofcourse you need to add the other completefield to the
 ajaxresponse...

 Hope this pseudo code works a little better... Was on my way out the
 door before...


 Oliver Lieven wrote:

 Hi Nino,
 thanks for your fast reply. Yes, a shared PropertyModel would help
 to
 keep
 both fields synchronized.

 I still can't see how this could help me to determine the value
 selected
 by
 the user.
 The AutoComplete works like

 1. getChoices() is called to populate the autocomplete list with my
 zipcode
 - city options
 2. when user selects a value from the autocomplete list, the
 corresponding
 field is set with the textvalue (e.g. the 'city' field is filled
 with
 the
 city's name)
 3. because of this 

Re: Validating a NonZero Values and Validators Project in General

2007-10-11 Thread Gwyn Evans
On Thursday, October 11, 2007, 8:06:47 PM, Francisco [EMAIL PROTECTED] wrote:

 Hi, I am using Apache Wicket 1.3.0-beta2 and want to have a nonzero positive
 validator, a nonzero negative, and a nonzero positive or negative.

 I saw that wicket comes with the NumberValidator.minimum maximun etc.
 Will there be more validators added to the framework?
 Is there a stuff project or smaller project in which to contribute?
 Could I have these validators without implementing my own?

You could supply a patch to NumberValidator, but they're not really
complex, e.g.

/**
 * Validator to check the number is greater than zero 
 */
public class PositiveLongValidator extends AbstractValidator {
protected void onValidate(IValidatable validatable) {
final long value = ((Number) validatable.getValue()).longValue();
if (!(value  0)) {
error(validatable);
}
}
}

/Gwyn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache Wicket 1.3.0-beta4 released!

2007-10-11 Thread Martijn Dashorst
This is a special occasion for the Wicket project:

According to me, Wicket 1.3.0-beta4 is the first release performed by
another person than myself, since we became an open source project at
sourceforge. It most certainly is the first in a couple of years
though.

Special thanks go to Frank for making this release reality!

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache Wicket 1.3.0-beta4 released!

2007-10-11 Thread Eelco Hillenius
 Special thanks go to Frank for making this release reality!

Yay!

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache Wicket 1.3.0-beta4 released!

2007-10-11 Thread Martijn Dashorst
Copy paste is a bitch :)

 Apache Wicket is a component oriented Java web application framework
 currently undergoing incubation at the Apache Software foundation. With
  ^
 proper mark-up/logic separation, a POJO data model, and a refreshing lack of

Frank, where did you get the template from? We should fix this one.

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Jetty classloader

2007-10-11 Thread John Patterson

Hi,

I am having problems deploying my app on Jetty getting this message:

org.apache.wicket.WicketRuntimeException: Application class  
com.hello.site.HelloApplication must be a subclass of WebApplication
at  
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.create 
Application(ContextParamWebApplicationFactory.java:78)
at  
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.create 
Application(ContextParamWebApplicationFactory.java:51)


I imagine that Jetty is using two classloaders, one for the Filter  
and one for my application classes.  Has anyone else had this problem?


Thanks,

John

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Jetty classloader

2007-10-11 Thread John Patterson
Ooops!  Posted too soon... I had simply removed wicket from my pom by  
mistake and Eclipse had not shown any build errors but did remove the  
import statement from my Application.  Might have to change this  
setting!



On 11 Oct 2007, at 14:37, John Patterson wrote:


Hi,

I am having problems deploying my app on Jetty getting this message:

org.apache.wicket.WicketRuntimeException: Application class  
com.hello.site.HelloApplication must be a subclass of WebApplication
at  
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.crea 
teApplication(ContextParamWebApplicationFactory.java:78)
at  
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.crea 
teApplication(ContextParamWebApplicationFactory.java:51)


I imagine that Jetty is using two classloaders, one for the Filter  
and one for my application classes.  Has anyone else had this problem?


Thanks,

John



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Jetty classloader

2007-10-11 Thread Gwyn Evans
On Thursday, October 11, 2007, 9:37:27 PM, John [EMAIL PROTECTED] wrote:

 I imagine that Jetty is using two classloaders, one for the Filter
 and one for my application classes.  Has anyone else had this problem?

No, but different classloaders would suggest you've deployed the Wicket jar 
somewhere other than
in the web app's WEB-INF/lib/, wouldn't it?  Is that the case?

/Gwyn


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache Wicket 1.3.0-beta4 released!

2007-10-11 Thread Frank Bille
Crap.. Knew I should have got a second oppinion on it :(

http://martijndashorst.com/blog/2007/08/29/wicket-13-beta-3-released/

Frank


On 10/11/07, Martijn Dashorst [EMAIL PROTECTED] wrote:

 Copy paste is a bitch :)

  Apache Wicket is a component oriented Java web application framework
  currently undergoing incubation at the Apache Software foundation. With
   ^
  proper mark-up/logic separation, a POJO data model, and a refreshing
 lack of

 Frank, where did you get the template from? We should fix this one.

 Martijn

 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0-beta4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Updating distant (unrelated) components via Ajax when a shared model changes

2007-10-11 Thread MattClark

All,

We're building an application which in some respects needs to behave like a
desktop client, where actions in one part of the UI affect components in
another portion of the UI.  Our specific case was that we had a left-nav
which contained some links, and a content area which contains an
AjaxTabbedPanel.  The links in the left-nav need to be rendered
visible/invisible based on the type of content in the currently selected
tab.

Since we didn't want to have a hard reference from the tab panel to the left
nav panel (because we wanted them to be relatively reusable components), we
decided to create a custom model that is shared between the two.  We then
used the attached class/interfaces to:

1) Enable the tab panel to notify the tab model that it has changed it via
Ajax
2) Enable the model in turn to notify the left-nav panel that its model has
changed
3) Allow the left-nav panel to re-render itself by adding it to the
AjaxRequestTarget

So, in our implementation we have a TabModel, which extends AjaxAwareModel. 
The LefNavPanel implements AjaxModelAware, and has an indirect reference to
the TabModel. When the currently selected tab is changed via Ajax in the
AjaxTabbedPanel, we call getTabModel().notifyModelChanged(this, target). 
The AjaxAwareModel code then looks for any component in the page which
extends AjaxModelAware, and notifies them that the tab model changed.

I'm posting this code because 1) I hope it will prove useful to someone
else, and 2) I'd appreciate any feedback, as I'd rather learn about major
design issues I overlooked sooner rather than later!  I see two improvements
we could make.  First, add generics to AjaxModelAware, so we can reduce the
number of components who are notified about the model changing by only
looking for components implementing the typed AjaxModelAware interface. 
Second, move the code in AjaxAwareModel into some sort of helper class so
that models can participate in this mechanism without having to extend that
class.

BTW, thanks to Frank Bille who actually started me down the path which led
to this.

http://www.nabble.com/file/p13165777/AjaxAwareModel.java AjaxAwareModel.java 
http://www.nabble.com/file/p13165777/AjaxModelAware.java AjaxModelAware.java 
http://www.nabble.com/file/p13165777/AjaxUpdateAware.java
AjaxUpdateAware.java 

Thanks in advance for any thoughts!
Matt Clark
-- 
View this message in context: 
http://www.nabble.com/Updating-distant-%28unrelated%29-components-via-Ajax-when-a-shared-model-changes-tf4610276.html#a13165777
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoCompleteTextfield - how to populate two input fields

2007-10-11 Thread Oliver Lieven

Hi German,

thanks for your offer, would be great if you could send me your code.

BTW, in the meantime I got my 2nd approach working, too. I've got the two
separate textfields, each of them showing the zipcode - city autocomplete
lists when data is entered. After selecting from the autocomplete list, both
fields are updated correctly! 

Regards,
Oliver 



German Morales wrote:
 
 Hi again,
 
 Yes, we have something similar to what you describe in your point 2.
 
 The only difference is that we have other structure. What we have is the
 following:
 
 -Each locality has an internal ID, a Zip Code, a City and a (swiss)
 kanton.
 
 -in the html we have a Hidden, which stores the internal ID, and 1 (only)
 TextField, which shows Zip Code + City + Canton (For example: 8052
 Seebach, ZH).
 
 -then we have an extension as you mention (AutoCompleteTextField,
 Renderer, Behavior, JavaScript), which is already working with this
 schema. It also contains many fixes over the original
 autocompletetextfield (perhaps originated from the extra behavior?).
 
 If this approach is good for you, i can send you our version, plus some
 example usages.
 
 Regards,
 
 German
 
 
 It seems that Oliver Lieven wrote:

 Hi,

 thanks for your answer.

 No, solution didn't work as supposed, mainly because the AutoComplete
 fills
 the input field in the browser with the data (in my case either zipcode
 or
 city), but doesn't update the model.

 To update the model I have to attach some Ajax...Behavior, but this is
 called with the data put into the textfield (i.e. either the selected
 zipcode put into the zipcode field by the autocomplete, *or* the selected
 city from the city field). In the Ajax...Behavior's onUpdate()-method
 neither the city nor the zipcode are enough to determine the value to use
 to
 update the related field.

 So I had two other ideas:

 1. in my autocomplete-list I set the textvalue to the id of a
 zipcode-city combination. When the user selects from the
 autocomplete-list, this id is written into the corresponding input-field.
 The attached AjaxOnChangeBehavior now gets this id, determines the
 zipcode-city, and updates the city and the zipcode field. This works, but
 looks a little strange to the user (e.g. selection of 71254 Ditzingen
 from
 autocomplete-list writes the id (1223) into the zipcode-field, this
 issues
 the Ajax-call, which updates both fields with the correct data, i.e.
 zipcode=71254, city=Ditzingen). As I said, works but not pretty.

 2. So I'm currently extended the AutoCompleteTextField, ...Renderer,
 ...Behavior, ..JavaScript to accept a second, related field in its
 constructor. I then attach two attributes to the autocomplete-list
 entries
 (say textvalue and textvalue2), and modified the JavaScript to update
 both
 fields. This seems to me the best approach to my specific problem, and
 seems
 to work as intended.

 Hope my answer was not to confusing...
 regards,
 Oliver


 German Morales wrote:

 Hi,

 Sorry, i'm a little late with my response.
 Did the suggestion by Nino work?

 If it works, i would like to know more details about it.

 If not, we already had a somehow similar problem (Swiss addresses), and
 we
 have a different solution already working. Perhaps it can help you too.

 Regards,

 German


 It seems that Nino Saturnino Martinez Vazquez Wael wrote:
 NP, waiting with excitement to hear if it works:)

 Oliver Lieven wrote:
 Thanks allot for your efforts and detailed answer! Sounds good, I'll
 give it
 a try.


 Nino.Martinez wrote:

 No what I meant was that when a user selects something in one  of
 your
 auto complete fields  they'll automatickly select something in both,
 might have been a little scares on information:

 IModel commonModel=new Model();


 AbstractModel() Text=new AbstractModel(){

 getObject{
 return commonModel.getObject.Text;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }


 AbstractModel() name=new AbstractModel(){

 getObject{
 return commonModel.getObject.name;
 }
 setObject(obj){
 commonModel.setObject(obj)
 }

 }



 AutoCompleteTextField phoneName = new AutoCompleteTextField(
 phoneName, name,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };


 AutoCompleteTextField phoneSeries = new AutoCompleteTextField(
 phoneName, text,
 new BestEffortRendererAutoCompleteRenderer()) {
 @Override
 protected Iterator getChoices(String input) {

 return findItems(input);
 }
 };

 And ofcourse you need to add the other completefield to the
 ajaxresponse...

 Hope this pseudo code works a little better... Was on my way out the
 door before...


 Oliver Lieven wrote:

 Hi Nino,
 thanks for your fast reply. Yes, a shared PropertyModel would help
 to
 keep
 both fields 

POM problems in trunk?

2007-10-11 Thread Tauren Mills
I just updated wicket, wicket-extensions and wicket-examples from
trunk. When I tried to run mvn install eclipse:eclpise, I got errors
stating that there were dependencies missing versions.  So I added
versions to the pom.xml for wicket and wicket-examples. Now mvn runs.

Am I doing something wrong, or do the pom.xml files in trunk need
versions?  Changing them to contain version params did the trick, but
should it work without them?

wicket/pom.xml:

dependency
groupIdjavax.portlet/groupId
artifactIdportlet-api/artifactId
version1.0/version
scopeprovided/scope
optionaltrue/optional
/dependency
dependency
groupIdorg.apache.portals.bridges/groupId
artifactIdportals-bridges-common/artifactId
version1.0.3/version
scopeprovided/scope
optionaltrue/optional
/dependency

wicket-examples/pom.xml:

dependency
groupIdjavax.portlet/groupId
artifactIdportlet-api/artifactId
version1.0/version
scopeprovided/scope
/dependency

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]