Updating view when the model changes

We have a requirement that when we receive a message and write to database we should update all the concerned User's(intersted in that data) view(implemented as JSP's). We don't want to put a time based refresh mechanism as it would be entirely inefficient and annoying for the users whose view of interest has not changed. Can we implement a MDB which when it gets a messages calles controller( servlet) which in turns calles the JSP's? If the approach is fine then the issue is that message need to be written to database and then only the view need to be refreshed, Any thoughts on the implementation strategy?
I tried to serach for already posted topics on the issue but could not find much..so Sorry if the issue is repeated.

Sorry, HTTP is a pull only medium and wasn't design for real time updates like you're asking for.
You may be able to write JavaScript that polls for updates and only reloads the change when there is an update but that is beyond my JavaScript skills. Or you could write a Java Applet that polled the server often.
No matter what you do it's gonna be an ugly hack. I suggest you reconider what is more important, real time updates or a web interface.

Similar Messages

  • DefaultCellEditor in JTable can not update itself when the value changes

    Hi,
    I have a JTable which has 4 columns. The 3rd column has a comboBox. whenever I select an item from the first row, the cell at (currentrow, 4thcolumn) will be updated according to the item selected.
    Now the problem is, after selecting the item in any cell with 3rd column, the row is updated correctly, but then all comboBox in column 3 are gone! I cannot figure out what causes this. Please help! Any suggestion will be greatly appreciated!
    Jing

    Thanks! Could you give more details on how to use the second approach?
    I have a table with two columns, one called ID and the other called Value. I'm using JComboBox for the Value column. Whenever I select an item from the comboBox, I want the value in the cell under the ID column to change value to the value selected in the comboBox.
    The problem I'm having now is although I can change the value in the comboBox and which triggers the event to change the value under the ID column, when I click the comboBox of another row, the cell under ID of the previous row changed also, before the value under ID of the current selected row.
    I think the problem is there is no distinct comboBox for each row of the table. Seems like when one box change and trigger an event, that event performed in every other rows in the table.
    Following is the code:
    public class Test extends JPanel{
         DefaultTableModel tm;
         JTable table;
         JScrollPane nscrollPane;
         public int total=4;
         public Vector datavec, thvec;
         public Test(Vector datavec, Vector thvec){
              this.datavec=datavec;
              this.thvec=thvec;
         tm = new DefaultTableModel(datavec,thvec);
              table = new JTable(tm);
              table.addMouseListener(new PopupListener(table));
    // table.addMouseListener(new PopupListener(table));
    //tm.setTableHeader(table.getTableHeader()); //ADDED THIS
    int height = table.getRowHeight()*table.getRowCount();
    table.setPreferredScrollableViewportSize(new Dimension(500, height));
    //Create the scroll pane and add the table to it.
    nscrollPane = new JScrollPane(table);
    setUpNNColumn(table, table.getColumnModel().getColumn(1));
    //Add the scroll pane to this panel.
    add(nscrollPane);
    public void updateLabel(Integer size)
         int r=table.getSelectedRow();
         if(r!=-1)
         ((Vector)datavec.elementAt(r)).setElementAt(size, 0);
         repaint();
    public void setUpNNColumn(JTable table, TableColumn nnColumn) {
              //Set up the editor for the sport cells
              JComboBox comboBox = new JComboBox();
              comboBox.addActionListener(new ComboBoxListener());
              int num=total/2;
              for(int i=0; i<2; i++){
                   comboBox.addItem(new Integer(num*(i+1)));
              comboBox.setSelectedIndex(1);
              nnColumn.setCellEditor(new DefaultCellEditor(comboBox));
    private class ComboBoxListener implements ActionListener{
         public void actionPerformed(ActionEvent e)
              JComboBox cb = (JComboBox)e.getSource();
    Integer size = (Integer)cb.getSelectedItem();
         updateLabel(size);
    private static void createAndShowGUI(Vector a, Vector b) {
    \ JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Nearest Neighbor Fact Table");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    Test newContentPane = new Test(a, b);
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
         int patidx, hitnum=2;
         Vector a=new Vector();
         Vector a1=new Vector();
         Vector a2=new Vector();
         a1.add(new Integer(1));
         a1.add(new Integer(4));
         a.add(a1);
         a2.add(new Integer(2));
         a2.add(new Integer(4));
         a.add(a2);
         Vector b=new Vector();
         b.add("ID");
         b.add("Value");
         //StatTableGUI.createAndShowGUI(gd);
         Test.createAndShowGUI(a,b);
    Any suggestions? Thanks!
    Jing

  • Update manager in IdM automatically when the manager changes in SAP HR

    Hi Experts
    I have been given a requirement where the manager of a user in IdM should be updated automatically when the manager changes in SAP HR.
    The HR extraction job is currently in place and runs every 30mins.
    Please could you give me some ideas on how to implement this.
    IDM 7.2 SP 6
    Thanks
    Ran

    Hi Deepak
    I have been discussing this a bit more in detail with the client. So, the issue is as follows
    When a new/replacement manager is hired
    When people are moved from one org unit to another
    The scheduled extraction job (RPLDAP_EXTRACT_IDM with a variant with the delta tick on) does not update the new manager info in IDM for the relevant users who report to that manager. The client has to run the program (RPLDAP_EXTRACT_IDM with a variant with the delta tick off) manually each time for the affected users which updates the manager info successfully in idm.
    I investigated the query LDAP_IDM_QUERY from user group /SAPQUERY/L1 and want to know if the below should be ticked as well. Your thoughts please?
    Please advise.
    Thanks
    Ranjit

  • Do I need to recreate the View when the underlying field changes?

    Re: Do I need to recreate the View when the underlying field changes?
    I did an ALTER TABLE1 to change FIELD1 from varchar(5) to varchar(7). TABLE1.FIELD1 is in VIEW1. When I do a SELECT * FROM VIEW1 it shows 7 characters. But when I look at VIEW1 in object explorer (after refreshing), FIELD1 is varchar(5). Do I care?
    Should I recreate the VIEW1?

    If you have refreshed using sp_refreshview stored procedure then you are good, if not then here you go...
    The metadata for the view is not automatically updated when the tables are modified.
    The fix is to either drop and re-create or alter the view or to use the sp_refreshview stored procedure.
    Example :
    EXEC sp_RefreshView View_Tablename
    GO
    http://msdn.microsoft.com/en-us/library/ms187821.aspx
    Raju Rasagounder Sr MSSQL DBA

  • Sales Order Updation when the delivery changed

    Hello Experts,
                           I am working an object where I need to update the sales order when the delivery changed.
                             Actually when the remote system rejected the delivery an IDOC will come to R/3
    Sooner the delivery changed in R/3 I need to update few fields in sales order.
              When I am trying to code in the exit in the FM attached to the IDOC it is first updating the sales order and calling ws_update_delivery  next.
    Even if I am trying in mv45afz1 also same thing is happening.
              Can anyone let me know how to solve this problem.

    Hi,
    you can see the work center capacity situation for manufacturing an item in the salesorder. But it needs Assemble to Order strategy. Anyway u can see the material details in the sales order.
    Kiran.

  • How can i close the preview in Adobe Viewer when the LINK ist fullscreen on my eMag? It will always go to URL and i can't open the summary.

    How can i close the preview in Adobe Viewer when the LINK ist fullscreen on my eMag? It will always go to URL and i can't open the summary.

    You have to change your page design so the link doesn't occupy the full screen of your content.
    Neil

  • Refresh the main view when the pop up was closed

    Hi,all
    how can I refresh the main view when the pop up window  was
    closed to see the updated data? In pop up window I update
    single row in the table based in main view.
    Regards,
    Michael

    Michael,
    There are 2 type of pop-ups in WD, and the answer is different depending on which type you are using:
    1. Stand-alone browser window that hosts separate application (result of IWDWindowManager.createNonModalExternalWindow) -- no way.
    2. Inner pop-up created via IWDWindowManager.createModalWindow -- absolutely possible:
    -- a. Create event in component controller (probably with parameters)
    -- b. Create method in component controller that fires this event (with corresponding parameters, if any)
    -- c. In view that corresponds to window invoke method created in [ b ] and hence fire event. This should be done in action handler of something like "OK" Button or "Close" LinkToAction.
    -- d. In any other controller subscribe to event described in [ a ]
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to deal with the situation when the database change into ms-sqlserver ?

    Hi,dear all,
    How to deal with the situation when the database change into ms-sqlserver or other database?
    Now, i want to build a j2ee project with ORACLE ADF bc,but this project may be used in several diffrent databases for example oracle db,ms db,mysql and so on.however,if i have developer this project in jdeveloper and this project connection was config as a oracle database,and then,can this project be reused for other databases espasially including the model codes? if yes,how should i do?
    all who know how to resolve this,tell me pls,thanks.
    bruce Li,
    China
    Message was edited by:
    user526724

    Hi Paulbin,
    Do you want to supply a function-pointer to a DLL so it can call[back] your VI?  Here's how it can be done with .NET, though, that solution requires a C compiler.   A single "VI_to_function-reference" utility could handle all cases where the callback passes no parameters.  Maybe someday somebody will share that dll.
    Did you know that LabVIEW can use Events for some COM-signals change?  See pic.  (Note: DTR is not listed - - )
    Another question is another function's prototype is WORD SetTestType(WORD comHandle, bool type1, bool type2, bool type3),   I tried to use a boolean control and a Boolean to (0,1) node in labVIEW to pass parameters to CLF, I config the bool input value as U8(according to C++ bool type) and U32(according to WIN32 BOOL type), it dose not help, when I execute the VI, LabVIEW will be disappeare, it seems to be closed, I must start it again.
    Could someone has similar experience on this points?
    It's easy to crash LabVIEW misusing CLF - maybe there's another reason for the crash besides bool mis-match(?)  Do you know which "Calling convention" is required?  What type is comHandle? (where does comHandle come from?) 
    Cheers!
    Message Edited by tbd on 03-23-2007 09:34 PM
    Message Edited by tbd on 03-23-2007 09:35 PM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    evt.jpg ‏7 KB

  • How do I update iCloud when I have changed my Apple id?

    How do I update iCloud when I have changed my Apple id with a new e-mail address?

    Fatinc97 wrote:
    Bt I Cnt Get His Password
    We are sorry for your loss. You will need to repurchase the app under your Apple ID. There is no way around it.
    Umm I Cant Change This Habbit Of Typing
    Yes, you can. Habits are made. They can be broken. Unless, of course, you're too lazy to try?

  • Credit exposure updating even when the sales order is blocked

    Hi,
    We are using FSCM credit management. We observed that the credit exposure is updated even when the sales order is blocked. When we investigated it is found out that SD has removed the requirement 101 in the subsequent functions. The reason is they want the confirmed quantity to be updated even though the order is blocked. This will allow the Material Planning to go ahead and purchase the goods. Is there a way around it where we can have MM see the confirmed quantity in the order and it will not updated the credit exposure?
    Thanks and Regards
    Madhu Vutukuri

    Hi Sravan,
    Please let us know, whether the document is really getting reflected in the blocked documents list for a particular kind of block and you are releasing that particular block in the specified area as we have different areas for releasing blocks. Chances are that in the mean time, the concerned block might have been removed in the system and not updated as it might have been. It will be of great help, if you can provide us with the screenshots of the process followed.
    Regards,
    Aman

  • Newsstand suppresses the home screen from the app switcher view when the home button is pressed?

    Newsstand suppresses the home screen from the app switcher view when the home button is pressed.
    Has anyone else seen this before, I needed to lock and unlock iPad to get back to the home screen.

    Aloha Ethan. Fortunately it's working as designed, but you'd never believe how many people wanted to argue with me smply because it worked differently. Can't please everybody I guess.  Bob. 

  • [svn:fx-trunk] 11112: DatGroup and SkinnableDataContainer dispatch a " dataProviderChanged" event when the dataProvder changes.

    Revision: 11112
    Author:   [email protected]
    Date:     2009-10-23 12:35:31 -0700 (Fri, 23 Oct 2009)
    Log Message:
    DatGroup and SkinnableDataContainer dispatch a "dataProviderChanged" event when the dataProvder changes.  Fixed a ScrollerLayout typo.
    QE notes:
    Doc notes: none
    Bugs: sdk-23489
    Reviewer: Ryan
    Tests run: DataGroup
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/sdk-23489
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayo ut.as

  • When the state change, my StyleableTextField html formatting is lost

    Hello,
    When the state change, my StyleableTextField html formatting is lost (mobile project)
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              addedToStage="ats(event)">
              <fx:Script>
                        <![CDATA[
                        import spark.components.supportClasses.StyleableTextField;
                        protected function ats(event:Event):void
                                  StyleableTextField(txt.textDisplay).htmlText="<i>test</i>";
                        public function ok(e:Event):void{
                                  currentState = "state2";
                        ]]>
              </fx:Script>
              <s:states>
                        <s:State name="initialState" />
                        <s:State name="state2" />
              </s:states>
              <s:VGroup>
                        <s:TextArea width="100%" id="txt" includeIn="initialState, state2" skinClass="spark.skins.mobile.TextAreaSkin"/>
                        <s:Button label="add" click="ok(event);" includeIn="initialState, state2"/>
                        <s:TextArea width="100%" text="state2" includeIn="state2"/>
              </s:VGroup>
    </s:Application>
    Thanks

    How are you doing this?
    The text area of a web app has HTML encoding and is all fine.
    If you make a multiline custom text field the encoding remains.
    You need to provide a bit more information because the above do keep their encoding.

  • SSDT Project hangs when the model comes up

    SQL Server 2012 Developer Edition SP1  on Windows 8.1 Professional
    I recently brought over a Tabular Analysis SSDT project from my work laptop to my own personal laptop. I managed to bring up the  model, successfully deploy the model  to SSAS on the same personal laptop (Weds).
    Today when I went in to bring up the model, the system hang, CPU usage goes up to 100% and there is more than enough memory and disk space.
    Any ideas would be appreciated and thanks.
    regards Steve Simon SQL Server MVP

    Hi Stefaans,
    This is a duplicate thread with:
    http://social.technet.microsoft.com/Forums/en-US/509d7649-2b01-4d12-a0a3-c53d5cfac267/ssdt-project-hangs-when-the-model-comes-up?forum=sqlanalysisserv
    I will merge it to that thread.
    Regards,
    Charlie Liao
    Charlie Liao
    TechNet Community Support

  • How to catch an event when the user change values in the project information dialog

    hi,
    i would like to know how to catch an event in my C# code when the user change values in the project information dialog?
    taskChange doesn't catch these changes.
    thanks.
    Thanks, Sharon.

    You need to write save button event handler for project information dialog. Link is having same functionality described. 
    http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx
    http://www.projectserver2010blog.com/2010/01/sharepoint-2010-webpart-client-server.html
    kirtesh

Maybe you are looking for

  • Sort pictures in a new Gallery

    Hi I have creatded a picture gallery with 50-60 pictures in it. I draged and dropped the pictures into the gallery and all the pictures landed in a mess..... not in number order??? Why? How can I sort them in number order? // BR / J

  • Files not being added to an Apple hosted feed collection

    Main Issue: I created a collection using an apple hosted feed, added 12 new items, but it still says I have 0 items in the collections dashboard so am not able to publish the new collection. Yesterday I added two files to an existing collection, but

  • Error Connecting to Access 2007 database

    Hi there, We are seeing the below error when trying to Connect to Access 2007 using Crystal 2008, when using the Access/DAO connection wizard .. Logon failed Details: DAO Error Code: 0xd0f Source: DAO.Workspace Description: Unrecognised database form

  • Menu Xtra

    Hello, I know my question is probably a FAQ. But, have done lots of reasearch and still have no answer. I'm looking for an Xtra that can create a drop down menu, (hopefuly very simple and easy to use). Also, would like it to be cross platform. This i

  • Can't operate CS6 on my mac

    I just paid for creative cloud membership and then after installation realised i have a 32bit processor that cannot operate CS6. How do i go about cancelling my membership? or getting CS5 instead of CS6? Please can you advise what my options are? Tha