I have/can have only one Jquery dialog box. This dialog box has some advertisement content to the User. On reading it, a User can avail the offer or ignore it for the time being.
User can avail the offer by clicking on Submit button inside the dialog box. Or he can ignore it by clicking on "Remind me later" link which will close the dialog box. Contents inside dialog box are updated through Ajax. So when Submit button is clicked, a thank you message is shown inside the same dialog box.
When User avails the offer, "Remind me later" link would still be there. If User clicks on that, logically, dialog box should be shown again. But, User has already availed the offer!
How can I render or not render Close link of Jquery dialog box programatically?
Code for dialog box is below,
$h(document).ready(function() {
$h("#showForm").dialog({
open: function(event, ui) {
jQuery('.ui-dialog-titlebar-close').html('<span>Remind me later</span>');
jQuery('.ui-dialog-content').removeClass("ui-dialog-content").addClass("advertise-upgrade-content");
},
duration: 800,
height: 727,
minWidth: 811,
width: 811,
position: ['middle', 154],
zIndex: 99999999,
modal: true,
show: {
effect: 'puff',
duration: 400
},
hide: {
effect: 'puff',
duration: 400
}
});
});
<div id="showForm" height: 670px;">
<div class="submitClass">
<a4j:commandLink immediate="true" action="#{myBean.clickToAvail}" reRender="renderSuccess" value="Submit">
</a4j:commandLink>
</div>
<h:panelGroup id="renderSuccess">
<h:outputText value="Thank you for availing this offer">
</h:panelGroup>
</div>
Am using jquery.min.js
, jquery-1.6.2.js
, jquery-ui.min.js
.