Search Results

Search found 13450 results on 538 pages for 'recent items'.

Page 65/538 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Using formLabel in FormPanel for Localization

    - by user1782712
    I am trying to implement Localization within a panel, so to make the fieldLabel accessable from another file I am defining it like this Ext.define('Ext.app.detailForm', { extend: 'Ext.form.Panel', id: 'cscForm', // frame: true, uncomment this to show blue frame background title: 'CSC Details :', //trying cscCode: 'CSC Code', bodyPadding: 5, layout: 'anchor', // Specifies that the items will now be arranged in columns autoScroll: true, //width:1200, //height: 300, collapsible: true, fieldDefaults: { labelAlign: 'left', msgTarget: 'side' }, items: [{ columnWidth: 0.4, xtype: 'container', layout:'anchor', defaults: { labelWidth: 150 }, defaultType: 'textfield', items: [{ xtype: 'container', layout: 'hbox', items:[{ xtype: 'fieldset', columnWidth:1.5, layout: 'column', width:1050, defaultType: 'textfield', defaults: { labelWidth: 150, margin: '3 0 0 10' }, items: [{ fieldLabel: this.cscCode, name: 'CSCCode', width: 500 }, {..... but when I try to render this panel, the formLabel for cscCode does not display, is there some thing which I am doing wrong here? I am basically not able to access "this.cscCode"

    Read the article

  • Apps Script Office Hours - November 29, 2012

    Apps Script Office Hours - November 29, 2012 In this episode Arun and Ikai ... - Talk about the recent Apps Script hackathon they held in Los Angeles. - Cover the items in the release notes for recent releases. - Discuss recent Apps Script blog posts, including reminders, open source libraries, and more. - Answer a question about where best to store your data in Apps Script. Visit developers.google.com to find out when we'll be hosting our next Office Hours. From: GoogleDevelopers Views: 363 11 ratings Time: 28:55 More in Science & Technology

    Read the article

  • List<string> doesn't update the UI when change occurs [WPF]

    - by Hard Turner
    <ListBox x:Name="MainList" HorizontalAlignment="Left" Height="468" Margin="10,10,0,0" VerticalAlignment="Top" Width="100" ItemsSource="{Binding Items,Mode=TwoWay}" DisplayMemberPath="Name"/> [Serializable()] public class MYcontainer : INotifyPropertyChanged,ISerializable { private List<MYClass> _items = new List<MYClass>(); public List<MYClass> Items { get{ return _items;} set { this._items =value; OnPropertyChanged("Items"); } public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propertyName = null) { var eventHandler = this.PropertyChanged; if (eventHandler != null) eventHandler(this, new PropertyChangedEventArgs(propertyName)); } } when i add an item to "Items" the UI doesnt update, the binding is working fine, since if i closed the window and opened it again, the new items appear correctly what am i doing wrong? i know if i used observablecollection it will work fine, but shouldn't it work with List<? , i already have in another window a string[] property and it update fine

    Read the article

  • Referencing the current jQuery object in a chain?

    - by Lance McNearney
    At DevDays in SF last year (before jQuery 1.4 was released), I thought they mentioned an upcoming feature in 1.4 that would allow you to reference the current jQuery object while in a chain. I've read through all of the 1.4 improvements and wasn't able to find it. Does anyone know how this can be done? Example Being able to access the current jQuery object would be helpful when working with methods that are in relation to the current object like .next(): // Current way var items = $(this).closest('tr'); items = items.add(items.next(':not([id])')); // Magical 1.4 way? Is there a "chain"-like object? var items = $(this).closest('tr') .add(chain.next(':not([id])'));

    Read the article

  • Jquery Help : Draggable to Sortable and then back to draggable again.

    - by Swamy g
    I have a pool of items in the drag list which is connected to a sortable using connectToSortable option. Now I want to remove some items from this sort list and move them back to the drag list. Sort of like an undo. Suppose the user moves some 5 items to sort list and decides he/she wants only 4 items, and decides to just drag the unwanted item from the sortlist TO the drag list. How do I accomplish this WITHOUT adding a "remove" link in the sort list. Thanks a lot. For more information please refer to http://the-stickman.com/web-development/javascript/jquery-dropping-items-from-a-draggable-list-to-a-sortable-list/

    Read the article

  • Core Data strategy using in memory cache, or no core data at all?

    - by randombits
    I have a user interface where the user can check off a bunch of items from a tableview, almost like a todo list. The items are populated from a Core Data stack. I need to be able to take all of the items they're clicking through and put them into a "temporary" shopping cart. Once they're in the shopping cart, users can go through the list and remove the items, or just submit them to a server. The thing is, the selected items are temporary just like an internet based shopping cart. It's nothing something that gets persisted once the application closes. Once the view is no longer in display, I can assume that the shopping cart is safe to discard. What's the best way to approach this? Since the user is essentially clicking on instances that map back to a Core Data entity .. should I setup a different persistence store such as in memory and add that store to my managed object context?

    Read the article

  • Creating objects and referencing before saving object to db

    - by Flexo
    Sorry about the vague title, but i didnt know how to ask the question in one line :) I have an order with nested itemgroups that again have nested items. the user specify the amount of item that he would like to have in each itemgroup. I would like to create these items in the create method of the orders controller when the order itself is being created. I kinda have 2 problems here. First, how do i set the reference of the items, or better yet, put the items into the @order object so they are saved when the @order is saved? the items are being stored in the db as the code is now, but the reference is not set because the order is not stored in the db yet so it doesnt have an id yet. Second, im not sure im using the correct way to get the id from my itemgroup. @order = Order.new(params[:order]) @order.itemgroups.each do |f| f.amount.times do @item = Item.new() @item.itemgroup_id = f.id @item.save end end

    Read the article

  • trouble with a javascript Cannot read property 'value' of

    - by Stanislas Piotrowski
    I've done a function but I do not understand why, a part of it does not work. Actualy I use the methode using className and Id. Here is the part of the code: var items = new Array(); var itemCount = document.getElementsByClassName("items"); for(var i = 0; i < itemCount.length; i++) { items[i] = document.getElementById("p"+(i+1)).value; } return items; } And in jsfiddle the html part that show that this Id exist. So it should not return to me this errors: Uncaught TypeError: Cannot read property 'value' of null fiddle.jshell.net:402 the concerned line is the following: items[i] = document.getElementById("p"+(i+1)).value; http://jsfiddle.net/Wt4qd/ Kind Regards SP.

    Read the article

  • Facing difficulty in moving the two id's

    - by user1806560
    By means of <?php echo $productlist->productid;?> in href i am passing the productid,its fine based on that i can able to display the items. The url is looking like this when i am passing like this http://localhost/sample/index.php/userlogin/items/35 . <ul class="left_menu"> <li class="odd"><a href="<?php echo BASE_INDEX_URL;?>/userlogin/items/<?php echo $productlist->productid;?>"> <?php echo $productlist->productname; ?> </a></li> </ul> My model is taking the value like this public function items($productid=0) { } But i want to pass one more id as categoryid in the href, how can i do that My model is taking the value like this(for 2 parameters) public function items($productid=0,$categoryid=0) { }

    Read the article

  • Data binding of itemscontrol in Silverlight 3.0

    - by jmkarthik
    I am trying to define an itemscontrol and data bind it to a List and the code is as below. XAML Item Class public class Item { public string val; } XAML.cs public MainPage() { InitializeComponent(); List<Item> items = new List<Item>(); Item item1 = new Item(); item1.val = "iasl;fdj1"; items.Add(item1); Item item2 = new Item(); item2.val = "iasfdkasdkljf2"; items.Add(item2); ic.ItemsSource = items; } The items are displayed when I run this. Am I missing something?

    Read the article

  • SEO: Nested List vs List, Split Over Divs vs Definition List

    - by Jon P
    From an SEO perspective which, if any, is better: Option 1: Nested lists with h2 tags <ul id="mainpoints"> <li><h2>Powerful Analysis</h2> <ul> <li>Charting and indicators</li> <li>Daily trading signals</li> <li>Company health checks</li> </ul> </li> <li><h2>World Market Data</h2> <ul> [List Items removed for brevity] </ul> </li> <li><h2>Daily Market Data</h2> <ul> [List Items removed for brevity] </ul> </li> </ul> Option 2: Divs with h2 and lists <div id="mainpoints"> <div> <h2>Powerful Analysis</h2> <ul> <li>Charting and indicators</li> <li>Daily trading signals</li> <li>Company health checks</li> </ul> </div> <div> <h2>World Market Data</h2> <ul> [List Items removed for brevity] </ul> </div> <div> <h2>Daily Market Data</h2> <ul> [List Items removed for brevity] </ul> </div> </div> Option 3: Definition List <dl id="mainpoints"> <dt>Powerful Analysis</dt> <dd>- Charting and indicators</dd> <dd>- Daily trading signals</dd> <dd>- Company health checks</dd> <dt>World Market Data</dt> [List Items removed for brevity] <dt>Daily Market Data</dt> [List Items removed for brevity] </dl> My instincts tell me that semanticaly the pure list options (1 & 3) are the best and that h2 may be more SEO friendly (1 & 2) which would point to option 1 as being the best option. I do love the lean makeup of the definition list but will I take an SEO hit by losing the h2 tags? Before anyone asks, h2 is not valid markup in a dt tag. Are my instincts right with a nested list being the way to go?

    Read the article

  • How to use a list of values in Excel as filter in a query

    - by Luca Zavarella
    It often happens that a customer provides us with a list of items for which to extract certain information. Imagine, for example, that our clients wish to have the header information of the sales orders only for certain orders. Most likely he will give us a list of items in a column in Excel, or, less probably, a simple text file with the identification code:     As long as the given values ??are at best a dozen, it costs us nothing to copy and paste those values ??in our SSMS and place them in a WHERE clause, using the IN operator, making sure to include the quotes in the case of alphanumeric elements (the database sample is AdventureWorks2008R2): SELECT * FROM Sales.SalesOrderHeader AS SOH WHERE SOH.SalesOrderNumber IN ( 'SO43667' ,'SO43709' ,'SO43726' ,'SO43746' ,'SO43782' ,'SO43796') Clearly, the need to add commas and quotes becomes an hassle when dealing with hundreds of items (which of course has happened to us!). It’d be comfortable to do a simple copy and paste, leaving the items as they are pasted, and make sure the query works fine. We can have this commodity via a User Defined Function, that returns items in a table. Simply we’ll provide the function with an input string parameter containing the pasted items. I give you directly the T-SQL code, where comments are there to clarify what was written: CREATE FUNCTION [dbo].[SplitCRLFList] (@List VARCHAR(MAX)) RETURNS @ParsedList TABLE ( --< Set the item length as your needs Item VARCHAR(255) ) AS BEGIN DECLARE --< Set the item length as your needs @Item VARCHAR(255) ,@Pos BIGINT --< Trim TABs due to indentations SET @List = REPLACE(@List, CHAR(9), '') --< Trim leading and trailing spaces, then add a CR\LF at the end of the list SET @List = LTRIM(RTRIM(@List)) + CHAR(13) + CHAR(10) --< Set the position at the first CR/LF in the list SET @Pos = CHARINDEX(CHAR(13) + CHAR(10), @List, 1) --< If exist other chars other than CR/LFs in the list then... IF REPLACE(@List, CHAR(13) + CHAR(10), '') <> '' BEGIN --< Loop while CR/LFs are over (not found = CHARINDEX returns 0) WHILE @Pos > 0 BEGIN --< Get the heading list chars from the first char to the first CR/LF and trim spaces SET @Item = LTRIM(RTRIM(LEFT(@List, @Pos - 1))) --< If the so calulated item is not empty... IF @Item <> '' BEGIN --< ...insert it in the @ParsedList temporary table INSERT INTO @ParsedList (Item) VALUES (@Item) --(CAST(@Item AS int)) --< Use the appropriate conversion if needed END --< Remove the first item from the list... SET @List = RIGHT(@List, LEN(@List) - @Pos - 1) --< ...and set the position to the next CR/LF SET @Pos = CHARINDEX(CHAR(13) + CHAR(10), @List, 1) --< Repeat this block while the upon loop condition is verified END END RETURN END At this point, having created the UDF, our query is transformed trivially in: SELECT * FROM Sales.SalesOrderHeader AS SOH WHERE SOH.SalesOrderNumber IN ( SELECT Item FROM SplitCRLFList('SO43667 SO43709 SO43726 SO43746 SO43782 SO43796') AS SCL) Convenient, isn’t it? You can find the script DBA_SplitCRLFList.sql here. Bye!!

    Read the article

  • Searching for context in Silverlight applications

    - by PeterTweed
    A common behavior in business applications that have developed through the ages is for a user to be able to get information or execute commands in relation to some information/function displayed by right clicking the object in question and popping up a context menu that offers relevant options to choose. The Silverlight Toolkit April 2010 release introduced the context menu object.  This can be added to other UI objects and display options for the user to choose.  The menu items can be enabled or disabled as per your application logic and icons can be added to the menu items to add visual effect.  This post will walk you through how to use the context menu object from the Silverlight Toolkit. Steps: 1. Create a new Silverlight 4 application 2. Copy the following namespace definition to the user control object of the MainPage.xaml file: xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"   3. Copy the following XAML into the LayoutRoot grid in MainPage.xaml:          <Border CornerRadius="15" Background="Blue" Width="400" Height="100">             <TextBlock Foreground="White" FontSize="20" Text="Context Menu In This Border...." HorizontalAlignment="Center" VerticalAlignment="Center" >             </TextBlock>             <my:ContextMenuService.ContextMenu>                 <my:ContextMenu >                     <my:MenuItem                 Header="Copy"                 Click="CopyMenuItem_Click" Name="copyMenuItem">                         <my:MenuItem.Icon>                             <Image Source="copy-icon-small.png"/>                         </my:MenuItem.Icon>                     </my:MenuItem>                     <my:Separator/>                     <my:MenuItem Name="pasteMenuItem"                 Header="Paste"                 Click="PasteMenuItem_Click">                         <my:MenuItem.Icon>                             <Image Source="paste-icon-small.png"/>                         </my:MenuItem.Icon>                     </my:MenuItem>                 </my:ContextMenu>             </my:ContextMenuService.ContextMenu>         </Border>   The above code associates a context menu with two menu items and a separator between them to the border object.  The menu items has icons associated with them to add visual appeal.  The menu items have click event handlers that will be added in the MainPage.xaml.cs code behind in a later step. 4. Add two icon sized images to the ClientBin directory of the web project hosting the Silverlight application, named copy-icon-small.png and paste-icon-small.jpg respectively.  I used copy and paste icons as the names suggest. 5. Add the following code to the class in MainPage.xaml.cs file:         private void CopyMenuItem_Click(object sender, RoutedEventArgs e)         {             MessageBox.Show("Copy selected");         }           private void PasteMenuItem_Click(object sender, RoutedEventArgs e)         {             MessageBox.Show("Paste selected");         }   This code adds the event handlers for the menu items defined in step 3. 6. Run the application, right click on the border and select a menu option and see the appropriate message box displayed. Congratulations it’s that easy!   Take the Slalom Challenge at www.slalomchallenge.com!

    Read the article

  • What would be a correct implemantation of JSF Converter if I need to get an Integer to run a query?

    - by Ignacio
    HI here's my code: List.xhmtl <h:selectOneMenu value="#{produtosController.items}"> <f:selectItems value="#{produtosController.itemsAvailableSelectOne}"/> </h:selectOneMenu> <h:commandButton action="#{produtosController.createByCodigos}" value="Buscar" /> My Controller Class with innner Converter implemantation @ManagedBean (name="produtosController") @SessionScoped public class ProdutosController { private Produtos current; private DataModel items = null; @EJB private controladores.ProdutosFacade ejbFacade; private PaginationHelper pagination; private int selectedItemIndex; public ProdutosController() { } public Produtos getSelected() { if (current == null) { current = new Produtos(); selectedItemIndex = -1; } return current; } private ProdutosFacade getFacade() { return ejbFacade; } public PaginationHelper getPagination() { if (pagination == null) { pagination = new PaginationHelper(10) { @Override public int getItemsCount() { return getFacade().count(); } @Override public DataModel createPageDataModel() { return new ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(), getPageFirstItem()+getPageSize()})); } }; } return pagination; } public String prepareList() { recreateModel(); return "List"; } public String prepareView() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "View"; } public String prepareCreate() { current = new Produtos(); selectedItemIndex = -1; return "Create"; } public String create() { try { getFacade().create(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosCreated")); return prepareCreate(); } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } } public String createByMarcas() { items = new ListDataModel(ejbFacade.findByMarcas(current.getIdMarca())); updateCurrentItem(); return "List"; } public String createByModelos() { items = new ListDataModel(ejbFacade.findByModelos(current.getIdModelo())); updateCurrentItem(); return "List"; } public String createByCodigos(){ items = new ListDataModel(ejbFacade.findByCodigo(current.getCodigo())); updateCurrentItem(); return "List"; } public String prepareEdit() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "Edit"; } public String update() { try { getFacade().edit(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosUpdated")); return "View"; } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } } public String destroy() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); performDestroy(); recreateModel(); return "List"; } public String destroyAndView() { performDestroy(); recreateModel(); updateCurrentItem(); if (selectedItemIndex >= 0) { return "View"; } else { // all items were removed - go back to list recreateModel(); return "List"; } } private void performDestroy() { try { getFacade().remove(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosDeleted")); } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); } } private void updateCurrentItem() { int count = getFacade().count(); if (selectedItemIndex >= count) { // selected index cannot be bigger than number of items: selectedItemIndex = count-1; // go to previous page if last page disappeared: if (pagination.getPageFirstItem() >= count) { pagination.previousPage(); } } if (selectedItemIndex >= 0) { current = getFacade().findRange(new int[]{selectedItemIndex, selectedItemIndex+1}).get(0); } } public DataModel getItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } private void recreateModel() { items = null; } public String next() { getPagination().nextPage(); recreateModel(); return "List"; } public String previous() { getPagination().previousPage(); recreateModel(); return "List"; } public SelectItem[] getItemsAvailableSelectMany() { return JsfUtil.getSelectItems(ejbFacade.findAll(), false); } public SelectItem[] getItemsAvailableSelectOne() { return JsfUtil.getSelectItems(ejbFacade.findAll(), true); } @FacesConverter(forClass=Produtos.class) public static class ProdutosControllerConverter implements Converter{ public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0) { return null; } ProdutosController controller = (ProdutosController)facesContext.getApplication().getELResolver(). getValue(facesContext.getELContext(), null, "produtosController"); return controller.ejbFacade.find(getKey(value)); } java.lang.Integer getKey(String value) { java.lang.Integer key; key = Integer.decode(value); return key; } String getStringKey(java.lang.Integer value) { StringBuffer sb = new StringBuffer(); sb.append(value); return sb.toString(); } public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Produtos) { Produtos o = (Produtos) object; return getStringKey(o.getCodigo()); } else { throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: "+ProdutosController.class.getName()); } } } } and my EJB @Entity @ViewScoped @Table(name = "produtos") @NamedQueries({ @NamedQuery(name = "Produtos.findAll", query = "SELECT p FROM Produtos p"), @NamedQuery(name = "Produtos.findById", query = "SELECT p FROM Produtos p WHERE p.id = :id"), @NamedQuery(name = "Produtos.findByCodigo", query = "SELECT p FROM Produtos p WHERE p.codigo = :codigo"), @NamedQuery(name = "Produtos.findByDescripcion", query = "SELECT p FROM Produtos p WHERE p.descripcion = :descripcion"), @NamedQuery(name = "Produtos.findByImagen", query = "SELECT p FROM Produtos p WHERE p.imagen = :imagen"), @NamedQuery(name = "Produtos.findByMarcas", query="SELECT m FROM Produtos m WHERE m.idMarca.id = :idMarca"), @NamedQuery(name = "Produtos.findByModelos", query="SELECT m FROM Produtos m WHERE m.idModelo.id = :idModelo")}) public class Produtos implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Integer id; @Column(name = "codigo") private Integer codigo; @Column(name = "descripcion") private String descripcion; @Column(name = "imagen") private String imagen; @JoinColumn(name = "id_modelo", referencedColumnName = "id") @ManyToOne(optional = false) private Modelos idModelo; @JoinColumn(name = "id_marca", referencedColumnName = "id") @ManyToOne(optional = false) private Marcas idMarca; public Produtos() { } public Produtos(Integer id) { this.id = id; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getCodigo() { return codigo; } public void setCodigo(Integer codigo) { this.codigo = codigo; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public String getImagen() { return imagen; } public void setImagen(String imagen) { this.imagen = imagen; } public Modelos getIdModelo() { return idModelo; } public void setIdModelo(Modelos idModelo) { this.idModelo = idModelo; } public Marcas getIdMarca() { return idMarca; } public void setIdMarca(Marcas idMarca) { this.idMarca = idMarca; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Produtos)) { return false; } Produtos other = (Produtos) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "" + codigo + ""; } }

    Read the article

  • WPF: TreeViewItem bound to an ICommand

    - by Richard
    Hi All, I am busy creating my first MVVM application in WPF. Basically the problem I am having is that I have a TreeView (System.Windows.Controls.TreeView) which I have placed on my WPF Window, I have decide that I will bind to a ReadOnlyCollection of CommandViewModel items, and these items consist of a DisplayString, Tag and a RelayCommand. Now in the XAML, I have my TreeView and I have successfully bound my ReadOnlyCollection to this. I can view this and everything looks fine in the UI. The issue now is that I need to bind the RelayCommand to the Command of the TreeViewItem, however from what I can see the TreeViewItem doesn't have a Command. Does this force me to do it in the IsSelected property or even in the Code behind TreeView_SelectedItemChanged method or is there a way to do this magically in WPF? This is the code I have: <TreeView BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TreeView.Items> <TreeViewItem Header="New Commands" ItemsSource="{Binding Commands}" DisplayMemberPath="DisplayName" IsExpanded="True"> </TreeViewItem> </TreeView.Items> and ideally I would love to just go: <TreeView BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TreeView.Items> <TreeViewItem Header="New Trade" ItemsSource="{Binding Commands}" DisplayMemberPath="DisplayName" IsExpanded="True" Command="{Binding Path=Command}"> </TreeViewItem> </TreeView.Items> Does someone have a solution that allows me to use the RelayCommand infrastructure I have. Thanks guys, much appreciated! Richard

    Read the article

  • Android ASync task ProgressDialog isn't showing until background thread finishes

    - by jackbot
    I've got an Android activity which grabs an RSS feed from a URL, and uses the SAX parser to stick each item from the XML into an array. This all works fine but, as expected, takes a bit of time, so I want to use AsyncActivity to do it in the background. My code is as follows: class AddTask extends AsyncTask<Void, Item, Void> { protected void onPreExecute() { pDialog = ProgressDialog.show(MyActivity.this,"Please wait...", "Retrieving data ...", true); } protected Void doInBackground(Void... unused) { items = parser.getItems(); for (Item it : items) { publishProgress(it); } return(null); } protected void onProgressUpdate(Item... item) { adapter.add(item[0]); } protected void onPostExecute(Void unused) { pDialog.dismiss(); } } Which I call in onCreate() with new AddTask().execute(); The line items = parser.getItems() works fine - items being the arraylist containing each item from the XML. The problem I'm facing is that on starting the activity, the ProgressDialog which i create in onPreExecute() isn't displayed until after the doInBackground() method has finished. i.e. I get a black screen, a long pause, then a completely populated list with the items in. Why is this happening? Why isn't the UI drawing, the ProgressDialog showing, the parser getting the items and incrementally adding them to the list, then the ProgressDialog dismissing?

    Read the article

  • Forcing an item to remain in place in a jQuery UI Sortable list

    - by calumbrodie
    I've set up a jQuery sortable list but I need to be able to keep some items in the sortable 'fixed' in place and for the other items to sort around them. I thought that there would be built in methods to achieve this, alas this is not the case. I'm able to set up the list and not include the items in question: <ul id="fruit"> <li class="fixed">apples</li> <li>oranges</li> <li>bananas</li> <li>pineapples</li> <li>grapes</li> <li class="fixed">pears</li> <li>mango</li> </ul> <script type="text/javascript"> $('#fruit').sortable({items: "li:not('.fixed')"}) </script> This stops me from drag/dropping these items but they still move if the items around them are sorted. There may be a way to do this using the many callbacks that this method has but I've been unable to work this out. Maybe this method would be a good addition to the UI Sortable options?

    Read the article

  • How to add a badge to the system generated "More" UITabBarItem

    - by Mark Hoffman
    My app has 6 menu items, so the OS shows the first 4, then shows a "More" item that links to a screen where the user can select the other two. My problem is that I want to show a badge on the More item so that the user knows that one of the menu items that is hidden needs their attention. (It's clear to our users which hidden item the badge represents since one of the hidden items is Settings and the other is current Uploads) I don't know how to access the "More" item since the "items" array on UITabBar only contains the 6 actual UITabBarItems that I've created; it doesn't include the system generated "More" item. I've tried setting the badge on one of the hidden UITabBarItems, but no badge is ever displayed. I didn't find much on Google, which makes me wonder if I'm going about this completely wrong. The iTunes app does the same thing when you download items. They display a More item and attach a badge to it, so I figured I was in good company, but I'll be damned if I see how they did that. (Unless they manually created a UITabBarSystemItemMore item and manually handled displaying the other menu items. Ugh.)

    Read the article

  • iPhone:Tabbar hides when pushing from TableView to UIViewController

    - by user187532
    Hello all, I have four Tab bar items in a Tab bar which is being bottom of the view where i have the TableView. I am adding Tab bar and items programmatically (Refer below code) not through I.B. Click on first three Tab bar items, will show the data in the same TableView itself. But clicking on last Tab bar items will push to another UIViewcontroller and show the data there. The problem here is, when i push to the viewController when clicking on last Tab bar item, main "Tab bar" is getting removed. Tab bar code: UITabBar *tabBar = [[UITabBar alloc] initWithFrame:CGRectMake(0, 376, 320, 44)]; item1 = [[UITabBarItem alloc] initWithTitle:@"First Tab" image:[UIImage imageNamed:@"first.png"] tag:0]; item2 = [[UITabBarItem alloc] initWithTitle:@"Second Tab" image:[UIImage imageNamed:@"second.png"] tag:1]; item3 = [[UITabBarItem alloc] initWithTitle:@"Third Tab" image:[UIImage imageNamed:@"third.png"] tag:2]; item4 = [[UITabBarItem alloc] initWithTitle:@"Fourth Tab" image:[UIImage imageNamed:@"fourth.png"] tag:3]; item5 = [[UITabBarItem alloc] initWithTitle:@"Fifth Tab" image:[UIImage imageNamed:@"fifth.png"] tag:4]; NSArray *items = [NSArray arrayWithObjects: item1,item2,item3,item4, item5, nil]; [tabBar setItems:items animated:NO]; [tabBar setSelectedItem:item1]; tabBar.delegate=self; [self.view addSubview:tabBar]; Push controller code clicking from last Tab bar item: myViewController = [ [MyViewController alloc] initWithNibName:@"MyView" bundle:nil]; myViewController.hidesBottomBarWhenPushed=NO; [[self navigationController] pushViewController:myViewController animated:NO]; I am not seeing bottom Tab bar when i push my current TableView to myViewController. I am seeing full screen view there. I want to see bottom Tab bar always when every tab item clicked. What might be the problem here? Could someone who come across this issue, please share your suggestion to me? Thank you.

    Read the article

  • Kohana 3 ORM: How to get data from pivot table? and all other tables for that matter

    - by zenna
    I am trying to use ORM to access data stored, in three mysql tables 'users', 'items', and a pivot table for the many-many relationship: 'user_item' I followed the guidance from http://stackoverflow.com/questions/1946357/kohana-3-orm-read-additional-columns-in-pivot-tables and tried $user = ORM::factory('user',1); $user->items->find_all(); $user_item = ORM::factory('user_item', array('user_id' => $user, 'item_id' => $user->items)); if ($user_item->loaded()) { foreach ($user_item as $pivot) { print_r($pivot); } } But I get the SQL error: "Unknown column 'user_item.id' in 'order clause' [ SELECT user_item.* FROM user_item WHERE user_id = '1' AND item_id = '' ORDER BY user_item.id ASC LIMIT 1 ]" Which is clearly erroneous because Kohana is trying to order the elements by a column which doesn't exist: user_item.id. This id doesnt exist because the primary keys of this pivot table are the foreign keys of the two other tables, 'users' and 'items'. Trying to use: $user_item = ORM::factory('user_item', array('user_id' => $user, 'item_id' => $user->items)) ->order_by('item_id', 'ASC'); Makes no difference, as it seems the order_by() or any sql queries are ignored if the second argument of the factory is given. Another obvious error with that query is that the item_id = '', when it should contain all the elements. So my question is how can I get access to the data stored in the pivot table, and actually how can I get access to the all items held by a particular user as I even had problems with that? Thanks

    Read the article

  • C# : changing listbox row color?

    - by Meko
    HI. I am trying to changing backround colorof some rows on listbox.I have 2 list that one has all names and it shown on listbox.And second list has some same value with first list.I want to show that when clicking button it will search in listbox and in second list then will change color where found value. I may search in list box like for (int i = 0; i < listBox1.Items.Count; i++) { for (int j = 0; j < students.Count; j++) if (listBox1.Items[i].ToString().Contains(students[j].ToString())) { } } But I don't know which method to change appearances of row.Any help? *EDIT: * HI I made my code like private void ListBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); Graphics g = e.Graphics; Brush myBrush = Brushes.Black; Brush myBrush2 = Brushes.Red; g.FillRectangle(new SolidBrush(Color.Silver), e.Bounds); e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), e.Font, myBrush, e.Bounds, StringFormat.GenericDefault); for (int i = 0; i < listBox1.Items.Count; i++) { for (int j = 0; j < existingStudents.Count; j++) if (listBox1.Items[i].ToString().Contains(existingStudents[j])) { e.Graphics.DrawString(listBox1.Items[i].ToString(), e.Font, myBrush2, e.Bounds, StringFormat.GenericDefault); } } e.DrawFocusRectangle(); } Now it draws my list on listbox.But when I click button first it shows only student that in list with red color but when I click on listbox it again draws all elements.I want that it will show all element ,when I click button it will show all elements and founded element in list with red color.Whre is my mistake?

    Read the article

  • System.Windows.Forms.DataVisualization Namespace Fine in One Class but Not in Another

    - by jxpx777
    Hi. I'm getting this error The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?) Here is my using section of the class: using System; using System.Collections; using System.Collections.Generic; using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting.Borders3D; using System.Windows.Forms.DataVisualization.Charting.ChartTypes; using System.Windows.Forms.DataVisualization.Charting.Data; using System.Windows.Forms.DataVisualization.Charting.Formulas; using System.Windows.Forms.DataVisualization.Charting.Utilities; namespace myNamespace { public class myClass { // Usual class stuff } } The thing is that I am using the same DataVisualization includes in another class. The only thing that I can think that is different is that the classes that are giving this missing namespace error are Solution Items rather than specific to a project. The projects reference them by link. Anyone have thoughts on what the problem is? I've installed the chart component, .Net 3.5 SP1, and the Chart Add-in for Visual Studio 2008. UPDATE: I moved the items from Solution Items to be regular members of my project and I'm still seeing the same behavior. UPDATE 2: Removing the items from the Solution Items and placing them under my project worked. Another project was still referencing the files which is why I didn't think it worked previously. I'm still curious, though, why I couldn't use the namespace when the classes were Solution Items but moving them underneath a project (with no modifications, mind you) instantly made them recognizable. :\

    Read the article

  • Uncaught TypeError: Object [object Object] has no method 'onAdded'

    - by user3604227
    I am using ExtJS4 with Java servlets. I am following the MVC architecture for ExtJS. I am trying a simple example of displaying a border layout but it doesnt work and I get the following error in ext-all.js in the javascript console: Uncaught TypeError: Object [object Object] has no method 'onAdded' Here is my code: app.js Ext.Loader.setConfig({ enabled : true }); Ext.application({ name : 'IN', appFolder : 'app', controllers : [ 'Items' ], launch : function() { console.log('in LAUNCH-appjs'); Ext.create('Ext.container.Viewport', { items : [ { xtype : 'borderlyt' } ] }); } }); Items.js (controller) Ext.define('IN.controller.Items', { extend : 'Ext.app.Controller', views : [ 'item.Border' ], init : function() { this.control({ 'viewport > panel' : { render : this.onPanelRendered } }); }, onPanelRendered : function() { console.log('The panel was rendered'); } }); Border.js (view) Ext.define('IN.view.item.Border',{extend : 'Ext.layout.container.Border', alias : 'widget.borderlyt', title : 'Border layout' , autoShow : true, renderTo : Ext.getBody(), defaults : { split : true, layout : 'border', autoScroll : true, height : 800, width : 500 }, items : [ { region : 'north', html : "Header here..", id : 'mainHeader' }, { region : 'west', width : 140, html : "Its West..", }, { region : 'south', html : "This is my temp footer content", height : 30, margins : '0 5 5 5', bodyPadding : 2, id : 'mainFooter' }, { id : 'mainContent', collapsible : false, region : 'center', margins : '5', border : true, } ] }); The folder structure for the Webcontent is as follows: WebContent app controller Items.js model store view item Border.js ext_js resources src ext_all.js index.html app.js Can someone help me resolve this error? Thanks in advance

    Read the article

  • Passing a list of ints to WebMethod using jQuery and ajax.

    - by birdus
    I'm working on a web page (ASP.NET 4.0) and am just starting simple to try and get this ajax call working (I'm an ajax/jQuery neophyte) and I'm getting an error on the call. Here's the js: var TestParams = new Object; TestParams.Items = new Object; TestParams.Items[0] = 1; TestParams.Items[1] = 5; TestParams.Items[2] = 10; var finalObj = JSON.stringify(TestParams); var _url = 'AdvancedSearch.aspx/TestMethod'; $(document).ready(function () { $.ajax({ type: "POST", url: _url, data: finalObj, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { $(".main").html(msg.d); }, error: function (xhr, ajaxOptions, thrownError) { alert(thrownError.toString()); } }); Here's the method in my code behind file: [Serializable] public class TestParams { public List<int> Items { get; set; } } public partial class Search : Page { [WebMethod] public static string TestMethod(TestParams testParams) { // I never hit a breakpoint in here // do some stuff // return some stuff return ""; } } Here's the stringified json I'm sending back: {"Items":{"0":1,"1":5,"2":10}} When I run it, I get this error: Microsoft JScript runtime error: 'undefined' is null or not an object It breaks on the error function. I've also tried this variation on building the json (based on a sample on a website) with this final json: var TestParams = new Object; TestParams.Positions = new Object; TestParams.Positions[0] = 1; TestParams.Positions[1] = 5; TestParams.Positions[2] = 10; var DTO = new Object; DTO.positions = TestParams; var finalObj = JSON.stringify(DTO) {"positions":{"Positions":{"0":1,"1":5,"2":10}}} Same error message. It doesn't seem like it should be hard to send a list of ints from a web page to my webmethod. Any ideas? Thanks, Jay

    Read the article

  • populating one checkedlistbox with another (checkedlistbox)

    - by 8thWonder
    I am having difficulties populating a checkedlistbox (CLB) based on the selection(s) made in another. It should also be noted that I have a "Select All" checkbox at the top that checks/unchecks all of the items in the first CLB. Here's the code: Private Sub chkSelectAll_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSelectAll.CheckedChanged For i As Integer = 0 To clb1.Items.Count - 1 clb1.SetItemChecked(i, chkSelectAll.Checked) Next End Sub Private Sub clb1_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles clb1.ItemCheck Dim i As Integer = clb1.SelectedIndex For j As Integer = 0 To al_2.Count - 1 If i = -1 Then For k As Integer = 0 To al_2.Count - 1 If Not clb2.Contains(al_2(k).sDate) Then clb2.Items.Add(al_2(k).sDate) Else : k += 1 End If Next ElseIf (e.NewValue = CheckState.Checked And al_2(j).sName = al_1(i)) Then clb2.Items.Add(al_2(j).sDate) ElseIf (e.NewValue = CheckState.Unchecked And al_2(j).sName = al_1(i)) Then clbProdBkups.Items.Remove(al_2(j).sDate) End If Next End Sub The first CLB is populated with an arraylist of values on the button click event. Based on whatever is checked in the first CLB, corresponding values from an arraylist of structures should fill the second CLB. The following code partially works until the "Select All" checkbox is clicked at which point one of two things happens: If other values have been selected before "Select All" is checked, the second CLB is filled with the correct number of corresponding values BUT only those of the most recently selected item of the first CLB instead of all of corresponding values of all of the items that were not already selected. When "Select All" is unchecked, the most recently incorrect values are removed, everything in CLB 1 is unchecked but the values in CLB 2 that were selected before "Select All" was checked remain. If "Select All" is checked before anything else is selected, I get an "unable to cast object of type 'System.String' to type 'System.Windows.Forms.Control'" error that points to the following statement from the itemcheck event: If Not clb2.Contains(al_2(k).sDate) Then Any insights will be greatly appreciated. ~8th

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >