Search Results

Search found 1606 results on 65 pages for 'datasource'.

Page 1/65 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Trouble with datasource not being called from viewWillAppear

    - by user278859
    A little background. I have taken GCCalendar which only works in portrait orientation and extended it to work in landscape similar to how the iPhone's Calendar app works. I did this by duplicating the main view class and modifying it to work in landscape. So when the phone is in portrait orientation the CGCalendar is instantiated from the apps main view controller using the original portrait view class and when in landscape orientation using the new modified landscape view class. Most of the other classes in GCCalendar are shared without modification. A few had to be duplicated as well. I got it all working great except for an issue with the datasource. The datasource is called when the calendar is first loaded and each time the user changes the dates being viewed. Problem is I can't get the datasource call to work on the first call. I am stumped as it works fine in portrait orientation and I cannot find any difference between the 2 versions. Following is some of the code that shows how it gets to the datasource call the first time. Subsequent calls removes all the calendar subviews and instantiates them again with the new dates. The duplicated landscape class names end in LS. Otherwise as you can see they are identical. Does anyone has any idea of where else I might look to resolve this issue? Thanks, John -------------------------------- //App main view controller - (void)showLandscapeCalendar { GCCalendarLandscapeView *calendar = [[[GCCalendarLandscapeView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (void)showPortraitCalendar { GCCalendarPortraitView *calendar = [[[GCCalendarPortraitView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (NSArray *)calendarEventsForDate:(NSDate *)date{ //build and return the events array //this is the protocol datasource method //It is supposed to run every time the date changes in the calendar } ------------------------------- // GCCalendarLandscapeView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayViewLS *nextDayView = [[GCCalendarDayViewLS alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayViewLS - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { //** first time through the dataSource method does not run events = [dataSource calendarEventsForDate:date]; } ------------------------------- // GCCalendarPortraitView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayView *nextDayView = [[GCCalendarDayView alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayView - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { **//this one works every time events = [dataSource calendarEventsForDate:date]; }

    Read the article

  • Using cellUpdateEvent with YUI DataTable and JSON DataSource

    - by Rob Hruska
    I'm working with a UI that has a (YUI2) JSON DataSource that's being used to populate a DataTable. What I would like to do is, when a value in the table gets updated, perform a simple animation on the cell whose value changed. Here are some relevant snippets of code: var columns = [ {key: 'foo'}, {key: 'bar'}, {key: 'baz'} ]; var dataSource = new YAHOO.util.DataSource('/someUrl'); dataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; dataSource.connXhrMode = 'queueRequests'; dataSource.responseSchema = { resultsList: 'results', fields: [ {key: 'foo'}, {key: 'bar'}, {key: 'baz'} ] }; var dataTable = new YAHOO.widget.DataTable('container', columns, dataSource); var callback = function() { success: dataTable.onDataReturnReplaceRows, failure: function() { // error handling code }, scope: dataTable }; dataSource.setInterval(1000, null, callback); And here's what I'd like to do with it: dataTable.subscribe('cellUpdateEvent', function(record, column, oldData) { var td = dataTable.getTdEl({record: record, column: column}); YAHOO.util.Dom.setStyle(td, 'backgroundColor', '#ffff00'); var animation = new YAHOO.util.ColorAnim(td, { backgroundColor: { to: '#ffffff'; } }); animation.animate(); }; However, it doesn't seem like using cellUpdateEvent works. Does a cell that's updated as a result of the setInterval callback even fire a cellUpdateEvent? It may be that I don't fully understand what's going on under the hood with DataTable. Perhaps the whole table is being redrawn every time the data is queried, so it doesn't know or care about changes to individual cells?. Is the solution to write my own specific function to replace onDataReturnReplaceRows? Could someone enlighten me on how I might go about accomplishing this? Edit: After digging through datatable-debug.js, it looks like onDataReturnReplaceRows won't fire the cellUpdateEvent. It calls reset() on the RecordSet that's backing the DataTable, which deletes all of the rows; it then re-populates the table with fresh data. I tried changing it to use onDataReturnUpdateRows, but that doesn't seem to work either.

    Read the article

  • DataSource for Tomcat web app, Spring and Hibernate

    - by EugeneP
    Web app runs on Tomcat. Datasource is configured with Spring configuration, and is used by Hibernate. If we cannot use JNDI, what would you suggest to use as a DataSource? org.springframework.jdbc.datasource.DriverManagerDataSource will be ok? It's not very good, but sincerely speaking, it can be used on production server, right? Just a bit of headache with too frequent connection reopening. Also, we can use BasicDataSource from Apache. It's much better of course, but here's the question. IF WE DON'T USE JNDI, THEN: If every instance of an app will create its own copy of a DataSource, and every DataSource can have 5 open connections, what do we get? Num_of_running_apps * Num_of_max_active_connections = max active open connection on a DB for this user? Second question: from the perspective of Hibernate, is there any difference about what datasource implementation is used? Will it work with no matter what datasource perfectly and in a stable way?

    Read the article

  • Sharing a custom datasource between Winforms and Webforms

    - by Earlz
    Hello, I'd like to create a custom datasource that is shared between a Winforms and Webforms project. This functions as a middle layer for a reporting tool(DevExpress Reporting). The Webforms project is a designer for these reports. So we want for the reports to be capable of going to the server to get data and such. So our datasource would abstract away all the communication overhead. Then, for consistency, the datasource would also run on the server for reporting, except for their would be no communication. What would be the best course of action? There doesn't seem to be such a thing as a DataSource in Winforms. Is DataSource not the thing I'm looking for? Edit: After some research, it appears that IDataAdapter may be good for my purpose. Any opinion on that?

    Read the article

  • Tomcat6 MySql JDBC Datasource configuration

    - by Bob
    Hi, I've always used Spring's dependency injection to get datasource objects and use them in my DAOs, but now, I have to write an app without that. With Spring I can write something like this: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://127.0.0.1/app?characterEncoding=UTF-8" /> <property name="username" value="u" /> <property name="password" value="p" /> </bean> But how can I use datasource in my DAOs without Spring or anything? I'm using servlets and JSPs only. Performance is very important factor. Thanks in advance!

    Read the article

  • KendoUI Mobile switch and datasource

    - by OnaBai
    I'm trying to have a list of items displayed using a listview, something like: <div data-role="view" data-model="my_model"> <ul data-role="listview" data-bind="source: ds" data-template="list-tmpl"></ul> </div> Where I have a view using a model called my_model and a listview where the source is bound to ds. My model is something like: var my_model = kendo.observable({ ds: new kendo.data.DataSource({ transport: { read: readData, update: updateData, create: updateData, remove: updateData }, pageSize: 10, schema: { model: { id: "id", fields: { id: { type: "number" }, name: { type: "string" }, active: { type: "boolean" } } } } }) }); Each item includes an id, a name (that is a string) and a boolean named active. The template used to render each element is: <script id="list-tmpl" type="text/kendo-tmpl"> <span>#= name # : #= active #</span> <input data-role="switch" data-bind="checked: active"/> </script> Where I display the name and (for debugging) the value of active. In addition, I render a switch bound to active. You should see something like: The problems observed are: If you click on a switch you will see that the value of active next to the name changes its value (as expected) but if then, you pick another switch, the value (neither next to name nor in the DataSource) is not updated (despite the value of the switch is correctly updated). The update handler in the DataSource is never invoked (not even for the first chosen switch and despite the DataSource for that first toggled switch is updated). You can check it in JSFiddle: http://jsfiddle.net/OnaBai/K7wEC/ How do I make that the DataSource gets updated and update handler invoked?

    Read the article

  • Websphere 6.1, Datasource, two apps

    - by asrijaal
    Hi, I've got a webapp running on a Websphere 6.1 Server which JNDI lookups for a datasource. This webapp runs fine, the Websphere server recognizes the datasource ref in the web.xml etc.. Now we added a second webapp which should use this datasource with same configuration but I only getting a NULL Object when I invoke my JNDI lookup and a ClassCastException is thrown (which is correct). Maybe one of you has some suggestions?

    Read the article

  • Arraylist as repeater datasource (how to access from .aspx)

    - by Phil
    I have an arraylist: Dim downloadsarray As New ArrayList downloadsarray.Add(iconlink) downloadsarray.Add(imgpath) downloadsarray.Add(filesize) downloadsarray.Add(description) Which is the datasource of my repeater: DownloadsRepeater.DataSource = downloadsarray DownloadsRepeater.DataBind() Please can you tell me how I output the items in the array to the .aspx page. I usually use (when using sqldatareader as datasource): <%#Container.DataItem("1stcolumnnamestring")%> <%#Container.DataItem("2ndcolumnnamestring")%> But this does not work when using the arraylist as datasource. Thanks. ps... I know how to use <%#Container.DataItem% to dump everything but I need to get at the items in the array individually, not have them all ditched out to the page in one go. For example, item 1 contains a link, item 2 contains an image path, item 3 contains a description. I need to have them kick out in the correct order to build the link and icon correctly.

    Read the article

  • Crate datasource for mysql to different machine in glassfish

    - by Dickson
    I'm using glassfish(v2.11) as my application server and I have another machine for mysql database server. Currently I want to separate the app server and db server, so I create a jdbc datasource to point to mysql server, but it doesn't works as expect, by the way, when I create datasource to point to local machine (glassfish app server and mysql db server in single machine), and It works well. Is there any configuration I need to care of when pointing datasource to different machine which I use to host my database (MySQL 5.1)?

    Read the article

  • Custom DataSource Extender

    - by Brian
    I dream of creating a control which works something like this: <asp:SqlDataSource id="dsFoo" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>" SelectCommandType="StoredProcedure" SelectCommand="cmd_foo"> </asp:SqlDataSource> <Custom:DataViewSource id="dvFoo" runat="server" rowfilter="colid &gt; 10" datasourceid="dsFoo"> </Custom:DataViewSource> I can accomplish the same thing in the code behind by executing cmd_foo, loading the results into a DataTable, then loading them into a DataView with a RowFilter. The goal would be to have multiple DataViews for one DataSource with whatever special filters I wish to apply to the select portion of the DataSource. I could imagine extending this to be more powerful. I tried peaking at this and this but am a bit confused on a few points. Currently, my main issue is being unsure where to grab the output data of the DataSource so I can stick it into a DataTable.

    Read the article

  • Passing DataSource object from a servlet to a JavaBean

    - by Slavko
    I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data to avoid having that lookup code in the bean?

    Read the article

  • Weblogic JDBC datasource,java.sql.SQLException: Cannot obtain XAConnection weblogic.common.resourcep

    - by gauravkarnatak
    I am using weblogic JDBC datasource and my DB is oracle 10g,below is the configuration. It used to work fine but suddenly it started giving problem,please see below exception. Weblogic JDBC datasource,java.sql.SQLException: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool <?xml version="1.0" encoding="UTF-8"?> <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd" XL-Reference-DS jdbc:oracle:oci:@abc.COM oracle.jdbc.driver.OracleDriver user DEV_260908 password password dll ocijdbc10 protocol oci oracle.jdbc.V8Compatible true baseDriverClass oracle.jdbc.driver.OracleDriver 1 100 1 true SQL SELECT 1 FROM DUAL DataJndi OnePhaseCommit This exception is coming on dev environment where connected user is only one. I know, this is related to pool max size but I also suspect this could be due to oracle,might be oracle isn't able to create connections. below are my queries Is there any debug/logging parameter to enable datasource logging,so that I can check no of connections acquired,released and unused in logs ? How to check oracle connection limit for a particular user ?

    Read the article

  • refering Tomcat JNDI datasource in persistence.xml

    - by binary_runner
    in server.xml I've defined global resource (I'm using Tomcat 6): <GlobalNamingResources> <Resource name="jdbc/myds" auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="3" maxWait="10000" username="sa" password="" driverClassName="org.h2.Driver" url="jdbc:h2:~/.myds/data/db" /> </GlobalNamingResources> I see in catalina.out that this is bound, so I suppose it's OK. In my web app I have the link to the datasource, I'm not sure it's OK: <Context> <ResourceLink global='jdbc/myds' name='jdbc/myds' type="javax.sql.Datasource"/> </Context> and in application there is persistence.xml : <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="oam" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>jdbc/myds</non-jta-data-source> <!-- class definitions here, nothing else --> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> </properties> </persistence-unit> </persistence> It shuld be OK, but most probably this or the ResourceLink definition is wrong because I'm getting: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context What's wrong and why this does not work ?

    Read the article

  • Oracle JDBC connection with Weblogic 10 datasource mapping, giving problem java.sql.SQLException: Cl

    - by gauravkarnatak
    Oracle JDBC connection with Weblogic 10 datasource mapping, giving problem java.sql.SQLException: Closed Connection I am using weblogic 10 JNDI datasource to create JDBC connections, below is my config http://www.bea.com/ns/weblogic/920.xsd" XL-Reference-DS jdbc:oracle:oci:@abc.XL.COM oracle.jdbc.driver.OracleDriver user DEV_260908 password password dll ocijdbc10 protocol oci oracle.jdbc.V8Compatible true baseDriverClass oracle.jdbc.driver.OracleDriver 1 100 1 true SQL SELECT 1 FROM DUAL ReferenceData OnePhaseCommit When I run a bulk task where there are lotsa connection made and closed, sometimes it gives connection closed exception for any of the task in the bulk task. Below is detailed exception' java.sql.SQLException: Closed Connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207) at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3512) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3265) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3367) Any pointers ? Thanks in advance, Gaurav

    Read the article

  • Maintain Added List Item while binding from datasource

    - by Kronass
    Hi, I have a drop down list, and I added some items in it as follows <asp:DropDownList ID="ddlInsAuther" runat="server" DataSourceID="ObjectDataSourceInsAuthers" DataTextField="AutherName" DataValueField="AutherID"> <asp:ListItem Value="-1">No Authers</asp:ListItem> </asp:DropDownList> And in Datasource <asp:ObjectDataSource ID="ObjectDataSourceInsAuthers" runat="server" SelectMethod="GetAll" TypeName="MyProject.BusinessLayer.AuthersFactory"> </asp:ObjectDataSource> When it loads it clears the list and loads the new items, I don't want to make a custom binder on page load, how can I maintain my added items in the list while binding from datasource?

    Read the article

  • Model Object called in NSOutlineView DataSource Method Crashing App

    - by Alec Sloman
    I have a bewildering problem, hoping someone can assist: I have a model object, called Road. Here's the interface. @@@ @interface RoadModel : NSObject { NSString *_id; NSString *roadmapID; NSString *routeID; NSString *title; NSString *description; NSNumber *collapsed; NSNumber *isRoute; NSString *staff; NSNumber *start; NSArray *staffList; NSMutableArray *updates; NSMutableArray *uploads; NSMutableArray *subRoads; } @property (nonatomic, copy) NSString *_id; @property (nonatomic, copy) NSString *roadmapID; @property (nonatomic, copy) NSString *routeID; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *description; @property (nonatomic, copy) NSNumber *collapsed; @property (nonatomic, copy) NSNumber *isRoute; @property (nonatomic, copy) NSString *staff; @property (nonatomic, copy) NSNumber *start; @property (nonatomic, copy) NSArray *staffList; @property (nonatomic, copy) NSMutableArray *updates; @property (nonatomic, copy) NSMutableArray *uploads; @property (nonatomic, copy) NSMutableArray *subRoads; - (id)initWithJSONObject:(NSDictionary *)JSONObject; @end This part is fine. To give you some background, I'm translating a bunch of JSON into a proper model object so it's easier to work with. Now, I'm trying to display this in an NSOutlineView. This is where the problem is. In particular, I have created the table and a datasource. - (id)initWithRoads:(NSArray *)roads { if (self = [super init]) root = [[NSMutableArray alloc] initWithArray:roads]; return self; } - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { if (item == nil) return root.count; return 0; } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { return NO; } - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item { if (item == nil) item = root; if (item == root) return [root objectAtIndex:index]; return nil; } - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { return [item title]; } In the final datasource method, it attempts to return the "title" string property of the model object, but for some reason crashes each time. I have checked that the method is taking in the correct object (I checked [item class] description], and it is the right object), but for some reason if I call any of the objects accessors the app immediately crashes. This is totally puzzling because in the init method, I can iterate through root (an array of RoadModel objects), and print any of its properties without issue. It is only when I'm trying to access the properties in any of the datasource methods that this occurs. I wonder if there is something memory-wise that is going on behind the scenes and I am not providing for it. If you can shed some light on to this situation, it would be greatly appreciated! Thanks in advance!

    Read the article

  • Define DataSource bean on code

    - by Ruben Trancoso
    I would like to make a "First Access Database Setup Process" in my spring application and the only thing I can imagine as a solution would be to initialize the DataSource bean programatically. My current bean is defined as: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/catalog" /> <property name="username" value="condominium" /> <property name="password" value="password" /> <property name="validationQuery" value="SELECT 1" /> <property name="testOnBorrow" value="true" /> <property name="defaultAutoCommit" value="false" /> <property name="maxWait" value="5000" /> </bean> but the ideal thing was to load it by myself in whenever I need it and with the parameter I define. The scenario is that the user (administrator) comes to the application at the first time and I ask him the server, port and catalog to connect. I store it in a embeeded db and next time application start, a bean can check if the parameter are set on the embedded db and load it again. Is it possible?

    Read the article

  • Externalizing Grails Datasource configuration

    - by miek
    Grails 1.x allows using external configuration files by setting the grails.config.locations directive. Is there a similar approach available for externalizing the database configuration in Datasource.groovy (without setting up JNDI)? It would prove helpful to be able to configure DB credentials in a simple configuration file outside the application. Thanks in advance!

    Read the article

  • vb.net using SortedDictionary as combobox datasource

    - by user228058
    I have a combobox which i am binding to a sortedDictionary list, so it displays in ascending order. My question is, I need to display "--Select--" as the first option. Is there any way to either: 1) add another item besides for the datasource or 2) add an unsorted item to the top of the sortedDictionary any other ideas welcome as well :) TIA

    Read the article

  • How can I spoof a jndi lookup for a datasource without a app server

    - by Wiszh
    I want to test some new functionality which is part of an internal web app. This new code uses a database connection normally provided by an app server (tomcat). I do not want to recreate the entire web app on my local machine to test the new code, since I only need to run one function. Does anyone know how I can 'spoof' a Context, or Datasource, to retrieve the database config, without actually creating a web app instance on a server? Thanks

    Read the article

  • How to cache YUI DataSource?

    - by Matt McCormick
    I'm setting up a YUI DataTable with filtering by following the steps on the YUI site However, I am using JSON as the DataSource ResponseType. When I type in a value to filter, the request will be sent to the server again. I find this to be wasteful as all the data has already been retrieved the first time. Is there a way to cache the initial data returned and then filter only according to that data so another AJAX request does not have to be made?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >