Note that there are some explanatory texts on larger screens.

plurals
  1. POexecute an action and request a signature if needed
    text
    copied!<p>I am trying to develop a component where a signature is requiered from a user to complete a certain operation here is the sequence:</p> <ol> <li>User clicks on a commandButton or commandLink.</li> <li>A popup opens requesting the user to enter the username/password</li> <li>If the user enters the correct username/password the original action is executed.</li> <li>If the user enters the wrong username/password or clicks the cancel button nothing happens.</li> <li>Finally when the action is really executed the signature information should be available.</li> </ol> <p>Note: the solution should be a composite component that should have the following structure:</p> <pre><code>&lt;myCC:confirm action="#{testMB.delete}" singatureType="deleteObject"/&gt; </code></pre> <p>What I did to implement this behavior is:</p> <ol> <li><p>Created a view scoped managed bean <strong>SignatureMB</strong> to handle the signature with the properties (username, password, and signatureType)</p></li> <li><p>Created a request scoped managed bean <strong>#{testMB}</strong> with a managed property mapped to the <strong>#{signatureMB}</strong></p></li> <li><p>in my composite component <strong>myCC:confirm</strong> I created two links an outputLink that will open a popup with the signature form, the second is a hidden commandLink that will contain the real action to submit i.e. <strong>#{testMB.delete}</strong></p></li> <li><p>The signature form is posted and if the username/password are correct the popup will close itself and trigger the click event of the hidden commandLink.</p></li> <li><p>Finally in the <strong>#{testMB.delete}</strong> I will have the signature information, and be able to process the information and when done I will reset the values in the <strong>signatureMB</strong>.</p></li> </ol> <p>What do you think about this implementation? do you think there is a better way to do it? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload