Nyt i 8.5.3: view.postScript

Med denne ‘event’ kan du kører Client Side JavaScript efter Server Side JavaScript har kørt. Eksempel fra OpenNTF Snippets: Display Client-Side alert if Server-Side validation fails

<xp:label id="label1">
 <xp:this.value><![CDATA[#{javascript:/** If there are any messages for this request, run the client-side JavaScript after the viewRoot response is completed **/
 if(facesContext.getMessages().hasNext()){
 var x="alert('THE DOCUMENT WAS NOT SAVED.\\n\\nAll required fields were not completed or they do not contain valid data.\\n\\nPlease review the fields and correct any errors.');";
 view.postScript(x);
 }}]]></xp:this.value>
</xp:label>

Ovenstående stump kode vil fint kunne løse dette problem -> http://xpages.dk/?p=297 mht.  Service Side Validation og Partial Update

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *

*