How to control the processing of the request?

I have something like this:
<h:inputText value="#{sessionController.currentRowData.settlementId}"/>
<h:inputText value="#{sessionController.currentRowData.remark}"/>
<h:inputText value="#{sessionController.currentRowData.fromDate}">
     <f:convertDateTime pattern="yyyy-MM-dd"/>
</h:inputText>
The currentRowData object is the currently selected row of a data model.
Problem is, the model is updated with the value of the components whenever the form is submitted,
and regardless of whether the value of the components has changed or not.
(Actually, the behaviour depends on the type of the property, as ie. Date is treated differently from String or int.)
This causes unwanted changes to the model, and, if a new row is selected, it will at once
be updated with the values of the previous row (from the current state of the components).
I want the above components to update the model only if the user wants to, ie. only if a
specific command button is pressed.
How to control this?
Let a PhaseListener check the request, and do renderResponse on the FacesContext if
the "selectRow" request is found in the request parameter map?
This is not very elegant, and it does not seem to work either. If setting PhaseId to APPLY_REQUEST_VALUES, the action itself (selecting row)
will not be executed, and if using UPDATE_MODEL_VALUES, the value of the components is set from the request (even if unchanged), and not updated according the the new data in the model (the rendered values does not reflect the values of the properties of the object the components are bound to)
Another solution might be to let the "disabled"-attribute of the inputText tags be dependent on whether
a specific "edit"-button has been pressed (disabled inputText tags are rendered correctly after a row change).
But a better solution would to have the ability to control the behaviour, something like
"for these components, no updating of state should be done unless the condition c is true"
(I'm not sure what condition this could be, though).
Whatever solution I may end up with, the real problem seems to be that the state (and hence the model)
is updated from the request also in the case where the value in the request is the same as the current value of the component.
Or maybe there is something I have missed here?
erik

This one is a tricky problem - a side-effect of JSF doing a lot of things automatically is that sometimes it does too much.
I don't have a great solution, but here's a couple of ideas:
(1) Try using multiple <h:form>s on your page (not nested one inside the other, but separate). Data will only get updated in the form that contains the button that got pressed.
(2) Use an intermediate model layer, and discard updates as appropriate.
Neither of these are beautiful solutions - the second is way ugly - but they might help. Long-range, I'd love to see something like "subforms" supported in JSF that can provide finer grained control over what gets processed (validations, model pushes, etc.) and what doesn't without resorting to the blunt hammer of multiple HTML forms.
I'm a little confused about "the model is updated with the value of the components whenever the form is submitted, and regardless of whether the value of the components has changed or not.", because JSF is checking the old value and using ".equals()" to see if its changed. Note, however, that it's not caching the old value across the request, but simply going back to the model on the subsequent request, which may (or may not) explain the behavior you're seeing.
-- Adam Winer (EG member)

Similar Messages

  • How could control the scroll events in ALV OO?

    Hello experts!
    I'm programing a report, inside there is a field that need time of processing. I'm using ALV OO.
    I have thought that it could only calculate the field for the lines that visualize.
    How could control the scroll events to calculate the field of the visualized lines?
    I'm using CL_SALV_TABLE class and cl_salv_events_table to control the events, but there aren't any event to control the scroll.
    best regards!

    Hi Sriram,
    I did view the information that you was attaching, but this don't resolve my problem. With methods get_scroll_info_via_id and set_scroll_info_via_id, we can get and put information of selection and view rows in the screen but we don't control when the user click in the scroll for advance or to back down a page.
    I would like to refresh the data in ALV when the user view news rows.
    I want your genial ideas.
    Best regards!

  • How to control the number of instances of an object ?

    Hi all,
    Can anybody answer, How to control the number of instances of an object being created?
    suppose at any point of time, if i would like to have 5 instances at the maximum, how can i disable the further requests?
    Thanks in advance
    Pradi

    write a factory method that controls the number of instances for you:
    import java.util.List;
    import java.util.Arrays;
    public class Bar
       private static final int MAX_BARS = 5;
       private static int numBars = 0;
       private int id;
       public static void main(String [] args)
          try
             int numBars = ((args.length > 0) ? Integer.parseInt(args[0]) : MAX_BARS+1);
             Bar [] bars = new Bar[numBars];
             for (int i = 0; i < bars.length; ++i)
                bars[i] = Bar.create();
             System.out.println(Arrays.asList(bars));
          catch (Exception e)
             e.printStackTrace();
       private Bar() { this.id = numBars++; }
       public String toString() { return "I am bar number " + this.id; }
       public static Bar create()
          Bar nextBar = null;
          if (numBars < MAX_BARS)
             nextBar = new Bar();
          return nextBar;
    }%

  • How to control the sequence of a map?

    Hello
    we are using a send email with attachment (map) in our process design, the email body has a few pdf documents, does anyone know how to control the sequence of attachment in the email body?
    thanks,

    Values in a map are ordered randomly, you can't predict the order.

  • How to delete the request in se10

    Hi Experts,
    How to delete the request in se10 ....plz explain
    Regards
    Venkat

    Hi,
    Go to SE10,select the request which you wnat to delete.You will find a delete icon on the top.Select it.
    This will delete the request.
    Make sure that this request is the one which is under ur ID.If you want to delete the request which is under other ID,it wont allow to delete.
    Thanks & Regards,
    Suchitra.V

  • How to control the data  in data selection

    Hi,
    how to control the data  .
    in the transfer structure I am having 10 fields and and the file which is to be loaded contains 7 fields only.where can I control  the other 3 fields and how .
    thanks in advance
    karna

    If your source file is flat file, add extra three fields with blank (just add field separator say comma for each extra field) and then load. It should be ok.
    Hope it helps..

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to control the measure based on the related dimension.

    Hi Experts,
    In order to improve performance, I have created three kinds of time tables in DB,such as Year .Month, Day.
    Then import them into the physical layer in RPD, and combine them into one dimension in BMM.
    Actually, it has three level fact related with three time tables,so they are also dragged into one fact in BMM,and one column will be corresponding with three column derived from different Fact table in physical layer.
    So I want to know how to control the measure based on the related dimension.
    For example:
    when users drag the Year,Sales column, it will come from Year Dimension and Year Fact Table.
    when users drag the Month,Sales column, it will come from Month Dimension and Month Fact Table.
    when users drag the Day,Sales column, it will come from Day Dimension and Day Fact Table.

    Hi,
    Create a dimension Hierarchy, with Year >> Month >> Day Levels and
    Next Double click on Year Table LTS >> click on Ocntetnt Tab >> set as Year
    same way for Month LTS and Day LTS.
    So now when you select year column then server canknow which LTS to hit and Hits Year LTS.
    Mark If Helpfu/correct
    Thanks.

  • How to control the size of live data in Coherence?

    How to control the size of live data in Coherence?
    See the following statement:
    Pause times increase as the amount of live data in the heap increases. We recommend not exceeding 70% live data in your heap. This includes primary data, backup data, indexes, and application data.
    --Excerpted from http://coherence.oracle.com/display/COH35UG/Best+Practices                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

  • How to control the size of SVG images in epub files?

    There is unfortunately no support for SVG files in InDesign.
    Most of my images in jpg convertes nicely, but the small ones do not.
    Therefore I want to use SVG files which I have created in Illustrator.
    But how do I set the size in the epub file? Right now, whatever I do, they come out too big and I don't know how to control the size.
    Is there a program, like Sigil or other, that can place the image for me - I'm no html wizard you see....

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

  • How to control the looping time of the for loop in 10 microseconds in labview?

    I need to create a +/- 9 volt square wave with period of 20us using a D/A card (Not NI card). I can write command to the card using outport provide by Labview. Right now, I can generate square wave with 4ms period which is limited by the resolution of the wait until next ms icon I used inside the for loop. Could anyone tell me how to control the execution time of the for loop to about 10 us? Your help would be much appreciated.

    I'm not sure if this will hep, but this answer seems to answer this question
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000029410000&UCATEGORY_0=_30_%24_12_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=microsecond+resolution+1ms&USEARCHCONTEXT_QUESTION_S=0

  • How to control the number of fields in the Advanced mode in af:query

    Hi,
    How to control the number of fields in the Advanced mode in <af:query>?
    Say i have 20 fields in my table and i created a view criteria with 2 fields. It would work perfectly in Basic mode. But in the Advanced mode all other fields selection is possible on clicking the ADD Fields button. I did not want the client to make a search with all 20 fields. Only 10 fields are to be listed in the Advanced Mode even though there are 20 fields in my table.
    How do i control the list of fields in ADDFields button?
    Any ideas?
    KR

    You can uncheck the Querable property of the attributes which you need not show up in the Advanced Mode (but they will not show up in other modes too !) or programatically set the same as mentioned here -
    http://adfcodebits.blogspot.com/2010/11/bit-27-setting-view-object-attributes.htmlAlso you can hide the AddFields button as suggested here - http://www.notjustjava.com/2011/12/cool-tips-to-showhide-components-of-the-query-control-of-adf/

  • How to control the opening form multiple times

    Greetings to all,
    I used Open_Form to open the form in my 'Menu.mmb'.
    My Question is:
    How we control the opening of a form from multiple times?
    Ex:
    In my menu.mmb I used OPEN_FORM.If we open the form,which was already opened ,I want to stop the form to open. How to do this?
    Thanks,
    Bhujendra

    pls try with
    FIND_FORM('EMPDETAILS1');
    OPEN_FORM('C:\INH\EMPDETAILS1');
    jeneesh                                                                                                                                                                                           

  • How to control the rounding rule at answer?

    Hi grus,
    I use the BIEE 11.1.1.6.5.
    And I create the 2 answers(A and B) with a same column which setting is same column formula and data format(Treat Numbers As "number", Decimal places "2") on column properties.
    Then I run the answer A that the value is 3.68( this column's SQL value is 3.675, so this means rounding up the value)
    But I run the answer B with same criteria that the value is 3.67(this means truncating the value)
    Why do these difference happen?
    How to control the rounding rule?
    Best Regards,
    Takashi

    Hi,
                 When add the Itemcode, default warehouse and costing codes (Profit Center) are automatically asign by SAP.
    When change the warehouse for this Itemcode, the costing codes(Profit Center) are disappear. I don't want to disappear the costing codes, that's why I try to resign the default costing codes when the warehouse change.
                At SAP 2005, easily  access the screen matrix in the marketing document and add the required values in each costing codes columns. But SAP 2007, all costing codes are combined in 1 col and those have the other screen.
              Do you have any idea to control the costing codes?
    Thanks and regards,
    Lei Nandar Myint

  • How to control the line-in volume input via LabView?

    Anyone know how to control the line-in volume and balance input via LabView?

    I assume you are referring to audio line-in volume control and lerft-right balance...
    If so, then check out this thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000D83A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Look at the info near the bottom from Paul S & Spectre. They talk about "winmm.dll"
    -cheers-
    JLV

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

Maybe you are looking for

  • Regarding guidance to use standard search help

    I need to add two fields PLANT and STORAGE Location on the item level of the service order.  These fields are not mandatory, and should enable the user to enter a Plant and Storage location.The storage location field editable and using a value help,

  • Sales order number should be sent as a SMS to customer automaticaly

    Hi,      i want whenever i raise the SO that respective SO number should gone to the customer as SMS automatically. Please suggest how i can do this?

  • How can I change the location of files? (buffers, history)

    I want to change the location of my history and buffers from my SSD to a flashdisk. [Reason: to overcome wear and rear on my SSD.] How can I do this? Open question: What other file locations (paths) should I change?

  • Safari crash report - Does this mean anything?

    Process:         Safari [217] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         5.1 (6534.50) Build Info:      WebBrowser-75345000~1 Code Type:       X86 (Native) Parent Process:  launc

  • Can't install the SMC Update v1.6

    So, I've tried to install the SMC update available here http://support.apple.com/kb/DL1560 on my mid 2011 Air. It downloads fine, but when I try to install, I get an error message that my system does not support this software. However, this is suppos