Search Results

Search found 6941 results on 278 pages for 'drupal views'.

Page 78/278 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • is it possible to add a string template to views in a .net mvc project?

    - by Lina
    Hi, I have a newbie question,, how do i add a string template to the views folder in a .net mvc project? i have added a reference to StringTemplate.dll and antlr.runtime.dll but seems that is not enough. i.e. when i right-click on views and choose Add New Item i can't find a file with .st extension in the list that i get... how do i achieve that? Thanks a million in advance

    Read the article

  • In this context with views in a tree, which class should perform the task?

    - by Jhonny 8
    Imagine that I have this context: A main view containing a table containing some cells. Each one of them with their own controller and view files. In the main view, I have an object "Person", with 3 different IDs. Depending on certain conditions (let say, time of the day), I have to choose one of them and display it in the cell. My question is, should the main view pass the whole object to the table, and this one to the cell, and the cell will calculate the ID that it will be shown? or, The main view calculates this parameter, and send the result to the table and this to the cell? Is a question focused on OO design, which one of this approaches is more suitable in an OO design and why?

    Read the article

  • Android: Layouts and views or a single full screen custom view?

    - by futlib
    I'm developing an Android game, and I'm making it so that it can run on low end devices without GPU, so I'm using the 2D API. I have so far tried to use Android's mechanisms such as layouts and activities where possible, but I'm beginning to wonder if it's not easier to just create a single custom view (or one per activity) and do all the work there. Here's an example of how I currently do things: I'm using a layout to display the game's background as an image view and the square game area, which is a custom view, centered in the middle. What would you say? Should I continue to use layouts where possible or is it more common/reasonable to just use a large custom view? I'm thinking that this would probably also make it easier to port my code to other platforms.

    Read the article

  • How to handle notifications to several partial views of the same model?

    - by Seki
    I am working on refactoring an old simulation of a Turing machine. The application uses a class that contains the state and the logic of program execution, and several panels to display the tape representation and show the state, messages, and the GUI controls (start, stop, program listing, ...). I would like to refactor it using the MVC architecture that was not used originaly: the Frame is the only way to get access to the different panels and there is also a strong coupling between the "engine" class and the GUI updates in the way of frame.displayPanel.state.setText("halted"); or frame.outputPanel.messages.append("some thing"); It looks to me that I should put the state related code into an observable model class and make the different panels observers. My problem is that the java Observable class only provides a global notification to the Observers, while I would prefer not to refresh every Observers everytime, but only when the part that specificaly observe has changed. I am thinking of implementing myself several vectors of listeners (for the state / position, for the output messages, ...) but I feel like reinventing the wheel. I though also about adding some flags that the observers could check like isNewMessageAvailable(), hasTapeMoved(), etc but it sounds also approximative design. BTW, is it ok to keep the fetch / execute loop into the model or should I move it in another place? We can think in a theorical ideal way as I am completely revamping this small application.

    Read the article

  • How do I switch out Views in a Cocoa application?

    - by David Garcia
    So I'm beginning to learn how to use Cocoa. I think I've pretty much got it but I'm hung up on creating and switching views. I'm rewriting a game I made a little bit ago for practice. All I want is one window (preferably not resizable) and I want to be able to switch out views for different screens in the game. First, I have the main menu (Start Game, High Scores, Exit). Then I need a window for each screen (Gameplay screen, Highscore screen). What I'm getting confused with is how to design this. I looked up NSViewController thinking it manages views but it doesn't. It only manages one view by loading it really. I don't understand why I'd need to use NSViewController then. Couldn't I just have a window class that contains multiple subclasses of NSView and load them like that? I'm not sure I understand the purpose of the ViewController. Does my Window Class really need to subclass NSWindowController? I was trying to follow the example of Apple's ViewController example and it has a window controller class that's a subclass of NSWindowController. I don't see what the purpose was of subclassing that. All NSWindowController seems to add is - initWithPath:(NSString *)newPath but I fail to see the use in that either when I can just edit the plist file to open the window on start up. Apple's example also has an NSView variable and an NSViewController variable. Don't you only need one variable to store the current view? Thanks in advance guys, I'm really confused as to how this works.

    Read the article

  • How can I create dynamically updated views in a tab bar view, based on settings selection?

    - by Diggers
    Hi all, Noob question.... I've created a Tab Bar application. It has four tabs and works fine. Each view is created with a XIB and is effectively static. Each view takes user input and responds on screen. What I need to be able to do is change the input options the user have - in effect remove some UITextFields dependant upon which option the user selects in settings. I've created root.plist and created settings no problem i've also created additional XIBS for the altered UI, but what I don't know how to do, is call these into the tab view controller on demand. Effectively tab one has 3 possible views, tab two 3 possible views etc. But I only want the one that's relevant for the users settings selction to be displayed? Make sense? For reference, if we call the different views - UIInputViewA1, ...A2,....A3 UIInputViewB1,....B2....B3 etc. Hope someone can help, been trawling the net for nights trying to get my head round this. Beggining iPhone Development Bible doesn't help either. If you need any more info, please shout. Cheers Paul.

    Read the article

  • How Do I Restrict Views of a Custom List by Group in Sharepoint 2007?

    - by Crash893
    I'm pretty new to Sharepoint and what I would like to do is create a huge master list of all our employees and then make different "views" on that person depending on the persons group For example: A new employee might have Salary info Security info Personnel info Contract info I would like to have all that in one row (per employee) but then when someone from the hr group logs in they can only see Personnel and Salary or something like that. If that is not an option is there a way to link tables across different lists?

    Read the article

  • Using YQL multi-query & XPath to parse HTML, how to escape nested quotes?

    - by Tivac
    The title is more complicated than it has to be, here's the problem query. SELECT * FROM query.multi WHERE queries=" SELECT * FROM html WHERE url='http://www.stumbleupon.com/url/http://www.guildwars2.com' AND xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span'; SELECT * FROM xml WHERE url='http://services.digg.com/1.0/endpoint?method=story.getAll&link=http://www.guildwars2.com'; SELECT * FROM json WHERE url='http://api.tweetmeme.com/url_info.json?url=http://www.guildwars2.com'; SELECT * FROM xml WHERE url='http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.guildwars2.com'; SELECT * FROM json WHERE url='http://www.reddit.com/button_info.json?url=http://www.guildwars2.com'" Specifically this line, xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span' It's problematic because of the quoting, I have to nest them three levels deep and I've run out of quote characters to use. I've tried the following variations without success: //no attribute quoting xpath='//li[@class=listLi]/div[@class=views]/a/span' //try to quote attribute w/ backslash & single quote xpath='//li[@class=\'listLi\']/div[@class=\'views\']/a/span' //try to quote attribute w/ backslash & double quote xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span' //try to quote attribute with double single quotes, like SQL xpath='//li[@class=''listLi'']/div[@class=''views'']/a/span' //try to quote attribute with double double quotes, like SQL xpath='//li[@class=""listLi""]/div[@class=""views""]/a/span' //try to quote attribute with quote entities xpath='//li[@class=&quot;listLi&quot;]/div[@class=&quot;views&quot;]/a/span' //try to surround XPath with backslash & double quote xpath=\"//li[@class='listLi']/div[@class='views']/a/span\" //try to surround XPath with double double quote xpath=""//li[@class='listLi']/div[@class='views']/a/span"" All without success. I don't see much out there about escaping XPath strings but everything I've found seems to be variations on using concat (which won't help because neither ' nor " are available) or html entities. Not using quotes for the attributes doesn't throw an error but fails because it's not the actual XPath string I need. I don't see anything in the YQL docs about how to handle escaping. I'm aware of how edge-casey this is but was hoping they'd have some sort of escaping guide.

    Read the article

  • Rails, Rake, moving a folder to a new location

    - by Sam
    I need to move a folder from a plugin to the main app/views. I guess using rake to do this with the following command is the easiest way: require 'fileutils' FileUtils.mv('/vendor/plugins/easy_addresses/lib/app/views', '/app/views/') I'm just not sure where to tell script where to look and where to place the folder. The file I want to move is in the following location: `vender/plugins/easy_addresses/lib/app/views/easy_addresses easy_ addresses is the name of the folder in views that I want to move to my_app/app/views/

    Read the article

  • how to find which button has been clicked in app widgets in android?

    - by chrish
    I want to design simple app widget which has two textview and two button for previous/next. I am getting difficult to handle button click in app widget. Actually my desire is,if user click on previous button i want to show previous value and if user click on Next button i want to show next value from database. How to know which button is clicked? here i register button click listener like this public static class UpdateWidgetService extends IntentService { public UpdateWidgetService() { super("UpdateWidgetService"); } @Override protected void onHandleIntent(Intent intent) { AppWidgetManager appWidgetManager = AppWidgetManager .getInstance(this); int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { updateOneAppWidget(appWidgetManager, incomingAppWidgetId); } } private void updateOneAppWidget(AppWidgetManager appWidgetManager, int appWidgetId) { DatabaseManager dbManager = new DatabaseManager(this); dbManager.open(); String contactNumber, date, status, message; ArrayList<QueuedMessage> listOfQuedMessage = (ArrayList<QueuedMessage>) dbManager .fetchContactNumber(); if (listOfQuedMessage.size() == 0) Log.i("Db", "null"); else{ date = dbManager.fetchDate(); message = dbManager.fetchMessage(); status = dbManager.fetchStatus(); dbManager.closeDatabase(); RemoteViews views = new RemoteViews(this.getPackageName(), R.layout.schdulesms_appwidget_layout); views.setTextViewText(R.id.to_appwidget_saved_data, listOfQuedMessage.get(count).contacNumber); views.setTextViewText(R.id.date_appwidget_saved_data, date); views.setTextViewText(R.id.status_appwidget_saved, status); views.setTextViewText(R.id.message_appwidgset_saved_data, message); **//here i want do** if(button1){ btnNxtClick(views, appWidgetId,listOfQuedMessage.size()); }else{ btPrevClick(views, appWidgetId, listOfQuedMessage.size()); } appWidgetManager.updateAppWidget(appWidgetId, views); } } private void btnNxtClick(RemoteViews views, int appWidgetId,int sizeOfList) { Intent btnNextIntent = new Intent(this, this.getClass()); btnNextIntent.putExtra(EXTRA_APPWIDGET_ID, appWidgetId); PendingIntent btnNextPendingIntent = PendingIntent.getService(this, 0, btnNextIntent, PendingIntent.FLAG_UPDATE_CURRENT); views.setOnClickPendingIntent(R.id.btnNext, btnNextPendingIntent); } private void btPrevClick(RemoteViews views, int appWidgetId,int sizeOfList) { Intent btnNextIntent = new Intent(this, this.getClass()); btnNextIntent.putExtra(EXTRA_APPWIDGET_ID, appWidgetId); PendingIntent btnNextPendingIntent = PendingIntent.getService(this, 0, btnNextIntent, PendingIntent.FLAG_UPDATE_CURRENT); views.setOnClickPendingIntent(R.id.btnPrev, btnNextPendingIntent); } } can anyone help me out from this problem?? thanks

    Read the article

  • Custom View Engine in ASP.NET MVC 2 does not work with Areas

    - by mare
    I used the code below so far with ASP.NET MVC v1 and v2 but when I added an Area today to my application, the controller for the area couldn't find any views in my Areas/Views/controllerView folder. It issued the very well known exception that it searched those 4 standard folders but it did not look under Areas.. How can I change the code so that it will work with Areas? Maybe an example of custom view engine under ASP.NET MVC 2 with Areas support? The information about it on the net is very scarse.. Here's the code: public class PendingViewEngine : VirtualPathProviderViewEngine { public PendingViewEngine() { // This is where we tell MVC where to look for our files. /* {0} = view name or master page name * {1} = controller name */ MasterLocationFormats = new[] {"~/Views/Shared/{0}.master", "~/Views/{0}.master"}; ViewLocationFormats = new[] { "~/Views/{1}/{0}.aspx", "~/Views/Shared/{0}.aspx", "~/Views/Shared/{0}.ascx", "~/Views/{1}/{0}.ascx" }; PartialViewLocationFormats = new[] {"~/Views/{1}/{0}.ascx", "~/Views/Shared/{0}.ascx"}; } protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) { return new WebFormView(partialPath, ""); } protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) { return new WebFormView(viewPath, masterPath); } }

    Read the article

  • My architecture has a problem with views that required information from different objects. How can I solve this?

    - by Oscar
    I am building an architecture like this: These are my SW layers ______________ | | | Views | |______________| ______________ | | |Business Logic| |______________| ______________ | | | Repository | |______________| My views are going to generate my HTML to be sent to the user Business logic is where all the business logics are Repository is a layer to access the DB My idea is that the repository uses entities (that are basically the representation of the tables, in order to perform DB queries. The layers communicate between themselves using Business Objects, that are objects that represent the real-world-object itself. They can contain business rules and methods. The views build/use DTOs, they are basically objects that have the information required to be shown on the screen. They expect also this kind of object on actions and, before calling the business logic, they create BO. First question: what is your overall feeling about this architecture? I've used similar architecture for some projects and I always got this problem: If my view has this list to show : Student1, age, course, Date Enrolled, Already paid? It has information from different BO. How do you think one should build the structure? These were the alternatives I could think of: The view layer could call the methods to get the student, then the course it studies, then the payment information. This would cause a lot of DB accesses and my view would have the knowledge about how to act to generate this information. This just seems wrong for me. I could have an "adapter object", that has the required information (a class that would have a properties Student, Course and Payment). But I would required one adapter object for each similar case, this may get very bad for big projects. I still don't like them. Would you have ideas? How would you change the architecture to avoid this kind of problems? @Rory: I read the CQRS and I don't think this suits my needs. As taken from a link references in your link Before describing the details of CQRS we need to understand the two main driving forces behind it: collaboration and staleness That means: many different actors using the same object (collaboration) and once data has been shown to a user, that same data may have been changed by another actor – it is stale (staleness). My problem is that I want to show to the user information from different BO, so I would need to receive them from the service layer. How can my service layer assemble and deliver this information? Edit to @AndrewM: Yes, you understood it correctly, the original idea was to have the view layer to build the BOs, but you have a very nice point about the creation of the BO inside the business layers. Assuming I follow your advice and move the creation logic inside the business layer, my business layer interface would contain the DTOs, for instance public void foo(MyDTO object) But as far as I understand, the DTO is tightly coupled to each view, so it would not be reusable by a second view. In order to use it, the second view would need to build a specific DTO from a specific view or I would have to duplicate the code in the business layer. Is this correct or am I missing something?

    Read the article

  • How do I (or should I?) access the service layer from a SiteMesh template (views/layouts/main.gsp) in Grails?

    - by knorv
    I need to create a toplist in the page footer on a site that I'm building. The footer is created in the default SiteMesh layout template (views/layouts/main.gsp). In order to create the toplist access to the database is needed, so I've encapsulated all logic needed for the toplist creation in a service class (services/FooService). Please note that while services are usually accessed from the controller layer, in this case the default layout template (views/layouts/main.gsp) is not generated from a controller. Can the layout view (views/layouts/main.gsp) access a service class? How? Is this the correct design decision? If not, what is a better encapsulation and how do I interact with said encapsulation from the layout view (views/layouts/main.gsp)?

    Read the article

  • How do I get toolbars on UISplitView detail & root views?

    - by Gerry
    I'm porting my iPhone app to iPad. I have a bunch of detail views that derive from UIViewController and implement UITableViewDelegate. (Basically TableViews but not derived as such). The old app used TabBar, but now I'd like to use SplitView with toolbars on the Detail and Master views. How do I enable a toolbar on my UIViewController inside a UISplitViewController? I'm not using Interface Builder here, just code. @interface HeadlineViewController : UIViewController { UITableView *tableView; NSMutableArray *bullIds; UIActivityIndicatorView *prog; } Thanks,

    Read the article

  • where should we send notification for updating many views?

    - by Thanh-Cong Vo
    Hi all, I want to ask about software design. I have a task, the view controller handles UI event for calling a model manger to perform that task. After finishing, the model manager will callback to update the view. There have also other views who care about that task, and also want to update its own view when that task is finished. So I register a Notification for that task in each views. The problem is defining where should I send Notification, in Model manager or in the View who handles event and receives the callback from Model manager? What is better design? Shoud the model care about send this "common" task, or shoud the view? Thanks

    Read the article

  • Most Rails-y way to give different views of the same resource?

    - by Nathan Long
    In Rails, is there a canonical way of giving different views of the same resource? For example, a directory of people, where each person can have multiple photos, phone numbers, email addresses, etc. The people, photos and phone numbers are actually different resources with their own RESTful actions. But when viewing people, one page might shows everyone's name and associated photos; another page is names and associated contact information, formatted for printing. Would it be more "Rails-y" to: Create additional actions on the People controller besides the RESTful ones, like "index_with_contact_info"? Create a different controller and a different group of views? Neither seems quite right to me, but the first seems more likely. Any thoughts?

    Read the article

  • Javascript code in ASP.NET MVC Partial Views (ASCX) or not?

    - by Alex
    Is there a "best practice" for placing Javascript code when you have many partial views and JS code that's specific to them? I feel like I'm creating a maintenance nightmare by having many partial views and then a bunch of independent Javascript files for them which need to be synced up when there is a partial view change. It appears, for maintenance purposes, better to me to put the JS code with the partial view. But then I'm violating generally accepted practices that all JS code should be at the bottom of the page and not mixed in, and also I'd end up with multiple references to the same JS file (as I'd include a reference in each ASCX for intellisense purposes). Does anyone have a better idea? Thank you!

    Read the article

  • How to create and show views on command request?

    - by user365575
    Hi, I've started using mvvm-light toolkit , and new to WPF. My question is: I want to create an pplication where the main window includes a grid with 2 columns 1 col command and col2 will display views when each command will be pressed. i want the views to be created on command and colsed from it's own view. I've tried to figure out how to do it but with no success. I don't know how to write this kind of funconality using the mvvm light. I just know how to create main window with mainview and another view creted already on load. Please help me out.. I'm using 2008 WPF3.5 Shirly. Make me happy today.. i've just started the week!!!

    Read the article

  • if all my views are passed a strongly typed viewdata, if they have a baseviewdata class, can I set a

    - by Blankman
    I want all my views to inherit from a baseview data so I can set some shared properties that all my views will need. Can I set some properties in OnExecuting so I don't have to do it for all Actions? I want to then display the string value of the property in all my view pages. If yes, how can I do this? I need to hook into the base view data somehow? so i'll have: public MyViewData : ViewData { } And I need one for generics also?

    Read the article

  • Is there a way to increase how much is cached for thumbnail views of pictures?

    - by JimDel
    Is there a way to increase how much is cached for thumbnail views of pictures? If I'm looking through a folder of .png files for example, with "medium" set as the view size. The screen will eventually fill all the thumbnails with the appropriate pictures. But as I scroll down it takes a while for the pictures to fill in again. I would like a way for "off screen" pictures to fill in before I get the that section of the screen. Is there a way to do this? Thanks

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >