Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 76/285 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Render public html for dynamic banners in Rails ?

    - by benoror
    Hi, I would like to render specific HTML snippets for displaying banners, because each banner has a different nature (some images, some flash, etc). Every banner file is under app/public/banners/. I tried many ways, like: render :file => "/banners/somebanner.html" But it can't locate the file, because Rails looks under app/views. Any ideas ? Thanks! Missing template banners/somebanner.html in view path app/views

    Read the article

  • Dynamic model choice field in django formset using multiple select elements

    - by Aryeh Leib Taurog
    I posted this question on the django-users list, but haven't had a reply there yet. I have models that look something like this: class ProductGroup(models.Model): name = models.CharField(max_length=10, primary_key=True) def __unicode__(self): return self.name class ProductRun(models.Model): date = models.DateField(primary_key=True) def __unicode__(self): return self.date.isoformat() class CatalogItem(models.Model): cid = models.CharField(max_length=25, primary_key=True) group = models.ForeignKey(ProductGroup) run = models.ForeignKey(ProductRun) pnumber = models.IntegerField() def __unicode__(self): return self.cid class Meta: unique_together = ('group', 'run', 'pnumber') class Transaction(models.Model): timestamp = models.DateTimeField() user = models.ForeignKey(User) item = models.ForeignKey(CatalogItem) quantity = models.IntegerField() price = models.FloatField() Let's say there are about 10 ProductGroups and 10-20 relevant ProductRuns at any given time. Each group has 20-200 distinct product numbers (pnumber), so there are at least a few thousand CatalogItems. I am working on formsets for the Transaction model. Instead of a single select menu with the several thousand CatalogItems for the ForeignKey field, I want to substitute three drop-down menus, for group, run, and pnumber, which uniquely identify the CatalogItem. I'd also like to limit the choices in the second two drop-downs to those runs and pnumbers which are available for the currently selected product group (I can update them via AJAX if the user changes the product group, but it's important that the initial page load as described without relying on AJAX). What's the best way to do this? As a point of departure, here's what I've tried/considered so far: My first approach was to exclude the item foreign key field from the form, add the substitute dropdowns by overriding the add_fields method of the formset, and then extract the data and populate the fields manually on the model instances before saving them. It's straightforward and pretty simple, but it's not very reusable and I don't think it is the right way to do this. My second approach was to create a new field which inherits both MultiValueField and ModelChoiceField, and a corresponding MultiWidget subclass. This seems like the right approach. As Malcolm Tredinnick put it in a django-users discussion, "the 'smarts' of a field lie in the Field class." The problem I'm having is when/where to fetch the lists of choices from the db. The code I have now does it in the Field's __init__, but that means I have to know which ProductGroup I'm dealing with before I can even define the Form class, since I have to instantiate the Field when I define the form. So I have a factory function which I call at the last minute from my view--after I know what CatalogItems I have and which product group they're in--to create form/formset classes and instantiate them. It works, but I wonder if there's a better way. After all, the field should be able to determine the correct choices much later on, once it knows its current value. Another problem is that my implementation limits the entire formset to transactions relating to (CatalogItems from) a single ProductGroup. A third possibility I'm entertaining is to put it all in the Widget class. Once I have the related model instance, or the cid, or whatever the widget is given, I can get the ProductGroup and construct the drop-downs. This would solve the issues with my second approach, but doesn't seem like the right approach.

    Read the article

  • Drupal 6 dynamic menu item

    - by djeux
    I need to create a menu item, which changes its title and link if a user has a certain condition, or not. Drupal caches all the menues, so i can't really think of a way to do that. For example, user has a node attached to his profile, menu item is "Create blabla" (link node/add/blabla) User doesn't have the node, menu item is "Create notblablabla" (link node/add/notblabla)

    Read the article

  • Dynamic column width

    - by nCdy
    protected void GridView1_DataBound(object sender, EventArgs e) { GridView1.Columns[0].ItemStyle.Width = 400; <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" ObjectDataSource1 returns data table , but I can't find any width property there , so I guess there is GridView side option but even on data bound there is like no columns ... protected void GridView1_DataBound(object sender, EventArgs e) { if (GridView1.Columns.Count!=0) GridView1.Columns[0].ItemStyle.Width = 800;

    Read the article

  • setting up 301 redirects: dynamic urls to static urls

    - by MS
    We are currently using a template-based website and are hoping to move to a site with static urls. Our domain will stay the same. I understand that using 301 redirects in a .htaccess file is the preferred method -- and the one that has the highest chance of preserving our google rankings. I am still new at all this and am having a hard time figuring out the proper way to code it all. Over a hundred of our pages are indexed. They all have a similar URL but with different pageIDs: http://www.realestate-bigbear.com/Nav.aspx/Page=%2fPageManager%2fDefault.aspx%2fPageID%3d2020765 Some link out to provided content, ex. /RealEstateNews/Default.aspx Then there are many that flow from the main featured listings page: /ListNow/Default.aspx Down to all the specific properties.. where the PropertyId changes /ListNow/Property.aspx?PropertyID=2048098 would a simple set of codes work... like the following.... redirect 301 /Nav.aspx/Page=%2fPageManager%2fDefault.aspx%2fPageID%3d2020765 www.realestate.bigbear.com/SearchBigBearMLS.htm or do I need to do something entirely different?

    Read the article

  • convert HTML to PDF with dynamic image using PD4ML

    - by vishwanath
    We are using PD4ML library to convert HTML to PDF. Is there any way with which I can include a image from the internet in my HTML to convert it into PDF. I am having problem in getting the image into PDF. I tried using base parameter in the PD4ML library but that didn't worked out. May be I am doing something wrong or PD4ML doesn't support including image from the internet. Because when I discussed my problem with other colleagues, found out that when we use the image from local server it gets to the PDF but image from internet don't. I am bound to use PD4ML, so solution with PD4ML only will be highly appreciated.

    Read the article

  • Dynamic choices for Django SelectMultiple Widget

    - by PhilGo20
    I'm building a form (not modelForm) where i'd like to use the SelectMultiple Widget to display choices based on a query done during the init of the form. I can think of a few way to do this but I am not exactly clear on the right way to do it. I see different options. I get the "choices" I should pass to the widget in the form init but I am not sure how I should pass them. class NavigatorExportForm(forms.Form): def __init__(self,user, app_id, *args,**kwargs): super (NavigatorExportForm,self ).__init__(*args,**kwargs) # populates the form language_choices = Navigator.admin_objects.get(id=app_id).languages.all().values_list('language', flat=True) languages = forms.CharField(max_length=2, widget=forms.SelectMultiple(choices=???language_choices))

    Read the article

  • How to Retrieve Dynamic Columns?

    - by user2514925
    I have a table: EmpId FirstName LastName Domain Vertical Account City 345 Priya Palanisamy DotNet LS Abbott Chennai 346 Kavitha Amirtharaj DotNet CG Diageo Chennai 647 Kala Haribabu DotNet IME IMS Chennai I want to take the particular columns dynamically. I am using the following procedure but I can take only one column at a time: create PROC columnlist ( @COLUMNS VARCHAR(1000) ) AS BEGIN DECLARE @sql nvarchar(max) = 'SELECT '+ @COLUMNS + ' FROM Table'; exec sp_executesql @sql,N'' END

    Read the article

  • Dynamic linking in Visual Studio

    - by ILya
    I have to link dynamically with OpenSSL libeay32.dll. I'm writing native c++ console application using Visual C++ Express 2008. I'm including a header evp.h from OpenSSL distribution. Building and...: error LNK2001: unresolved external symbol _EVP_aes_256_cbc error LNK2001: unresolved external symbol _EVP_DecryptInit error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_init How to make calls to libeay32.dll methods? I don't know where to specify it's filename

    Read the article

  • Struts2 dynamic form elements

    - by bozo
    Hi, I would like to create little higer-level framework on top of Stuts2 which can take form element description from Action and render a complete form, in order to avoid having a separate JSP files with hardcoded form elements for every form in a large web application (so if I manage to do this I will have just a few generic JSPs for data form and few for layout). Application is extremely data-driven. My idea is to create form description using custom objects in the Action (i.e. Button, TextInput etc.) and then to create a single JSP page that will render eveything out. What is the best way of doing this? Can you propose some concrete way to do this? I don't want to write something if I can reuse the existing code with some effort. Any ideas are appreciated. Kind regards, Bozo

    Read the article

  • Apache - "dynamic" rewrite rule

    - by Christian A. Rasmussen
    Hi there. I'm working on a Zend Framework project where I've stumbled across a bit of a problem. The problem originates from the fact that modules are 2nd class citizens in Zend Framework. In my project, I'd like for each module to have a folder containing files which are to be accessed from the outside - files such as stylesheets, javascripts and images. Now, how is this to be done. With a Zend Framework project I have a folder structure which looks like this: application/ modules/ moduleOne/ public/ stylesheet.css moduleTwo/ moduleThree/ public/ index.php The standard .htaccess file located in the public/ folder holds this: SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] The way it works, is that the project's apache DocumentRoot is the public/ folder. All requests gets redirected through the index.php file where Zend Framework's router component takes over. Now, I'm by no means an expert with Apache nor mod_rewrite so pardon me if this is just silly. I imagine that I implement an extra step in the existing rewrite rule so that if I request http://project/public/moduleOne/stylesheet.css it will for instance resolve to /var/www/project/application/modules/moduleOne/public/stylesheet.css. So the steps which need to be done is to check if the first element in the URI is public/ if it is, we take the next segment as the modules name and use that in the path we're trying to resolve to and attempt to serve the file. Is this at all possible or does anyone have a better suggestion? Thank you for your time Christian Rasmussen

    Read the article

  • Dynamic notifications using jQuery

    - by sparkymark75
    I'm currently building a homepage for our staff which is to be set as the homepage in their browser. I'm currently building the facility whereby nominated members of staff can send notifications to all staff. These will popup on their home page without the need for them to refresh the page. I've currently got the code below which worked fine for 1 notification, but there may be more than 1 at a time waiting to be shown. I've switched to outputting json but I'm not sure how to modify my code to consume it. I'm using the PeriodicalUpdater and jGrowl plugins to get this functionality, if there's better alternatives then feel free to sugget them. $.PeriodicalUpdater({ url: 'getNotifications.aspx', maxTimeout: 6000, type: 'json' }, function(data) { var message = data; if (message != '') { $.jGrowl(message, { sticky: true }); } }); As an additional piece of functionality, would it be possible to store in a cookie when a user has closed a notification so they don't see it again? Thanks.

    Read the article

  • Securing against dynamic linking in .NET

    - by Henri
    I want to deploy an application with a license attached. However, I want to prevent that my dll can be easily referenced in visual studio. What are the usual ways of doing this? I was thinking about ngen-ing the application to prevent this, however, then the code becomes architecture dependent. Im not targetting any other architecture/platform besides windows, however, ngen-ing the application after making a release build seems like a workaround to me. Are there any other techniques to achieve this?

    Read the article

  • Symfony dynamic forms

    - by Asier
    Hi there, I started with a form, which is made by hand because of it's complexity (it's a javascript modified form, with sortable parts, etc). The problem is that now I need to do the validation, and it's a total mess to do it from scratch in the action using the sfValidator* classes. So, I am thinking to do it using sfForm so that my form validation and error handling can be done more easier and so I can reuse this form for the Edit and Create pages. The form is something like this: <form> <input name="form[year]"/> <textarea name="form[description]"></textarea> <div class="sortable"> <div class="item"> <input name="form[items][0][name]"/> <input name="form[items][0][age]"/> </div> <div class="item"> <input name="form[items][1][name]"/> <input name="form[items][1][age]"/> </div> </div> </form> The thing is that the sortable part of the form can be expanded from 2 to N elements on the client side. So that it has variable items quantity which can be reordered. How can I approach this problem? Any ideas are welcome, thank you. :)

    Read the article

  • Dynamic expansion of a Crystal report...

    - by Chathuranga Chandrasekara
    I have a crystal report consisting of several pages. Each page consists of a several fields that are populated from database. Suppose the following example : Name : aaaaaa Education Background:bbbbbbb Age:cc In my case the Education Background's details (bbbbbbb here) may consist of several words or several pages. If I set a large space for it, it will waste a big space on report (Yes. May be a paper) in a case of short answer. How can I eliminate this problem? Does crystal reports provide a way to dynamically expand the space?

    Read the article

  • How to create a dynamic width column in Twitter Bootstrap

    - by Elad
    How do you use Twitter Bootstrap to create a table-like list structure, where some columns take as much space as required to accommodate the widest element of that column, and a single column takes the remaining space? For example Id |Name |Email address 100001|Joe |[email protected] 100 |Christine|[email protected] 1001 |John |[email protected] the Id column takes just enough space to accommodate the 100001 id which is the longest id, and the Name column takes just enough space to accommodate the name Christine. The Email column takes the remaining space.

    Read the article

  • jquery get last ID of dynamic div

    - by Pjack
    Couldn't find an answer, but Im trying to get the last ID of the last div that was created on the page. The code I'm using doesn't seem to work using .last(). My syntax is probably wrong but I can't get it to show the ID. jQuery(document).ready(function() {jQuery("a.more_posts").live('click', function(event){ jQuery("div[id^='statuscontainer_']").last(); var id = parseInt(this.id.replace("statuscontainer_", "")); alert(id); }); });

    Read the article

  • Build dynamic LINQ?

    - by d daly
    Hi Im using #LINQ# to query data, but can anyone tell me how to build the query dynamically, if the user only wants to report on say 1 of the 3 fields? (see below) Thanks DD var query = from cl in db.tblClaims join cs in db.tblCases on cl.ref_no equals cs.ref_no where cl.claim_status == "Appeal" && cl.appeal_date >= Convert.ToDateTime(txtReferedFromDate.Text) && cl.appeal_date <= Convert.ToDateTime(txtReferedToDate.Text) && cs.referred_from_lho == dlLHO.Text && cs.adviser == dlAdviser.Text select new { Ref = cs.ref_no, ClaimType = cl.claim_type, ClaimStatus = cl.claim_status, AppealDate = cl.appeal_date }; gvReport.DataSource = query;

    Read the article

  • jQuery ajax post dynamic url insertion

    - by Kirill
    $.ajax({ type: "POST", url: "OMFG.php", data: info, success: function(){ }}); is what I'm using atm as a test and it works fine. I need to get the url from the link I'm clicking, so I do: var url = $(this).attr("href"); which works fine if I alert it out(the link includes http://samedomain.com/etc.php), but the ajax function doesn't post if I insert it into the ajax code: $.ajax({ type: "POST", url: url, data: info, success: function(){ }}); Please help, as I'm screwed without this working.

    Read the article

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