Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

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

  • JSF: Cannot catch ViewExpiredException

    - by ifischer
    I'm developing a JSF 2.0 application on Glassfish v3 and i'm trying to handle the ViewExpiredException. But whatever i do, i always get a Glassfish error report instead of my own error page. To simulate the occurrence of the VEE, i inserted the following function into my backing bean, which fires the VEE. I'm triggering this function from my JSF page through a commandLink. The Code: @Named public class PersonHome { (...) public void throwVEE() { throw new ViewExpiredException(); } } At first i tried it by simply adding an error-page to my web.xml: <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/error.xhtml</location> </error-page> But this doesn't work, i'm not redirected to error but i'm shown the Glassfish errorpage, which shows a HTTP Status 500 page with the following content: description:The server encountered an internal error () that prevented it from fulfilling this request. exception: javax.servlet.ServletException: javax.faces.application.ViewExpiredException root cause: javax.faces.el.EvaluationException:javax.faces.application.ViewExpiredException root cause:javax.faces.application.ViewExpiredException Next thing i tried was to write ExceptionHandlerFactory and a CustomExceptionHandler, as described in JavaServerFaces 2.0 - The Complete Reference. So i inserted the following tag into faces-config.xml: <factory> <exception-handler-factory> exceptions.ExceptionHandlerFactory </exception-handler-factory> </factory> And added these classes: The factory: package exceptions; import javax.faces.context.ExceptionHandler; public class ExceptionHandlerFactory extends javax.faces.context.ExceptionHandlerFactory { private javax.faces.context.ExceptionHandlerFactory parent; public ExceptionHandlerFactory(javax.faces.context.ExceptionHandlerFactory parent) { this.parent = parent; } @Override public ExceptionHandler getExceptionHandler() { ExceptionHandler result = parent.getExceptionHandler(); result = new CustomExceptionHandler(result); return result; } } The custom exception handler: package exceptions; import java.util.Iterator; import javax.faces.FacesException; import javax.faces.application.NavigationHandler; import javax.faces.application.ViewExpiredException; import javax.faces.context.ExceptionHandler; import javax.faces.context.ExceptionHandlerWrapper; import javax.faces.context.FacesContext; import javax.faces.event.ExceptionQueuedEvent; import javax.faces.event.ExceptionQueuedEventContext; class CustomExceptionHandler extends ExceptionHandlerWrapper { private ExceptionHandler parent; public CustomExceptionHandler(ExceptionHandler parent) { this.parent = parent; } @Override public ExceptionHandler getWrapped() { return this.parent; } @Override public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); System.out.println("Iterating over ExceptionQueuedEvents. Current:" + event.toString()); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); Throwable t = context.getException(); if (t instanceof ViewExpiredException) { ViewExpiredException vee = (ViewExpiredException) t; FacesContext fc = FacesContext.getCurrentInstance(); NavigationHandler nav = fc.getApplication().getNavigationHandler(); try { // Push some useful stuff to the flash scope for // use in the page fc.getExternalContext().getFlash().put("expiredViewId", vee.getViewId()); nav.handleNavigation(fc, null, "/login?faces-redirect=true"); fc.renderResponse(); } finally { i.remove(); } } } // At this point, the queue will not contain any ViewExpiredEvents. // Therefore, let the parent handle them. getWrapped().handle(); } } But STILL i'm NOT redirected to my error page - i'm getting the same HTTP 500 error like above. What am i doing wrong, what could be missing in my implementation so that the exception is handled correctly?

    Read the article

  • With NHibernate, how can I add a child object when updating a parent object?

    - by BMZ
    I have a simple Parent/Child relationship between a Person object and an Address object. The Person object exists in the DB. After doing a Get on the Person, I add a new Address object to the Address sub-object list of the parent, and do some other updates to the Person object. Finally, I do an Update on the Person object. With a SQL trace window, I can see the update to the Person object to the Person table and the Insert of the Address record to the Address table. The issue is that, after the update is performed, the AddressId (primary key on the Address object) is still set to 0, which is what it defaults to when you first initialize the Address object. I have verified that when I do an Add, this value is set correctly. Is this a known issue when trying to add sub-objects as part of an NHibernate UPDATE? Sample code and mapping files are below Thanks <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="BusinessEntities.Wellness.Person,BusinessEntities.Wellness" table="Person" lazy="true" dynamic-insert="true" dynamic-update="false"> <id name="Personid" column="PersonID" type="int"> <generator class="native" /> </id> <version type="binary" generated="always" name="RecordVersion" column="`RecordVersion`"/> <property type="int" not-null="true" name="Customerid" column="`CustomerID`" /> <property type="AnsiString" not-null="true" length="9" name="Ssn" column="`SSN`" /> <property type="AnsiString" not-null="true" length="30" name="FirstName" column="`FirstName`" /> <property type="AnsiString" not-null="true" length="35" name="LastName" column="`LastName`" /> <property type="AnsiString" length="1" name="MiddleInitial" column="`MiddleInitial`" /> <property type="DateTime" name="DateOfBirth" column="`DateOfBirth`" /> <bag name="PersonAddresses" inverse="true" lazy="true" cascade="all"> <key column="PersonID" /> <one-to-many class="BusinessEntities.Wellness.PersonAddress,BusinessEntities.Wellness" / </bag> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="BusinessEntities.Wellness.PersonAddress,BusinessEntities.Wellness" table="PersonAddress" lazy="true" dynamic-insert="true" dynamic-update="false"> <id name="PersonAddressId" column="PersonAddressID" type="int"> <generator class="native" /> </id> <version type="binary" generated="always" name="RecordVersion" column="`RecordVersion`" /> <property type="AnsiString" not-null="true" length="1" name="AddressTypeid" column="`AddressTypeID`" /> <property type="AnsiString" not-null="true" length="60" name="AddressLine1" column="`AddressLine1`" /> <property type="AnsiString" length="60" name="AddressLine2" column="`AddressLine2`" /> <property type="AnsiString" length="60" name="City" column="`City`" /> <property type="AnsiString" length="2" name="UsStateId" column="`USStateID`" /> <property type="AnsiString" length="5" name="UsPostalCodeId" column="`USPostalCodeID`" /> <many-to-one name="Person" cascade="none" column="PersonID" /> </class> </hibernate-mapping> Person newPerson = new Person(); newPerson.PersonName = "John Doe"; newPerson.SSN = "111111111"; newPerson.CreatedBy = "RJC"; newPerson.CreatedDate = DateTime.Today; personDao.AddPerson(newPerson); Person updatePerson = personDao.GetPerson(newPerson.PersonId); updatePerson.PersonAddresses = new List<PersonAddress>(); PersonAddress addr = new PersonAddress(); addr.AddressLine1 = "1 Main St"; addr.City = "Boston"; addr.State = "MA"; addr.Zip = "12345"; updatePerson.PersonAddresses.Add(addr); personDao.UpdatePerson(updatePerson); int addressID = updatePerson.PersonAddresses[0].AddressId;

    Read the article

  • ListView selection issue...Using onItemClick(AdapterView<?> parent, View view, ...)

    - by searchMaker
    The problem I hope to resolve here is that when I click on one item in the ListView that item's background changes to light gray, but when I continue to scroll through the list every 4th item has the background changed to light gray even though those other items have not been clicked. How do I make only the item I clicked be effected by the click? ListView lv = (ListView) findViewById(R.id.resultsList); lv.setAdapter(new ArrayAdapter(this, R.layout.resultitem, (String[])labelList.toArray(new String[labelList.size()]))); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int position, long id) { TextView tv = (TextView)view.findViewById(R.id.result); tv.setBackgroundColor(Color.LTGRAY); tv.setTextColor(Color.BLACK);

    Read the article

  • Silverlight 4: How to find ContextMenu' s Parent Control from menuitem_click?

    - by funwithcoding
    I have a datagrid and I added silverlight 4 toolkit contextmenu to textbox in datagrid as follows. When users right click on the textbox, contextmenu is being displayed. When users click the menu item with Header "Test", "MenuItem_Click" is getting executed. Now I want to access the textbox from the MenuItem_Click and modify its properties like background etc. Is there anyway to find textbox element(which is contextmenu's parent) from MenuItem_Click event? <my:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text="{Binding AcctId}" Style="{StaticResource documentTextBoxStyle}" ToolTipService.ToolTip="Right Click to modify parameters" > <toolkit:ContextMenuService.ContextMenu > <toolkit:ContextMenu > <toolkit:MenuItem Header="Test" Click="MenuItem_Click"/> </toolkit:ContextMenu> </toolkit:ContextMenuService.ContextMenu> </TextBox> </DataTemplate>

    Read the article

  • C# - How can i open a second winform asynchronously but still behave as a child to the parent form?

    - by Gary Willoughby
    I am creating an application and i would like to implement a progress window that appears when a lengthy process is taking place. I've created a standard windows form project to which i've created my app using the default form. I've also created a new form to use as a progress window. The problem arises when i open the progress window (in a function) using: ProgressWindow.ShowDialog(); When this command is encountered, the focus is on the progress window and i assume it's now the window who's mainloop is being processed for events. The downside is it blocks the execution of my lengthy operation in the main form. If i open the progress window using: ProgressWindow.Show(); Then the window opens correctly and now doesn't block the execution of the main form but it doesn't act as a child (modal) window should, i.e. allows the main form to be selected, is not centered on the parent, etc.. Any ideas how i can open a new window but continue processing in the main form?

    Read the article

  • How should I delete a child object from within a parent's slot? Possibly boost::asio specific.

    - by kaliatech
    I have written a network server class that maintains a std::set of network clients. The network clients emit a signal to the network server on disconnect (via boost::bind). When a network client disconnects, the client instance needs to be removed from the Set and eventually deleted. I would think this is a common pattern, but I am having problems that might, or might not, be specific to ASIO. I've tried to trim down to just the relevant code: /** NetworkServer.hpp **/ class NetworkServices : private boost::noncopyable { public: NetworkServices(void); ~NetworkServices(void); private: void run(); void onNetworkClientEvent(NetworkClientEvent&); private: std::set<boost::shared_ptr<const NetworkClient>> clients; }; /** NetworkClient.cpp **/ void NetworkServices::run() { running = true; boost::asio::io_service::work work(io_service); //keeps service running even if no operations // This creates just one thread for the boost::asio async network services boost::thread iot(boost::bind(&NetworkServices::run_io_service, this)); while (running) { boost::system::error_code err; try { tcp::socket* socket = new tcp::socket(io_service); acceptor->accept(*socket, err); if (!err) { NetworkClient* networkClient = new NetworkClient(io_service, boost::shared_ptr<tcp::socket>(socket)); networkClient->networkClientEventSignal.connect(boost::bind(&NetworkServices::onNetworkClientEvent, this, _1)); clients.insert(boost::shared_ptr<NetworkClient>(networkClient)); networkClient->init(); //kicks off 1st asynch_read call } } // etc... } } void NetworkServices::onNetworkClientEvent(NetworkClientEvent& evt) { switch(evt.getType()) { case NetworkClientEvent::CLIENT_ERROR : { boost::shared_ptr<const NetworkClient> clientPtr = evt.getClient().getSharedPtr(); // ------ THIS IS THE MAGIC LINE ----- // If I keep this, the io_service hangs. If I comment it out, // everything works fine (but I never delete the disconnected NetworkClient). // If actually deleted the client here I might expect problems because it is the caller // of this method via boost::signal and bind. However, The clientPtr is a shared ptr, and a // reference is being kept in the client itself while signaling, so // I would the object is not going to be deleted from the heap here. That seems to be the case. // Never-the-less, this line makes all the difference, most likely because it controls whether or not the NetworkClient ever gets deleted. clients.erase(clientPtr); //I should probably put this socket clean-up in NetworkClient destructor. Regardless by doing this, // I would expect the ASIO socket stuff to be adequately cleaned-up after this. tcp::socket& socket = clientPtr->getSocket(); try { socket.shutdown(boost::asio::socket_base::shutdown_both); socket.close(); } catch(...) { CommServerContext::error("Error while shutting down and closing socket."); } break; } default : { break; } } } /** NetworkClient.hpp **/ class NetworkClient : public boost::enable_shared_from_this<NetworkClient>, Client { NetworkClient(boost::asio::io_service& io_service, boost::shared_ptr<tcp::socket> socket); virtual ~NetworkClient(void); inline boost::shared_ptr<const NetworkClient> getSharedPtr() const { return shared_from_this(); }; boost::signal <void (NetworkClientEvent&)> networkClientEventSignal; void onAsyncReadHeader(const boost::system::error_code& error, size_t bytes_transferred); }; /** NetworkClient.cpp - onAsyncReadHeader method called from io_service.run() thread as result of an async_read operation. Error condition usually result of an unexpected client disconnect.**/ void NetworkClient::onAsyncReadHeader( const boost::system::error_code& error, size_t bytes_transferred) { if (error) { //Make sure this instance doesn't get deleted from parent/slot deferencing //Alternatively, somehow schedule for future delete? boost::shared_ptr<const NetworkClient> clientPtr = getSharedPtr(); //Signal to service that this client is disconnecting NetworkClientEvent evt(*this, NetworkClientEvent::CLIENT_ERROR); networkClientEventSignal(evt); networkClientEventSignal.disconnect_all_slots(); return; } I believe it's not safe to delete the client from within the slot handler because the function return would be ... undefined? (Interestingly, it doesn't seem to blow up on me though.) So I've used boost:shared_ptr along with shared_from_this to make sure the client doesn't get deleted until all slots have been signaled. It doesn't seem to really matter though. I believe this question is not specific to ASIO, but the problem manifests in a peculiar way when using ASIO. I have one thread executing io_service.run(). All ASIO read/write operations are performed asynchronously. Everything works fine with multiple clients connecting/disconnecting UNLESS I delete my client object from the Set per the code above. If I delete my client object, the io_service seemingly deadlocks internally and no further asynchronous operations are performed unless I start another thread. I have try/catches around the io_service.run() call and have not been able to detect any errors. Questions: Are there best practices for deleting child objects, that are also signal emitters, from within parent slots? Any ideas as to why the io_service is hanging when I delete my network client object?

    Read the article

  • Pure CSS Dropline Menu - second level menu items sit below their parent - but sometimes extend off s

    - by Simon
    Hi, I'm working on a pure css menu that consists of four levels Level 1 and 2 are a dropline menu in style Levels 3+ are dropdown menus When you hover over a level 1 menu item, the level 2 menu displays directly below menu item you are currently hovering over. However if there are lots of menu items on level 2 then the level 2 menu goes off the screen and you see a horizontal scroll bar. What I want to happen is that if the menu is going to go off the screen I want it to get pushed to the left. For example, if the menu was 300px long, but there was only 250px between the level 1 menu item and the edge of the page, then the level 2 menu should not be placed directly under the level 1 parent, instead it should be 50px to the left. I use a nested unordered list for the menu.

    Read the article

  • WPF- Is there a way to stop TreeViewItems from becoming selected and activated when thier parent TreeViewItem is selected?

    - by Justin
    I have a control template for TreeViewItems and instead of showing the normal FocusVisualStyle I have a MultiTrigger set up like this: <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true"/> <Condition Property="IsSelectionActive" Value="true"/> </MultiTrigger.Conditions> <Setter Property="FontWeight" Value="Bold"/> </MultiTrigger> However this also causes the FontWeight to change to bold when a TreeViewItem's parent item is selected. Is there any way I can stop that from happening?

    Read the article

  • When Web page is displayed in a div, Error: Unable to modify the parent container element before the

    - by Jean
    Hello, A url is being displayed in a div as shown below <div id="ipage"> <? $url = "http://www.yahoo.com"; $file1 = fopen($url, "r"); $content = file_get_contents($url); echo $content; ?> </div> And I receive this error Webpage error details Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917) Bright idea to solve this. Thanks Jean

    Read the article

  • Is it possible to position an element relative to the border-box of its parent?

    - by Timwi
    Consider the following jsfiddle for reference: http://jsfiddle.net/apmmw2ma/ As you can see, the “inner” box (with the red border) is positioned relative to the outer’s padding-box: left:0 positions it just to the right of outer’s border, and top:100% appears to mean “100% of the content plus padding, but not the border”. Unfortunately, adding box-sizing: border-box to the outer div seems to have no effect. I want to position a child element directly below its parent’s border-box, i.e. the two borders should abut no matter how thick they are. Is this possible?

    Read the article

  • Can events fired from an iframe be handled by elements in its parent?

    - by allyourcode
    Suppose I have a page located at www.example.com/foo, and it contains an iframe with src="http://www.example.com/bar". I want to be able to fire an event from /bar and have it be heard by /foo. Using the Prototype library, I've tried doing the following without success: Element.fire(parent, 'ns:frob'); When I do this, in ff 3.5, I get the following error: Node cannot be used in a document other than the one in which it was created" code: "4 Line 0 Not sure if that's related to my problem. Is there some security mechanism that's preventing scripts in /bar from kicking off events in /foo?

    Read the article

  • Under what circumstances would a Ruby $LOAD_PATH be acquired from a parent process?

    - by Dr Nic
    In my cucumber scenarios, if I call rake db:schema:load within a target Rails app folder, I get the cucumber process's $LOAD_PATH and not the Rails app's own Gemfile/load path. I think this is very weird. The consequence is that I get the following error: no such file to load -- rails/all I can't reproduce it outside of my cucumber scenario. ruby -rubygems -e "system 'rake -T'" works normally - the 'rake -T' has the application's own Gemfile-based $LOAD_PATH; and doesn't generate the error above. Can anyone think why a child process (rake -T or rake db:schema:load or rails runner...; invoked by either system, exec, %x[...] or backtick; would start with the parent processes' $LOAD_PATH (from the cucumber scenario's Gemfile) instead of its own $LOAD_PATH (from the Rails app's Gemfile)?

    Read the article

  • Is it possible to create a sub window which will not deactivate the parent?

    - by Bob
    Normally when creating a sub window (WS_POPUP), the child window will become activate and the parent will become deactivated. However, with menus, both remain active. At least I am assuming the menu is active, it at least has focus. Example: Click on the file menu in notepad, the menu appears, yet the notepad window still looks active. Is it possible to mirror this behavior with either a window style or responding to a particular message? Thanks Another example: Combo boxes seem to show a subwindow, yet do not deactivate the window. And you can click on that subwindow, while still maintaining an activate main window. Any ideas on how to grab the class /style of that window?

    Read the article

  • Set to null a parent record so that children are removed: howto?

    - by EugeneP
    How to delete a child row (on delete cascade ?) when setting a null value on a parent? Here's the db design. table A [id, b_id_1, b_id_2] table B [id, other fields...] b_id_1 and b_id_2 can be NULL if any of them is null, it means NO B records for corresponding FK (there are 2 of them) so (b_id_1,b_id_2) can be (null,null), (100, null), (null, 100_or_any_other_number) etc How in one SQL query both set b_id_1 or b_id_2 to null and delete all rows from B that have this id? What FK design should be applied to the 2 tables? what foreign keys should be added? A - B (FK_1: A.b_id_1 references B.id, FK_2: A.b_id_2 references B.id) and also B-A (FK_3: B.id references A.b_id_1, FK_4: B.id references A.b_id_2) ? But again, setting an A's b_id_1 or A's b_id_2 to null - will it remove any of B's records? I don't think so. So how to do that?

    Read the article

  • How to handle recursive parent/child problems like this?

    - by lsdude
    In web dev I come across these problems a lot. For example, we have a giant list of URLs that are in this format: /businesses /businesses/food /businesses/food/wendys /businesses/food/wendys/chili /businesses/food/wendys/fries /businesses/food/wendys/chicken-nuggets /businesses/pharmacy/cvs /businesses/pharmacy/cvs/toothpaste /businesses/pharmacy/cvs/toothpaste/brand ... and then we need to output each one, where the parent category is in h1 tags, the child is in h2 tags, and the children of that are in h3 tags. I can handle this but I feel my code is messy. I'm sure there is a design pattern I can use? Langs are ruby/php usually. how would you handle this?

    Read the article

  • How to add style to parent <li> item if child <ul> exists?

    - by user1292760
    I'm trying to make a menu in advance to be seen whether there is a double nesting. <ul class="parent"> <li class="child"></li> <li class="child"> <ul slass="nesting"> <li></li> <li></li> </ul> </li> <li class="child"></li> </ul> So ul class="nesting" hidden by default but appears during the hover of li class="child". I want to make another design on the li class="child" which have a nested ul. Another words how can i show nesting before hover by the means of Javascript/JQuery? Thnaks in advance!

    Read the article

  • Is it possible for a parent to use a child's constant or static variables from inside a static metho

    - by ryeguy
    Below is an example of what I'm trying to do. The parent can't access any of the child's variables. It doesn't matter what technique I use (static or constants), I just need some kind of functionality like this. class ParentClass { public static function staticFunc() { //both of these will throw a (static|const) not defined error echo self::$myStatic; echo self::MY_CONSTANT; } } class ChildClass extends ParentClass { const MY_CONSTANT = 1; public static $myStatic = 2; } ChildClass::staticFunc();

    Read the article

  • jQuery noob: $("this").parent().attr("id",newId); troubles.

    - by Kyle Sevenoaks
    Hi, I have this code which I am trying to change the ID of on.hover. <span id="slidingProd"> <a href="{link controller=order action=addToCart id=$product.ID returnPath=true}" rel="nofollow" class="addToCart" title="Bestill" onclick="addToBasket(); return false;" id="fly_to_basket">&nbsp;</a> </span> I tried to use this jQuery, but it doesn't change the ID. $(function() { $("#fly_to_basket").hover(function() { $(this).parent().attr("id",slidingprod(1)); }); $("#fly_to_basket").hover(function() { $(this).attr("onclick",addToBasket(1)); }); What am I doing wrong? Thanks :)

    Read the article

  • how to get all the menu items below a certain parent in drupal?

    - by sprugman
    I really only need the mlid and title text for the first level below a certain menu item. Here's what I'm doing at the moment. (It works, but I suspect there may be a more drupal-y way.): /** * Get all the children menu items below 'Style Guide' and put them in this format: * $menu_items[mlid] = 'menu-title' * @return array */ function mymod_get_menu_items() { $tree = menu_tree_all_data('primary-links'); $branches = $tree['49952 Parent Item 579']['below']; // had to dig for that ugly key $menu_items = array(); foreach ($branches as $menu_item) { $menu_items[$menu_item['link']['mlid']] = $menu_item['link']['title']; } return $menu_items; } Is there?

    Read the article

  • What does a mercurial revision with no parent mean?

    - by Wilka
    I have a Mercurial repository that is in a strange state now. This is what it looks like in TortoiseHG: I didn't think this would be possible. Revision 54 has a parent of "-1 (000000000000)" (i.e. nothing). There's clearly something I don't understand yet about Mercurial, can anyone let me know what this means - and what must have happened for it to get into this state. As far as I know, it's only had stuff pushed and pulled from it - and nobody has been using any wacky extensions. Revisions 54 and 55 were just adding tags, but if I 'update -C' to revision 54 I end up with ONLY the .hgtags file. I've made a clone from revision 53 to fix this. But I'd rather understand what happened here, so I can avoid it happening again.

    Read the article

  • WPF Binding to DataRow Columns

    - by Trindaz
    Hi, I've taken some sample code from http://sweux.com/blogs/smoura/index.php/wpf/2009/06/15/wpf-toolkit-datagrid-part-iv-templatecolumns-and-row-grouping/ that provides grouping of data in a WPF DataGrid. I'm modifying the example to use a DataTable instead of a Collection of entities. My problem is in translating a binding declaration {Binding Parent.IsExpanded}, which works fine where Parent is a reference to an entity that has the IsExpanded attribute, to something that will work for my weakly typed DataTable, where Parent is the name of a column and references another DataRow in the same DataTable. I've tried declarations like {Binding Parent.Items[IsExpanded]} and {Binding Parent("IsExpanded")} but none of these seem to work. How can I create a binding to the IsExpanded column of the DataRow Parent in my DataTable? Thanks in advance, Dave

    Read the article

  • Another Internet Explorer problem... JQuery events

    - by Parhs
    Here is my spaggeti code $("#table_exams tbody tr").click(function () { window.location.hash="#" +$(this).attr("exam_ID"); window.location.href="/medilab/prototypes/exams/edit?examId=" + $(this).attr("exam_ID") +"&referer=" + referer; row_select(this); }); $("#table_exams tbody tr td a").click(function () { window.location.hash="#" +$(this).parent().parent().attr("exam_ID"); var where="/medilab/prototypes/exams/edit?examId=" + $(this).parent().parent().attr("exam_ID") +"&referer=" + referer; window.open(where); row_select($(this).parent().parent()); alert("propaganda"); event.stopPropagation(); event.preventDefault(); return false; }); The problem is that when this function is triggered $("#table_exams tbody tr td a").click(function () { the other function is triggered also.... only in IE... What can i do for this????

    Read the article

  • Qt - drag and drop with graphics view framework

    - by David Davidson
    I'm trying to make a simple draggable item using the graphics framework. Here's the code for what I did so far: Widget class: class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); }; Widget::Widget(QWidget *parent) : QWidget(parent) { DragScene *scene = new DragScene(); DragView *view = new DragView(); QHBoxLayout *layout = new QHBoxLayout(); DragItem *item = new DragItem(); view->setAcceptDrops(true); scene->addItem(item); view->setScene(scene); layout->addWidget(view); this->setLayout(layout); } Widget::~Widget() { } DragView class: class DragView : public QGraphicsView { public: DragView(QWidget *parent = 0); }; DragView::DragView(QWidget *parent) : QGraphicsView(parent) { setRenderHints(QPainter::Antialiasing); } DragScene class: class DragScene : public QGraphicsScene { public: DragScene(QObject* parent = 0); protected: void dragEnterEvent(QGraphicsSceneDragDropEvent *event); void dragMoveEvent(QGraphicsSceneDragDropEvent *event); void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); void dropEvent(QGraphicsSceneDragDropEvent *event); }; DragScene::DragScene(QObject* parent) : QGraphicsScene(parent) { } void DragScene::dragEnterEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dragMoveEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dragLeaveEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dropEvent(QGraphicsSceneDragDropEvent *event){ qDebug() << event->pos(); event->acceptProposedAction(); DragItem *item = new DragItem(); this->addItem(item); item->setPos(event->pos()); } DragItem class: class DragItem : public QGraphicsItem { public: DragItem(QGraphicsItem *parent = 0); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); void mouseMoveEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); }; DragItem::DragItem(QGraphicsItem *parent) : QGraphicsItem(parent) { setFlag(QGraphicsItem::ItemIsMovable); } QRectF DragItem::boundingRect() const{ const QPointF *p0 = new QPointF(-10,-10); const QPointF *p1 = new QPointF(10,10); return QRectF(*p0,*p1); } void DragItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){ if(painter == 0) painter = new QPainter(); painter->drawEllipse(QPoint(0,0),10,10); } void DragItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event){ } void DragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){ } void DragItem::mousePressEvent(QGraphicsSceneMouseEvent *event){ QMimeData* mime = new QMimeData(); QDrag* drag = new QDrag(event->widget()); drag->setMimeData(mime); drag->exec(); } void DragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){ } main.cpp instantiates a Widget and shows it. When I try to drag the circle, the app just creates another circle over the original one, regardless of where I release the drag. qDebug() in DragScene's dropEvent() shows QPointF(0,0) everytime the drag ends. I'm having a hard time trying to understand exactly what I have to do, which classes I should subclass, which methods needs to be overriden, to make this work. The documentation on this isn't very detailed. I'd like to know how to make this work, and if there's some other, more comprehensive resource to learn about the graphics view framework, besides the official documentation (which is excellent btw, but it would be great if there was a more detailed treatise on the subject). EDIT: Following badgerr's advice, I replaced item-pos() in DragScene::dropEvent() with item-scenePos(), now the drop event creates a new circle in the drop site, which is more or less what I wanted. But the original circle is still in place, and while the drag is in progress, the item doesn't follow the mouse cursor. The QGraphicsSceneDragDropEvent documentation says that pos() should return the cursor position in relation to the view that sent the event, which, unless I got it wrong, shouldn't be (0,0) all the time. Weird. I've read in a forum post that you can use QDrag::setPixMap() to show something during the drag, and in examples I've seen pictures being set as pixmaps, but how do I make the pixmap just like the graphics item I'm supposed to be dragging?

    Read the article

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