w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I bind data from nested List<> objects to nested ListView controls?
You can bind the datasource of your inner list view to a property of the items bound to your outer listview. However, to do that the inner listview as to be in the itemtemplate of the outer listview. See the code below and note the DataSource='<%# Eval("Labels_color") %>' attribute for the inner list view. <asp:ListView ID="ListView_Orp_Results" runat="server" ItemPlaceholderID="itemPlaceholder"> <LayoutTemplate> <div id="outer_result_container"> <div id="itemPlaceholder" /> </div> </LayoutTemplate> <ItemTemplate> <div id="result_photo">...</div> <div id="result_category">...</div> <div id="result_detector">...</div> <div id="inner_result_container" runat="server"

Categories : Asp Net

Horizontal controlgroup nested in a listview
So this is CSS question then. You should wrap the text in one <div> and float both that <div> and the <p class="ui-li-aside"> below. Check out: http://jsfiddle.net/h5gcL/6/ Hope it helps ;)

Categories : Jquery

Nested ListView only displays first selected data
The reason could be: The ListForumSubjectByCategoryID only returns one record Something weird is going on with the inner ListView Everything is ok except the browser for some reason is not showing all the data Based on the code you have provided (which seems sane, and a quick test of my own shows that it should work), the problem is likely the third option. Can you check by viewing the source of the rendered page to see it the content is there? If so, you need to investigate your CSS to figure out why the browser is only showing the first line.

Categories : Asp Net

jquerymobile not rendering nested listview with knockoutJS
If you're using the latest version of jQuery Mobile, you must know that nested lists have only partial support. Here's the source link.. As mentioned we'll have to use the page -> page navigation system by ourselves, so here goes. Setup I built up an example for this sometime back. You could adapt your code to that. I have a json object array like this : [ { "name": "DC Comics", "characters": [ "All-Star Squadron", "Birds of Prey", ... ] }, { "name": "Marvel Studios", "characters": [ "Alpha Flight", "Avengers", "Champions", "Defenders", ... ] } .... ] So, it might be better if you have two pages, one for show

Categories : Jquery

Android Arbitrarily Nested ListView Type Menu
Look into Wizard Pager to see if this does what you need. Otherwise, you could implement it as an activity that takes a tree and has an adapter that shows its current level, and then passes subtrees to new activities via intent extras. Or you could implement it as a Fragment that does approximately the same thing and stay in the same activity and just do FragmentTransactions.

Categories : Android

jQuery Mobile Collapsible with nested Listview does not display correctly
When you add html manually in jQuery Mobile you need to tell it to re-do the enhancements that were done during page create. To do this call the .listview() constructor which will recreate the widget rather than .listview('refresh') which will just refresh. Also make sure that when you re-create any markup that you add the data-role attribute. Lastly don't use $(document).ready it will cause problems with JQM navigation instead use $('#mypageid').on('pageinit', function(){}); http://api.jquerymobile.com/category/events/

Categories : Jquery

How to Code on checkbox which is add in listview
You have to add checkbox in listview below: <asp:CheckBox ID="CheckBox1" OnCheckedChanged="Check" runat="server" AutoPostBack="True"/> and have to code like this for work on it: C#: <script runat="server"> public void Check(object sender, EventArgs e) { //Some code here...... } </script> VB: <script runat="server"> Public Sub Check(sender As Object, e As EventArgs) //Some code here...... End Sub </script>

Categories : Asp Net

How to add a ListViewItem in ListView control in asp.net code behind
No other way of binding data to ListView except DataSourceId and SataSource Check the ListView control Reference from MSDN Here.

Categories : Asp Net

Nested Control Accordion < Accordion < ListView ItemEditing Issue
Found a fix for my problem. After much googling, I found that the issue was the ClientID of the nested controls being identical. I used this as a solution: Accordion related: "ID xxx ALREADY DEFINED"

Categories : Asp Net

Jenkins: Creating Jenkins Nested/ListView Views programatically
There is a great job-dsl plugin to automate a process of job and view creation. Checkout example of Nested View dsl. We used it for Continuous Delivery, and it works pretty well! You may start here.

Categories : Jenkins

How to retrieve column items from listview in code
Dim constr As String = "Put your connection string here" Dim ds As New DataSet Dim con As New SqlClient.SqlConnection(constr) con.Open() Dim sqladap As New SqlClient.SqlDataAdapter("select * from tbl_Employee", con) sqladap.Fill(ds) For i As Integer = 0 To ds.Tables(0).Columns.Count - 1 ListView1.Columns.Add(ds.Tables(0).Columns(i).ToString()) Next For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 Dim listRow As New ListViewItem listRow.Text = ds.Tables(0).Rows(i)(0).ToString() For j As Integer = 1 To ds.Tables(0).Columns.Count - 1 listRow.SubItems.Add(ds.Tables(0).Rows(i)(j).ToString())

Categories : Wpf

If the ListView is not visible, does refresh code execute?
If you're firing a timer, and that timer is executing code that refreshes the display of the list view, it will execute, but the display will not refresh until you ... actually display it to the user. In other words, the ListView's state gets updated with the changes, but the changes aren't displayed until the form is visible. No video card pixels are harmed in the updating of the hidden ListView, in other words.

Categories : Vb.Net

ASP.NET 4.5 - Constructor not found when using code-behind UpdateMethod in ListView and FormView
This modified code works, but it's definitely not the solution I want. I had to ditch using the ListView/FormView model binding and use an ObjectDataSource instead.: View: <%@ Page Title="View Blog Post" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Record.aspx.cs" Inherits="Pritchard.Jumpstart.Webforms.BlogPost.Record" %> <%@ Import Namespace="Microsoft.AspNet.FriendlyUrls" %> <%@ Import Namespace="Pritchard.Jumpstart.Common.Data" %> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <asp:ObjectDataSource ID="BlogPostDataSource" runat="server" SelectMethod="GetBlogPost" InsertMethod="InsertBlogPost"

Categories : Asp Net

how to write code for onitemClickListener for customized listview using BaseAdapter?
Well, we don't know about your TaskClass, but I expect you want something like this: listViewInstance.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int pos, long id) { TaskClass taskClass = taskClasslistInstance.get(pos); Log.d(TAG, "Clicked on: " + taskClass) // Do stuff with taskClass }});

Categories : Java

How to get youtube thumbnails in a listview using JSON in Android? My code so far:
I have used Universal ImageL0ader for Lazy Loading. You download the same and use it or use a different technique. Customize the below according to your needs. Use a thread or Asynctask to make a http request to the json response. Parse the response and store it in a list. Use a Custom Adapter to display the data. You can also use Volley library. public class MainActivity extends Activity { Button b; ListView lv; ArrayList<String> msg = new ArrayList<String>(); ArrayList<String> title = new ArrayList<String>(); ArrayList<String> thumb = new ArrayList<String>(); ProgressDialog pd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layo

Categories : Android

Highlight ListView item at creation time via code
In getView method of listview's adapter class,take id of text from Layout file and apply background color to it. for example, public View getView(int position, View convertView, ViewGroup parent) { View v = null; String inflater = Context.LAYOUT_INFLATER_SERVICE; LayoutInflater li = (LayoutInflater) my_ctx .getSystemService(inflater); v = li.inflate(R.layout.layoutfile, parent, false); if(position==0) { TextView text = (TextView) findViewById(R.id.textView1); text.setBackgroundColor(Color.ANY_COLOR); } }

Categories : Android

optimize a c code on nested loop
Here's one idea: Try to extract parts of the calculation that don't change to outside at least the inner loop. For example, i + rl + rc from the in calculation doesn't need to be inside the loop. Once you have that, you realize that the value of in increases by u every iteration, modulo 16 of course. So instead of doing a multiplication, you can do an addition. The jn calculation also has quote a few things you can extract. Of course, this is assuming that you actually know this to be a performance bottleneck (profile it!) and the compiler isn't smart enough to do such an optimization for your. When in doubt, inspect the assembly.

Categories : C

adding nested ul list from code behind
In the inner loop, you need to create a sub <ul> tag. foreach (TreeNode childNode in node.ChildNodes) { HtmlGenericControl child_li = new HtmlGenericControl("li"); navMenu.Controls.Add(child_li); becomes if(node.ChildNodes.Count > 0) { HtmlGenericControl child_ul = new HtmlGenericControl("ul"); li.Controls.Add(child_ul); foreach (TreeNode childNode in node.ChildNodes) { HtmlGenericControl child_li = new HtmlGenericControl("li"); child_ul.Controls.Add(child_li); etc...

Categories : HTML

From Code Retrieve dynamically generated objects from listview's datatemplate
So I ended up replacing the collection with a collection of canvas objects. The next step was to replace the binding and use a content presenter, to directly display the canvases that were in my collection. One other useful change I made was to the column 1 code to display the index of my items. Not as hacky as I was looking for, but arguably hacky enough. <ListView Name="MyListView" <!-- COMMENT ItemsSource="{Binding MySimpleData}"> END COMMENT--> ItemsSource="{Binding CanvasCollection}"> <!-- EDIT HERE --> AlternationCount="{Binding CanvasCollection.Count}" <ListView.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.View> <GridView

Categories : C#

Creating a nested object from parsed bb code
Try this simple stack-based parser: token = /(?:[(w+)(.*?)])|(?:[/(w+)])|([^[]]+)/g root = {children:[]} stack = [root] bbStr.replace(token, function() { var a = arguments; if(a[1]) { var node = {tag: a[1], attr: a[2], children:[]} stack[0].children.push(node); stack.unshift(node); } else if(a[3]) { if(stack[0].tag != a[3]) throw "Unmatched tag"; stack.shift(); } else if(a[4]) { stack[0].children.push({tag: "#text", value: a[4]}); } }) The output format differs from what you've posted, but that should be no problem. http://jsfiddle.net/L8UZf/

Categories : Javascript

PHP - Avoiding nested if statements - cleaner way to code this
You don't need the empty checks at that point, move them to the validation functions. For example: function validate_email($str) { if(empty($str)) { return false; } $str = trim(strtolower($str)); if(!filter_var($str, FILTER_VALIDATE_EMAIL)) { return false; } else { return $str; } } $email = validate_email($_POST['email']); if($email) { // your code }

Categories : PHP

How do I target a specific element nested in HTML/CSS code?
Check this Fiddle Give border-top and border-bottom to you li and target your #logo with border:none; this will solve your problem. And for the gap you can see in between li elements this can be solved by setting the parent elements font-size:0; and then define the font-size:npx to your li element. HTML <ul id="nav"> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="portfolio.html">Portfolio</a></li> <li id="logo"><a href="index.html"><img src="http://placehold.it/50x50/" /></a></li> <li><a href="projects.html">Projects</a></li> <li><a href="contact.html">Con

Categories : HTML

Times of code been executed in a nested for loop in Java
You just need to evaluate the following sum: You could do that by hand, but Wolfram Alpha is much better at that. It is not hard to verify that (N-1)(N-2) = N2 - 3N + 2 which shows the formula you gave. For the manual analysis: Start with the inner sum, which is easy: Plugging this in the middle sum gives: This sum would be easier to evaluate if the dummy variable started from 0 (rather than i+1), therefore we apply the dummy transformation p = j - i - 1: Finally, this must be plugged in the outer sum:

Categories : Java

Wrong code when combining anonymous and nested procedures
How can I know where this is going to cause problems? It's hard to tell at this point in time. If we knew the nature of the fix in Delphi XE2 we'd be in a better position. All you can do is refrain from using anonymous functions. Delphi has had procedural variables, so the need for anonymous functions ready is not that dire. See http://www.deltics.co.nz/blog/posts/48. It would be interesting to me to know if this is fixed in later versions of Delphi According to @Sertac Akyuz this has been fixed in XE2. Personally I dislike anonymous methods and have had to ban people from using them in my Java projects because a sizable proportion of our code base was going anonymous (event handlers). Used in extreme moderation I can see the use case. But in Delphi where we have proced

Categories : Delphi

Cleaner code: Re-factor multiple nested if statements
Possibly encapsulate the functionality you need for each boolean condition into a method and use the method instead of specifying condition1, condition2, condition3 etc. private boolean isRed() { //do some stuff } private boolean isBlue() { //do some other stuff } private boolean isGreen() { //do some more stuff } ... if(isRed() && isBlue() && isGreen()) { //do some more stuff }

Categories : C#

How to rewrite complicated lines of C++ code (nested ternary operator)
This is better? !m_seedsfilter ? good=true : m_seedsfilter==1 ? good=newClusters(Sp) : good=newSeed(Sp); I'll add that, while it's theoretically possible to simplify this expression (by why? It's so much clear!), the resulting expression wouldn't probably be 100% equivalent in all the possible cases... And showing if two expressions are really equivalent in C++ is a problem very very very very very complex... The degenerate example I have contrived (http://ideone.com/uLpe0L) (note that it isn't very degenerate... It's only based on a small programming error) is based on considering good a bool, creating two classes UnixDateTime and SmallUnixDateTime, with newClusters() returning a SmallUnixDateTime and newSeed() returning a UnixDateT

Categories : C++

Struts 1.1 nested and in combination
Use <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> and the code will look like <c:choose> <c:when test="${element.method1 == true}"> <c:choose> <c:when test="${element.method2 == true}"> <span style="color:green;"><c:out value="${element.prop1}/></span> </c:when> <c:otherwise> <span style="color:red;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose> </c:when> <c:otherwise> <span style="color:black;"><c:out value="${element.prop1}/></span> </c:otherwise> </c:choose>

Categories : Java

I have a nested function in a function but my code won't clear the display correctly. I am not getting an error in console?
I recommend just declaring the functions outside of the $(document).ready(function(){ .. }); The console doesn't recognize that the functions exist because you are basically trying to make local functions. function clearTheDisplayInitial() { $("#Resume, #CodingExamples, #AboutMe").hide(); } function clearTheDisplay() { $("#Resume, #CodingExamples, #AboutMe, #mainMenu").fadeOut(900); } $(document).ready(function() { $("#displayResume").click(function() { clearTheDisplayInitial(); // you could just add $("#Resume, #CodingExamples, #AboutMe").hide(); here $("#Resume").fadeIn(900); }); $("#CodingExamples1").click(function() { clearTheDisplay(); // you could just add $("#Resume, #CodingExamples, #AboutMe, #mainMenu").fadeOut(900); here $("#A

Categories : Javascript

How to use search function in my custom listview(fetching data from website and display in listview)
Use addTextChangeListener to show list according to the content:- searchContentEditText.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable s) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { selection= searchContentEditText.getText().toString().toLowerCase(); List newListTwo=new ArrayList(); textlength = selection.trim().length(); System.err.println("selection" + textlength);

Categories : Java

In android layout how do I align elements underneath a listview regardless of the listview's height
It sounds like you've used android:layout_below="@id/listVieId" and android:layout_alignParentBottom="true" as these would give the results you mentioned. It sounds like what you want is addFooterView(View v) Note what the Docs say NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.

Categories : Android

.listview() is not a function error when creating a dynamic listview in jquery mobile
You're not using jQuery-selector the right way. To target an element with an id, use $('#element_id') and for an element with a class $('.element_class'). So, your selection should be as below. $('#newsfeedposts').append(markup); and then $('#newsfeedposts').listview('refresh');

Categories : Javascript

Text values are changed in customized listview when scroll the listview in android?
The problem is that you are not using a different view holder for every line, and that when recycling your list item views your holders are shuffled togheter. You can see this simply adding a final int position field to your holder, where to store the getView position parameter; debugging, you will see what happen. So, you can't use holders to store your quantity values Furthermore, you are not using the variable list to store quantity values. This code is working for me: public View getView(final int position, View convertView,final ViewGroup parent) { final ViewHolder holder; LayoutInflater inflater = activity.getLayoutInflater(); if (convertView == null) { convertView = inflater.inflate(R.layout.order_custom, null); holder = new ViewHolder();

Categories : Android

Null pointer exception onFling on listview item in a fragment while trying to swipe delete in ListView
Your log is showing e1 is null and historySize=0, so it only has one event to report. You'll need to add a null check to ensure you have both events. @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { Log.e(THIS_FILE, "======onFling "+REL_SWIPE_MAX_OFF_PATH+" , "+e1+" , "+e2); if (e1 == null || e2 == null) { return false; // If it still gives you trouble return true } if (Math.abs(e1.getY() - e2.getY()) > REL_SWIPE_MAX_OFF_PATH) return false; if (e1.getX() - e2.getX() > REL_SWIPE_MIN_DISTANCE && Math.abs(velocityX) > REL_SWIPE_THRESHOLD_VELOCITY) { int pos = getListView() .pointToPosition((int) e1.getX(), (int) e2.getY()); if (pos &

Categories : Android

Make an AFNetworking operation complete before next code line after [operation start] and how to handle nested operations
This is not an AFNetworking related question, rather a general Objective-C or asynchronous question. You may try to reload the table view whenever the images of one model have been loaded: - (void)getAllModels{ NSURLRequest *request = ...; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { for(NSDictionary *model in JSON){ Model *model = [Model alloc] initWithId:...; [model getPhotosWithCompletionBlock: ^(NSArray *results){ dispatch_async(dispatch_get_main_queue(), ^{ model.photos = results; [self.tableView reloadData]; }); }failureBlock:^(NSError *error) { N

Categories : Misc

Scroll Vertically inside ListView when ListView is VerticalAlignment="Stretch"
Remove the StackPanel. That prevents the ListView (or any other children) to have a delimited size. That's why you're not getting any scrollbars, because the ListView has an infinite height, as layout-ed by the StackPanel. Besides, having a StackPanel with only 1 child makes no sense. It's supposed to "stack" its children. Edit: Also remove the ScrollViewer, as the ListView already has a ScrollViewer inside of it as per the default Template. Unless of course you had changed the Default ControlTemplate for that.

Categories : C#

Visual Basic 2010 - Transfer listview info to another listview
I think you may be wanting to try something like this Private Sub ListView1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick ListView2.Items.Add(ListView1.Items(0).Clone()) End Sub HTH

Categories : Vb.Net

How do I dynamically add items to a listview in jQuery Mobile / Listview not updating
Before refresh the listview you have to wait until its initialization. Try with this: $( "#location_popup" ).one( "pagebeforeshow", function( event ) { $('#location_listview').listview('refresh'); }); Demo here.

Categories : Jquery

Get the id of parent listview in child listview checkbox change event
change your checkbox property to <asp:CheckBox ID="chkSubModuleView" Checked="true" runat="server" AutoPostBack="true" Key='<%# Eval("ID")%>' OnCheckedChanged="chkSubModuleView_CheckedChanged" /> In your .cs protected void chkSubModuleView_CheckedChanged(object sender, EventArgs e) { CheckBox chk = (CheckBox)sender; string yourID = chk.Attributes["Key"].ToString(); }

Categories : Asp Net

NullPointerException when enabling drag-sort-listview from a OnItemLongClickListener in a listview
I am hitting the same issue - were you able to work around this? One solution I had was to set the drag handler on the list view item to GONE initially - this way the user can't drag to sort. When the long press triggers, set the drag handler's visibility to VISIBLE. However a problem a ran into here is that when you de-select the item after long pressing it, even if you set the drag handler to GONE again, the user can still drag sort by pressing on the position where the handler used to be.

Categories : Android

Are functions inside GUI code or Level-2 S-functions nested?
According to the documentation on functions: You can declare multiple local functions within the same file, or nest functions. If any function in a file contains a nested function, all functions in the file must use the end keyword to indicate the end of the function. Otherwise, the end keyword is optional. I believe the same applies for GUIs and S-functions. I find nested functions particularly useful for GUIs as a nested function can access the data (workspace) of its parent function without having to pass the variables as arguments.

Categories : Matlab



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.