How can I update / set Mask of telerik RadMaskedTextBox at client side (using javascript / jquery) - telerik

I want to set / update mask of telerik RadMaskedTextBox at client side. Please help !
<telerik:RadMaskedTextBox RenderMode="Lightweight" runat="server"
ID="txtTest" Mask="(###) ###-####">
</telerik:RadMaskedTextBox>

Related

Primefaces responsive data table displaying sort drop down in all cases

I am using a very basic example of responsive data table as follows:
<p:dataTable value="#{personManagedBean.personList}" var="person" reflow="true">
<p:column sortBy="#{person.firstName}" headerText="First Name">
#{person.firstName}
</p:column>
<p:column sortBy="#{person.lastName}" headerText="Last Name">
#{person.lastName}
</p:column>
</p:dataTable>
The issue is that, once i make a column sortable by using the sortBy attribute, an extra drop down starts appearing on top of the data table for the respective column (as shown in the attached image).
I realize that this behavior is coming because i have made the data table responsive, but ideally it should appear only when the screen size is minimized enough that the responsiveness of the UI is active i.e. when the layout of data table's columns changes and becomes stacked. It should not appear in all cases.
Please suggest if there is a way to achieve the required behavior. Thanks.
Environment:
Primefaces version: 5.3.11
JSF version: 2.2
Browser: Firefox 45.0.2, Chrome 50.0.2661.94 m

p:spinner p:ajax and f:param mixed together, bean method executed multiple times

I'm developping with Primefaces 4.0, JSF Mojarra 2.1.7 and jBoss_7.1.1_Final.
The tool I'm creating is mainly a dialog window showing a dataTable with dynamic columns (p:columns)
Those dynamic columns show a pSpinner like this :
<p:spinner id="updateQj_#{colIndex}_#{rowQj.idQbt}" widgetVar="updateQjJs_#{colIndex}_#{rowQj.idQbt}" stepFactor="1" min="0" max="#{rowQj.qbtType}"
value="#{rowQj.quantiteDuJour(qjColonne.property)}" onkeydown="return false;"
styleClass="editQj" rendered="#{not verrouille}" title="Cliquez ici pour modifier la quantité journalière" >
<p:ajax listener="#{recherche.updateQj}" update="#this, :formRecherche:growl" process="#this"/>
<f:param name="idQbt" value="#{rowQj.idQbt}"/>
<f:param name="jour" value="#{qjColonne.property}"/>
<f:param name="ligne" value="#{rowIndex}"/>
<f:param name="colonne" value="#{colIndex}"/>
</p:spinner>
</p:column>
</p:columns>
Everything seems to be working fine till for some unknown reason, the click in one of the columns modifies the current value plus the one previously updated in another column. To see it clearly: if I keep clicking/updating spinners in the same column everything works fine. If I click a spinner of another column it updates both. Any idea would be greatly appreciated.
in primefaces4, p:spinner in a cell made of p:columns>p:column doesn't behave like it should, first clicks work but at some moments, a simple click generates incessant ajax calls as if i clicked each spinner in each cell...After several days of workaround, and thinking that pf makes usage of jquery under the cover i tried by myself. Surprisingly, firebug console logged 'spinner is not a function' and jquery.ui.version was 1.10.3 so i downloaded 1.10.4 on jquery's site and included it in my header after other javascripts. jquery.ui.version showed 1.10.4 and no more error message appeared. :)
Finally, i wrote this in each p:column of p:columns in a p:datatable
<input id="updateQj_#{rowIndex}_#{colIndex}_#{rowQj.idQbt}" widgetVar="updateQjJs" class="editQj" value="#{rowQj.listeDesQj[colIndex].quantiteRealisee}"> ‌​
</input>
<script type="text/javascript">
jQuery("input[id=updateQj_#{rowIndex}_#{colIndex}_#{rowQj.idQbt}]")
.spinner‌​({ min:0,
max:#{rowQj.qMax},
step:1,
change:function(){ rmt_updateQj([parameters]); } });
</script>

RadioButtonList not triggering ajax postback

I have an ASP.Net RadioButtonList control with AutoPostBack set to true and a server side handler for the SelectedIndexChanged event.
<asp:RadioButtonList runat="server" ID="btnAcceptReject" RepeatDirection="Horizontal" CssClass="checkboxlist borderless" ValidationGroup="data" AutoPostBack="true" OnSelectedIndexChanged="radioButtonList_SelectedIndexChanged">
<asp:ListItem Text="The edition is hereby validated for conformity to standards" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="The edition does not meet standards and still has to be reviewed" Value="1"></asp:ListItem>
</asp:RadioButtonList>
I am using a RadAjaxManager, a telerik control, to handle ajax postbacks
<telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerPRoxy1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnAcceptReject">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlControls" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
pnlControl is a panel on the page containing controls that will be enabled/disabled depending on which radio button was checked.
The above always performs a full postback of the page.
how can i make it perform an ajax partial postback?
Could it be a result of you using RadAjaxManagerProxy instead of RadAjaxManager?
RadAjaxManagerProxy expects that there is a RadAjaxManager declared elsewhere within a Master Page etc.
If that fails then I suggest to alter the pnlControl to become a RadAjaxPanel and then remove the RadAjaxManagerProxy declaration as the RadAjaxPanel will do all the work for you.
Good luck!
In reply to your comments, I would now suggest to do the following within the referencing ASPX page (if that is possible under your scenario):
Add a RadAjaxManagerProxy to the client-side
Within the code-behind add a new Sub to be called during Page_Load (outside the postback check)
Within the Sub:
Dim panel As Panel = CType(myUserControl.FindControl("pnlControls"),Panel)
Dim radio As RadioButtonList = CType(myUserControl.FindControl("btnAcceptReject"), RadioButtonList)
RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(radio, panel, Nothing)
*Nothing - Optionally a RadAjaxLoadingPanelID if you have one declared on the .ASPX page
Hope it helps!

jqGrid custom pager search button

We have our custom button that is ASP.NET custom server control. We use it on all our pages for action buttons (< NS:OurButton ID='btn' runat="server" Text="Search"/ >).
Now we want to use that button to open our custom search form to filter the records in jqGrid.
Our business requirement that the search button must be a part of jqGrid pager.
How I can do it? I tried to search google and wiki help for jqGrid, but didn't found any way how to add that custom search button to the jqGrid pager.
If it's matters, the button rendered to the client in that markup:
<div id="btn" class="OurCustomButton">
<div class="LeftSide"></div>
<div class="ButtonContent">Search</div>
<div class="RightSide"></div>
</div>
Or maybe it's possible to create totally my own custom pager, with my own design and buttons and then to tell the jqGrid to use it's controls as triggers or to trigger events on my own with correct parameters?
One solution I can think of is to use jQuery's insertBefore()(or insertAfter) and have the html for your button inserted on the document.ready() event.
The code could be:
jQuery(document).ready(function(){
$('<div class="ButtonContent">Search</div>').insertBefore('.RightSide');
});

Primefaces Change menu entry via ajax an rerender content on full layout

I am trying to get a simple full layout to work with a navigation on the left side.
That works but I want to reload the center (content) via ajax on menu item selection.
The reason is, that I have a MP3 player on the right side and if the whole page reloads the mp3 player
start the playback again.
On Richfaces I did that with a session bean which holds the actual filename that needs to be rendered in the center
and on menu click the action method analyses the menu entry ID and sets the filename to its corresponding.
Actually that works a little bit for primefaces as well, but the content doesn't render correctly. After punshing F5
it is perfect.
Does anybody can give me a real simple example how I can do that?
Many greetings,
Hauke
I have never use menuitem but with commandButton I just use 'update' notation to refresh the form located in the center content via ajax.
On navigation layoutUnit
<p:commandButton
value="Enter"
image="ui-icon ui-icon-comment"
update="form_input_console form_output_console:tabbed_contents"
actionListener="#{dashboardUi.processCommand}" />
and on the center layout unit
<p:layoutUnit position="center">
<h:form id="form_output_console">
<p:tabView
id="tabbed_contents"
dynamic="true">

Resources