ExtJs Set Parameters Values - extjs

I have a form with some controls (extJs and ASP) like this:
<ext:ComboBox ID="Countries" runat="server" .../>
<asp:CheckBox ID="cb1" runat="server" />
I want to send parameters using BaseParams of the store object:
<ext:Parameter Name="cid" Value="Ext.get('#{Countries}').getValue()" />
<ext:Parameter Name="cbv" Value="#{cb1}.dom.checked" />
and that became:
Ext.apply( options.params,{
"cid":Ext.get('CountryCities1_Countries').getValue(),
"cbv":Ext.get("CountryCities1_cb1").dom.checked}
);
as you see get the value from ASP.Net checkbox is simpler than extJs Combobox... Do you know other clean way to get the combobox value?

I found it... Just like this:
<ext:ComboBox ...>
<Listeners>
<Select Handler=" #{myStore}.reload({ params: {cid: this.value}});" />
</Listeners>
</ext:ComboBox>

Related

ExtJs4 - Form defined in javascript multicombo loaded at runtime

When the form is initially loaded the multicombo on the form correctly reflects the data that is set up.
However, if I attempt to update the information at runtime, the list of options in the multicombo aren't updated when the form is displayed.
I have them successfully defined as form options, they have a simple 'text' only store. However, I can't seem to find the correct set of properties and method to actually update the multicombo from the C# code as needed.
I've noticed this as well. You can set the Ext.net.ListItems on page-load but they are fickle when it comes to setting them dynamically in code-behind. I now always use a Ext.net.Store with any Multicombo or ComboBox that needs to dynamically change.
You can use the Handler events on Focus or BeforeSelect to reload the list.
<ext:ComboBox ID="ComboBoxTransferGroupMembers" runat="server" FieldLabel="Transfer To" EmptyText="Group Members" LabelAlign="Top" DisplayField="Name" ValueField="Id" MarginSpec="0 0 5">
<Listeners>
<Focus Handler="#{ComboBoxTransferGroupMembers}.store.reload()" />
</Listeners>
<Store>
<ext:Store runat="server" OnReadData="StoreTransferGroupMember_ReadData" ID="StoreXferGroup">
<Model>
<ext:Model IDProperty="Id" runat="server">
<Fields>
<ext:ModelField Name="Name" />
<ext:ModelField Name="Id" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Mode="Raw" Name="Group" Value="#{ComboBoxTransferGroup}.getValue()" />
</Parameters>
</ext:Store>
</Store>
<DirectEvents>
<Select OnEvent="ComboBoxTransferGroupMembers_Select">
<ExtraParams>
<ext:Parameter Mode="Raw" Name="Group" Value="#{ComboBoxTransferGroup}.getValue()" />
</ExtraParams>
</Select>
</DirectEvents>
</ext:ComboBox>

ExtJS 3.4/Ext.NET: Changes aren't reflected on grid with Ext.data.Record.set('field', value)

It's a pretty small problem but it's been bugging me for a while. Let's go with a very simplified example:
Store:
<ext:Store ID="myStore" runat="server" UseIdConfirmation="true">
<Reader>
<ext:JsonReader IDProperty="fieldId">
<Fields>
<ext:RecordField Name="myField" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
Grid:
<ext:GridPanel ID="myGrid" runat="server" StoreID="myStore Width="200">
<ColumnModel>
<Columns>
<ext:Column ColumnID="myField" Header='My Field' DataIndex="myField" AutoDataBind="true" Width="180" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" MoveEditorOnEnter="false" SingleSelect="true" />
</SelectionModel>
</ext:GridPanel>
For simplicity's sake, let's say I have the following inside a button's listener into the grid:
<Click Handler="changeRowValue(rowIndex, myGrid)" />
Javascript snippet:
var newValue = 'foo';
var changeRowValue = function(rowIndex, grd){
var store = grd.getStore();
store.getAt(rowIndex).set('myField', newValue);
}
This way, the store value is updated but it won't show 'foo' in the grid.
I know a simple
grd.view.refresh()
will update the grid, but it cleans the "dirt" and I'd like it dirty (that sounded nasty) to give the user feedback that the value hasn't been commited yet (you know, the small red arrow in the upper right corner).
This isn't a big deal in any extent and I know it can be done because I've done it before (I just can't remember where or how), so what's wrong here?
PS: I can't stress enough that this is a VERY simplified vision of the actual problem so there might be something in-between messing things up, but I find it to be very unlikely.
try using , myStore.reload();
function ,be sure u declare "onRead" function inside the store which reload the grid data
[
<ext:Store ID="myStore" runat="server" UseIdConfirmation="true" onRead="Load_Grid_Data">
<Reader>
<ext:JsonReader IDProperty="fieldId">
<Fields>
<ext:RecordField Name="myField" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
var newValue = 'foo';
var changeRowValue = function(rowIndex, grd){
var store = grd.getStore();
store.getAt(rowIndex).set('myField', newValue);
store .reload();
}
and codebehind
protected void Load_Grid_Data (){//load grid}
]
whenever u call the reload function ,It triger onread function.

Select only one radio button in a row with telerik radgrid

I have 2 radio button columns in telerik radgridview, I want to have selected only one radio button in a row How to do this ?
As user1834059 said, use the GroupName property. The GroupName should be unique for each row, so use your DataKey or any other dataItem value that would be unique for each row (some id).
<telerik:RadGrid ID="RadGrid1" runat="server" >
<MasterTableView
DataKeyNames="myDataKey">
<Columns>
...Your columns...
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="radioButton1" runat="server"
Text="Your text"
GroupName='{Binding myDataKey}' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="radioButton2" runat="server"
Text="Your text"
GroupName='{Binding myDataKey}' />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

calendar in Primefaces Mobile

I am looking at picking a date in Primefaces Mobile with "calendar" component:
<p:calendar value="#{bean.date}" pattern="MM/dd/yyyy HH:mm" />
The calendar pops up but it looks very odd. It overlaps the page content in a transparent way.
Is there a work around for this issue? Or a way to get it pop up correctly inside a dialog? Maybe to combine another framework with Primefaces?
By the way, the dialog seems not to work too in Primefaces Mobile.
Thanks
Primefaces Mobile is really great and is still under development but it doesn't implement Jquery mobile extensions like "datebox". I find a way to combine both. I included the jquery-datebox library in the header of a JSF page (see link):
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pm="http://primefaces.prime.com.tr/mobile"
xmlns:p="http://primefaces.prime.com.tr/ui"
contentType="text/html">
<pm:page title="Faces">
<f:facet name="postinit">
<h:outputStylesheet library="css" name="jquery.mobile-1.0b3.min.css" />
<h:outputStylesheet library="css" name="jquery.mobile.datebox.min.css" />
<h:outputScript library="primefaces" name="mobile/mobile.js" />
<h:outputScript library="js" name="jquery.mobile.datebox.min.js" />
</f:facet>
<!-- Main View -->
<pm:view id="main" swatch="b">
<pm:header title="Hello">
<f:facet name="left">
<pm:button value="Back" icon="back" role="back"/>
</f:facet>
</pm:header>
<pm:content>
<h:form id="myform">
<h:outputText value="Input: " />
<h:inputText id="input" />
</h:form>
</pm:content>
<label for="mydate">Date: </label>
<input name="mydate" id="mydate" type="date" data-role="datebox" value="#{mybean.date}"
data-options='{"mode": "calbox"}' />
<div data-role="fieldcontain">
<label for="slider">Duration: </label>
<input type="range" name="slider" id="slider"
value="#{mybean.duration}" min="1" max="10" />
</div>
<pm:content>
<h:form id="Form">
<pm:field>
<h:outputLabel for="duration" value="duration: "/>
<pm:slider id="duration" min="1" max="10" value="#{mybean.duration}"/>
</pm:field>
</h:form>
</pm:content>
</pm:view>
</pm:page>
</f:view>
The datepicker works well but both sliders inside and outside a pm-view (see the code) are displayed like normal inputs!
Any suggestions? Thanks
PS: #administrator: a new tag is needed: "Primefaces-mobile"

How to work in Crystal Report with Object Data Source?

How to work in Winforms Crystal Report with Object Data Source?
So far I have found web-links to use Crystal Report with DataSets or Databases directly.
Can anyone show me how to do it like this?
its the same as before...
reportDocument.SetDataSource(List1);
<CR:CrystalReportViewer ID="crvmyDataReport" runat="server"
ReportSourceID="crsmyData" EnableDatabaseLogonPrompt="False" DisplayGroupTree="False"
EnableParameterPrompt="False" ReuseParameterValuesOnRefresh="True"
BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" />
<br />
<CR:CrystalReportSource ID="crsmyData" runat="server">
<Report FileName="myData.rpt">
<DataSources>
<CR:DataSourceRef DataSourceID="odsmyData" TableName="myData" />
</DataSources>
</Report>
</CR:CrystalReportSource>
<asp:ObjectDataSource ID="odsmyData" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="myDataQuery"
TypeName="myDataAppTableAdapters.myDataTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="tb1" ConvertEmptyStringToNull="False"
DbType="String" Name="p1" PropertyName="Text" />
<asp:ControlParameter ControlID="tb2" ConvertEmptyStringToNull="False"
DbType="String" Name="p2" PropertyName="Text" />
<asp:ControlParameter ControlID="tb3" ConvertEmptyStringToNull="False"
DbType="String" Name="p3" PropertyName="Text" />
<asp:ControlParameter ControlID="ddl1" ConvertEmptyStringToNull="False"
DbType="String" Name="p4" PropertyName="SelectedValue" />
</SelectParameters>
</asp:ObjectDataSource>

Resources