[Lift] Re: About the ajaxButton's confirm ?

2009-10-26 Thread Marius

That is exactly what I described above does. jsFunc: Call is the
javascript function call that will receive an extra parameter which is
the function that does your Ajax call. You can choose whne to invoke
the ajax call.

Do you need a more concrete example?

Br's,
Marius

On Oct 26, 4:07 am, Neil.Lv anim...@gmail.com wrote:
   The work flow is like this:

   1. When pressing the button, the js function will be executed, like
 the js confirm() method,
        if choose the 'NO' and nothing will be happen, but choose the
 'YES' and the Ajax request is
        sent to the server
   2. On server side Lift executes your scala function

 Cheers,
   Neil

 On Oct 25, 11:18 pm, Marius marius.dan...@gmail.com wrote:

  Please use this definition of the ajax button:

    def ajaxButton(text: NodeSeq, jsFunc: Call, func: () = JsCmd,
  attrs: (String, String)*): Elem

  I described the functionality 
  here:http://groups.google.com/group/liftweb/browse_thread/thread/ec573c0e3...
  .. see the last post.

  Let me know if you have further questions.

  Br's,
  Marius

  On Oct 25, 1:24 pm, Neil.Lv anim...@gmail.com wrote:

   Hi all,

     I use the ajaxButton to delete the record from the database, and How
   can the ajaxButton surpport

     the confirm dialog when clicking the delete button(ajaxButton) ?

     1:)
     I use this method that it will be show the confirm dialog when
   clicking the delete button, but it never call the deleteItemFromDb()
   method.
   ###
   ajaxButton(S.?(delete), Call(confirm, Str(are you sure?)), () =
   {deleteItemFromDb(); reDraw()})
   ###

     2:)
      When clicking the delete button, the record will be deleted from
   the db, but it doesn't show the
   confrim dialog (the js confirm dialog) .
   ###
   ajaxButton(S.?(delete), () = {deleteItemFromDb(); reDraw();})

     Thanks for any suggestion !

   Cheers,
     Neil

   ###
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: About the ajaxButton's confirm ?

2009-10-25 Thread Marius

Please use this definition of the ajax button:

  def ajaxButton(text: NodeSeq, jsFunc: Call, func: () = JsCmd,
attrs: (String, String)*): Elem

I described the functionality here:
http://groups.google.com/group/liftweb/browse_thread/thread/ec573c0e3052a862/038920885900c7d6?lnk=gstq=ajaxButton#038920885900c7d6
.. see the last post.

Let me know if you have further questions.

Br's,
Marius

On Oct 25, 1:24 pm, Neil.Lv anim...@gmail.com wrote:
 Hi all,

   I use the ajaxButton to delete the record from the database, and How
 can the ajaxButton surpport

   the confirm dialog when clicking the delete button(ajaxButton) ?

   1:)
   I use this method that it will be show the confirm dialog when
 clicking the delete button, but it never call the deleteItemFromDb()
 method.
 ###
 ajaxButton(S.?(delete), Call(confirm, Str(are you sure?)), () =
 {deleteItemFromDb(); reDraw()})
 ###

   2:)
    When clicking the delete button, the record will be deleted from
 the db, but it doesn't show the
 confrim dialog (the js confirm dialog) .
 ###
 ajaxButton(S.?(delete), () = {deleteItemFromDb(); reDraw();})

   Thanks for any suggestion !

 Cheers,
   Neil

 ###
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: About the ajaxButton's confirm ?

2009-10-25 Thread Neil.Lv


  The work flow is like this:

  1. When pressing the button, the js function will be executed, like
the js confirm() method,
   if choose the 'NO' and nothing will be happen, but choose the
'YES' and the Ajax request is
   sent to the server
  2. On server side Lift executes your scala function

Cheers,
  Neil


On Oct 25, 11:18 pm, Marius marius.dan...@gmail.com wrote:
 Please use this definition of the ajax button:

   def ajaxButton(text: NodeSeq, jsFunc: Call, func: () = JsCmd,
 attrs: (String, String)*): Elem

 I described the functionality 
 here:http://groups.google.com/group/liftweb/browse_thread/thread/ec573c0e3...
 .. see the last post.

 Let me know if you have further questions.

 Br's,
 Marius

 On Oct 25, 1:24 pm, Neil.Lv anim...@gmail.com wrote:

  Hi all,

I use the ajaxButton to delete the record from the database, and How
  can the ajaxButton surpport

the confirm dialog when clicking the delete button(ajaxButton) ?

1:)
I use this method that it will be show the confirm dialog when
  clicking the delete button, but it never call the deleteItemFromDb()
  method.
  ###
  ajaxButton(S.?(delete), Call(confirm, Str(are you sure?)), () =
  {deleteItemFromDb(); reDraw()})
  ###

2:)
 When clicking the delete button, the record will be deleted from
  the db, but it doesn't show the
  confrim dialog (the js confirm dialog) .
  ###
  ajaxButton(S.?(delete), () = {deleteItemFromDb(); reDraw();})

Thanks for any suggestion !

  Cheers,
Neil

  ###

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---