Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

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

  • Passing markup into a Rails Partial

    - by 1ndivisible
    Is there any way of doing something equivilant to this: <%= render partial: 'shared/outer' do %> <%= render partial: 'shared/inner' %> <% end %> Resulting in <div class="outer"> <div class="inner"> </div> </div> Obviously there would need to be a way of marking up 'shared/outer.html.erb' to indicate where the passed in partial should be rendered: <div class="outer"> <% render Here %> </div>

    Read the article

  • Passing in extra parameters in a URL

    - by Scott Atkinson
    I have the below column on my table what gets binded on pageload, the parameters in there work fine but i need to add an additional parameter which is the fullname which is the next column along but im having trouble figuring our the syntax, here is my ASP <asp:TemplateField HeaderText="ID"> <ItemTemplate> <asp:HyperLink ID="hyperLeadID" runat="server" NavigateUrl='<%#Eval("ID","/documents/Q-Sheet.aspx?LeadID={0}&isHappyCallReferral=yes&isHappyName={1}") %>' Text='<%#Eval("ID")%>'></asp:HyperLink> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Referral Name"> <ItemTemplate> <asp:Label ID="lblRefName" CssClass="gvItem" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> As you can see at the end of ID column i have added isHappyName={1} which i assumed it would select the next column along as it starts at 0 but it keeps throwing an error which is "Index (zero based) must be greater than or equal to zero and less than the size of the argument list." Can someone help me to pass the usersname through the URL Thanks

    Read the article

  • Passing variables from Model to Model in codeigniter

    - by Craig Ward
    Hi, I need to pass a variable to model, that model needs to send another back and use that variable to query a different model. EG: I have a product_ID which I send to the product model, From that I find out the supplier_ID. I want to grab that supplier_ID to the supplier model to get the supplier name. How do you implement this in codeigniter?

    Read the article

  • Error when passing data between views

    - by Kristoffer Bilek
    I'm using a plist (array of dictionaries) to populate a tableview. Now, when a cell i pressed, I want to pass the reprecented dictionary to the detail view with a segue. It's working properly to fill the tableview, but how do I send the same value to the detail view? This is my try: #import "WinesViewController.h" #import "WineObject.h" #import "WineCell.h" #import "WinesDetailViewController.h" @interface WinesViewController () @end @implementation WinesViewController - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; } - (void)viewDidUnload { [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - Table view data source - (void)viewWillAppear:(BOOL)animated { wine = [[WineObject alloc] initWithLibraryName:@"Wine"]; self.title = @"Vinene"; [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [wine libraryCount]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"wineCell"; WineCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell... cell.nameLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Name"]; cell.districtLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"District"]; cell.countryLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Country"]; cell.bottleImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Image"]]; cell.flagImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Flag"]]; cell.fyldeImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Fylde"]]; cell.friskhetImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Friskhet"]]; cell.garvesyreImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Garvesyre"]]; return cell; } #pragma mark - Table view delegate - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"DetailSegue"]) { NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow]; WinesDetailViewController *winesdetailViewController = [segue destinationViewController]; //Here comes the error line: winesdetailViewController.winedetailName = [wine objectAtIndex:indexPath.row] valueForKey:@"Name"]; } } I get one error for: winesdetailViewController.winedetailName = [wine objectAtIndex:indexPath.row] valueForKey:@"Name"]; Use of undeclaired identifier: indexPath. did you mean NSIndexPath? I think I've missed something important here..

    Read the article

  • Passing JS variable from child Iframe to parent JSP on cross sub domain

    - by Tarun
    I am stuck at 1 location and need some help. I created two subdomains on apache tomcat server like domain1.localhost.com and domain2.localhost.com in server.xml. On domain1 I have a JSP that includes iFrame (hosted on domain2). How can we pass the JS variable from child Iframe to parent JSP and store it in local variable of JSP hosted on domain1.localhost.com? I tried defining document.domain = "localhost" on both JSP but didn't work. Even parent DOM window is also not available in child iFrame (on sub-domain) because of obvious cross domain policies. Any help would be highly appreciated.

    Read the article

  • Is there a definitive list of uri patterns for use in android apps made by google?

    - by The Trav
    Apart from http://developer.android.com/guide/appendix/g-app-intents.html (which is quite good but fairly limited in the number of apps/uri's it covers) I've been unable to find a decent reference source for looking up URI's to use when integrating with google apps. I'm currently working on triggering the "add new contact" UI, and have found that the tel: uri pattern seems to work, but what if I only have a name and an email? I wouldn't have expected I'd need to rely on sample code / trial and error, but I really can't see anywhere where the intent/URI interface is supposed to be documented in android apps. Does such a standard exist? Is there some quasi standard / user database that I can consult? On a platform with such a good inter-interoperability architecture it just seems like something so useful I can't believe it's not there

    Read the article

  • Error when rendering a partial (RoR) passing the form as a local variable

    - by Dmitriy Likhten
    In my main template I have the following: <%= render :partial => "delivery_date", :collection => @brand.delivery_dates, :locals => {:form => f} %> However when the partial tries to use the form local variable, I get this error Showing app/views/brands/_delivery_date.html.erb where line #2 raised: wrong number of arguments (0 for 1) Extracted source (around line #2): 1: <%= delivery_date.id %> 2: <%= form.text_field :name %> 3: <% new_or_existing = delivery_date.new_record? ? 'new' : 'existing' %> 4: <% prefix = "brand[#{new_or_existing}_delivery_date_attributes][]" %> 5: <% fields_for prefix, delivery_date do |dd_f| %> Does anyone understand what this error means? Actually I want to do <% form.fields_for delivery_date do |dd_f| %> but that fails as well.

    Read the article

  • Passing control's ID to javascript via ScriptControlDescriptor

    - by markiz
    I create a control in CreateChildControls(): HtmlGenericControl mycontrol= HtmlGenericControl("li"); mycontrol.ID = "controlID"; controlId = mycontrol.ID; protected virtual IEnumerable<ScriptDescriptor> GetScriptDescriptors() { ScriptControlDescriptor descriptor = new ScriptControlDescriptor("Project.TEditor", this.ClientID); descriptor.AddProperty("controlId", controlId); return new ScriptDescriptor[] { descriptor }; } Then in javascript i try to find this control using the ID property: alert($get(this.get_controlId())); I get null because the actual control ID has a prefix that was added by asp. How to solve that?

    Read the article

  • Passing bundle to activity set as singletask

    - by Falmarri
    So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it's displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode="singletask" in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I'm not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity. I hope that made sense. I can post code if necessary, but I think that should explain my situation.

    Read the article

  • mysql reference result from subquery

    - by iamrohitbanga
    this is what i am doing update t1 set x=a,y=b where a and b are obtained from (select query here) i know the select query the select query returns multiple results which are the same when i use group by or distinct query execution slows down considerably a and b are forward references so mysql reports an error i want to set a equal to the value obtained in the first row and b equal to the value obtained in the first row for the respective columns, to avoid group by. i don't know how to refer to the first result from the select query. how can i achieve all this?

    Read the article

  • Passing value in HTML URL link

    - by pradeep
    $.post("/diabetes/ropimages/getcount.php",{pid:$("#patient_id").val()} ,function(data1){ //alert(data1); var count = data1; var pid = $("#patient_id").val(); var rid; for( var i = 1 ; i <= count ; i++) { var link ='<img src="/diabetes/ropimages/thumbpicdisplay.php?pid=+pid+&rid=1" />'; $("#content1").empty().html(link); } }); I am trying to pass pid value in url ..but its taking directly as +pid+ as value ..how do i give it the value of pid. And how do i print 3 images in a div? like the one in code

    Read the article

  • c++: Reference array of maps

    - by donalmg
    I have a function which creates an array of Maps: map<string, int> *pMap And a function which writes maps to the array: int iAddMap(map<string, int> mapToAdd, map<string, int> *m, int i) { m = &(pMap[i]); memcpy(m, mapToAdd, sizeof(map<string, int>)); } And a function to get maps from the array map<string, int>& getMap(int i) { return pMap[i]; } I can write maps to the array without any issue, but every get call results in a seg fault: int val; // val defined after this map<string, int> * pGetMap = &(getMap(val)); Any suggestions on why this is happening?

    Read the article

  • JQuery\Javascript - Passing a function as a variable.

    - by Josh
    I was just curious if I could pass a function as a variable. For example: I have a function $('#validate').makeFloat({x:671,y:70,limitY:700}); I would like to do something like this: $('#validate').makeFloat({x:function(){ return $("#tabs").offset().left+$("#tabs").width();},y:70,limitY:700}); This does not work, but ideally every time the variable was accessed it would compute the new value. So if the window was resized it would automatically adjust as opposed to a variable passed in being static. I realize I can implement this directly inside the function\widget, but I was wondering if there was some way to do something like the above.

    Read the article

  • Chrome extension - Message Passing

    - by Felipe Barreiros
    Hey there. I'm trying to get the info that is set on the Options Page to alter the behavior of my extension. Basically, if a checkbox on OptionsPage is set to true, the extension runs, otherwise it doesn't. I'm returning true on the background.html for testing purposes, but still, it doesn't work. Would you guys help me out? Thanks! Code being injected to the page: if(chrome.extension.sendRequest() == 'true') alert("checkbox set to true"); else alert("it is disabled"); background.html <script> chrome.extension.onRequest.addListener(function(){ return true; } </script>

    Read the article

  • Passing an address inside a WordPress post to a Google Map elsewhere on the Page

    - by ael_ecurai
    Background: My client is building their own WordPress site (using a purchased feature-rich theme), and I'm modifying a child theme as necessary to achieve customizations she wants. The theme comes with a Page template that includes a full-width Google Map across the top, which pulls its marker from a single address set within the Theme Options. It's meant to be used for one main "Contact Us" page. The client's business has several locations, and she wants each location's page to include such a map. (Example linked below.) It seems that the ideal solution would be the ability to specify an address within a shortcode in the Post, and have that set the map marker. Here's how the theme makes the map (where $mapAddress is the address from the Theme Options): <?php $mapAddress = ot_get_option( 'map_address' ); $mapHeight = ot_get_option( 'map_height' ); $mapContent = ot_get_option( 'map_content' ); ?> <section id="block-map-wrapper"> <div id="block-map" class="clearfix"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> jQuery(document).ready(function(){ // Map Options var mapOptions = { zoom: 15, scrollwheel: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeControl: true, scaleControl: false, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; // The Map Object var map = new google.maps.Map(document.getElementById("map"), mapOptions); var address = ""; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ "address" : "<?php echo $mapAddress; ?>" }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { address = results[0].geometry.location; map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ position: address, map: map, clickable: true, animation: google.maps.Animation.DROP }); var infowindow = new google.maps.InfoWindow({ content: "<?php echo $mapContent; ?>" }); google.maps.event.addListener(marker, "click", function() { infowindow.open(map, marker); }); } }); }); </script> <div id="map" class = "map" style = "width: 100%; height: <?php echo $mapHeight; ?>px"></div> </div><!-- #block-map --> <div class="shadow-bottom"></div> </section><!-- #block-map-wrapper --> Here's a test page using a custom Page template I've created. Right now it's using the same map code as above. I've tried creating a shortcode that takes an address attribute and sets it as $mapAddress, but that didn't work. I believe it's because the map is already loaded by the time the Loop gets parsed. How can I tell Maps to "come back" to the post to get the proper address? My specialty lies in HTML & CSS, but Javascript befuddles me fairly easily, so please be explicit when explaining implementation. Bonus: A further goal is to have the locations' parent Page also include such a map, but have multiple markers representing the multiple locations. When taking more than one location, Google Maps only accepts latitude/longitude. I don't want my client to be concerned with coordinates, so I know there's got to be something I can do with the geocoding service so she can just input a list of addresses instead (into the same, or similar, shortcode solution developed for my main question). But I am extra-clueless about how to do that.

    Read the article

  • Referencing text input fields in CKEditor dialogs

    - by rt-uk
    Hi, I've been playing around with this for a couple of weeks now with no success... In a CKEditor dialog, text input fields are renamed with a unique number - e.g. id: 'txtUrl' will become something like id='27_textinput'. How do I reference this? // I feel it should be something like: var myfield = CKEDITOR.instances.myElement.document.$.body.getId('txtUrl'); // or maybe: var myfield = CKEDITOR.dialog.getContentElement('info','txtUrl'); // and then: myfield.value = 'myvalue'; But these don't work. Please help! Thanks in advance, R

    Read the article

  • passing javascript value in html url link

    - by pradeep
    $.post("/diabetes/ropimages/getcount.php",{pid:$("#patient_id").val()} ,function(data1){ //alert(data1); var count = data1; var pid = $("#patient_id").val(); var rid; for( var i = 1 ; i <= count ; i++) { var link ='<img src="/diabetes/ropimages/thumbpicdisplay.php?pid=+pid+&rid=1" />'; $("#content1").empty().html(link); } }); i am trying to pass pid value in url ..but its taking directly as +pid+ as value ..how do i give it the value of pid. and how do i print 3 images in a div ? like the one in code

    Read the article

  • Passing operator as a parameter

    - by nacho4d
    Hi, I want to have a function that evaluates 2 bool vars (like a truth table) for example: since T | F : T then myfunc('t', 'f', ||); /*defined as: bool myfunc(char lv, char rv, ????)*/ should return true; how can I pass the third parameter? (I know is possible to pass it as a char* but then I will have to have another table to compare operator string and then do the operation which is something I would like to avoid) Is it possible to pass an operator like ^(XOR) or ||(OR) or &&(AND), etc in a function/method? Thanks in advance

    Read the article

  • using php Download File From a given URL by passing username and password for http authentication

    - by Acharya
    Hi all, I need to download a text file using php code. The file is having http authentication. What procedure I should use for this. Should I use fsocketopen or curl or Is there any other way to do this? I am using fsocketopen but it does not seem to work. $fp=fsockopen("www.example.com",80,$errno,$errorstr); $out = "GET abcdata/feed.txt HTTP/1.1\r\n"; $out .= "User: xyz \r\n"; $out .= "Password: xyz \r\n\r\n"; fwrite($fp, $out); while(!feof($fp)) { echo fgets($fp,1024); } fclose($fp); Here fgets is returning false. Any help!!!

    Read the article

  • Null reference for first memory address between 0 - 65535

    - by Terry
    I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question. How come the following code, accessing memory address 0(and up to 65535) in C# would throw NullReferenceException byte* pointer = (byte*)0; byte test = *pointer; Thanks a lot in advance!

    Read the article

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