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>
Related
I am not able to see my lightning component when trying to create a lighting tab. Something is wrong with one of the components -
I moved the component and tab using salesforce dx and when editing the component. I am getting below error. I seems like one of the component is throwing an error when i am trying to edit the record -
Error = Review all error messages below to correct your data.
You can only create lightning tabs for AuraDefinitionBundles containing a component that implements force:appHostable and has no required attributes without a default value. (Related field: Content)
Observation - When i remove the attribute from parent component and child component than its working and i am able to save the tab. Something is not correct with my component initiation.
Code in parent Component -
<aura:if isTrue="{!!v.customTab}">
<div aura:id="defaultTabContent" class="slds-show">
<c:ApiRequestFieldMapping custom="false" objectName="Credit_Report__c"/>
</div>
</aura:if>
<aura:if isTrue="{!v.customTab}">
<div aura:id="customTabContent" class="slds-hide">
<c:ApiRequestFieldMapping custom="true" listSObjects="
{!v.listSObjects}" message="Select object from drop-down."
messageClass="Info"/>
</div>
Code in Child Component -
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<aura:registerEvent name="handleModelVisiblity" type="c:HandleModel"/>
<!-- attributes -->
<aura:attribute name="custom" type="Boolean"/>
<aura:attribute name="objectName" type="String"/>
<aura:attribute name="listSObjects" type="String[]"/>
<aura:attribute name="message" type="String"/>
<aura:attribute name="messageClass" type="String"/>
<aura:attribute name="listSObjectFields" type="String[]"
required="false"/>
<aura:attribute name="customObjectName" type="String"
required="false"/>
<aura:attribute name="listWrapper"
type="RequestMappingWrapper.MappingRecords[]" required="false"/>
Already Tried - 1. My component is already implementing "force:appHostable" interface.
2. The component us using latest version.(40.0)
3. Have already tried creating the components.
4. My org has my domain enabled and also have namespace.
I have fixed the issue. I have removed the reference to inner class in one of the attribute. Changed "RequestMappingWrapper.MappingRecords[]" to "RequestMappingWrapper[]".
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.
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>
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 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>