Friday, May 7, 2010

Can 29 Years Old Can Put Teeth Braces?

JBoss WebService connection - DNS can not resolve IP is required

following problem with me with the setup JSF2.0 jQuery 1.4 and show: (the whole thing on GlassFish v3 (hence mojarra created as JSF implementation)

How to make a "cool" security question in connection with a two JSF AJAX action?
More precisely, how can before calling a two JSF CommandButton AJAX Action jQuery UI hide a dialog in which the classic "Do you want wirklcih" is queried
to a side I have a table with ui: repeat is . Each line can be edited and deleted as well. The deletion is represented by a symbol (X ') at the end of the line.
This is as follows: \u0026lt;td>
\u0026lt; h: command button action
=

"# {schlagView.removeWorking (working.tempIdent)}"
image

=
"./img/delete-icon.png"                 
styleClass

=
>
            <
f:ajax render
=
"@form"
execute =
"@ form"
/>

\u0026lt;/
h: CommandButton >
\u0026lt;/ td> works perfectly as an AJAX event! increase J
To the usability but something that would obviously be a security warning beautiful. can via JavaScript, this simply determined as follows:
\u0026lt; td> \u0026lt;
h: CommandButton onclick = "return confirm (' Really? ') " ; action = "#{schlagView.removeWorking(working.tempIdent)}"                        image =
"./img/delete-icon.png"                        styleClass
= "listRemove"
>
           
< f:ajax
render =
"@form"
execute = "@form"
/>             </ h:commandButton > </
td >
                                               JSF translated when rendering the page it accordingly so that the JavaScript onclick event is as follows:
onclick = "jsf.util.chain (this, event, 'return confirm (\\' really \\ ');',' mojarra.ab (this, event, \\' action \\ ', \\' @ form \\ ', \\' @ shape \\')'); return false
here just for the event is' NO 'stopped' and nothing happens. Works perfectly! J In order to increase the usability but something more would, of course, a good looking prompt great. A security check based on a jQuery UI Confirm dialogue such as ... The problem here is, though, that is realized in the dialogue of the jQuery event of the buttons via callback function. This means the actual JSF AJAX call is then gone already. What you would be required commandAction synchronous processing of the dialog callback function to call in the JSF. With the following lines of code can do this:
JSF code:
\u0026lt; h:commandButton onclick =
"return removeRow(this);"
                
action =

"#{schlagView.removeWorking(working.tempIdent)}"
                 image =

"./img/delete-icon.png"
                 styleClass
=
"listRemove" >
     
<
f:ajax
render
=

"@form"
execute
=
"@form"
/> \u0026lt;/ h: commandButton >
JavaScript Code: var
confirmOk = false ;
function RemoveRow (elem) {
if ( ! confirmOk) {             $( '#dialog-confirm' ).dialog({                   width:500,                   modal: ,
true buttons: { 'true' :

function () {
confirmOk = true ; ; $ (Element). Click (); Confirmed = false
;
; $( this ).dialog(
'close' );                         },
                       
'No way' : function () {
;. $ (
this ) dialog ( 'close' ) ; }
                  }             });       }    
     
return confirmOk; };

This is called before the JSF AJAX call the JavaScript method removeRow
. The first call is confirmOk == false and thus the jQuery dialog appears. The method is however further processed directly, and provides first false , preventing further access the JSF AJAX calls.
jQuery is in dialogue that is true '(OK) is clicked, the variable confirmOk on true and set the Click event of the CommandButton
triggered again ( $ (elem). click () ). If the method is executed at this time, but it provides a true back

JSF and AJAX call is in progress.

Works J

0 comments:

Post a Comment