Re: How to make the link to a wicket page from an external website?

2013-04-27 Thread Martin Grigorov
Hi,

Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-pages/


On Sat, Apr 27, 2013 at 5:57 AM, mike.hua hz...@sohu.com wrote:

 Oh,I know!
 The BookmarkablePageLink helped me!

 If I want to get the wicket page access url,I can use
 http://website/wicket/bookmarkable/packageName.TargetPageClass;!

 Thanks!



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-make-the-link-to-a-wicket-page-from-an-external-website-tp4658313p4658336.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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


Re: Ajax call of textfield after pressing the Enter key

2013-04-27 Thread Martin Grigorov
Hi,


On Sat, Apr 27, 2013 at 12:31 AM, Andre Schütz wic...@faustas.de wrote:

 Hello,

 I tried to find out how I can make a Ajax call from a textfield after
 pressing the Enter key. I want to reach the following:
 - The user types a name into the textfield
 - After pressing the Enter key, the value of the textfield will be
 processed on the server side

 I tried AjaxFormSubmitBehavior and AjaxFormComponentUpdatingBehavior
 without success.
 Can anyone help me with an example?


Both behaviors will do the job.
You should listen on keypress or keyup event and you should have a
AjaxCallListener precondition that checks that the pressed key is Enter
(Wicket.Event.keyCode(attrs.event) === 27)



 --
 Andre Schütz wic...@faustas.de

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




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


Re: Ajax call of textfield after pressing the Enter key

2013-04-27 Thread vineet semwal
hi,
just minor correction, enter key is 13 ..



On Sat, Apr 27, 2013 at 11:34 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,


 On Sat, Apr 27, 2013 at 12:31 AM, Andre Schütz wic...@faustas.de wrote:

  Hello,
 
  I tried to find out how I can make a Ajax call from a textfield after
  pressing the Enter key. I want to reach the following:
  - The user types a name into the textfield
  - After pressing the Enter key, the value of the textfield will be
  processed on the server side
 
  I tried AjaxFormSubmitBehavior and AjaxFormComponentUpdatingBehavior
  without success.
  Can anyone help me with an example?
 

 Both behaviors will do the job.
 You should listen on keypress or keyup event and you should have a
 AjaxCallListener precondition that checks that the pressed key is Enter
 (Wicket.Event.keyCode(attrs.event) === 27)


 
  --
  Andre Schütz wic...@faustas.de
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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




-- 
regards,

Vineet Semwal


Re: Example for saving value edited in Text Box on exit event

2013-04-27 Thread Martin Grigorov
Hi Bruno,

What is the current problem ?
I think your code should work.
But you may either change the event to 'change', 'blur' or 'input' or at
least add throttling (I don't remember the syntax for 1.4) because now it
will fire Ajax event for every typed character.

Ah, and Wicket 1.4/1.5 work with inline attributes so you need the 'on'
prefix - onkeyup.

On Fri, Apr 26, 2013 at 11:10 PM, Bruno Moura brunormo...@gmail.com wrote:

 Hi Martin

 I trying to add a TextField in a list view as is showed bellow:

 val detail = new TextField(detail, new PropertyModel(objItem,
 description))
   detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
 protected def onUpdate(target: AjaxRequestTarget) {
 objItemDAO.saveObjItem(objItem)
 }
 })
 item.add(detail)

 I need to save the object objItem immediately after the user finishes
 editing this. Maybe this component
 coulb be changed by a inline label, but I need to some example that could
 works with wicket 1.4.

 Thanks again Martin for your help.




 Bruno Moura


 2013/4/26 Martin Grigorov mgrigo...@apache.org

  Hi,
 
  There is no 'exit' event.
  Please give us more details. And show us what you have so far.
 
 
  On Fri, Apr 26, 2013 at 8:54 PM, Bruno Moura brunormo...@gmail.com
  wrote:
 
   Hi someone please could give me an example for saving value edited in
  Text
   Box, inside a listview, via ajax on exit event.
  
   I need a example of this implementation for wicket 1.4 and if its
  possible
   in scala.
  
   Thanks
  
  
  
   Bruno Moura
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 




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


Submit button without form component

2013-04-27 Thread Bertrand Guay-Paquet

Hello,

I have action links which I want to transform to POST actions since they 
can have side-effects on the database. (See 
http://stackoverflow.com/questions/679013/get-vs-post-best-practices) My 
understanding is that this is only possible with either javascript or forms.


I decided (for now) to use forms since they're more accessible and 
easier to do while keeping the page stateless. I was hoping to use 
markup like so:

form action=. method=post
button wicket:id=doItdo it!/button
/form

Note that there is only a Button component and no Form. Since the form 
contains only the button, I'd really like to omit it from the component 
hierarchy to keep things simple. Is this possible? I can't get my 
Buttons onSubmit() method called... One part of the problem is that the 
action attribute gets changed automatically by Wicket to a relative 
path to the application context root.


Or is there another better way to achieve POSTing in Wicket?

Regards,
Bertrand

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



Re: Submit button without form component

2013-04-27 Thread Martin Grigorov
Hi,

I haven't tried something like this before and I don't know what exactly
breaks but the simplest solution I see at the moment is to use
StatelessForm.


On Sat, Apr 27, 2013 at 4:01 PM, Bertrand Guay-Paquet 
ber...@step.polymtl.ca wrote:

 Hello,

 I have action links which I want to transform to POST actions since they
 can have side-effects on the database. (See http://stackoverflow.com/**
 questions/679013/get-vs-post-**best-practiceshttp://stackoverflow.com/questions/679013/get-vs-post-best-practices)
 My understanding is that this is only possible with either javascript or
 forms.

 I decided (for now) to use forms since they're more accessible and easier
 to do while keeping the page stateless. I was hoping to use markup like so:
 form action=. method=post
 button wicket:id=doItdo it!/button
 /form

 Note that there is only a Button component and no Form. Since the form
 contains only the button, I'd really like to omit it from the component
 hierarchy to keep things simple. Is this possible? I can't get my Buttons
 onSubmit() method called... One part of the problem is that the action
 attribute gets changed automatically by Wicket to a relative path to the
 application context root.

 Or is there another better way to achieve POSTing in Wicket?

 Regards,
 Bertrand

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




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


Form not displaying messages correctly

2013-04-27 Thread Taro Fukunaga
I have a FencedFeedbackPanel inside a form but when I try to display a
message, the form closes and the message is displayed on the main page
instead of in my form. The form is in turn inside a modal window (see
hierarchy below). When I have invalid input, I want my form (and modal
window) to stay open and the error message displayed on that form so that
the user can correct it. 

public class MyForm extends Form {
  public MyForm {
FencedFeedbackPanel feedbackPanel = new FencedFeedbackPanel(
myFeedbackPanel, this );
feedbackPanel.setOutputMarkupId( true );
add( feedbackPanel );
...
  }
}

I am also using a FormValidator and am adding it to my field for validation.

public class MyForm extends Form {
  public MyForm {
   ...
   final TextFieldInteger myInput = new TextFieldInteger( myInput, new
IModelInteger() {
   add( new MyFormValidator( myInput ) );

The code for MyFormValidator is similar to
http://blog.armstrongconsulting.com/?p=40, except that I'm using a 
TextFieldInteger instead of a TextArea. Like the example, in my code I am
just saying error() in the validator and am expecting it to display inside
the form.

?xml version=1.0 encoding=UTF-8 ?
wicket:panel xmlns:wicket=http://wicket.apache.org;
  div id=myPanel
form id=myForm wicket:id=myForm

  

The Hierarchy is like this:

MyPage
  |
MyModalWindow
  |
MyPanel
  |
MyForm
  |
Input Field

I'm using Wicket 6.5

Thank you.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-not-displaying-messages-correctly-tp4658351.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