Search Results

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

Page 113/278 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • How to imitate the workflow view of Automator?

    - by andyfeind
    I’m starting to develop my first full-blown Cocoa application containing a view which I would like to behave (and look) similar to Automator’s AMWorkflowView. The basic features I’d like to achieve: Positioning of subviews Display of subviews in expanded / collapsed states Multiple selection Drag and drop In order to get accustomed to Cocoa, I started with a custom NSView which mainly served as a container for the custom subviews and handled their positioning and multiple selection. The subviews are also subclasses of NSView, and contain a variable amount of views themselves, like buttons, labels and popup menus, and therefore can have different heights. This worked quite well, but before going on, I want to make sure to have everything neat and tidy according to the MVC pattern. I suspect that there already is a class in Cocoa that facilitates the implementation of a view container, like maybe NSCollectionView. It seems that there is no (easy) way to display differently sized views in an NSCollectionView, though. Should I continue implementing my custom NSView (probably using an NSArrayController for selection and sorting support), or are there better ways to go? Any help is much appreciated

    Read the article

  • Multiple Rails forks with separate designs and layouts

    - by mettadore
    I have a Rails project that is basically a simple web app for a membership-based organization. We've open sourced the code on Github for the web app so that others can use it, but have a licensed design/layout that the original organization is going to use. This layout cannot be open sourced. I was wondering if others have run into the situation where you have an open-source Rails app with a non-OS design. My initial thought is to put app/views in .gitignore, and to have anyone forking the code add their own views directory, perhaps including an app/views_default directory with a web-app-theme layout or something else to get people running. Is this the best option (realizing that there are other files such as JavaScript, CSS, etc that come with the layout that must also be ignored). Does anyone have some good thoughts or pointers on this?

    Read the article

  • Repetitive SQL: What does it mean?

    - by Lijo
    Hi In a different post I got a reply that tells about Repetitive SQL. Could you please explain what is Repetitive SQL? http://stackoverflow.com/questions/2657459/sql-code-smells I thought to make it a new post as it is a different subject. The reply says that use of "multiple stored procedures that perform the exact same joins but different filters" can be avoided using VIEWs. Could you please give an example that can only be achieved using repetitive queries, if we are using Stored Proecure? [The same can be achieved without repetition when used VIEWS] Thanks Lijo

    Read the article

  • Fallback to another existing MIME type when the required is missing in Rails

    - by fifigyuri
    I want to extend the existing supported HTML type of my site by support for iPhone. For this I registered a new MIME type. I created a layout for iphone and also converted some of the html views to iphone version. However, I did not convert all of the html.erb files. I do not see the reason to convert all views, some of them should not change, some partials simply just remain the same. I guess there should be a solution for this case. I tried to search for ways how to fallback to an existing format, but did not find any answer. Does a way to define fallback for MIME types in Rails exist? How does it work? If it doesn't exist and thus I wanted to solve the issue not the right way, what could simply solve the task of extending an existing site by another format? Thanks for your suggestions.

    Read the article

  • Emulate back button in multi-view TabActivity

    - by ZelluX
    Hi, all I have a TabActivity with several tabs. Each tab corresponds to a specific view, and those views may further switch to other views. For example, one of my tabs displays RSS feed list, after user clicks one of the RSS feed, it will switch to a view displaying a list of articles, and after user clicks one of the titles, a full article view will be displayed. I'm going to add support for "back" button in my application. For instance, in a full article view, after user presses the "back" button, it should switch back to the article list view. And if user presses it the "back" button again, my application should switch back to the feed list view. My idea is to maintain a Stack<View> during navigation, and every time user presses the "back" button, the program will pop a View out of the stack, and set it as the current view. But I would like to know how to set current view in TabHost. Many thanks.

    Read the article

  • iPhone: How do I override the back button in a Navigation Controller?

    - by Angelo Stracquatanio
    Hello, In my app I have a basic Navigation Controller. For all of my views, except one, the controller works as it should. However, for one view in particular, I would like the 'back' button to not go back to the previous view, but to go to one I set. In particular it is going to go back 2 views and skip over one. After doing some research I found that I can intercept the view when it disappears, so I tried to put in code to have it navigate to the page I would like: - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; //i set a flag to know that the back button was pressed if (viewPushed) { viewPushed = NO; } else { // Here, you know that back button was pressed mainMenu *mainViewController = [[mainMenu alloc] initWithNibName:@"mainMenu" bundle:nil]; [self.navigationController pushViewController:mainViewController animated:YES]; [mainViewController release]; } } That didn't work, so does anyone have any ideas? Thanks!!

    Read the article

  • Django - Check users messages every request

    - by Hanpan
    Hi, I want to check if a user has any new messages each time they load the page. Up until now, I have been doing this inside of my views but it's getting fairly hard to maintain since I have a fair number of views now. I assume this is the kind of thing middleware is good for, a check that will happen every single page load. What I need it to do is so: Check if the user is logged in If they are, check if they have any messages Store the result so I can reference the information in my templates Has anyone ever had to write any middleware like this? I've never used middleware before so any help would be greatly appreciated.

    Read the article

  • Play! Framework - Can my view template be localised when rendering it as an AsyncResult?

    - by avik
    I've recently started using the Play! framework (v2.0.4) for writing a Java web application. In the majority of my controllers I'm following the paradigm of suspending the HTTP request until the promise of a web service response has been fulfilled. Once the promise has been fulfilled, I return an AsyncResult. This is what most of my actions look like (with a bunch of code omitted): public static Result myActionMethod() { Promise<MyWSResponse> wsResponse; // Perform a web service call that will return the promise of a MyWSResponse... return async(wsResponse.map(new Function<MyWSResponse, Result>() { @Override public Result apply(MyWSResponse response) { // Validate response... return ok(myScalaViewTemplate.render(response.data())); } })); } I'm now trying to internationalise my app, but hit the following error when I try to render a template from an async method: [error] play - Waiting for a promise, but got an error: There is no HTTP Context available from here. java.lang.RuntimeException: There is no HTTP Context available from here. at play.mvc.Http$Context.current(Http.java:27) ~[play_2.9.1.jar:2.0.4] at play.mvc.Http$Context$Implicit.lang(Http.java:124) ~[play_2.9.1.jar:2.0.4] at play.i18n.Messages.get(Messages.java:38) ~[play_2.9.1.jar:2.0.4] at views.html.myScalaViewTemplate$.apply(myScalaViewTemplate.template.scala:40) ~[classes/:na] at views.html.myScalaViewTemplate$.render(myScalaViewTemplate.template.scala:87) ~[classes/:na] at views.html.myScalaViewTemplate.render(myScalaViewTemplate.template.scala) ~[classes/:na] In short, where I've got a message bundle lookup in my view template, some Play! code is attempting to access the original HTTP request and retrieve the accept-languages header, in order to know which message bundle to use. But it seems that the HTTP request is inaccessible from the async method. I can see a couple of (unsatisfactory) ways to work around this: Go back to the 'one thread per request' paradigm and have threads block waiting for responses. Figure out which language to use at Controller level, and feed that choice into my template. I also suspect this might not be an issue on trunk. I know that there is a similar issue in 2.0.4 with regards to not being able to access or modify the Session object which has recently been fixed. However I'm stuck on 2.0.4 for the time being, so is there a better way that I can resolve this problem?

    Read the article

  • Backbone: rendering syntax

    - by ksol
    We're using Backbone.js in one of my team's projects, and this is the first time I use it. I've seen many times this kind of code (it's coffeescript, but clear enough I think. @ means this.) clients_view = new Homespa.Views.Orders.Clients.SectionView(collection: @options.clients) @$("#clients-section").html(clients_view.render().el) clients_search_view = new Homespa.Views.Orders.Clients.SearchView @$("#clients_search_modal").html(clients_search_view.render().el) Isn't there a better way to do this? I would expect to just call render on my view, and then everything's good, I shouldn't have to get the html and append/replace it by hand. Thanks for you time !

    Read the article

  • Android: how to update UI dynamically?

    - by pandre
    I have an Android app and I need to change UI dynamically: ex: when user presses a button, I want to change the current activity's views and, as in some cases there are a lot of views involved, I need to display a ProgressDialog. I have been using an AsyncTask, but I think that it is not the best solution, because AsyncTask's doInBackground runs a different thread, so I can't update UI from there - I have to use runOnUiThread, which runs the code in the UI Thread, but freezes the progress dialog that is shown. I guess there should be more people with similar issues, as updating UI while displaying a ProgressDialog seems to be something done regularly by applications. So does anyone have a solution to this?

    Read the article

  • rails - caches_action expire_action

    - by mark
    Hi I want to expire a cached action and wondered how to generate the correct reference. #controller caches_action :index, :layout => false #generates this fragment which works fine views/0.0.0.0:3000/article/someid/posts #sweeper ... expire_action article_posts_path(:article_id => post.article) # results in this Expired fragment: views//en/article/someid/posts (0.0ms) So this is almost ok, except the host is missing. What do I do that supplies this to the expire_action method? Thanks in advance.

    Read the article

  • What's the correct way to represent a linear process in CocoaTouch (UIKit)?

    - by UloPe
    I need to represent a linear process (think wizard) in an iPad app. In principle I could use a UINavigationController and just keep pushing new controllers for each step of the process. But this seems rather inefficient since the process I'm modeling has no notion of navigating backwards so all previous views would pointlessly stay around and use up resources. At the moment I keep adding and removing a subview to one "master" viewcontroller and basically swapping out the contents. This works but feels rather clunky and I hope there is some nicer way to achieve this. Additionally there needs to be an animated transition between the views. (I have this working at the moment via beginAnimations / commitAnimations)

    Read the article

  • django-haystack urlpatterns include('haystack.urls') where does it lead to?

    - by Eugene
    I've recently begun to learn/install django/haystack/solr. Following the tutorial given in haystack site, I have urlpatterns = pattern('', r'^search/', include('haystack.urls')) I found haystack installed in /usr/local/lib/python2.6/dist-packages/haystack and located urls.py there. It has urlpatterns=patterns('haystack.views', url(r'^$', SearchView(), name='haystack_search'),) I thought the second argument of url() should be callable object. I looked at the views.py and SearchView is a class. What is going on here? What's get called eventually?

    Read the article

  • How to undo SQL changes using installer

    - by Sunil Agarwal
    I have installer to install procedures, scripts, views, etc in SQL server 2005/2008. Now I want to add a condition in the installer like if there is any error while installing, I want to undo all the changes done in SQL server. I tried to store the procedures, views, etc which I am changing while installing and reverting them back if I get any error. But am not able to do it the way I want. Can someone guide me if he had done the same thing? To specify I am using WIX installer. Also if someone has tried SMO, it will be of great help.

    Read the article

  • How to generilize view?

    - by MexicanHacker
    Hey guys, I'm in the process of designing a set of views that use the same model in my app, the difference is that some views will differ in Read Only and Modifiable fields. So for example for view A I want to be able to modify A.One but no A.Two properties and for view B I want to have B.One and B.Two as modifiable fields. I was thinking in having a map that will hold this information and iterate both the modifiable and non-modifiable lists in a generic view, but I was thinking that maybe I can get feedback from you guys. What do you think?

    Read the article

  • How to generate a ListView with headers above some sections?

    - by Janusz
    I want to generate a Listview that has some dividers between some of the entries, like it can be seen in some of the property sections. See the example below. I try to generate a List that consists of some textviews followed by one of the fancy dividers explaining the next part of the list and then again some text views. How can this be done? I thought about creating different views to add to the list? Is this the way to go?

    Read the article

  • can't save form content to database, help plsss!!

    - by dana
    i'm trying to save 100 caracters form user in a 'microblog' minimal application. my code seems to not have any mystakes, but doesn't work. the mistake is in views.py, i can't save the foreign key to user table models.py looks like this: class NewManager(models.Manager): def create_post(self, post, username): new = self.model(post=post, created_by=username) new.save() return new class New(models.Model): post = models.CharField(max_length=120) date = models.DateTimeField(auto_now_add=True) created_by = models.ForeignKey(User, blank=True) objects = NewManager() class NewForm(ModelForm): class Meta: model = New fields = ['post'] # widgets = {'post': Textarea(attrs={'cols': 80, 'rows': 20}) def save_new(request): if request.method == 'POST': created_by = User.objects.get(created_by = user) date = request.POST.get('date', '') post = request.POST.get('post', '') new_obj = New(post=post, date=date, created_by=created_by) new_obj.save() return HttpResponseRedirect('/') else: form = NewForm() return render_to_response('news/new_form.html', {'form': form},context_instance=RequestContext(request)) i didn't mention imports here - they're done right, anyway. my mistake is in views.py, when i try to save it says: local variable 'created_by' referenced before assignment it i put created_py as a parameter, the save needs more parameters... it is really weird help please!!

    Read the article

  • ReSharper 5 disable resolve view

    - by Rob
    I just did a fresh installation of Visual Studio 2010 Ultimate and ReSharper 5. But now ran into the following situation; return View("~/Plugin/Plugin.Product.dll/Plugin.Product.Views.CreateProduct.ascx"); From a controller i'm returning a view a shown above. ReSharper 5 is trying to resolve this view, but can't find it. Which is explainable in my situation. What i want is to disable the option for ReSharper to try and resolve the views. Is this possible?

    Read the article

  • How can I store a useful value in my ASP.NET MVC site's URL and make it propagate?

    - by joshjs
    Let's say I have a simple ASP.NET MVC site with two views. The views use the following routes: /Foo and /Foo/Bar. Now let's say I want to use the URL to specify (just for the sake of example) the background color of the site. I want my routes to be, for instance, /Blue/Foo or /Green/Foo/Bar. Also, if I call Html.ActionLink from a view, I want the Blue or Green value to propagate. So, e.g., if I call Html.ActionLink("Bar", "Foo") from /Blue/Foo, I want /Blue/Foo/Bar to come back. How best can I do this? (Forgive me if I'm missing an existing post. This is hard for me to articulate concisely, so I'm not quite sure what to search for.)

    Read the article

  • SSAS OLAP MDX and relationships

    - by Sonic Soul
    I new to OLAP, and still not sure how to create a relationship between 2 or more entities. I am basing my cube on views. For simplicity sake let's call them like this: viewParent (ParentID PK) viewChild (ChildID PK, ParentID FK) these views have more fields, but they're not important for this question. in my data source, i defined a relationship between viewParent and viewChild using ParentID for the link. As for measures, i was forced to create separate measures for Parent and Child. in my MDX query however, the relationship does not seem to be enforced. If i select record count for parent, child, and add some filters for the parent, the child count is not reflecting it.. SELECT { [Measures].[ParentCount],[Measures].[ChildCount] } ON COLUMNS FROM [Cube] WHERE { ( {[Time].[Month].&[2011-06-01T00:00:00]} ,{[SomeDimension].&[Foo]} ) } the selected ParentCount is correct, but ChildCount is not affected by any of the filters (because they are parent filters). However, since i defined a relationship, how can i take advantage of that to filter children by parent filter?

    Read the article

  • Play 2.0 javaToDo tutorial doesn't compile

    - by chsn
    I'm trying to follow the Play2.0 JavaToDO tutorial and for some reason it just doesn't want to work. Have looked through stackoverflow and other online resources, but haven't find an answer to this and it's driving me crazy. Attached code of the Application.java package controllers; import models.Task; import play.data.Form; import play.mvc.Controller; import play.mvc.Result; public class Application extends Controller { static Form<Task> taskForm = form(Task.class); public static Result index() { return redirect(routes.Application.tasks()); } public static Result tasks() { return ok( views.html.index.render(Task.all(), taskForm)); } public static Result newTask() { return TODO; } public static Result deleteTask(Long id) { return TODO; } } Attached code of the Task java package models; import java.util.List; import javax.persistence.Entity; import play.data.Form; import play.data.validation.Constraints.Required; import play.db.ebean.Model.Finder; import play.mvc.Result; import controllers.routes; @Entity public class Task { public Long id; @Required public String label; // search public static Finder<Long,Task> find = new Finder( Long.class, Task.class); // display tasks public static List<Task> all() { return find.all(); } // create task public static void create(Task task) { task.create(task); } // delete task public static void delete(Long id) { find.ref(id).delete(id); // find.ref(id).delete(); } // create new task public static Result newTask() { Form<Task> filledForm = taskForm.bindFromRequest(); if(filledForm.hasErrors()) { return badRequest( views.html.index.render(Task.all(), filledForm) ); } else { Task.create(filledForm.get()); return redirect(routes.Application.tasks()); } } } I get a compile error on Task.java on the line static Form<Task> taskForm = form(Task.class); As I'm working on eclipse (the project is eclipsified before import), it's telling me that taskForm cannot be resolved and it also underlines every play 2 command e.g. "render(), redirect(), bindFromRequest()" asking me to create a method for it. Any ideas how to solve the compilations error and also how to get Eclipse to recognize the play2 commands? EDIT: updated Application.java package controllers; import models.Task; import play.data.Form; import play.mvc.Controller; import play.mvc.Result; public class Application extends Controller { // create new task public static Result newTask() { Form<Task> filledForm = form(Task.class).bindFromRequest(); if(filledForm.hasErrors()) { return badRequest( views.html.index.render(Task.all(), filledForm) ); } else { Task.newTask(filledForm.get()); return redirect(routes.Application.tasks()); } } public static Result index() { return redirect(routes.Application.tasks()); } public static Result tasks() { return ok( views.html.index.render(Task.all(), taskForm)); } public static Result deleteTask(Long id) { return TODO; } } Updated task.java package models; import java.util.List; import javax.persistence.Entity; import play.data.Form; import play.data.validation.Constraints.Required; import play.db.ebean.Model; import play.db.ebean.Model.Finder; import play.mvc.Result; import controllers.routes; @Entity public class Task extends Model { public Long id; @Required public String label; // Define a taskForm static Form<Task> taskForm = form(Task.class); // search public static Finder<Long,Task> find = new Finder( Long.class, Task.class); // display tasks public static List<Task> all() { return find.all(); } // create new task public static Result newTask(Task newTask) { save(task); } // delete task public static void delete(Long id) { find.ref(id).delete(id); // find.ref(id).delete(); } }

    Read the article

  • How do you render a rails partial that is outside of a namespace in a view that is inside of a namespace?

    - by iand675
    I've got a 'static' controller and static views that are pages that don't utilize ruby in their views. For these pages, I have a sitemap partial that is generated programatically and used in the application layout file. Namespaced routes still use the application layout file but are taking the static routes and trying to namespace them too. Here's the relevant portion of the route file: namespace :admin do resources :verse_categories resources :verses resources :songs resources :flowers resources :visits, :except => [:new, :create] end match ':action' => 'static' root :to => 'static#home' Here's the error I'm getting: No route matches {:controller=>"admin/static", :action=>"about"} Note that about is one of the static pages that the sitemap partial uses. So, how can I resolve this routing issue so that it's not trying to find my static sites inside of the admin namespace? Any help would be appreciated!

    Read the article

  • Zend Framework Autoloading in 3 modules

    - by haohan
    I am new to ZF and I am writing in Zend Framework 1.10 . Here is my application directory structure. APPLICATION_PATH` +-configs +-layouts +-modules +-admin ¦ +-controllers ¦ +-forms ¦ +-models ¦ +-views ¦ +-filters ¦ +-helpers ¦ +-scripts ¦ +-authentication ¦ +-cars ¦ +-index +-default +-controllers +-forms ¦ +-admin +-models ¦ +-DbTable +-plugins +-views +-helpers +-scripts +-about +-contact +-error +-index +-insurance +-used-cars I have 3 bootstrap.php files in APPLICATION_PATH, /default/ and /admin, i used AutoLoader to load models and forms $modelLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => '', 'basePath' => APPLICATION_PATH . '/modules/default')); The code above will load all models and forms automatically in modules/default, and now, I have a problem to load forms and models in /modules/admin, Any solutions to solve this problem? How should I name the class name in /modules/admin Thanks.

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >