w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Displaying empty rows by Telerik RadGrid while viewing page in browser
If all you want are empty rows, create any object that you can iterate over, like a collection, and throw that object into the datasource of the grid. Below is a very basic example. Example: <telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" runat="server"> </telerik:RadGrid> protected void RadGrid1_NeedDataSource(object sender, EventArgs e) { DataTable table = new DataTable(); table.Columns.Add("Some Column", typeof(string)); table.Rows.Add(""); // Add some empty rows table.Rows.Add(""); table.Rows.Add(""); RadGrid1.DataSource = table; }

Categories : Asp Net

create a new page in a form dynamically, based on data of the prev. page
Using the UiApp service, you have one doGet() and one doPost() function... but here's a way to extend them to support a dynamic multi-part form. (The example code is borrowed from this answer. Your doGet() simply builds part1 of your form. In the form, however, you need to identify your form by name, like this: var form = app.createFormPanel().setId("emailCopyForm"); You doPost() then, will pass off handling of the post operation to different functions, depending on which form has been submitted. See below. (Also included: reportFormParameters (), a default handler that will display all data collected by a form part.) /** * doPost function with multi-form handling. Individual form handlers must * return UiApp instances. */ function doPost(eventInfo) { var app; Logger.log("For

Categories : Google Apps Script

Telerik radgrid paging in webshop, breaks when changing product amount on last page
The guys at Telerik helped me, the problem was that I was going through all items and not just the one where the amount changed. Updated tbQuantity_TextChanged protected void tbQuantity_TextChanged(object sender, EventArgs e) { if (!_readMode) { RadNumericTextBox tbQuantity = (RadNumericTextBox)sender; GridDataItem dataItem = (GridDataItem)tbQuantity.NamingContainer; var shopItemID = (int)dataItem.GetDataKeyValue("ID"); var shopItem = _sessionHelper.CurrentCart.CartItems.Find(x => x.ID == shopItemID); if (!shopItem.IsExternal) { _sessionHelper.CurrentCart.CartItems.Find(x => x.ID == shopItemID).Quantity = Convert.ToInt32(tbQuantity.Text); _sessionHelper.Curr

Categories : C#

How to redirect /page/index page to /page (and /page to /page/) in Ruby on Rails?
If you don't want to cause a full reload of the page, then you should not use "redirect" in your routes, as that simply issues a browser redirect. That would cause Rails to issue a 301 "Moved Permanently". That essentially means "there is a /page/index route but it's a mistake, we don't use it anymore, please go to /page instead and never come back here." If that is the case then that is what you want to do. If you're using Passenger and will continue to use Passenger, it would be more efficient to put an Apache redirect rule in the htaccess file. It also seems strange that this is even an issue. How have /page/index, /page, and /page/ emerged in the wild as URLs that all point to the same index#index action? What is this index controller? The usual thing is to have, say, a PagesControlle

Categories : Ruby On Rails

How to compare second page getting correct data from first page or not(Functional testing) in Telerik test studio
The attachments you referenced do not display with your question, however, I believe the following is what you want to do. 1) With recorder navigate to invoice page 2) Enable hover over elements 3) Hover over your element containing the value 'price', click on the blue dot, click on 'Quick Tasks' then select 'Extract - text contains...' 4) Repeat for element containing value for 'total' 5) Databind each variable with a unique name on the test steps page 6) Navigate to your journal History page 7) Hover over the element that contains the value for total, click the blue dot, select 'Build Verification', click content, then click ok 8) Repeat for element containing value for 'total' 9) Go back to test steps click on the verification steps and apply the binding from steps 3 and 4.

Categories : Misc

How to add prev page, and next page of posts on Wordpress?
in your admin settings > Reading (wp-admin/options-reading.php) change the posts per page count to 5 and for the links you're writing it wrong as per the codex try this <?php posts_nav_link('','<','>'); ?> UPDATE: You can add this if/else statement to show different on single or index <?php if(is_single()) { // single-view navigation ?> <?php $posts = query_posts($query_string); if (have_posts()) : while (have_posts()) : the_post(); ?> <?php previous_post_link('%link', '<'); ?> | <?php next_post_link('%link', '>'); ?> <?php endwhile; endif; ?> <?php } else { // archive view navigation ?> <?php posts_nav_link('','<','>'); ?> <?php } ?> see more help here

Categories : PHP

ui-bootsrap pagination: first page button is not disabled when page loads
i found a way to make it work: removed this line from the controller : $scope.currentPage = response("X-MyApp-currentPage"); and added this one : $scope.currentPage = 1; which gives : controller('ListCtrl', ['$scope', 'List', function($scope, List) { // collect: concatenate the objects before to send it to loadList() $scope.collect = function (a,b){ var c = {}; for (var att in a) { c[att] = a[att]; } for (var att in b) { c[att] = b[att]; } return c; } $scope.currentPage = 1; $scope.loadList = function (param) { $scope.list = List.query(p, function(list, response) { $scope.pageCount = response("X-MyApp-pagesCount"); }); } }]) apparently the pagination component doesn't need the X-MyApp-currentPage information from the server (and i'm not sur

Categories : Angularjs

pagination codeigniter always starts at page 2 and active link is always at page 2
try a different way of solution, controller(index()) $this->load->library('pagination'); $config['base_url'] = site_url().'classname/index'; $config['per_page'] = $this->config->item('pagination_number'); $config['uri_segment'] = 4; $data['count']=$this->example_model->count(); $config['total_rows'] =$data['count']; $data['classname']=$this->example_model->getall($this->config->item('pagination_number'),$this->uri->segment(4)); $this->pagination->initialize($config); $data['page_link']=$this->pagination->create_links(); $this->load->view('users/classname.php',$data); model function getall($num,$offset) { $this->db->from('table_name'

Categories : Codeigniter

jQuery Pagination: Don't want page to go back to page 1 on refresh
Alternate One use hash tags.. like if the user is on page one then pagename#1, if on page two then pagename#2.. Alternate Two use Web Storage Also have a look on Post/Redirect/Get this might help you

Categories : Jquery

JQuery Function not firing on page load it works only after i refresh page or re-visit the same page again
Well I got the general gist of your question but the entire question description is pretty confusing so I'll try to just help you out where I think it counts. var leftbar = $(".pg-left-bar").height(); var rightbar = $(".pg-right-bar").height(); if (leftbar >= rightbar) { $(".pg-right-bar").css({ "height": leftbar + "px" }) }else{ $(".pg-left-bar").css({ "height": rightbar + "px" }) } I omitted your magic numbers and the other code to make the change apparent but I think your issue was due to the lack of "px" being concatenated to the ends of your css declarations. If this isn't the issue would you mind showing a full example.

Categories : Javascript

how can I pass a variable from an input box on one page to another page and use this info to perform a search on page 2?
Did you try and search for the answer first? This should help you... Link to your question that has already been answered

Categories : PHP

With Flying Saucer, how do I generate a pdf with a page number and page total on every page at the footer?
In your html, you need to put this somewhere in the body tag: <div id="footer"> page <span id="pagenumber"></span> of <span id="pagecount"></span> </div> And this should be your css/style: #footer { position: running(footer); text-align: right; } @page { @bottom-right { content: element(footer); } } #pagenumber:before { content: counter(page); } #pagecount:before { content: counter(pages); } You can learn more about that @bottom-right option here.

Categories : Java

Pagination - 2 items per page on page 1, 10 items per page on other pages
In first page put the SQL query with LIMIT 0,2 On second page LIMIT 2,10 On third page LIMIT 12,10 In PHP you can do this like this: <?php if($p==1){ $start=0; $amount=2; }else{ $start=$p*10-18; $amount=10; } $sql="SELECT * FROM table LIMIT $start,$amount";

Categories : PHP

How can the Page Size, Page Orientation, and Page Margins of an ods Spreadsheet Be Set Using ODFDOM?
The necessary calls can be made to some of the underlying ODF objects which the SpreadsheetDocument provides access to. First, we need to get the proper document properties reference (for all examples, "spreadsheet" is a reference to a created SpreadsheetDocument): StyleMasterPageElement defaultPage = spreadsheet.getOfficeMasterStyles().getMasterPage("Default"); String pageLayoutName = defaultPage.getStylePageLayoutNameAttribute(); OdfStylePageLayout pageLayoutStyle = defaultPage.getAutomaticStyles().getPageLayout(pageLayoutName); PageLayoutProperties pageLayoutProps = PageLayoutProperties.getOrCreatePageLayoutProperties(pageLayoutStyle); Then, we can set the various properties, such as margins, orientation, and height/width. Note that the height and width values seem to

Categories : Java

how to display a coming soon page when a page doesn't have an index page using htaccess
I'm guessing that for http://domain1.com/, you've got the document root pointed to /domain1.com/, which means it will never be able to access files outside of the document root. You'll need to move the comingsoon.php file to the /domain1.com/ folder and include the same ErrorDocument. Another option is to include the full hostname in the original error document: ErrorDocument 403 http://maindomain.com/comingsoon.php But this will change the location in the browser's address bar.

Categories : Htaccess

Magento module custom block working in product details page but not working in list and grid page?
Well, The xml code which you are using in the category page ( list page) is not correct. It should be like this : <catalog_category_default> <reference name="category.products"> <block type="test/test" name="test" as="other" template="test/test.phtml" > <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" /> </block> </reference></catalog_category_default> <catalog_category_layered> <reference name="category.products"> <block type="test/test" name="test" as="other" template="test/test.phtml" > <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" /> </block> </reference> </catalog_category_layered> Please try wi

Categories : PHP

parallax refreshing the page not taking the page to the landing page
Did you try: document.getElementById("body").scrollTop = 0; If this doesn't work, you may want to replace the "body" element id with the id of the container of your parallax section. If you need parallax-specific scrolling help, my company and I have a list of parallax tutorials at http://potentpages.com/parallax-tutorials/. You will likely want the jQuery section. A tutorial there may be able to help you if the "scrollTop" solution doesn't work.

Categories : Misc

Javascript not working in php project and user is still getting routed to php page instead of holding at current page
What you need to do is prevent the default action. Change $("button#submit").click( function() { to $("button#submit").click( function(event) { event.preventDefault(); Also you are explicitly calling the submit function here: $("#myForm").submit(function() { return false; }); Try removing this code as well, it is likely resolving prior to the $.post call finishes Lastly your jquery code should be wrapped in a document.ready block ... $(document).ready(function(){ $("button#submit").click(function(event) { event.preventDefault(); if ($("#username").val() == "" || $("#password").val() == "") $("div#ack").html("Please enter both username and password"); else $.post($("#myForm").attr("action")

Categories : PHP

jquery mobile coming back to prev page onclick event is not working
Why don't you use the auto back feature. Just have this in your script after jquery-1.9.1.min.js and before jquery.mobile-1.3.1.min.js: $.mobile.page.prototype.options.addBackBtn = true; $.mobile.page.prototype.options.backBtnText = "Back"; Then it would automatically add back button markup on each page except first one and route backwards to the previous pages.

Categories : Javascript

magento jquery toggle not working in home page but working in product page
Open up your Chromium-Browser and your console https://developers.google.com/chrome-developer-tools/docs/console#opening_the_console Type jQuery into the console and press enter If you get: ReferenceError: jQuery is not defined then you have not included jQuery Post any errors you get in your console after refreshing the page...

Categories : Javascript

Login page with Spring Security not working URL(http://localhost:8080/site/j_spring_security_check) goes to PAGE NOT FOUND
You've been answered here and here, please don't cross-post The answers: if the j_spring_security_check URL is not part of the HST driven then make sure you add it to you hst:hosts exclusions, because otherwise the HST thinks it needs to handle the URL. and You need to insert the​ SpringSecurityValve into your existing pipelines​ as well​. ​you can use the hippo-spring-sec​ plugin for a cleaner spring security integration; http://hst-springsec.forge.onehippo.org/

Categories : Spring

Page reload not working when the page was called by AJAX
Try this <?php $var = $_GET['id']; if(empty($var)) { // here flag for redirection is set echo 1; } else { do something... } ?> In AJAX: $.ajax({ type: "POST", url: "call_me.php", data: "id=" + id, success: function(msg){ // checking the response is for redirection if(msg == 1) // javascript code for redirecting to callme.php window.location = "call_me.php?id=101"; } });

Categories : PHP

Access function in a JS page from another JS page on page load
Scripts are loaded asynchronously, so you never know which file will load first. Most probably one with less bytes. If you want to load scripts in order you provide, use library like requirejs.

Categories : Jquery

pagination is not working in wordpress main page
Is it a theme we can download or did you develop it ? The code you show get the last 7 articles, so the way it reacts is normal ^^ Here is, for example, the code used in twenty twelve : <?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentytwelve_content_nav( 'nav-below' ); ?> <?php else : ?> [...] It simply use the have_post() function to get the articles, and use the template called content (content.php) to show them. And the number of post to show is set in the administration panel > Settings > Reading. If you are developing your own theme, you should take a look at how th

Categories : PHP

Pagination in Laravel 4 works for one page. but not working for another
A few things to check. The new route exists in the app/routes.php file. You are returning a view file for the new route. That view file has the pagination output. For example: <?php echo $articles->links(); ?>. Ultimately, there appears to be some kind of error occurring, which is why the page is rendering blank. Trying turning php errors on in your dev env and see what happens after that.

Categories : PHP

Pagination link is not working /page/2 - NOT FOUND - Wordpress
use following paged query if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; } $produtos = new WP_Query(array( 'post_type' => 'blog', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'asc', 'paged' => $paged, 'tax_query' => array( array( 'taxonomy' => 'categorias', 'field' => 'slug', 'terms' => ACTIVE ) ) )); while ( $produtos->have_posts() ) : $produtos->the_post(); //CONTENT endwhile;

Categories : PHP

[google form]Creating form with a script : Page Break and go to page issue
You only need to change the order of your operations; you do not need to keep the operations on item together. Here's an example, using your code: function createForm() { var title = 'Multipage Form Test'; var description = 'Stackoverflow question 17083500'; var form = FormApp.create(title) .setDescription(description) .setConfirmationMessage('Thanks for responding!'); var page1 = form.addPageBreakItem() .setTitle('First page'); var item = form.addMultipleChoiceItem(); var page2 = form.addPageBreakItem() .setTitle('Second page'); var page3 = form.addPageBreakItem() .setTitle('Third page'); item.setTitle('Question') .setChoices([ item.createChoice('Yes',page2), item.createChoice('No',page3) ]); Logger.log(fo

Categories : Forms

Drupal 7 ajax not working properly (success function called but the drupal page is being printed instead of the page callbacks results)
mapresults_ajax is not returning anything. in this case, I would use print instead of return to send the results back to javascript without returning the whole HTML page. change your drupal_json_output to print drupal_json_output

Categories : PHP

Showing html page inside a php page by echo the html page contents
hmm, a simple html page: <html> <head> <title>Page title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="your-style-file.css" media="all" /> <script type="text/javascript" src="your-javascript-file.js"></script> </head> <body> <div id="div-tag">A div tag</div> <script type="text/javascript" src="another-javascript-file.js"></script> </body> </html> You can load external html file via javascript (or jquery load()). like this: $('#div-tag').load('external-file.html'); Or via php, like this: $external-html = file_get_contents('external-file.html'); print $external-html; Check your javascript, mayb

Categories : PHP

Take all user entered data from one jsp page to another JSP page and after user confirmation submit it from the first jsp page
Create a form with all the fields you require. Submit that form. set the action to the target jsp. In the request object of target jsp you will get all the data you entered. You can specify the action like this form id="login-form" action="Your action jsp url"

Categories : HTML

Page Prev/Next of PHP MYSQL
Set the 0 in your Limit clause to a variable and increment by 4 //$_POST['limit']=0,4,8,12.... $start = $_POST['limit']; $result = mysqli_query($con,"SELECT * FROM products Where username='$_SESSION[username]' LIMIT $start, 4");

Categories : PHP

RadGrid hyperLinkColumn + retain values to new page
Welcome to SO Jacob, I have done this before and it's not hard at all. Example: My select statement is "select top 5 ProductName from products" I then created a hyperlink column and assigned the properties under the data section as seen in the screenshot below. When run, it makes the data clickable and when clicked, it navigates to the url seen in the SS. If you want to use it in a querystring change the DataNavigateUrlFormatString to: http://google.com?ProductName={0} You would then read it on your new page via: var a = Request.QueryString["ProductName"]; //C# dim a = Request.QuesryString("ProductName") 'Vb.net If this is what you are after, click the green checkmark next to my answer to accept it and alert future users that this is the solution.

Categories : Asp Net

How to get IP address of the Client accessing my page where My web page or WebApp is hosted at some remote server
Check out this article at W3Schools: http://www.w3schools.com/asp/coll_servervariables.asp you can try: Request.ServerVariables("remote_addr")

Categories : C#

Ajax in Rails, it doesn't work because it jumps to other page without staying in current page.
If you have jquery rails in your gemfile (gem 'jquery-rails') and have: //= require jquery //= require jquery_ujs in your application.js, what you've got there should work. Minus the show.js.erb, which would require you changing the data-type to be script instead of html. Although based on your description, the show.js.erb wouldn't be needed. The script you have in index.html.erb will suffice.

Categories : Ruby On Rails

Chrome userscript works on a thread page, but not on a main forum page, with the same structure?
Adblock Plus is perfect for this kind of thing. Rather than trying a userscript or extension to block an external file, just install Adblock Plus and then add a filter for http://website.com/e3/2013/css/styles.css. If you insist on a userscript approach, then it appears that your existing code is fighting a race condition. That <link> node is part of a document that is stored in a div and is apparently manipulated by javascript (AJAX). Sometimes your script fires in time to catch a copy and sometimes it doesn't. This is exacerbated by the fact that Chrome scripts fire at unpredictable times, by default. It might be sufficient just to add "run_at": "document_end" to your manifest.json. (Which ironically, fires before the default script execution time.) However, to be sure, us

Categories : Javascript

How to find control bounded in item template on master page from content page?
Try finding the control within the repeater object itself, like this: var hiddensubcategory2id = repsubcategory2.FindControl("hf3") as HiddenField; Note: You should always check to see if the result of a FindControl() is null or not, like this: if(hiddensubcategory2id != null) { // Do something with the control you found }

Categories : Asp Net

Getting "An error exists on this page. Acrobat may not display the page correctly." using ITextSharp WriteSelectedRows
You're introducing a PDF syntax error here: PdfContentByte canvas = writer.DirectContent; canvas.SetTextMatrix(50, 50); With DirectContent, you grab an object that allows you to write PDF syntax directly to the content stream. Immediately after that, you introduce a text state operator. This is illegal PDF syntax: A text state operator is only valid inside a text object; that is: between BT (BeginText()) and ET (EndText) operators). Why do you need to set the text matrix? That line doesn't make sense, because you're defining the position of the table in the writeSelectedRows() method. Long story short: remove canvas.SetTextMatrix(50, 50); and you'll have at least one syntax error less in your PDF. I just checked the iText codebase, and normally your code should throw an "unbalanced

Categories : C#

Strip the tags of a page and get an array or a separated list of page numbers returned
may I suggest the PHP DOM library. You can access these values like so: <?php include 'simple_html_dom.php'; $html = str_get_html("<span class="current">1</span><a href="javascript:__doPostBack('ctl00$phCenterColumn$motoSearchResults$gvCatalog$ctl01$ctl03','')">2</a><a href="javascript:__doPostBack('ctl00$phCenterColumn$motoSearchResults$gvCatalog$ctl01$ctl04','')">"); $currentPage = $html->find('span.current'); foreach($currentPage as $page) { echo 'current page: ' . $page->plaintext . '<br />'; } $otherPages = $html->find('a'); echo 'other pages: '; foreach($otherPages as $otherPage) { echo $otherPage->plaintext . ' '; } ?> this gave me: current page: 1 other pages: 2

Categories : PHP

jQuery mobile stop running the script in the current page used after moving to the next page
As, Omar suggested I want to give an id instead of $(document). Using pagebeforeshow or pageshow , pagehide and Clearing the interval will solve this issue. The following code works for me, var auto_refresh; $("#light-page").on('pagebeforeshow', function(){ auto_refresh = setInterval(function () { // code }, 3000); }); $('#light-page').on('pagehide', function () { clearInterval(auto_refresh); }); Adding id in Html: <div data-role="page" id="light-page"> </div>

Categories : Javascript

How to open, jump to a page, change page size (basic read only operations of PDF)
You have misunderstood what iText is for. It's not a library for PDF rendering, you won't be able to visualize a PDF file with iText. As for your issue, most of the PDF viewers (Adobe Acrobat, Foxit Reader) accept parameters to achieve (partly) what you want. It's just a matter of finding the proper reader. Remember that seeking advices about libraries, applications, frameworks is considered off-topic on StackOverflow, so your question is likely to be closed.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.