我有一个PrimeFaces // SignalR plumbing
var hub, hubStart;
hub = $.connection.smartAppHub;
hubStart = $.connection.hub.start().done(function () {
if ($.connection.hub.state === $.signalR.connectionState.connected) {
console.log('SignalR is connected.');
console.log('Call the server method to monitor changes to Grid4');
hub.server.monitorGrid4DataChanges();
};
});
hub.client.grid4Read = function () {
console.log('Called grid4Read()');
};
hub.client.iDidSomething = function (response) {
console.log('I was told to do something\r\n' + response);
};
hub.client.gridUpdate = function (response) {
console.log("Entered hub.client.gridUpdate");
// Will show alerts when something moves.
// Plan on adjusting this via the 'Settings' menu.
var showNotification = true;
// Go get the order/load from the database
var ordHeaderId = response['OrdHeaderId'];
var loadId = response['LoadId'];
var newStatus = response['NewStatus'];
if (showNotification) {
//setToastrOptions();
//toastr["info"]("Grid update to loadId: " + loadId);
}
console.log('Client-side fromSqlDependency:\r\nOrdHeaderId: ' + ordHeaderId + '\r\nLoadId: ' + loadId + '\r\nNewStatus: ' + newStatus);
};
组件。
需要根据相关的侦听器更改其掩码。
<p:inputMask>
如果信用卡是AMEX,则需要屏蔽例如:<p:inputMask id="creditCardMask"
value="#{controllerCard.creditCard.creditCardNumber}"
mask="#{controllerCard.creditCardType.creditCardType}">
<p:ajax event="keyup"
process="@this keyCodePressedInInput"
update="creditCardImage creditCardMask creditCardInput"
listener="#{controllerCard.listenerCardNumber}" />
</p:inputMask>
,但如果这是万事达卡,则应为999-999
。
所以我需要使用999-999-999
ajax事件更新组件本身,但是每次从侦听器到辅助bean的请求都会重置它。
如何保留输入文本的值?