Search Results

Search found 13794 results on 552 pages for 'variable scope'.

Page 26/552 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Mixing AJAX requests with Flash scope objects not working

    - by AlanObject
    I have a JSF page that displays a table from an object called TableQuery that supports stateful pagination, sorting, etc. The bean that accesses the object is a RequestScoped object, and it attempts to preserve the TableQuery by storing it the flash map. The accessor method looks like this: public TableQuery<SysLog> getQuery() { if (query != null) return query; Flash flash = FacesContext.getCurrentInstance(). getExternalContext().getFlash(); query = (TableQuery) flash.get("Query"); if (query != null) System.out.println("TableSysLog.getQuery() Got query from flash!"); if (query == null) { query = slc.getNewTableQuery(); System.out.println("TableSysLog.getQuery() Created new query"); } flash.put("Query", query); return query; } The Links to go between pages are implemented with *p:commandLInk*s. I use Primefaces command link in AJAX mode so just the link gets processed when it is clicked. The action listener looks like this: public void doNextPage(ActionEvent evt) { getQuery().doNextPage(); } When it doesn't work I get the error message: WARNING: JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash. Any values stored to the flash will not be available on the next request. I found this thread when looking up this problem. When I turned of HTTP chunking as the article suggests, the error message went away but the problem remained. Does anyone know what is going on and how this might be fixed?

    Read the article

  • Scope of StaticResource within a WPF ResourceDictionary

    - by Nicolas Webb
    I have a WPF ResourceDictionary with the following TextBlock: <TextBlock Visibility="{Binding Converter={StaticResource MyBoolProp ResourceKey=BoolToVis}}"> </TextBlock> The ResourceDictionary is included in App.xaml under MergedDictionaries: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="MyResourceDictionary.xaml"/> Within the App.xaml I have defined the BoolToVis converter (again, under Application.Resources) <BooleanToVisibilityConverter x:Key="BoolToVis" /> When I start my app up - I get the following XamlParseException: "Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception." The InnerException is: "Cannot find resource named 'BoolToVis'. Resource names are case sensitive." I'm able to refer to this converter directly with App.xaml (in fact, it's another TextBlock) and within other UserControls with no problems. This particular bit of code also worked fine under the .NET 4.0 RC (and Beta2). This error only started happening when I upgraded to the .NET 4.0 RTM. I'm able to work around it by declaring another BooleanToVisibilityConverter within MyResourceDictionary.xaml and referring to it like so: <TextBlock Visibility="{Binding Converter={StaticResource MyBoolProp ResourceKey=BoolToVis2}}"> </TextBlock> Any reason why I should need to do this?

    Read the article

  • HTML form -> Flash submit button -> Set a PHP variable in flash button -> Submit form

    - by RobHardgood
    Okay, I'm sorry that this is pretty complicated, but it shouldn't be that hard to solve... Here's what I want to do. I have an HTML form that I want to upload to MySQL with PHP. That part's easy, but the thing is I want the submit button to be a Flash object. Somehow I need the Flash button to submit the form, but I think I can figure that out. The tricky part is that I need it to set another PHP variable before submitting the form. The variable will be determined by a bunch of stuff, but I can code that in actionscript later. I just need to figure out how to pass the variable back to the webpage. A $_POST variable would probably be fine. Thanks!! Let me know if I need to clarify more...

    Read the article

  • Environment variable retrieve from NAnt script is not recognize in Jenkins nant build step

    - by user1670340
    In my nant script I retrieve my environment variable in this way: but when I run it through jenkins using nant as build step I got an error like this. Expression: ${environment::get-variable('MAIN_PROJECT_PATH')} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Environment variable "MAIN_PROJECT_PATH" does not exist. Is there configuration for this? so that Jenkins will recognize environment variables access by my nant script? Help is greatly appreciated. Thanks.

    Read the article

  • BlackBerry - KeyListener with global scope

    - by Abs
    Hello all, I am new to BlackBerry App development. I want to be able to listen for keypress events whenever the BlackBerry (8900 in my case) is on and on all screens is this possible? If so, it would be great for someone to direct me in the right direction. I am already having a look at Interface KeyListener. import net.rim.device.api.system.*; Thanks all

    Read the article

  • Initiate User Scope Class at Session Start

    - by James Santiago
    I want to initiate a class for each user at the start of the user's session so that a single class can be used throughout the user's session. I checked out this post but I'm not sure where I should be placing this Sessionhandler class. Inside global.asax? How do I go about accomplishing this?

    Read the article

  • Scope of Connection Object for a Website using Connection Pooling (Local or Instance)

    - by Danny
    For a web application with connection polling enabled, is it better to work with a locally scoped connection object or instance scoped connection object. I know there is probably not a big performance improvement between the two (because of the pooling) but would you say that one follows a better pattern than the other. Thanks ;) public class MyServlet extends HttpServlet { DataSource ds; public void init() throws ServletException { ds = (DataSource) getServletContext().getAttribute("DBCPool"); } protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { SomeWork("SELECT * FROM A"); SomeWork("SELECT * FROM B"); } void SomeWork(String sql) { Connection conn = null; try { conn = ds.getConnection(); // execute some sql ..... } finally { if(conn != null) { conn.close(); // return to pool } } } } Or public class MyServlet extends HttpServlet { DataSource ds; Connection conn;* public void init() throws ServletException { ds = (DataSource) getServletContext().getAttribute("DBCPool"); } protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { try { conn = ds.getConnection(); SomeWork("SELECT * FROM A"); SomeWork("SELECT * FROM B"); } finally { if(conn != null) { conn.close(); // return to pool } } } void SomeWork(String sql) { // execute some sql ..... } }

    Read the article

  • python global variable trouble

    - by Guanidene
    I am having troubles using global variables in python... In my program, i have declared 2 global variables, global SYNC_DATA and global SYNC_TOTAL_SIZE Now in one of my functions, I am able to use the global variable SYNC_DATA without declaring it as global again in the function; however , I am not able to use the other global variable SYNC_TOTAL_SIZE in the same way. I have to declare the latter as global in the function again to use it. I get this error if i use it without declaring as global in the function - "UnboundLocalError: local variable 'SYNC_TOTAL_SIZE' referenced before assignment" Why is it so that sometimes I can access global variables without declaring them as global in functions and sometimes not? And why Is it that we have to again declare it as global in the function when it is already declared once in the beginning... Why doesn`t the function just check the variable in the global namespace if it does not find it in its namespace directly?

    Read the article

  • Unable to set enviornment variable in platform builder win CE 6.0

    - by mukesh
    Actually while building the win ce project getting the two errors -: Error 1 BUILD: [00:0000000015:ERRORE] C:\WINCE600\PLATFORM\ICOP_Vortex86_60CS\SRC\OAL\OALLIB\obj\x86\debug_objects.mac: create file failed. 2 Error 3 BLDDEMO: There were errors building mytest I think it's comes, due to unset of environmnet variable. facing problem to set environment variable IMGRAM128 in the project proerties, giving the error :- "The variable IMGRAM128 is associated with the 128 RAM catalog item.Would you like to set this variable by adding catalog item in OS design? The varible will not be added to the environmmet tab.............."

    Read the article

  • asp.net mvc post variable to controller

    - by Erwin
    Hello fellow programmer I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP codeigniter we can catch the post variable easily with $this->input->post("theinput"); I know that in ASP.Net MVC we can create an action method that will accepts variable from post request like this public ActionResult Edit(string theinput) Or by public ActionResult Edit(FormCollection formCol) Is there a way to catch post variable in ASP.Net like PHP's codeigniter, so that we don't have to write FormCollection object nor have to write parameter in the action method (because it can get very crowded there if we pass many variable into it) Is there a simple getter method from ASP.Net to catch these post variables?

    Read the article

  • What is the scope of xsl apply-imports?

    - by calavera.info
    My original idea about apply-imports was that if there are two templates which matches the same node, then using apply-imports in a template with higher priority runs the template with the lower priority. But I recently find out that it's important how are imports organized. Two cases interests me particularly. Will apply imports work on a template which is imported in imported file (nested import)? How about a "sibling import" (master file imports two files with templates matching the same nodes) It seems to me that this is not clearly described in specification. Could someone provide authoritative guidelines? EDIT: I can try those cases on my own, but there is always a danger that it will be implementation specific behavior.

    Read the article

  • Problem retrieving multiple instances of the same asp.net session variable

    - by sw1sh
    I'm having problems with retrieving multiple instances of a session variable from an InProc session state. In the following code I persist a simple BusinessObject into a session variable on the Page_Load event. On the click of a button I try to retrieve the object back into 2 new declared instances of the same BusinessObject. All works great until I change one of the properties in the first instance, it changes the second instance as well. Is this normal behaviour? I would have thought as these were new instances they wouldn’t demonstrate static behaviour? Any ideas where I'm going wrong? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then ' create a new instance of a business object and set a containg variable Dim BO As New BusinessObject BO.SomeVariable = "test" ' persist to inproc session Session("BO") = BO End If End Sub Protected Sub btnRetrieveSessionVariable_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRetrieveSessionVariable.Click ' retrieve the session variable to a new instance of BusinessObject Dim BO1 As New BusinessObject If Not Session("BO") Is Nothing Then BO1 = Session("BO") ' retrieve the session variable to a new instance of BusinessObject Dim BO2 As New BusinessObject If Not Session("BO") Is Nothing Then BO2 = Session("BO") ' change the property value on the first instance BO1.SomeVariable = "test2" ' why has this changed on both instances? Dim strBO1Property As String = BO1.SomeVariable Dim strBO2Property As String = BO2.SomeVariable End Sub ' simple BusinessObject class Public Class BusinessObject Private _SomeVariable As String Public Property SomeVariable() As String Get Return _SomeVariable End Get Set(ByVal value As String) _SomeVariable = value End Set End Property End Class

    Read the article

  • Javascript Array Scope - newbie here

    - by Gianluca
    So, I am learning Javascript while playing white Google Calendar APIs and I just can't figure how this piece of code is working this way: var entriesResult = []; var data = new Date(2010,3,22,17,0,0); var callback = function(result) { var entries = result.feed.getEntries(); if (entries.length != 0) { entriesResult = eventsManager(entries, 0, data); window.alert("inner entriesResult " + entriesResult.length); } } this.service.getEventsFeed(this.query, callback, handleGDError); window.alert("outer entriesResult " + entriesResult.length); eventsManager() is a function that returns an array of Objects. getEventsFeed() it's an API function: it queries the service and pass a "feed root" (a feed with selected items) to the callback function. Why the first alert (inner..) outputs a valid entriesResult.length while the second one (outer..) always outputs a 0? I tought javascript arrays are always passed by reference, what's wrong whit my code? Thank you :)

    Read the article

  • TWiki: Restricting users scope of editing the pages.

    - by abhishekgupta92
    I am making a twiki website and I am stuck with a problem. The users have access to write the files. So, I want to include Report Abuse option so that in case of vandalism of someone the thing can be corrected as soon as possible. Also, I am facing one more problem that someone told me that while editing the code the person can change the read/write permissions for the other users. And obviously, that wouldn't be something that I am expecting from Twiki. C'mon there must be some way of moderation in twiki to ensure thatthere is no undesirable content.

    Read the article

  • global variable and Python

    - by rejinacm
    A global variable created in one function cannot be used in another function directly. Instead I need to store the global variable in a local variable of the function which needs its access. Am I correct? Why is it so?

    Read the article

  • jQuery - ajax page load - php scope

    - by Develman
    I am using jquery.tabs() and want to load the pages of the tabs with ajax. I am using MVC pattern with PHP and used a frontcontroller / pagecontroller pattern. The templating is done by PHP, e.g.: <?php if($this->userLoggedIn == TRUE): ?> <span>Herzlich Willkommen <?php echo $this->userName; ?>! [<a href="logout">Ausloggen</a>] </span> <?php endif; ?> The variables ($this-userName) are injected by the pagecontroller class. The problem is, that when I load a page via ajax, the variables are not known. Following PHP error is coming up: Fatal error: Using $this when not in object context.... Any idea, how to use / load the variables and using it in the template files.

    Read the article

  • Next, Previous Records Using Named Scope

    - by keruilin
    I have a model for which I want to retrieve the next record(s) and previous record(s). I want to do this via a named_scope on the model, and also pass in as an argument the X number of next/previous records to return. For example, let's say I have 5 records: Record1 Record2 Record3 Record4 Record5 I want to be able to call Model.previous or Model.previous(1) to return Record2. Similarly, I want to be able to call Model.next or Model.next(1) to return Record4. As another example I want to be able to call Model.previous(2) to return Record3. I think you get the idea. How can I accomplish this?

    Read the article

  • Need an end of lexical scope action which can die normally

    - by Schwern
    I need the ability to add actions to the end of a lexical block where the action might die. And I need the exception to be thrown normally and be able to be caught normally. Unfortunately, Perl special cases exceptions during DESTROY both by adding "(in cleanup)" to the message and making them untrappable. For example: { package Guard; use strict; use warnings; sub new { my $class = shift; my $code = shift; return bless $code, $class; } sub DESTROY { my $self = shift; $self->(); } } use Test::More tests => 2; my $guard_triggered = 0; ok !eval { my $guard = Guard->new( #line 24 sub { $guard_triggered++; die "En guarde!" } ); 1; }, "the guard died"; is $@, "En guarde! at $@ line 24\n", "with the right error message"; is $guard_triggered, 1, "the guard worked"; I want that to pass. Currently the exception is totally swallowed by the eval. This is for Test::Builder2, so I cannot use anything but pure Perl. The underlying issue is I have code like this: { $self->setup; $user_code->(); $self->cleanup; } That cleanup must happen even if the $user_code dies, else $self gets into a weird state. So I did this: { $self->setup; my $guard = Guard->new(sub { $self->cleanup }); $user_code->(); } The complexity comes because the cleanup runs arbitrary user code and it is a use case where that code will die. I expect that exception to be trappable and unaltered by the guard. I'm avoiding wrapping everything in eval blocks because of the way that alters the stack.

    Read the article

  • Biztalk - local variable in expression shape

    - by Jeremy Stein
    Sometimes when I'm writing XLANG/s code in an expression shape, it would be more readable if I could just use a temporary variable within the scope of that one code block. I hate to clutter up the entire orchestration with a variable declaration. Is there a way to declare a variable within an expression shape?

    Read the article

  • how i got the name of the string variable in the strange attempt to debug unknown variable ?

    - by justjoe
    i got several variable. One is variable string, object, and array. $mystring = "hello im input"; $myobject = new userclass; $myarray = array ( 0 = 'zero', 1 = "one"); i want to create a new array with its variable name as key before send it to as function parameter with it's first line use extract function. the multi_array will be like this multi_array = array ( 'mystring' = "hello im input", 'myobject' = new userclass, 'myarray' = array ( 0 = 'zero', 1 = "one") ) i use key to get the name of array and getclass to get the name of object. But how i got the name of the string variable ? function i_do_extract($multi_array) { extract($multi_array); // Do Rest }

    Read the article

  • C++ stack memory still valid?

    - by jbu
    Hi all, If I create an object on the stack and push it into a list, then the object loses scope (outside of the for loop in the example below) will the object still exist in the list? If the list still holds the object, is that data now invalid/possibly corrupt? Please let me know, and please explain the reasoning.. Thanks, jbu class SomeObject{ public: AnotherObject x; } //And then... void someMethod() { std::list<SomeObject> my_list; for(int i = 0; i < SOME_NUMBER; i++) { SomeObject tmp; my_list.push_back(tmp); //after the for loop iteration, tmp loses scope } my_list.front(); //at this point will my_list be full of valid SomeObjects or will the SomeObjects no longer be valid, even if they still point to dirty data }

    Read the article

  • resource-ref at application scope in EJB 2.1 Project

    - by Mike Deck
    Is it possible to define resource references that are applicable to all EJBs in an application? Currently I have an ejb-jar.xml that looks something like this: <ejb-jar> <enterprise-beans> <session id="foo"> <!-- snip --> <resource-ref> <res-ref-name>jdbc/myDatasource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> <session id="bar"> <!-- snip --> <resource-ref> <res-ref-name>jdbc/myDatasource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> </enterprise-beans> </ejb-jar> You'll notice that both EJBs have the same resource-ref defined for both of them. Is there a way to factor this duplication out within a J2EE 1.4 application? Ideally I should be able to define the jdbc/myDatasource resource once within the application and have anything running inside that container be able to access it by doing a JNDI lookup for "java:comp/env/jdbc/myDatasource". Is there any way to accomplish this?

    Read the article

  • Controlling the scope of a document.write call coming from a third party

    - by pingrey
    Dear all, I'm writing a webpage that relies on an external javascript file (that I have no control of), which returns data by using document.write's. Is there any way to dynamically call the function without it overwriting the whole document? The most concise code I can think of is below: <html> <head> <script type="text/javascript"> function horriblefunction () { document.write("new text"); } </script> </head> <body> Starting Text... <div id="pleasewriteinme"></div> Other text... <button onclick="horriblefunction();">Click</button> </body> </html> The idea beginning that without altering "horriblefunction()" (as it's external) the new text could be placed in the div instead of overwriting the page. Is this possible or does the function have to be called inside the div as the page is created? Thanks for you help

    Read the article

  • Variable declared with variable keyword in sql plus(oracle 9i)?

    - by Vineet
    I am trying to declare g_num ,number data type with size it gives an error but in case of varchar2,char it does not. variable g_name varchar2(5);//correct accept size for varchar 2 variable g_num number(23);//Gives an error " VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) | VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) | NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR ] ]" Please suggest!

    Read the article

  • dos batch assign returned values from a command into a variable (from powershell)

    - by nokheat
    i am refering to this question ASSIGN win XP dos commandline output to variable http://stackoverflow.com/questions/537404/assign-win-xp-dos-commandline-output-to-variable i am trying to use it on a powershell code segment so i typed powershell date (get-date).AddDays(-1) -format yyyyMMdd and confirm it returns like 20100601 but then if i tried to for /f "tokens=*" %a in ('powershell date get-date -format yyyyMMdd ') do set var=%a then it failed to work as expected. how can i transfer the date to a variable?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >