Search Results

Search found 1192 results on 48 pages for 'listener'.

Page 40/48 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Hibernate Envers : How to delete entries from my audit table?

    - by Laurent T
    Hi everyone, I am currently working with Hibernate Envers. My problem is the following : How to delete entries in the audit table related to the entity I want to delete? My entity has no relation with other entities. I figured out that I have to do that in onPostDelete method of my custom listener : import org.hibernate.envers.event.AuditEventListener; import org.hibernate.event.PostCollectionRecreateEvent; import org.hibernate.event.PostDeleteEvent; import org.hibernate.event.PostInsertEvent; import org.hibernate.event.PostUpdateEvent; import org.hibernate.event.PreCollectionRemoveEvent; import org.hibernate.event.PreCollectionUpdateEvent; public class MyListener extends AuditEventListener { ... @Override public void onPostDelete(PostDeleteEvent arg0) { // TODO Auto-generated method stub super.onPostDelete(arg0); } ... } I've read the documentation, forums, many things but I can't figure it out. May be it's not possible, I don't know. Has someone ever done this before? Thank you :)

    Read the article

  • file upload in JSF using myfaces component

    - by prt
    Hi, all i am creating a JSF application where file uploading functionality is required.I have added all the required jar files in my /WEB-INF/lib folder. jsf-api.jar jsf-impl.jar jstl.jar standard.jar myfaces-extensions.jar commons-collections.jar commons-digester.jar commons-beanutils.jar commons-logging.jar commons-fileupload-1.0.jar but still when trying to deploy the application on apache 6.0.29 i am getting the following error. org.apache.catalina.core.StandardContext addApplicationListener INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored. org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart PM org.apache.catalina.core.StandardContext start SEVERE: Context [/jsfApplication] startup failed due to previous errors org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc The web application [/jsfApplication] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/jsfApplication] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/jsfApplication] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. i am using also using hibernate and spring framework for this application. please help. thanks,

    Read the article

  • MouseListener fired without checking JCheckBox

    - by Morinar
    This one is pretty crazy: I've got an AppSight recording (for those not familiar, it's a recording of what they did including keyboard/mouse input + network traffic, etc) of a customer reproducing a bug. Basically, we've got a series of items listed on the screen with JCheckBox-es down the left side. We've got a MouseListener set for the JPanel that looks something like this: private MouseAdapter createMouseListener() { return new MouseAdapter(){ public void mousePressed( MouseEvent e ) { if( e.getComponent() instanceof JCheckBox ) { // Do stuff } } }; } Based on the recording, it appears very strongly that they click just above one of the checkboxes. After that, it's my belief that this listener fired and the "Do stuff" block happened. However, it did NOT check the box. The user then saw that the box was unchecked, so they clicked on it. This caused the "Do stuff" block to fire again, thus undoing what it had done the first time. This time, the box was checked. Therefore, the user thinks that the box is checked, and it looks like it is, but our client thinks that the box is unchecked as it was clicked twice. Is this possible at all? For the life of me, I can't reproduce it or see how it could be possible, but based on the recording and the data the client sent to the server, I can't see any other logical explanation. Any help, thoughts, and or ideas would be much appreciated.

    Read the article

  • Java: Tracking a user login session - Session EJBs vs HTTPSession

    - by bguiz
    If I want to keep track of a conversational state with each client using my web application, which is the better alternative - a Session Bean or a HTTP Session - to use? Using HTTP Session: //request is a variable of the class javax.servlet.http.HttpServletRequest //UserState is a POJO HttpSession session = request.getSession(true); UserState state = (UserState)(session.getAttribute("UserState")); if (state == null) { //create default value .. } String uid = state.getUID(); //now do things with the user id Using Session EJB: In the implementation of ServletContextListener registered as a Web Application Listener in WEB-INF/web.xml: //UserState NOT a POJO this this time, it is //the interface of the UserStateBean Stateful Session EJB @EJB private UserState userStateBean; public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); servletContext.setAttribute("UserState", userStateBean); ... In a JSP: public void jspInit() { UserState state = (UserState)(getServletContext().getAttribute("UserState")); ... } Elsewhere in the body of the same JSP: String uid = state.getUID(); //now do things with the user id It seems to me that the they are almost the same, with the main difference being that the UserState instance is being transported in the HttpRequest.HttpSession in the former, and in a ServletContext in the case of the latter. Which of the two methods is more robust, and why?

    Read the article

  • Problem: Movie Clip contains just one frame

    - by Doug
    I'm a newbie at Flash, so started playing with a pretty standard code sample: one layer contains a movie clip with a flying rectangle, another layer has a button to control it. All script code is in Main.as file. The rectangle was named square1 through the Property window. Here is the problem: the constructor for Main has a line: square1.stop(); to prevent clip from playing, but it doesn't help - it plays. I know the constructor fires, because it has trace("stuff") in it. The code does check that the stage has been created. What strange is that square1.currentFrame always returns 1, and square1.totalFrames returns 1 as well. The layer has 24 frames on the timeline. I tried a tween with just 2 keyframes, then converted whole tween into frames - same result. I mean, the thing is flying before my eyes, how can it be 1 frame??? I even added a listener: square1.addEventListener(Event.ENTER_FRAME, onFrameChange); The event fires all the time, i.e. the frames change, but currentFrame is still 1. Also, tried to name individual frames and use square1.gotoAndStop("begin") and stuff like that. Nothing helps. I am really stuck with this stupid problem.

    Read the article

  • getting an onclick event to a select option using js

    - by Vadim.G
    i am having a very frustrating problem. I have this code which filters out my results and inputs them into a select box var syn = <?=json_encode($syn)?>; function filterByCity() { var e = document.getElementById("city_filter"); var city = e.options[e.selectedIndex].value; var selectOptions = document.getElementById('syn_list'); selectOptions.options.length = 0; for (i = 0; i < syn.length; i++) { if (city == syn[i]['city'] || city == 'all') { selectOptions.options[selectOptions.options.length] = new Option(syn[i]['name'], syn[i]['id'] + '" onclick="updateTxtContent(\'' + syn[i]['id'] + '\')'); } } } as you might see i am adding a onclick listener to every select "option" which look great in the source code of the page itself but if i copy it into an edit i notice this my problem is that the "updateTxtContent()" function is not called. <select size="10" name="syn_list" id="syn_list" class="span12" dir="rtl" style="text-align:right;"> <option value="13&quot; onclick=&quot;updateTxtContent('13')">option a</option> <option value="14&quot; onclick=&quot;updateTxtContent('14')">option b</option> obviously there should be a better way to do this that i am not aware of.

    Read the article

  • Execute a block of database querys

    - by Nightmare
    I have the following task to complete: In my program a have a block of database querys or questions. I want to execute these questions and wait for the result of all questions or catch an error if one question fails! My Question object looks like this (simplified): public class DbQuestion(String sql) { [...] } [...] //The answer is just a holder for custom data... public void SetAnswer(DbAnswer answer) { //Store the answer in the question and fire a event to the listeners this.OnAnswered(EventArgs.Empty); } [...] public void SetError() { //Signal an Error in this query! this.OnError(EventArgs.Empty); } So every question fired to the database has a listener that waits for the parsed result. Now I want to fire some questions asynchronous to the database (max. 5 or so) and fire an event with the data from all questions or an error if only one question throws one! Which is the best or a good way to accomplish this task? Can I really execute more then one question parallel and stop all my work when one question throws an error? I think I need some inspiration on this... Just a note: I´m working with .NET framework 2.0

    Read the article

  • Android: How to periodically send location to a server

    - by Mark
    Hi, I am running a Web service that allows users to record their trips (kind of like Google's MyTracks) as part of a larger app. The thing is that it is easy to pass data, including coords and other items, to the server when a user starts a trip or ends it. Being a newbie, I am not sure how to set up a background service that sends the location updates once every (pre-determined) period (min 3 minutes, max 1 hr) until the user flags the end of the trip, or until a preset amount of time elapses. Once the trip is started from the phone, the server responds with a polling period for the phone to use as the interval between updates. This part works, in that I can display the response on the phone, and my server registers the user's action. Similarly, the trip is closed server-side upon the close trip request. However, when I tried starting a periodic tracking method from inside the StartTrack Activity, using requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) where minTime is the poll period from the server, it just did not work, and I'm not getting any errors. So it means I'm clueless at this point, never having used Android before. I have seen many posts here on using background services with handlers, pending intents, and other things to do similar stuff, but I really don't understand how to do it. I would like the user to do other stuff on the phone while the updates are going on, so if you guys could point me to a tutorial that shows how to actually write background services (maybe these run as separate classes?) or other ways of doing this, that would be great. Thanks!

    Read the article

  • How to get JTree expanded?

    - by Dzmitry Zhaleznichenka
    I have a wizard with several screens where user has to fill his/her details for further processing. At the second screen I have a radio group with three radio buttons that enable additional elements. To proceed, user has to choose one of them. When user selects third button, single-selection JTree filled in with data enables and user has to select an option from it. Then user has to press "Next" to get to next screen. The option he\she had selected is stored as a TreePath. So far so good. My problem is the following. If the user wants to come back from the following screen to the screen with a JTree, I want to provide him\her with the JTree expanded to the option that had been selected and to highlight the option. However, whatsoever I try to do for that (any combinations of expandPath, scrollPathToVisible, addSelectionPath, makeVisible) always provides me with a collapsed tree. I try to expand both leaves and nodes. My code looks like this: rbProcessJTree.setSelected(isProcessJTree()); if (null != getSelectedTablePath()){ trTables.addSelectionPath(getSelectedTablePath()); trTables.expandPath(getSelectedTablePath()); trTables.scrollPathToVisible(getSelectedTablePath()); } When setSelected() is called, state change listener is invoked that enables JTree. The model is loaded during the form initialization. Each time I switch between screens, I save the input data from previous screen and dispose it. Then, when I need to open previous screen back, I save data from the following screen, dispose it, load data to this screen and show it. So each time the screen is generating from scratch. Could you please explain, what sequence of operations has to be done to get JTree expanded in a newly created form,with data model loaded and selection path provided?

    Read the article

  • Image swaping with click on <tr>

    - by Jonny Sooter
    I've edited this piece of code from the Data Tables Plugin witch makes a tr click able and pops open another tr with details from the clicked tr. This piece of code is the event listener for opening and closing. When "details" are open the img should be images/details_close.png and they are closed the img should be images/details_open.png and have a swap occurring when it opens and closes when clicked. What is happening is there is no swap going on when its open or closed I still only get the "details_open.png". I don't knoe if I'm just not selecting the img tag properly or whats going on. Link to project: http://www2.kent.k12.wa.us/ksd/it/www/mobile/elementary.html $('#example tbody').on('click', 'td', function (e) { var myImage = $(this).find("img"); var nTr = $(this).parents('tr')[0]; if ( oTable.fnIsOpen(nTr) ) { /* This row is already open - close it */ myImage.src = "images/details_open.png"; oTable.fnClose( nTr ); } else { /* Open this row */ myImage.src = "images/details_close.png"; oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' ); } } );

    Read the article

  • ListView setOnItemClickListener in ListFragment not working

    - by Siddarth Kaki
    I am developing an app that uses ActionBar tabs to display a list of options through ListFragment. The list (and ListFragment) display without a problem, but the ListView's setOnItemClickListener doesn't seems to work, as nothing happens when an item in the list is clicked. Here's the code for the ListFragment class: package XXX.XXX; public class AboutFrag extends SherlockListFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.aboutfrag, container, false); ListView lv = (ListView) view.findViewById(android.R.id.list); String[] items = new String[] {"About 1", "About 2", "About 3"}; lv.setAdapter(new ArrayAdapter<String>(getActivity(), R.layout.list_item, items)); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch (position) { case 0: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://google.com")); startActivityForResult(browserIntent, 0); break; case 1: Intent browserIntent2 = new Intent(Intent.ACTION_VIEW, Uri.parse("http://wikipedia.org")); startActivityForResult(browserIntent2, 0); break; case 2: Intent browserIntent3 = new Intent(Intent.ACTION_VIEW, Uri.parse("http:/android.com"); startActivityForResult(browserIntent3, 0); break; } } }); return view; } } I'm assuming it does not work because the class returns the view object, so the FragmentActivity can't run the listener code, so does anyone know how to make this work? By the way, I am using ActionBarSherlock. Thanks in advance!!!

    Read the article

  • How can I serve static content with Glassfish embedded?

    - by Andy Fiedler
    I'm trying to setup Glassfish embedded with a WAR project that implements a REST API and then some static Javascript content that calls it. I got the WAR to deploy and the REST API is available with a context root of "/Users". How can I use Glassfish to serve static content with a context root of "/". So for example, if the user requests http://myserver.com/Users/some-REST-call it routes to the WAR application and http://myserver.com/somefile.js serves a static file from some directory? Here's my Main class file so far: public class Main{ public static void main(String[] args) throws Exception { String port = System.getenv("PORT"); port = port != null ? port : "8080"; GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setPort("http-listener", Integer.parseInt(port)); GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); glassfish.start(); Deployer deployer = glassfish.getDeployer(); deployer.deploy(new File("target/Users-Rest.war")); } } Thanks a ton for your help!

    Read the article

  • Passing Extras and screen rotation

    - by Luis A. Florit
    This kind of questions appear periodically. Sorry if this has been covered before, but I'm a newbie and couldn't find the appropriate answer. It deals with the correct implementation of communication between classes and activities. I made a gallery app. It has 3 main activities: the Main one, to search for filenames using a pattern; a Thumb one, that shows all the images that matched the pattern as thumbnails in a gridview, and a Photo activity, that opens a full sized image when you click a thumb in Thumbs. I pass to the Photo activity via an Intent the filenames (an array), and the position (an int) of the clicked thumb in the gridview. This third Photo activity has only one view on it: a TouchImageView, that I adapted for previous/next switching and zooming according to where you shortclick on the image (left, right or middle). Moreover, I added a longclick listener to Photo to show EXIF info. The thing is working, but I am not happy with the implementation... Some things are not right. One of the problems I am experiencing is that, if I click on the right of the image to see the next in the Photo activity, it switches fine (position++), but when rotating the device the original one at position appears. What is happening is that Photo is destroyed when rotating the image, and for some reason it restarts again, without obeying super.onCreate(savedInstanceState), loading again the Extras (the position only changed in Photo, not on the parent activities). I tried with startActivityForResult instead of startActivity, but failed... Of course I can do something contrived to save the position data, but there should be something "conceptual" that I am not understanding about how activities work, and I want to do this right. Can someone please explain me what I am doing wrong, which is the best method to implement what I want, and why? Thanks a lot!!!

    Read the article

  • Event Source Live streaming in Ruby on rails onError method

    - by kishorebjv
    I'm trying to implement basic rails4 code with eventsource API & Action controller live, Everything is fine but I'm not able to reach event listner . Controller code: class HomeController < ApplicationController include ActionController::Live def tester response.headers["Content-Type"] = "text/event-stream" 3.times do |n| response.stream.write "message: hellow world! \n\n" sleep 2 end end Js code: var evSource = new EventSource("/home/tester"); evSource.onopen = function (e) { console.log("OPEN state \n"+e.data); }; evSource.addEventListener('message',function(e){ console.log("EventListener .. code.."); },false); evSource.onerror = function (e) { console.log("Error State \n\n"+e.data); }; & When i reloading the page, My console output was "OPEN state" & then "Error State" as output.. event-listener code was not displaying . 1.When I'm curling the page, "message: Hellow world!" was displaying. 2.I changed in development.rb config.cache_classes = true config.eager_load = true 3. My browsers are chrome & firefox are latest versions, so no issues with them, Where I'm missing? suggestions please!

    Read the article

  • In ActionScript, is there a way to test for existence of variable with datatype "Function"

    - by Robusto
    So I have a class where I instantiate a variable callback like so: public var callback:Function; So far so good. Now, I want to add an event listener to this class and test for existence of the callback. I'm doing like so: this.addEventListener(MouseEvent.MOUSE_OVER, function(event:MouseEvent) : void { if (callback) { // do some things } }); This works great, doesn't throw any errors, but everywhere I test for callback I get the following warning: 3553: Function value used where type Boolean was expected. Possibly the parentheses () are missing after this function reference. That bugged me, so I tried to get rid of the warning by testing for null and undefined. Those caused errors. I can't instantiate a Function as null, either. I know, I know, real programmers only care about errors, not warnings. I will survive if this situation is not resolved. But it bothers me! :) Am I just being neurotic, or is there actually some way to test whether a real Function has been created without the IDE bitching about it?

    Read the article

  • Keeping the number of objects and event-listeners on stage as low as possible

    - by DevEight
    Hello. I am creating a site with lots of big scrollable text-boxes in it. Each text-box object contained some text, and two buttons to scroll up/down with. The scroll buttons each had an event listener so the text moved when you clicked them. These text-boxes were stacked on-top of each other with all except one having an alpha of 0. If I wanted to change which text-box is active I move it to the front and call a small TweenLite animation. To the left (outside of the text-box objects) I have an object similar to a menu. It also has about 12 or so event-listeners (one for every button). This turns out cause A LOT of lag an it's very troublesome for my laptop to run it. What I need help with doing is to reduce the number of event-listeners on the stage and also the amount of text-boxes. What I was thinking was to add the text-boxes using AS so I only have 1 on the stage at a time but I couldn't figure out how to do it. I also thought it might be better to just use 1 big event-listeners and from mouseX and mouseY decide which button the user is trying to push. Are there any better alternatives to this? And if so, please elaborate on how to do it.

    Read the article

  • kQuery : Trying to find a specific instance of a class by number

    - by mattelliottIT
    I guess I have just hit a mental block with this one; maybe some fresh eyes will help. Basically I have a few instance of the class "menu-item" which when clicked call the click function via jQuery and bring up a video. Instead of giving each on an id as well as a class I am trying to find which instance of the class was clicked (1, 2, 3, etc). Just can't seem to get it though. //click listener for menu-items $('.menu-item').click(function(event) { var o = $('.menu-item'); var count = o.length(); // switch(count) { case 0 : filename == 'letters'; break; case 1 : filename == 'the-gift'; break; } var videoPlayer = '<video controls width="618px">'; videoPlayer += '<source src="_video/' + filename + '.mp4" />'; videoPlayer += '</video>'; //place video $('#videoCont').html(videoPlayer); }); I'm trying to create an array there where each instance of the 'menu-item' is one array item. (btw, for now I am just proofing this with an mp4 filetype before I add in the ogv and webm formats). Thanks for any and all help!

    Read the article

  • Navigating the timeline

    - by Dean 'Deacon' Beard
    O.K, being a little new to this, I have hit a brick wall, I'm using AS3 in Flash CS5. All I want to do is have a tweened animation which stops at a frame and which has a clickable button to access another part of the maintime line. Also there will be a button on the animation to skip it. How does one set this up? Obviously you need a stop(); at the stop frame of the time line and an event listener and function for both buttons right? Any more help besides that. I have it set up like this; totalSlides:Number = 60; currentSlideNumber:Number = 1; skipbutton.addEventListener(MouseEvent.CLICK,skipbuttonPress); function skipbuttonPress(evt:MouseEvent):void{ currentframelabel = currentframelabel+1; if(currentSlideNumber>=0){ currentframelabel = introstop; } framelabel.gotoAndStop(introstop); } and the frame it stops on is set up as follows stop(); totalSlides:Number = 60; currentSlideNumber:Number = 5; click01.addEventListener(MouseEvent.CLICK,click01Press); function click01Press( evt : MouseEvent ) : void { currentSlideNumber = currentSlideNumber+1; if (currentSlideNumber >= 0) { currentSlideNumber = 25; } framelabel.gotoAndStop(mainpage); } As I need this for a project, any help would be greatly valued. Many Thanks

    Read the article

  • Returning JSON from JavaScript to Python

    - by Chris Lacy
    I'm writing a simple App Engine app. I have a simple page that allows a user to move a marker on a Google map instance. Each time the user drops the marker, I want to return the long/lat to my Python app. function initialize() { ... // Init map var marker = new GMarker(center, {draggable: true}); GEvent.addListener(marker, "dragend", function() { // I want to return the marker.x/y to my app when this function is called .. }); } To my (admittedly limited) knowledge, I should be: 1). Returning a JSON structure with my required data in the listener callback above 2). In my webapp.RequestHandler Handler class, trying to retrieve the JSON structure during the post method. I would very much like to pass this JSOn data back to the app without causing a page reload (which is what has happened when I've used various post/form.submit methods so far). Can anyone provide me with some psuedo code or an example on how I might achieve what I'm after? Thanks.

    Read the article

  • Help me find article on Multi-threading and Event Handling in Java

    - by JDR
    I once read an article on how to properly write event handlers for multi-threading in Java, but I can't for the life of me find it anymore. It described the pitfalls and potentials for deadlocks that can occur when firing events (not Swing events mind you, but general events like model update notifications). To clarify, the situation would be as such: // let's say this is code from an MVC model somewhere public void setSomeProperty(String myProperty){ if(!this.myProperty.equals(myProperty)){ this.myProperty = myProperty; fireMyPropertyChangedEvent(...); } } The article described how passing control to arbitrary external listener code was a potential cause for deadlock. I now find myself in a situation where I need to fire such events in a multithreaded environment and I would very much like to read the article again to see what it has to say before I continue. Does anyone know the article I'm referring to? I believe it came as a (fairly short) PDF. It started off with an initial naive implementation and incrementally pointed out flaws and improved upon it. It ended with a sort of final proper-way-to-fire-multithreaded-events. I've searched endlessly in my browse history and on google, but all I could find were endless amounts topics on Swing event dispatch threads. Thank you.

    Read the article

  • Symfony 2 - Updating a table based on newly inserted record in another table

    - by W00d5t0ck
    I'm trying to create a small forum application using Symfony 2 and Doctrine 2. My ForumTopic entity has a last_post field (oneToOne mapping). Now when I persist my new post with $em->persist($post); I want to update my ForumTopic entity so its last_post field would reference this new post. I have just realised that it cannot be done with a Doctrine postPersist Listener, so I decided to use a small hack, and tried: $em->persist($post); $em->flush(); $topic->setLastPost($post); $em->persist($post); $em->flush(); but it doesn't seem to update my topics table. I also took a look at http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/working-with-associations.html#transitive-persistence-cascade-operations hoping it will solve the problem by adding cascade: [ 'persist' ] to my Topic.orm.yml file, but it didn't help, either. Could anyone point me to a solution or an example class? My ForumTopic is: FrontBundle\Entity\ForumTopic: type: entity table: forum_topics id: id: type: integer generator: strategy: AUTO fields: title: type: string(100) nullable: false slug: type: string(100) nullable: false created_at: type: datetime nullable: false updated_at: type: datetime nullable: true update_reason: type: text nullable: true oneToMany: posts: targetEntity: ForumPost mappedBy: topic manyToOne: created_by: targetEntity: User inversedBy: articles nullable: false updated_by: targetEntity: User nullable: true default: null topic_group: targetEntity: ForumTopicGroup inversedBy: topics nullable: false oneToOne: last_post: targetEntity: ForumPost nullable: true default: null cascade: [ persist ] uniqueConstraint: uniqueSlugByGroup: columns: [ topic_group, slug ] And my ForumPost is: FrontBundle\Entity\ForumPost: type: entity table: forum_posts id: id: type: integer generator: strategy: AUTO fields: created_at: type: datetime nullable: false updated_at: type: datetime nullable: true update_reason: type: string nullable: true text: type: text nullable: false manyToOne: created_by: targetEntity: User inversedBy: forum_posts nullable: false updated_by: targetEntity: User nullable: true default: null topic: targetEntity: ForumTopic inversedBy: posts

    Read the article

  • Error 1009 after gotoAndStop - stage instance never gets added

    - by ELambda
    I've been through the forums for hours (days?) searching on 1009 errors, but I remain stumped on this. It seems very mysterious and I would LOVE some help if you have any ideas. I have a single .swf that is 7 frames long - each frame represents a different "page" and you can switch pages through a menu widget in the top right corner. The menu widget calls gotoAndPlay( "frame" ). Everything works fine except when I switch from one particular frame to another. Then, during initialization of the new frame (setting some visible properties on various items, in actionscript), I get the dreaded 1009 error on a specific stage instance, a dynamic text instance i_word. Here's what I've tried so far: made sure the actionscript for the new frame starts with a stop() statement before starting initialization - no dice tried changing i_word into a movie_clip instead of dynamic text, made sure it was exported for actionscript - no difference. (I also have 2 other dynamic text instances on the same page that don't seem to cause a problem) added an ENTER_FRAME listener when the new frame is loaded, in case the problem was a timing issue. Put in a big if statement checking if i_word and other instances are not null before proceeding to initialization. It never enters the if, because i_word NEVER gets added. I added trace statements for all instances that are null, and it is the only one. If I remove all references to i_word in my actionscript, everything else is not null, and things go forward. The text for i_word even shows up on the screen in that case. tried renaming i_word - no dice tried deleting the layer i_word was on and adding a new layer - no dice It feels like there is a serious Gremlin in my flash file somewhere. Or maybe I'm missing something obvious. Let me know if you have any ideas...I'd be so grateful. Thank you! Elambda

    Read the article

  • Flex: Scale an Image so that its width matches contentWidth?

    - by Tong Wang
    I have a dynamic layout, where an image is loaded into an HBox: <mx:HBox ...> <mx:Image height="100%" .../> </mx:HBox> only the image's height is set on the image, so that it can take all the vertical space available, while its width is left undefined and I expect the width to scale accordingly with its height. It turns out that the image's height is equal to its contentHeight, i.e. height scales properly; however, the image's width is still the same as measuredWidth (the image's original width), and is not scaled accordingly. For example, if the image's original size is 800x600 and if the HBox is 300 in height, then image height will scale down to 300, however its width doesn't scale down to 400, instead it stays at 800. I tried to add an event listener to explicitly set the image width: <mx:Image id="img" height="100%" updateComplete="img.width=img.contentWidth;" .../> It works only the first time the image is loaded, after that, if I use Image.load() to dynamically load different images, it stops working - the image width is set to 0. Any help/advice will be highly appreciated.

    Read the article

  • How to best manage multi-frame MovieClips with classes?

    - by Arms
    After switching to AS3, I've been having a hell of a time figuring out the best way to manage MovieClips that have UI elements spread across multiple frames with a single class. An example that I am working on now is a simple email form. I have a MovieClip with two frames: the 1st frame has the form elements (text inputs, submit button) the 2nd frame has a "thank you" message and a button to go back to the first frame (to send another email) In the library I have linked the MovieClip to a custom class (Emailer). My immediate problem is how do I assign a MouseEvent.CLICK event to the button on the 2nd frame? I should note at this point that I am trying to avoid putting code on the timeline (except for stop() calls). This is how I am 'solving' the problem now: Emailer registers an event listener for a frame change ( addEventListener("frame 2", onFrameChange) ) On the 2nd frame of the MovieClip I am calling dispatchEvent(new Event("frame 2")); (I would prefer to not have this code on the frame, but I don't know what else to do) My two complaints with this method are that, first I have calls to addEventListener spread out across different class methods (I would rather have all UI event listeners registered in one method), and second that I have to dispatch those custom "onFrameChange" events. The second complaint grows exponentially for MovieClips that have more than just 2 frames. My so called solution feels makes me feel dirty and makes my brain hurt. I am looking for any advice on what to do differently. Perhaps there's a design pattern I should be looking at? Should I swallow my pride and write timeline code even though the rest of my application is written in class files (and I abhor the Flash IDE code editor)? I absolutely LOVE the event system, and have no problem coding applications with it, but I feel like I'm stuck thinking in terms of AS2 when working with mutl-frame movieclips and code. Any and all help would be greatly appreciated.

    Read the article

  • Android lifecycle: Fill in data in activity in onStart() or onResume()?

    - by pjv
    Should you get data via a cursor and fill in the data on the screen, such as setting the window title, in onStart() or onResume()? onStart() would seem the logical place because after onStart() the Activity can already be displayed, albeit in the background. Notably I was having a problem with a managed dialog that made me rethink this. If the user rotates the screen while the dialog is still open, onCreateDialog() and onPrepareDialog() are called between onStart() and onResume(). If the dialog needs to be based on the data you need to have the data before onResume(). If I'm correct about onStart() then why does the Notepad example give a bad example by doing it in onResume()? See http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html NoteEditor.java line 176 (title = mCursor.getString...). Also, what if my Activity launches another Actvity/Dialog that changes the data my cursor is tracking. Even in the simplest case, does that mean that I have to manually update my previous screen (a listener for a dialog in the main activity), or alternatively that I have to register a ContentObserver, since I'm no longer updating the data in onResume() (though I could update it twice of course)? I know it's a basic question but the dialog only recently, to my surprise, made me realize this.

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >