Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 16/285 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Javascript: Make a static code, dynamic - List of inputs

    - by BoDiE2003
    I have this code, that checks some ids and enable others, the javascript is pretty clear about what it does, but since it corresponds to some specific id ranges, I cant do just a look until it finishes, but I'm looking a way to do this dynamic and save 40 lines of code (or more), since its not the best way. function loopGroup1() { var a = 0; do { $$('.selectedAuthorities-3_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox1(); }); dynamicCheckbox1(); }); a++; } while (a < 4); } function dynamicCheckbox1() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable = ($$('.selectedAuthorities-3_0:checked').length > 0) ? true : false; var doEnable1 = ($$('.selectedAuthorities-3_1:checked').length > 0) ? true : false; var doEnable2 = ($$('.selectedAuthorities-3_2:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-4_' + i).each(function(item) { if (doEnable || doEnable1 || doEnable2) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 2 * * */ function loopGroup2() { var a = 0; do { $$('.selectedAuthorities-5_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox2(); }); dynamicCheckbox2(); }); a++; } while (a < 4); } function dynamicCheckbox2() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable3 = ($$('.selectedAuthorities-5_0:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-6_' + i).each(function(item) { if (doEnable3) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 3 * * */ function loopGroup3() { var a = 0; do { $$('.selectedAuthorities-6_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox3(); }); dynamicCheckbox3(); }); a++; } while (a < 4); } function dynamicCheckbox3() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable4 = ($$('.selectedAuthorities-6_0:checked').length > 0) ? true : false; var doEnable5 = ($$('.selectedAuthorities-6_1:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-7_' + i).each(function(item) { if (doEnable4 || doEnable5) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 4 * * */ function loopGroup4() { var a = 0; do { $$('.selectedAuthorities-9_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox4(); }); dynamicCheckbox4(); }); a++; } while (a < 4); } function dynamicCheckbox4() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable6 = ($$('.selectedAuthorities-9_0:checked').length > 0) ? true : false; var doEnable7 = ($$('.selectedAuthorities-9_1:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-10_' + i).each(function(item) { if (doEnable6 || doEnable7) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); };

    Read the article

  • Dynamic parameters for XSLT 2.0 group-by

    - by Ophileon
    I got this input <?xml version="1.0" encoding="UTF-8"?> <result> <datapoint poiid="2492" period="2004" value="1240"/> <datapoint poiid="2492" period="2005" value="1290"/> <datapoint poiid="2492" period="2006" value="1280"/> <datapoint poiid="2492" period="2007" value="1320"/> <datapoint poiid="2492" period="2008" value="1330"/> <datapoint poiid="2492" period="2009" value="1340"/> <datapoint poiid="2492" period="2010" value="1340"/> <datapoint poiid="2492" period="2011" value="1335"/> <datapoint poiid="2493" period="2004" value="1120"/> <datapoint poiid="2493" period="2005" value="1120"/> <datapoint poiid="2493" period="2006" value="1100"/> <datapoint poiid="2493" period="2007" value="1100"/> <datapoint poiid="2493" period="2008" value="1100"/> <datapoint poiid="2493" period="2009" value="1110"/> <datapoint poiid="2493" period="2010" value="1105"/> <datapoint poiid="2493" period="2011" value="1105"/> </result> and I use this xslt 2.0 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="result"> <xsl:for-each-group select="datapoint" group-by="@poiid"> <node type="poiid" id="{@poiid}"> <xsl:for-each select="current-group()"> <node type="period" id="{@period}" value="{@value}"/> </xsl:for-each> </node> </xsl:for-each-group> </xsl:template> </xsl:stylesheet> to convert it into <?xml version="1.0" encoding="UTF-8"?> <node type="poiid" id="2492"> <node type="period" id="2004" value="1240"/> <node type="period" id="2005" value="1290"/> <node type="period" id="2006" value="1280"/> <node type="period" id="2007" value="1320"/> <node type="period" id="2008" value="1330"/> <node type="period" id="2009" value="1340"/> <node type="period" id="2010" value="1340"/> <node type="period" id="2011" value="1335"/> </node> <node type="poiid" id="2493"> <node type="period" id="2004" value="1120"/> <node type="period" id="2005" value="1120"/> <node type="period" id="2006" value="1100"/> <node type="period" id="2007" value="1100"/> <node type="period" id="2008" value="1100"/> <node type="period" id="2009" value="1110"/> <node type="period" id="2010" value="1105"/> <node type="period" id="2011" value="1105"/> </node> Works smoothly. Where I got stuck is when I tried to make it more dynamic. The real life input has 6 attributes for each datapoint instead of 3, and the usecase requires the possibility to set the grouping parameters dynamically. I tried using parameters <xsl:param name="k1" select="'poiid'"/> <xsl:param name="k2" select="'period'"/> but passing them to the rest of the xslt is something that I can't get right. The code below doesn't work, but clarifies hopefully, what I'm looking for. <xsl:template match="result"> <xsl:for-each-group select="datapoint" group-by="@{$k1}"> <node type="{$k1}" id="@{$k1}"> <xsl:for-each select="current-group()"> <node type="{$k2}" id="@{$k2}" value="{@value}"/> </xsl:for-each> </node> </xsl:for-each-group> </xsl:template> Any help appreciated..

    Read the article

  • Dyanmic crm onSave change the value

    - by jk
    Hi I got one assignment on Dynamic CRM 4. We have one custome entity and it has one attribute called 'Issue Number' this attributes value generated by Plug-in when it save. When form will created meaning onLoad it will display blank value(text box is empty). But now we want to check that number is existing then concate with some random number. For that I wrote following javascript. if((event.Mode == 1) || (event.Mode == 2) ) { var varIssueNumber = crmForm.all.new_issueNumber.DataValue; alert(varIssueNumber); } but it is giving 'null'. Can anybody please let me know how can I get the value of text field? thanks in advance

    Read the article

  • jQuery for dynamic Add/Remove row function, it's clone() objcet cannot modify element name

    - by wcy0942
    I'm try jQuery for dynamic Add/Remove row function, but I meet some question in IE8 , it's clone() objcet cannot modify element name and cannot use javascript form (prhIndexed[i].prhSrc).functionKey, but in FF it works very well, source code as attachment, please give me a favor to solve the problem. <html> $(document).ready(function() { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Define some variables - edit to suit your needs //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // table id var _table = jQuery("#prh"); // modify here // tbody tbody var _tableBody = jQuery("tbody",_table); // buttons var _addRowBtn = jQuery("#controls #addRow"); var _insertRowBtn= jQuery("#controls #insertRow"); var _removeRowBtn= jQuery("#controls #removeRow"); //check box all var _cbAll= jQuery(".checkBoxAll", _table ); // add how many rows var _addRowsNumber= jQuery("#controls #add_rows_number"); var _hiddenControls = jQuery("#controls .hiddenControls"); var blankRowID = "blankRow"; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //click the add row button //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _addRowBtn.click(function(){ // when input not isNaN do add row if (! isNaN(_addRowsNumber.attr('value')) ){ for (var i = 0 ; i < _addRowsNumber.attr('value') ;i++){ var newRow = jQuery("#"+blankRowID).clone(true).appendTo(_tableBody) .attr("style", "display: ''") .addClass("rowData") .removeAttr("id"); } refreshTable(_table); } return false; //kill the browser default action }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //checkbox select all //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _cbAll.click(function(){ var checked_status = this.checked; var prefixName = _cbAll.attr('name'); // find name prefix match check box (group of table) jQuery("input[name^='"+prefixName+"']").each(function() { this.checked = checked_status; }); }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Click the remove all button //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _removeRowBtn.click(function(){ var prefixName = _cbAll.attr('name'); // find name prefix match check box (group of table) jQuery("input[name^='"+prefixName+"']").not(_cbAll).each(function() { if (this.checked){ // remove tr row , ckbox name the same with rowid jQuery("#"+this.name).remove(); } }); refreshTable(_table); return false; }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Click the insert row button //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _insertRowBtn.click(function(){ var prefixName = _cbAll.attr('name'); jQuery("input[name^='"+prefixName+"']").each(function(){ var currentRow = this.name;// ckbox name the same with rowid if (this.checked == true){ newRow = jQuery("#"+blankRowID).clone(true).insertAfter(jQuery("#"+currentRow)) .attr("style", "display: ''") .addClass("rowData") .removeAttr("id"); } }); refreshTable(_table); return false; }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Function to refresh new row //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function refreshTable(_table){ var tableId = _table.attr('id'); var count =1; // ignore hidden column // update tr rowid jQuery ( "#"+tableId ).find(".rowData").each(function(){ jQuery(this).attr('id', tableId + "_" + count ); count ++; }); count =0; jQuery ( "#"+tableId ).find("input[type='checkbox'][name^='"+tableId+"']").not(".checkBoxAll").each(function(){ // update check box id and name (not check all) jQuery(this).attr('id', tableId + "_ckbox" + count ); jQuery(this).attr('name', tableId + "_" + count ); count ++; }); // write customize code here customerRow(_table); }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Function to customer new row : modify here //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function customerRow(_table){ var form = document.myform; var pageColumns = ["prhSeq", "prhChannelproperty", "prhSrc"]; //modify here var tableId = _table.attr('id'); var count =1; // ignore hidden column // update tr rowid jQuery ( "#"+tableId ).find(".rowData").each(function(){ for(var i = 0; i < pageColumns.length; i++){ jQuery ( this ).find("input[name$='"+pageColumns[i]+"']").each(function(){ jQuery(this).attr('name', 'prhIndexed['+count+'].'+pageColumns[i] ); // update prhSeq Value if (pageColumns[i] == "prhSeq") { jQuery(this).attr('value', count ); } if (pageColumns[i] == "prhSrc") { // clear default onfocus //jQuery(this).attr("onfocus", ""); jQuery(this).focus(function() { // doSomething }); } }); jQuery ( this ).find("select[name$='"+pageColumns[i]+"']").each(function(){ jQuery(this).attr('name', 'prhIndexed['+count+'].'+pageColumns[i] ); }); }// end of for count ++; }); jQuery ( "#"+tableId ).find(".rowData").each(function(){ // only for debug alert ( jQuery(this).html() ) }); }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }); <div id="controls"> <table width="350px" border="0"> <tr><td> <input id="addRow" type="button" name="addRows" value="Add Row" /> <input id="add_rows_number" type="text" name="add_rows_number" value="1" style="width:20px;" maxlength="2" /> <input id="insertRow" type="button" name="insert" value="Insert Row" /> <input id="removeRow" type="button" name="deleteRows" value="Delete Row" /> </td></tr> </table></div> <table id="prh" width="350px" border="1"> <thead> <tr class="listheader"> <td nowrap width="21"><input type="checkbox" name="prh_" class="checkBoxAll"/></td> <td nowrap width="32">Sequence</td> <td nowrap width="153" align="center">Channel</td> <td nowrap width="200">Source</td> </tr> </thead> <tbody> <!-- dummy row --> <tr id='blankRow' style="display:none" > <td><input type="checkbox" id='prh_ckbox0' name='prh_0' value=""/></td> <td align="right"><input type="text" name="prhIndexed[0].prhSeq" maxlength="10" value="" onkeydown="" onblur="" onfocus="" readonly="readonly" style="width:30px;background-color:transparent;border:0;line-height:13pt;color: #993300;background-color:transparent;border:0;line-height:13pt;color: #993300;"></td> <td><select name="prhIndexed[0].prhChannelproperty"><option value=""></option> <option value="A01">A01</option> <option value="A02">A02</option> <option value="A03">A03</option> <option value="A04">A04</option> </select></td> <td><input type="text" name="prhIndexed[0].prhSrc" maxlength="6" value="new" style="width:80px;background-color:#FFFFD7;"> <div id='displayPrhSrcName0'></div> </td> </tr> <!-- row data --> <tr id='prh_1' class="rowData"> <td><input type="checkbox" id='prh_ckbox1' name='prh_1' value=""/></td> <td align="right"><input type="text" name="prhIndexed[1].prhSeq" maxlength="10" value="1" onkeydown="" onblur="" onfocus="" readonly="readonly" style="width:30px;background-color:transparent;border:0;line-height:13pt;color: #993300;background-color:transparent;border:0;line-height:13pt;color: #993300;"></td> <td><select name="prhIndexed[1].prhChannelproperty"><option value=""></option> <option value="A01">A01</option> <option value="A02">A02</option> <option value="A03">A03</option> <option value="A04">A04</option> </select></td> <td><input type="text" name="prhIndexed[1].prhSrc" maxlength="6" value="new" style="width:80px;background-color:#FFFFD7;"> <div id='displayPrhSrcName0'></div> </td> </tr> <tr id='prh_2' class="rowData"> <td><input type="checkbox" id='prh_ckbox2' name='prh_2' value=""/></td> <td align="right"><input type="text" name="prhIndexed[2].prhSeq" maxlength="10" value="2" onkeydown="" onblur="" onfocus="" readonly="readonly" style="width:30px;background-color:transparent;border:0;line-height:13pt;color: #993300;background-color:transparent;border:0;line-height:13pt;color: #993300;"></td> <td><select name="prhIndexed[2].prhChannelproperty"><option value=""></option> <option value="A01">A01</option> <option value="A02">A02</option> <option value="A03">A03</option> <option value="A04">A04</option> </select></td> <td><input type="text" name="prhIndexed[2].prhSrc" maxlength="6" value="new" style="width:80px;background-color:#FFFFD7;"> <div id='displayPrhSrcName0'></div> </td> </tr> </tbody> </table>

    Read the article

  • Duck type testing with C# 4 for dynamic objects.

    - by Tracker1
    I'm wanting to have a simple duck typing example in C# using dynamic objects. It would seem to me, that a dynamic object should have HasValue/HasProperty/HasMethod methods with a single string parameter for the name of the value, property, or method you are looking for before trying to run against it. I'm trying to avoid try/catch blocks, and deeper reflection if possible. It just seems to be a common practice for duck typing in dynamic languages (JS, Ruby, Python etc.) that is to test for a property/method before trying to use it, then falling back to a default, or throwing a controlled exception. The example below is basically what I want to accomplish. If the methods described above don't exist, does anyone have premade extension methods for dynamic that will do this? Example: In JavaScript I can test for a method on an object fairly easily. //JavaScript function quack(duck) { if (duck && typeof duck.quack === "function") { return duck.quack(); } return null; //nothing to return, not a duck } How would I do the same in C#? //C# 4 dynamic Quack(dynamic duck) { //how do I test that the duck is not null, //and has a quack method? //if it doesn't quack, return null }

    Read the article

  • Technology Selection for a dynamic product

    - by Kuntal Shah
    We are building a product for Procurement Domain in JAVA. Following are the main technical requirements. Platform Independent Database Independent Browser Independent In functional requirements the product is very dynamic in nature. The main reason being the procurement process around the world is different from client to client. Briefly we need to have a dynamic workflow engine and a dynamic template engine. The workflow engine by which we can define any kind of workflows and the template engine allows us to define any kind of data structures and based on definition it can get the user input through workflow. We have been developing this product for almost 2 years. It has been a long time till we can get down with the dynamics of requirements. Till now we have developed a basic workflow and template engine and which is in use at one of the client. We have been using following technologies. GWT-Ext (Front End Framework) Hibernate (Database Layer) In between we have faced some issues with GWT-Ext (mainly browser compatibility) and database optimization due to sub classing in hibernate. For resolving GWT-Ext issue, which a dying community so we decided to move to SmartGWT. In SmartGWT we faced issues related to loading and now we are able to finalize that GWT 2.3 will be the way to go as the library is rich and performance is upto the mark. We are able to almost finalize GWT-Spring based front and middle layer. In hibernate, we found main issues with sub-classing due to that it was throwing astronomical queries and sometimes it would stop firing any queries for 5-10 seconds or may be around 30 seconds and then resume again. Few days back I came to one article related to ORM. I am a traditional .Net SQL developer and I have always worked with relational database. Reading through this article, I also found it relating to the issues I face. I am still not completely convinced of using hibernate and this article just supported my opinion. Following are the questions for which I am looking for an answer. Should we be going with Hibernate in case of dynamic database requirements and the load of the data will be heavy in future? How can we partition the data, how we can efficiently join the data, how we can optimize the queries? If the answer is no then how do we achieve database independence? Is our choice related to GWT and Spring proper or do we need to change that too? Should we use any other key value pair database if the data is dynamic in nature and it is very difficult to make it relational?

    Read the article

  • jqGrid dynamic select option

    - by Jo
    I'm creating a jqgrid with drop down columns and I'm using cell editing. I need the options of the drop down columns to change dynamically and I've tried implementing this by setting the column to be: { name: "AccountLookup", index: "AccountLookup", width: 90, editable: true, resizable: true, edittype: "select", formatter: "select" }, and then in the beforeCellEdit event I have: beforeEditCell: function(id, name, val, iRow, iCol) { if(name=='AccountLookup') { var listdata = GetLookupValues(id, name); if (listdata == null) listdata = "1:1"; jQuery("#grid").setColProp(name, { editoptions: { value: listdata.toString()} }) } }, GetLookupValues just returns a string in the format "1:One;2:Two" etc. That works fine however the options are populated one click behind - ie i click on AccountID in row 1, and the dropdown is empty, however when I then click on AccountID in row 3 the options I set in the row 1 click are shown in the row 3 click. And so on. So always one click behind. Is there another way of achieving what I need? Bacially the dropdown options displayed are always changing and I need to load them as user enters the cell for editing. Perhaps I can somehow get at the select control in the beforeEditCell event and manually enter its values instead of using the setColProp call? If so could I get an example of doing that please? Another thing - if the dropdown is empty and a user doesn't cancel the cell edit, the grid script throws an error. I'm using clientarray editing if that makes a difference. Greatly appreciate any help. Regards, Jo

    Read the article

  • ASP.NET 3.5 GridView - row editing - dynamic binding to a DropDownList

    - by marc_s
    This is driving me crazy :-) I'm trying to get a ASP.NET 3.5 GridView to show a selected value as string when being displayed, and to show a DropDownList to allow me to pick a value from a given list of options when being edited. Seems simple enough? My gridview looks like this (simplified): <asp:GridView ID="grvSecondaryLocations" runat="server" DataKeyNames="ID" OnInit="grvSecondaryLocations_Init" OnRowCommand="grvSecondaryLocations_RowCommand" OnRowCancelingEdit="grvSecondaryLocations_RowCancelingEdit" OnRowDeleting="grvSecondaryLocations_RowDeleting" OnRowEditing="grvSecondaryLocations_RowEditing" OnRowUpdating="grvSecondaryLocations_RowUpdating" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label ID="lblPbxTypeCaption" runat="server" Text='<%# Eval("PBXTypeCaptionValue") %>' /> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddlPBXTypeNS" runat="server" Width="200px" DataTextField="CaptionValue" DataValueField="OID" /> </EditItemTemplate> </asp:TemplateField> </asp:GridView> The grid gets displayed OK when not in editing mode - the selected PBX type shows its value in the asp:Label control. No surprise there. I load the list of values for the DropDownList into a local member called _pbxTypes in the OnLoad event of the form. I verified this - it works, the values are there. Now my challenge is: when the grid goes into editing mode for a particular row, I need to bind the list of PBX's stored in _pbxTypes. Simple enough, I thought - just grab the drop down list object in the RowEditing event and attach the list: protected void grvSecondaryLocations_RowEditing(object sender, GridViewEditEventArgs e) { grvSecondaryLocations.EditIndex = e.NewEditIndex; GridViewRow editingRow = grvSecondaryLocations.Rows[e.NewEditIndex]; DropDownList ddlPbx = (editingRow.FindControl("ddlPBXTypeNS") as DropDownList); if (ddlPbx != null) { ddlPbx.DataSource = _pbxTypes; ddlPbx.DataBind(); } .... (more stuff) } Trouble is - I never get anything back from the FindControl call - seems like the ddlPBXTypeNS doesn't exist (or can't be found). What am I missing?? Must be something really stupid.... but so far, all my Googling, reading up on GridView controls, and asking buddies hasn't helped. Who can spot the missing link? ;-) Marc

    Read the article

  • Dynamic localization with Data Annotations possible?

    - by devries48
    Hi, I'm trying to dynamicly update the language of a Silverlight application. I tried the example provided by Tim Heuer and that was exactly wat I needed. Silverlight and localizing string data Now I'm experimenting with Data Annotations and would like to have the same behaviour.But with no luck... Can someone point me in the right direction. DataAnnotation of a property: [Display(Name = "UserNameLabel", ResourceType = typeof(Resources.Strings.StringResources))] [Required] public string Username ... My Xaml: <dataInput:Label Target="{Binding ElementName=tbUserName}" PropertyPath="UserName"/> Thanks, Ron

    Read the article

  • Silverlight 3 Dynamic DataGrid RowStyle Ignored

    - by antoinne85
    I subclassed the standard DataGrid into SpecialDataGrid so I could override the KeyDown/KeyUp events. Other than that SpecialDataGrid is exactly the same as DataGrid. At run-time I dynamically create a bunch of these SpecialDataGrids. When a user clicks a row in the grid it hightlights, which is fine, but when that grid loses focus, it leaves a residual gray highlight on the last-selected row, which is not fine. I've heavily edited the RowStyle and CellStyle I'm applying to these Grids to more-or-less remove all formatting. I even added a static SpecialDataGrid to the app with test data so I could see if the RowStyle was somehow incorrect, applying the same RowStyle and CellStyle that I'm applying to the dynamically generated one (you'll see it in the code below). What I saw was that the "test grid" showed up exactly as I wanted, and the real grid is ignoring part of the RowStyle! Has anyone run into this issue or have any ideas of how to correct it? Some source and images follow. Creating the SpecialDataGrid: //Set up a datagrid. SpecialDataGrid radio_datagrid = new SpecialDataGrid(); radio_datagrid.ItemsSource = radios; radio_datagrid.AutoGenerateColumns = false; radio_datagrid.HeadersVisibility = DataGridHeadersVisibility.None; radio_datagrid.BorderThickness = new Thickness(0); radio_datagrid.HorizontalAlignment = HorizontalAlignment.Stretch; radio_datagrid.IsReadOnly = true; radio_datagrid.MouseLeftButtonUp += new MouseButtonEventHandler(option_datagrid_MouseLeftButtonUp); radio_datagrid.KeyDown += new KeyEventHandler(radio_datagrid_KeyDown); radio_datagrid.KeyUp += new KeyEventHandler(radio_datagrid_KeyUp); //Radio column. DataGridTemplateColumn temp_col = new DataGridTemplateColumn(); temp_col.CellTemplate = (DataTemplate)this.Resources["RadioColumnTemplate"]; temp_col.Width = new DataGridLength(20); radio_datagrid.Columns.Add(temp_col); //Description column. DataGridTextColumn txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optionlabel"); txt_col.Width = new DataGridLength(350); radio_datagrid.Columns.Add(txt_col); //Product code column. txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optioncode"); txt_col.Width = new DataGridLength(80); radio_datagrid.Columns.Add(txt_col); //Price column. txt_col = new DataGridTextColumn(); txt_col.Binding = new Binding("optionprice"); txt_col.Width = new DataGridLength(80); radio_datagrid.Columns.Add(txt_col); //View column. temp_col = new DataGridTemplateColumn(); temp_col.CellTemplate = (DataTemplate)this.Resources["HyperlinkButtonColumnTemplate"]; temp_col.Width = new DataGridLength(30); radio_datagrid.Columns.Add(temp_col); radio_datagrid.RowStyle = (Style)this.Resources["StyleDataGridRowNoAlternating"]; radio_datagrid.CellStyle = (Style)this.Resources["Style_DataGridCell_NoHighlight"]; Example Image: The lower DataGrid appears that way regardless of what you do to it. No highlighting of any sort and certainly no residual highlights. Any idea what's keeping this from being applied to the first?

    Read the article

  • WPF ToolTip Style with dynamic LayoutTransform

    - by NoOne
    I have an app that scales it's UI and I want to scale the ToolTips with it. I have tried doing this: <Style TargetType="{x:Type ToolTip}"> <Setter Property="LayoutTransform" Value="{DynamicResource scaleTransf}"/> ... </Style> ...where scaleTransf is a resource that I change via code: Application.Current.Resources["scaleTransf"] = new ScaleTransform(...); Most of the ToolTips do get scaled in size but some of them that are created by C# code don't get scaled. I've checked and it seems that I don't set their Style or LayoutTransform by code, so I don't really understand what is going wrong... Moreover, I have the impression that the above XAML code worked fine a few days ago. :( Is there sth I can do to make it work all the time without setting the LayoutTransform in code-behind? EDIT : The ToolTips that don't change scale are the ones that have become visible before. EDIT2 : Extra code: <ScaleTransform x:Key="scaleTransf" ScaleX="1" ScaleY="1"/> I have also tried this: Application.Current.Resources.Remove("scaleTransf"); Application.Current.Resources.Add("scaleTransf", new ScaleTransform(val, val)); EDIT3 : My attempt to solve this using a DependencyProperty: In MainWindow.xaml.cs : public static readonly DependencyProperty TransformToApplyProperty = DependencyProperty.Register("TransformToApply", typeof(Transform), typeof(MainWindow)); public Transform TransformToApply { get { return (Transform)this.GetValue(TransformToApplyProperty); } } Somewhere in MainWindow, in response to a user input: this.SetValue(TransformToApplyProperty, new ScaleTransform(val, val)); XAML Style: <Style TargetType="{x:Type ToolTip}"> <Setter Property="LayoutTransform" Value="{Binding TransformToApply, ElementName=MainWindow}"/> ... Using this code, not a single one of the ToolTips seem to scale accordingly.

    Read the article

  • Dynamic SQL to generate column names?

    - by Ben McCormack
    I have a query where I'm trying pivot row values into column names and currently I'm using SUM(Case...) As 'ColumnName' statements, like so: SELECT SKU1, SUM(Case When Sku2=157 Then Quantity Else 0 End) As '157', SUM(Case When Sku2=158 Then Quantity Else 0 End) As '158', SUM(Case When Sku2=167 Then Quantity Else 0 End) As '167' FROM OrderDetailDeliveryReview Group By OrderShipToID, DeliveryDate, SKU1 The above query works great and gives me exactly what I need. However, I'm writing out the SUM(Case... statements by hand based on the results of the following query: Select Distinct Sku2 From OrderDetailDeliveryReview Is there a way, using T-SQL inside a stored procedure, that I can dynamically generate the SUM(Case... statements from the Select Distinct Sku2 From OrderDetailDeliveryReview query and then execute the resulting SQL code?

    Read the article

  • How to get default Ctrl+Tab functionality in WinForms MDI app when hosting WPF UserControls

    - by jpierson
    I have a WinForms based app with traditional MDI implementation within it except that I'm hosting WPF based UserControls via the ElementHost control as the main content for each of my MDI children. This is the solution recommended by Microsoft for achieving MDI with WPF although there are various side effects unfortunately. One of which is that my Ctrl+Tab functionality for tab switching between each MDI child is gone because the tab key seems to be swallowed up by the WPF controls. Is there a simple solution to this that will let the Ctrl+tab key sequences reach my WinForms MDI parent so that I can get the built-in tab switching functionality?

    Read the article

  • Dynamic CSS Width

    - by Alon
    I have a <div></div> and I want that its width will be the page width minus 40 pixels. Is there any way to do this without JavaScript or expression (because expression works only in IE)? Thanks.

    Read the article

  • Dynamic programming in VB

    - by Rahul Jain
    Hello Everybody, We develop applications for SAP using their SDK. SAP provides a SDK for changing and handling events occuring in the user interface. For example, with this SDK we can catch a click on a button and do something on the click. This programming can be done either VB or C#. This can also be used to create new fields on the pre-existing form. We have developed a specific application which allows users to store the definition required for new field in a database table and the fields are created at the run time. So far, this is good. What we require now is that the user should be able to store the validation code for the field in the database and the same should be executed on the run time. Following is an example of such an event: Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent Dim oForm As SAPbouiCOM.Form If pVal.FormTypeEx = "ACC_QPLAN" Then If pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And pVal.BeforeAction = False Then oProdRec.ItemPressEvent(pVal) End If End If End Sub Public Sub ItemPressEvent(ByRef pVal As SAPbouiCOM.ItemEvent) Dim oForm As SAPbouiCOM.Form oForm = oSuyash.SBO_Application.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount) If pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And pVal.BeforeAction = False Then If pVal.ItemUID = "AC_TXT5" Then Dim CardCode, ItemCode As String ItemCode = oForm.Items.Item("AC_TXT2").Specific.Value CardCode = oForm.Items.Item("AC_TXT0").Specific.Value UpdateQty(oForm, CardCode, ItemCode) End If End If End Sub So, what we need in this case is to store the code given in the ItemPressEvent in a database, and execute this in runtime. I know this is not straight forward thing. But I presume there must be some ways of getting these kind of things done. The SDK is made up of COM components. Thanks & Regards, Rahul Jain

    Read the article

  • jQuery - dynamic variables?

    - by user331884
    Newbie question. Given the following html. <div id="mycontainer1" class="container"> <input type="text" class="name"/> <input type="text" class="age"/> </div> <div id="mycontainer2" class="container"> <input type="text" class="name"/> <input type="text" class="age"/> <input type="text" class="address"/> </div> I'm trying to create a function where I can pass an element id and an array that contains the classes of the input values I want to get. So for example, var inputClasses = ['name','age']; getInputValue('#myContainer1', inputClasses); function getInputValue(elem, arr) { var temp = {}; $(elem).each(function() { // need a way to map items in array to variables // but how do I do this dynamically? var nameValue = $(this).find('.name').val(); var ageValue = $(this).find('.age').val(); });

    Read the article

  • Dynamic Scoped Resources in WPF/XAML?

    - by firoso
    I have 2 Xaml files, one containing a DataTemplate which has a resource definition for an Image brush, and the other containing a content control which presents this DataTemplate. The data template is bound to a view model class. Everything seems to work EXCEPT the ImageBrush resource, which just shows up white... Any ideas? File 1: DataTemplate for ViewModel <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:SEL.MfgTestDev.ESS.ViewModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <DataTemplate DataType="{x:Type vm:PresenterViewModel}"> <DataTemplate.Resources> <ImageBrush x:Key="PresenterTitleBarFillBrush" TileMode="Tile" Viewbox="{Binding Path=FillBrushDimensions, Mode=Default}" ViewboxUnits="Absolute" Viewport="{Binding Path=FillBrushPatternSize, Mode=Default}" ViewportUnits="Absolute" ImageSource="{Binding Path=FillImage, Mode=Default}"/> </DataTemplate.Resources> <Grid d:DesignWidth="1440" d:DesignHeight="900"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="192"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="120"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel HorizontalAlignment="Stretch" Width="Auto" LastChildFill="True" Background="{x:Null}" Grid.ColumnSpan="2"> <Image Source="{Binding Path=ImageSource, Mode=Default}"/> <Rectangle Fill="{DynamicResource PresenterTitleBarFillBrush}"/> </DockPanel> </Grid> </DataTemplate> </ResourceDictionary> File 2: Main Window Class which instanciates the DataTemplate Via it's view model. <Window x:Class="SEL.MfgTestDev.ESS.ESSMainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:SEL.MfgTestDev.ESS.ViewModel" Title="ESS Control Window" Height="900" Width="1440" WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" DataContext="{Binding}"> <Window.Resources> <ResourceDictionary Source="PresenterViewModel.xaml" /> </Window.Resources> <ContentControl> <ContentControl.Content> <vm:PresenterViewModel ImageSource="XAMLResources\SEL25YearsTitleBar.bmp" FillImage="XAMLResources\SEL25YearsFillPattern.bmp" FillBrushDimensions="0,0,5,110" FillBrushPatternSize="0,0,5,120"/> </ContentControl.Content> </ContentControl> </Window> And for the sake of completeness! The CodeBehind for the View Model using System; using System.Collections.Generic; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace SEL.MfgTestDev.ESS.ViewModel { public class PresenterViewModel : ViewModelBase { public PresenterViewModel() { } //DataBindings private ImageSource _imageSource; public ImageSource ImageSource { get { return _imageSource; } set { if (_imageSource != value) { _imageSource = value; OnPropertyChanged("ImageSource"); } } } private Rect _fillBrushPatternSize; public Rect FillBrushPatternSize { get { return _fillBrushPatternSize; } set { if (_fillBrushPatternSize != value) { _fillBrushPatternSize = value; OnPropertyChanged("FillBrushPatternSize"); } } } private Rect _fillBrushDimensions; public Rect FillBrushDimensions { get { return _fillBrushDimensions; } set { if (_fillBrushDimensions != value) { _fillBrushDimensions = value; OnPropertyChanged("FillBrushDimensions"); } } } private ImageSource _fillImage; public ImageSource FillImage { get { return _fillImage; } set { if (_fillImage != value) { _fillImage = value; OnPropertyChanged("FillImage"); } } } } }

    Read the article

  • Creating a dynamic linq query

    - by Bas
    I have the following query: from p in dataContext.Repository<IPerson>() join spp1 in dataContext.Repository<ISportsPerPerson>() on p.Id equals spp1.PersonId join s1 in dataContext.Repository<ISports>() on spp1.SportsId equals s1.Id join spp2 in dataContext.Repository<ISportsPerPerson>() on p.Id equals spp2.PersonId join s2 in dataContext.Repository<ISports>() on spp2.SportsId equals s2.Id where s1.Name == "Soccer" && s2.Name == "Tennis" select new { p.Id }; It selects all the person who play Soccer and Tennis. On runtime the user can select other tags to add to the query, for instance: "Hockey". now my question is, how could I dynamically add "Hockey" to the query? If "Hockey" is added to the query, it would look like this: from p in dataContext.Repository<IPerson>() join spp1 in dataContext.Repository<ISportsPerPerson>() on p.Id equals spp1.PersonId join s1 in dataContext.Repository<ISports>() on spp1.SportsId equals s1.Id join spp2 in dataContext.Repository<ISportsPerPerson>() on p.Id equals spp2.PersonId join s2 in dataContext.Repository<ISports>() on spp2.SportsId equals s2.Id join spp3 in dataContext.Repository<ISportsPerPerson>() on p.Id equals spp3.PersonId join s3 in dataContext.Repository<ISports>() on spp3.SportsId equals s3.Id where s1.Name == "Soccer" && s2.Name == "Tennis" && s3.Name == "Hockey" select new { p.Id }; It would be preferable if the query is build up dynamically like: private void queryTagBuilder(List<string> tags) { IDataContext dataContext = new LinqToSqlContext(new L2S.DataContext()); foreach(string tag in tags) { //Build the query? } } Anyone has an idea on how to set this up correctly? Thanks in advance!

    Read the article

  • Add calendar datepicker with Jquery on dynamic table.

    - by Cesar Lopez
    I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how. When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is: var txtDate = createTextInput(i, "txtDate", 8, 10); txtDate.className = "datepicker"; this.newcells[i].appendChild(txtsDate); I tried adding at the end : txtDate.datepicker(); But does not work. Can anybody help? Thanks.

    Read the article

  • Need help with Zend Framework dynamic Namespaces

    - by Marcus Sjölin
    I want to make my system redirect unknown requests such as www.address.com/a_company to the adress www.address.com/companies/company/ and display the company a_company if it exists in the database, otherwise throw the user to a 404 not found page. So in detail, I want to make namespace that is as the first example dynamically, if the company exist in the database, I have no problem connecting to the database and retrieving information or finding a way to parse a company name, I just need help how to make my system check and run a function every time the address doesn't exist and show the second page (/companies/company/).. I am using an Acl as well, but I think it should be fine if the page is /companies/company and then possibly add /?c=a_company or similar. Thank you. /Marcus

    Read the article

  • Dynamic controls not creating with RSS reader function

    - by TuxMeister
    Hello, I am working on a test project for an RSS reader. I am using Chilkat's module for .NET 3.5. What I am trying to do is this: For each item in the RSS feed, I want to dynamically create some controls (labels) that contain stuff like the title, the link and the publication date. The problem is that only the first control comes up "rssTitle", but not the rest and it's definitely not creating the rest, nor cycling through the RSS items. Any ideas where I'm wrong in my code? Imports Chilkat Public Class Form1 Dim rss As New Chilkat.Rss Dim success As Boolean Dim rssTitle As New Label Dim rssLink As New Label Dim rssPubDate As New Label Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click success = rss.DownloadRss("http://www.engadget.com/rss.xml") If success <> True Then MessageBox.Show(rss.LastErrorText) Exit Sub End If Dim rssChannel As Chilkat.Rss rssChannel = rss.GetChannel(0) If rssChannel Is Nothing Then MessageBox.Show("No channel found.") Exit Sub End If Dim numItems As Long numItems = rssChannel.NumItems Dim i As Long For i = 0 To numItems - 1 Dim rssItem As Chilkat.Rss rssItem = rssChannel.GetItem(i) Me.Controls.Add(rssTitle) With rssTitle .Name = "rssTitle" & Me.Controls.Count.ToString + 1 .Text = "Title: " & rssItem.GetString("title") .Left = 12 .Top = 12 End With Me.Controls.Add(rssLink) With rssLink .Name = "rssLink" & Me.Controls.Count.ToString + 1 .Text = "Link: " & rssItem.GetString("link") .Left = 12 .Top = 12 End With Me.Controls.Add(rssPubDate) With rssPubDate .Name = "rssPubDate" & Me.Controls.Count.ToString + 1 .Text = "Pub date: " & rssItem.GetString("pubDate") .Left = 12 .Top = 12 End With Next End Sub End Class I'm grateful for any help. Thanks!

    Read the article

  • Need help with dynamic programming problem

    - by John Retallack
    I have the following problem : I am given a tree with N apples, for each apple I am given it's weight and height,I can pick apples up to a given height H,each time I pick an apple the height of every apple is increased with U(also given).I have to find out the maximum weight of apples I can pick. e.g: N=4 H=100 U=10 (height-eight) apple1: 91 10 apple2: 82 30 apple3: 93 5 apple4: 94 15 The answer is 45 : I first pick the apple with the weight of 15 then the one with the weight of 30. I would like to know if someone here could help me with giving me an hint on how I should approach this problem. Thank you.

    Read the article

  • How do i create a table dynamically with dynamic datatype from a PL/SQL procedure

    - by Swapna
    CREATE OR REPLACE PROCEDURE p_create_dynamic_table IS v_qry_str VARCHAR2 (100); v_data_type VARCHAR2 (30); BEGIN SELECT data_type || '(' || data_length || ')' INTO v_data_type FROM all_tab_columns WHERE table_name = 'TEST1' AND column_name = 'ZIP'; FOR sql_stmt IN (SELECT * FROM test1 WHERE zip IS NOT NULL) LOOP IF v_qry_str IS NOT NULL THEN v_qry_str := v_qry_str || ',' || 'zip_' || sql_stmt.zip || ' ' || v_data_type; ELSE v_qry_str := 'zip_' || sql_stmt.zip || ' ' || v_data_type; END IF; END LOOP; IF v_qry_str IS NOT NULL THEN v_qry_str := 'create table test2 ( ' || v_qry_str || ' )'; END IF; EXECUTE IMMEDIATE v_qry_str; COMMIT; END p_create_dynamic_table; Is there any better way of doing this ?

    Read the article

  • Two DIV layers: resize top DIV based on dynamic height of bottom DIV

    - by user1650713
    I have two DIV layers, one above the other. In the top DIV, there is an image, and in the bottom DIV, there is a block of text. The amount of text in the bottom DIV will change, thus increasing and decreasing the required height. I need to dynamically decrease the height of the image in the top DIV based on how much height is required for the bottom. I have exactly 600px vertical space available. For example: If the bottom DIV requires 200px height, I need for the image to change height to 400px. If the bottom DIV requires 300px height, I need for the image to change height to 300px. I know that I can make the image height 100% of the top DIV, thus allowing it to expand or contract as needed. The issue is that I need for the bottom DIV to be able to expand freely and for the top DIV to react accordingly. In other words, I cannot have either be a fixed height. <div id="topdiv"> <img src="example.png" alt="This image needs a height based on the bottom div" /> </div> <div id="bottomdiv"> This text needs to be able to expand or contract freely </div> Can anyone help?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >