How to handle checkbox in struts

Hi,
Can you help me how to handle checkbox in Struts?
When i select/unselect checkbox in one page ,It should be selected/unselected stage when i come next time to that same page.

Hi,
Can you help me how to handle checkbox in Struts?
When i select/unselect checkbox in one page ,It should be selected/unselected stage when i come next time to that same page.

Similar Messages

  • How to handle exception in struts

    i am using global exception to pass to a page that shows an error message.
    I also want to pass the actual error message to that page is that possible
    through the struts config
    <global-exceptions>
    <!-- global exception handler -->
    <exception
    key="global.message"
    type="java.lang.Exception"
    path="Errors.jsp"/>
    </global-exceptions>

    i am using global exception to pass to a page that shows an error message.
    I also want to pass the actual error message to that page is that possible
    through the struts config
    <global-exceptions>
    <!-- global exception handler -->
    <exception
    key="global.message"
    type="java.lang.Exception"
    path="Errors.jsp"/>
    </global-exceptions>

  • How to handle sessions in struts

    i have created a session. even after logout its not destroying the session.
    //here i am creating session object
    public ActionForward setupdate(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) {
              ApplicationForm applicationForm = (ApplicationForm) form;
              String eid=applicationForm.getEid();
              HttpSession session = request.getSession(true);
              try {
                   PrintWriter out=response.getWriter();
                   if( applicationForm.getEid() != null && ! applicationForm.getEid().equals("") )
              session.setAttribute("User",applicationForm.getEid());
              System.out.println("you are logged in");
              out.println("you are logged in");
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                        return mapping.findForward("update") ;
    //this my logout method
    public ActionForward logout(ActionMapping mapping,ActionForm form,
                   HttpServletRequest request,
                   HttpServletResponse response)
              { ApplicationForm applicationForm = (ApplicationForm) form;
              //PrintWriter out=response.getWriter();
              HttpSession session=request.getSession(false);
              try {
                   PrintWriter out=response.getWriter();
                   if(session == null)
                        out.println("FIRST YOU NEED TO LOGIN");
                        System.out.println("FIRST YOU NEED TO LOGIN");
                   else
                        out.println("THANKS FOR USING OUR APPLICATION!!!!");
                        System.out.println("THANKS FOR USING OUR APPLICATION!!!!");
                        out.println("id---->"+session.getId());
                        session.getAttribute("User");
                        session.invalidate();
              } catch (IOException e) {
                   e.printStackTrace();
              return mapping.findForward("logout");}
    please me help me out.
    saju

    You might want to check the API on that method again.
    public void setMaxInactiveInterval(int interval)
    Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
    With regards to tracking who is logged on there are two issues.
    1 - tracking who is logged on
    - I would probably use a Map in application scope. Database table will also work. Its the same idea. When they log in, mark their presence. When they logout/expire then remove it.
    2 - responding to login/logout/expire events.
    - I would recommend using a HttpSessionBindingListener
    public class User implements HttpSessionBindingListener {
      String name;
      public User(String name){
        this.name = name;
      public void valueBound(HttpSessionBindingEvent event){
        // record login of this user
        if (userLoggedIn(this)){
          //user already logged in - throw an error and invalidate session
        else{
          // mark user as logged in.
      public void valueUnbound(HttpSessionBindingEvent event){
        // record logout of this user.
    }The code is invoked by the object being added/removed from a session.
    User user = new User("Bob");
    session.setAttribute("user", user);Cheers,
    evnafets

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • How to unSelect checkBoxes inside a buttonBar

    Hello!
    I've been a Flex developer for several months now and have made some great strides.  However, I've ran across a problem that requires some help from the Pros.
    I'm using Flash Builder 4.5 Premium.
    Scenerio:
    I have a buttonBar whose dataProvider is an mx:viewStack supplied by Spark NavigatorContent.  I have checkBoxes inside each of the NavigatorContent instances.  The checkBoxes turn content on and off.  Works great.
    Problem:
    When you select a different button in the buttonBar the selected content from the previuos button still displays.
    Question:
    How do I get the selected content from the previous button to not display? I'm not sure how to do this. 
    Bonus:
    If someone can tell me how to handle the checkBox eventHandler more efficiently that would be awesome!  Because right now I currently have an eventHandler function for each check box (like 18).  Since I'm still grean, so I figured I'd get everything working before trying to streamline this.  Or perhaps (I'm havina an epiphany) I need to add something to this code to unSelect the checkBox once the button has changed?  Not sure and confused. 
    Thanks for the help!
    Joe
    App Code:  If it's too much I appologize - I did leave out some.
    <?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"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   pageTitle="Aloha Existing Conditions"
                   initialize="initApp(event)">
        <fx:Style source="alohaExistingCond.css"/>
        <fx:Script>
            <![CDATA[
                import com.esri.ags.Graphic;
                import com.esri.ags.components.Editor;
                import com.esri.ags.components.Legend;
                import com.esri.ags.events.FeatureLayerEvent;
                import com.esri.ags.events.LayerEvent;
                import com.esri.ags.geometry.MapPoint;
                import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
                import com.esri.ags.layers.DynamicMapServiceLayer;
                import com.esri.ags.layers.TiledMapServiceLayer;
                import com.esri.ags.layers.supportClasses.LayerInfo;
                import com.esri.ags.layers.supportClasses.LayerLegendInfo;
                import com.esri.ags.layers.supportClasses.LegendItemInfo;
                import com.esri.ags.tasks.supportClasses.AddressCandidate;
                import flash.events.Event;
                import flashx.textLayout.events.UpdateCompleteEvent;
                import mx.containers.TitleWindow;
                import mx.controls.Alert;
                import mx.core.IFlexDisplayObject;
                import mx.events.FlexEvent;
                import mx.managers.PopUpManager;
                import mx.rpc.AsyncResponder;
                import spark.components.Panel;
                import spark.events.IndexChangeEvent;
                import splash1.SplashScreen1;
                public function initApp(event:FlexEvent):void
            //        showWindow();   
            //        viewMenu.addEventListener(IndexChangeEvent.CHANGING, bBarChangeHandler);
            //    public function bBarChangeHandler():void
                private var point1:Point = new Point();
                private function showWindow():void {
                    var login:SplashScreen1 = SplashScreen1(PopUpManager.createPopUp(this, SplashScreen1 , true));
                           PopUpManager.centerPopUp(login);
                public function turnonbasemap():void   
                    photo.visible = false;
                    basemap.visible = true;       
                public function turnonphoto():void
                    photo.visible = true;
                    basemap.visible = false;       
                public function bintBox(evt:MouseEvent):void
                    myLegend.visible = true;
                    if(CheckBox(evt.target).selected)
                    bikelaneMapServer.visible = true;
                else
                     bikelaneMapServer.visible = false;
                public function sintBox(evt:MouseEvent):void
                    sidewalkMapServer.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkMapServer.visible = false;   
                public function scomBox(evt:MouseEvent):void
                    sidewalkComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkComments.visible = false;   
                public function bcomBox(evt:MouseEvent):void
                    bikelaneComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        bikelaneComments.visible = false;   
                public function opsBox(evt:MouseEvent):void
                    OPS.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        OPS.visible = false;   
            ]]>   
        </fx:Script>
    <!-- Declaration are for Non-Visual Elements ~~~~~~~~~~~~~~~ -->
        <fx:Declarations>
            <esri:Locator id="locateTask"
                          url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer"/>
            <esri:SimpleMarkerSymbol id="mySymbol"
                                     alpha="0.5"
                                     color="0xFF0000"
                                     size="21"
                                     style="circle">
                <esri:SimpleLineSymbol width="2"/>
            </esri:SimpleMarkerSymbol>
        </fx:Declarations>
    <!-- Button Bar Window ~~~~~~~~~~~~~~~ -->
        <s:BorderContainer id="buttonBarContainer"
                           left="352" right="3" top="64" height="134"
                           borderWeight="2" cornerRadius="5">
            <s:Label text="Select an item below:"
                     x="10" y="10"/>
            <s:ButtonBar id="viewMenu" left="5" right="5" top="30" height="21"
                         dataProvider="{myViewStack}"
                         requireSelection="true"/>
                         <!-- change="changeSelection(event)" -->
                <s:Group id="layerGroup"
                         left="5" right="3" top="55" height="80">
                        <mx:ViewStack id="myViewStack" height="72">
                            <s:NavigatorContent id="planning" label="Planning">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="bCommentCheckBox" 
                                label="Bike Lane Comment"
                                fontSize="14"
                                click="bcomBox(event)"/>
                                <s:CheckBox id="foo1"
                                            label="Foo 1"
                                            fontSize="14"/>
                                <s:CheckBox id="foo2" 
                                            label="Foo 2"
                                            fontSize="14"/>
                                <s:CheckBox id="foo3"
                                            label="Foo 3"
                                            fontSize="14"/>
                                <s:CheckBox id="foo4" 
                                            label="Foo 4"
                                            fontSize="14"/>
                            </s:NavigatorContent>
    <!--  trans tab  ~~~~~~~~~~~~~~-->                   
                            <s:NavigatorContent id="trans" label="Transportation">
                                <s:layout>
                                    <s:TileLayout columnWidth="175" orientation="columns"
                                                  paddingLeft="10" paddingRight="20"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="sCommentCheckBox"
                                            label="Sidewalk Comments"
                                            fontSize="14"
                                            click="scomBox(event)"/>
                                <s:CheckBox id="sidewalkCheckBox"
                                            label="Sidewalk Inventory"
                                            fontSize="14"
                                            click="sintBox(event)"/>
                                <s:CheckBox id="bikelaneCheckBox" 
                                            label="Bike Lane Inventory"
                                            fontSize="14"
                                            click="bintBox(event)"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="environ" label="Environmental">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="200"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="opsCheckBox" 
                                            label="Watershed Enhancement"
                                            fontSize="14"
                                            click="opsBox(event)"/>
                                <s:CheckBox id="foo5"
                                            label="Foo 5"
                                            fontSize="14"/>
                                <s:CheckBox id="foo6" 
                                            label="Foo 7"
                                            fontSize="14"/>
                                <s:CheckBox id="foo8"
                                            label="Foo 8"
                                            fontSize="14"/>
                                <s:CheckBox id="foo9" 
                                            label="Foo 9"
                                            fontSize="14"/>
                                <s:CheckBox id="foo10"
                                            label="Foo 10"
                                            fontSize="14"/>
                                <s:CheckBox id="foo11" 
                                            label="Foo 11"
                                            fontSize="14"/>
                                <s:CheckBox id="foo12"
                                            label="Foo 12"
                                            fontSize="14"/>
                                <s:CheckBox id="foo13" 
                                            label="Foo 13"
                                            fontSize="14"/>
                                <s:CheckBox id="foo14" 
                                            label="Foo 14"
                                            fontSize="14"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="housing" label="Housing/Social">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Housing and Social Services Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="built" label="Built Environment">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Built Environment Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="transit" label="Transit">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Tansit Maps"/>
                            </s:NavigatorContent>
                        </mx:ViewStack>
                    <!--<s:Label id="selectionText"
                             x="10" y="60"/>  -->
                </s:Group>
        </s:BorderContainer>
    <!-- Legend Window ~~~~~~~~~~~~~~~ -->   
        <s:BorderContainer id="leContainer" left="3" top="140" bottom="3" width="347"
                           borderColor="#808080" borderWeight="2" cornerRadius="5" fontWeight="bold">
            <s:VGroup id="hGroup"
                      width="333"
                      height="500"
                      paddingBottom="11"
                      paddingLeft="5"
                      paddingRight="5"
                      paddingTop="10">
                <esri:Legend id="myLegend"
                             height="100%"
                             bottom="10"
                             width="330"
                             layers="{[ bikelaneMapServer, sidewalkMapServer, sidewalkComments, bikelaneComments, OPS ]}"
                             map="{myMap}"
                             respectCurrentMapScale="true"/>                 
            </s:VGroup>   
        </s:BorderContainer>   
    <!-- Map Window ~~~~~~~~~~~~~~~ -->       
        <s:BorderContainer id="mapBorder"
                           left="352" right="3" top="200" bottom="3"
                           borderColor="#808080"
                           borderWeight="2" cornerRadius="5">
            <esri:Map id="myMap" left="0" right="0" top="0" bottom="0" wrapAround180="true" logoVisible="false">
                <esri:extent>
                    <esri:Extent id="washco"
                                 xmin="7565269.4485383" ymin="657281.31999349" xmax="7607044.62214942" ymax="696603.368604601">   
                        <esri:SpatialReference wkid="2269"/>       
                    </esri:Extent>   
                </esri:extent>
                <esri:ArcGISTiledMapServiceLayer id="basemap"
                                                 url="http://......../Washco_primary_basemap_SP/MapServer"/>
                <esri:ArcGISTiledMapServiceLayer id="photo"
                                                 url="http://......../Orthos_2010_SP/MapServer"
                                                 visible="false"/>
                <esri:ArcGISDynamicMapServiceLayer id="bikelaneMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........DOE_Bikelane/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="sidewalkMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://......../DOE_Sidewalk/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="OPS"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........Watershed_Enhance/MapServer"/>   
                <esri:FeatureLayer id="sidewalkComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://........./SidewalkComment/FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:FeatureLayer id="bikelaneComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://......../FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:GraphicsLayer id="myGraphicsLayer"/>
            </esri:Map>
    </s:Application>

    Hi Kiran,
    U can use ItemRenderer to show button inside a cell of datagrid..!
    either inline ItemRenderer or external ItemRenderer as per your conveninent.
    sample:
    <mx:DataGrid>
    <mx:DataGridColumn headerText="Title" dataField="title">
                <mx:itemRenderer>
                    <mx:Component>
                            <mx:Button lable="Add" width="50" height="50"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
    </mx:DataGrid>
    Go Through this link : http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html
    Thanks,
    Pradeep

  • How to handle the control records in case of file to idoc scenario.

    Hi All,
    can you please clarify me how to handle the control records in case of file to idoc scenario.

    Hi,
    In File to Idoc scenario even though you selected apply control record values from payload and you are not getting those correct values which you have provided in the mapping.
    Also check the checkboxes Take sender from payload and Take receiver from payload along with the Apply control record values from payload checkbox
    Regards
    Seshagiri

  • How to handle table selection

    In the uix guidelines i found the following example on how to handle table selection:
    public static EventResult doSelectionEvent(BajaContext bc, Page page,
    PageEvent event)
    DataObject tableRows = new PageEventFlattenedDataSet(event, "table1");
    int index = SelectionUtils.getSelectedIndex(tableRows);
    String name = "Nothing Selected";
    // make sure that something was selected:
    if (index>=0)
    DataObject row = TABLEDATA.getItem(index);
    name = row.selectValue(null, "name").toString();
    EventResult result = new EventResult(page);
    result.setProperty("action", event.getName());
    result.setProperty("name", name);
    return result;
    It is not clear to me what TABLEDATA is.
    I read in some other thread that it is a DataObjectList and it represents the 'stored dataObjects'.
    I suppose '_TABLE_DATA' is not real code, may i ask for an example with real code to understand what it is?
    Thanks.

    This code works for me, I hope it is useful.
    (NB: i fear you will not read correctly the line
    with the getRowAtRangeIndex instruction. It's a problem with the editor).
    Mauro
    package view;
    import javax.servlet.http.HttpServletRequest;
    import oracle.adf.controller.struts.actions.DataActionContext;
    import oracle.adf.controller.struts.actions.DataForwardAction;
    import oracle.cabo.ui.beans.table.SelectionUtils;
    import oracle.cabo.ui.data.ServletRequestDataSet;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    public class GestEsAction extends DataForwardAction
    // To handle an event named "yourname" add a method:
    // public void onYourname(DataActionContext ctx)
    public void onValida(DataActionContext ctx)
    ServletRequestDataSet ds = new ServletRequestDataSet(req,"ReEsamiRichView12");
    int[] indices = SelectionUtils.getSelectedIndices(ds);
    ApplicationModule am = ctx.getBindingContainer().
    getApplicationModule();
    ViewObject vo = am.findViewObject("ReEsamiRichView1");
    int len = indices.length;
    String idEsameRich, currStato;
    for(int i=0; i<len; i++)
    Row row = vo.getRowAtRangeIndex(indices);
    idEsameRich = row.getAttribute("IdEsameRich").toString();
    currStato = row.getAttribute("Stato").toString();
    if (currStato.equals("E"))
    row.setAttribute("Stato","V");
    am.getTransaction().commit();
    // To override a method of the lifecycle, go to
    // the main menu "Tools/Override Methods...".

  • How to use checkboxes instead of radio button in datagrid

    I have a datagrid. I have two checkboxes in datagrid.That checkboxes should act like radio button.ie we can select only one checkbox at a time. If we select second checkbox,then the first selected checkbox should deselected.How to handle this scenario.Please give some code samples.
    Thanks & Regards
    kvpdy

    You could do that, but it will be a lot easier doing it from the data model. This way you don't have to modify the behavior of the chart, it just blindly renders the data given to it. Behind the scenes you're dealing with boolean values, so it's pretty easy to write setters accomplish this.
    public function set myAttribute(value:Boolean):void
         setAttributesTiedTogetherToFalse();
         _attrib = value;

  • Model of how APEX handles data (values)?

    Reference {thread:id=2486655}
    I'm trying to get a model of how APEX handles data (values). There are several places(?) that data (values) can exist. Or so it seems. I'm trying to understand how these work -- to put all the pieces together.
    Question:
    A) Where data can be?
    1) In the database
    2) In the session
    3) Rendered -- and hence displayed on the screen, if a displayed value -- but not in the session
    4) In perhaps(?) some working memory pool(?) but different from the page rendered values I see on the screen?
    5) Other?
    Why do I think this is relevant?
    Question:
    B) If there are rendered values and session values different from the rendered values, then when code executes, which of these values (rendered or session) is it executing against?
    And maybe the answer is, "You don't understand what's going on." Yes, "Exactly!" Hence the question.
    Best wishes,
    Howard

    Howard (DBA in Training) wrote:
    I'm putting this together now. For example:
    I set the value of a Page Item (say, :P2_DATA) to "BEFORE" in a Before Region process and change it to "AFTER" in an After Region Process. 'BEFORE' was displayed on the screen but 'AFTER' was in the session state. So I see that PL/SQL changes these values in the session state. But it doesn't "go back" to change the HTML after the region has been rendered -- hence we see BEFORE shown on the screen. (I'll have to think about what a Dynamic Action does.)
    Also, if a page item has a default value, say 'DEFAULT' then that value doesn't get into the session state. At least, not with my current settings. Oh, that explains a lot of confusion!! I suppose there's a logical reason for this but who would expect default values to be differently from other PL/SQL operations on the item?
    Questions:
    1) So why does a default value not get put into the session state?Several reasons, among them:
    *1. When/why is the value required?* Region items (and thus their source and default values) are rendered in region/item sequence order. The item's source/default value would therefore not be available in session state until it's rendering point. This is frequently later in page show processing than the value is actually required, such as the common use case of including a data value in the page or region title. Setting the value in a Before Header/Regions computation or process makes it available as required before the item is actually rendered.
    *2. The rendered page might not be submitted.* Default values are typically set when a page will create a new row. Consider the situation where the user clicks a "Create" button and is presented with an order entry form containing several default values. They then decide they don't want to create a new order after all, and navigate away from the form page via some mechanism that uses a redirect rather than a submit (such as a default "Cancel" button). This means that no page submit processing is performed, and generally that no session state management is performed. If the default values were set in session state, the order entry page would contain the default values for the non-existent order despite the user never submitting it. This may have unwanted side-effects if these values are referenced elsewhere in the application, and therefore would require extra session state management to be built into the application.
    *3. A rendered item might not be submitted with the page.* Per the HTML specification, the values of disabled controls unchecked checkboxes are not POSTed on page submit. Consider a situation where a checkbox item is set with several default values, but the application requires that the checkboxes be cleared and disabled by a dynamic action if the user chooses certain options from a select list. In this case, on page submission no values are submitted into session state for the checkbox item. If the defaults had been set in session state, then the application would be in an inconsistent state, with the user-selected option indicating that none of the checkboxes were checked, but with session state holding values showing that they were. This would require additional processing to ensure that the application's state was consistent before saving it to the database.<sup>1</sup>
    2 & 3 are particularly significant in basic wizard-generated applications. Doing things in this way, the wizard-generated DML and navigation "just works", without the need for additional session state management.
    2) Is there a Page Item setting that causes the default value to be saved to the session state?No. Hopefully the explanations above provide sufficient reason to show why this is genearlly not desirable. On the rare occasions when it is required, set the session state value using a computation or process.
    <sup>1</sup> There are other reasons&mdash;mainly security related&mdash;that make it good practice to perform such checks in more complex and internet-facing applications anyway.

  • How to handle Event in JACOB API

    Hi,
    I am read the outlook mail using JACOB[Java Com Bridge] API successfully, now i want to handle events for outlook mail using JACOB. and also i can able to catch the new mail event. but i am unable to catch any deleted mail and move mail from one folder to another folder. This is extremely important for my project. so any one please tell me how to handle and catch the Outlook deleted event and move event using JACOB.
    Thanks in Advance,
    With Regards,
    Ganesh

    Windows can be closed in a number of ways and the simplest way to trap them would be to handle Window Closing in code behind.
    This is also the easiest way to show dialogs if that's how you wanted the warning message to appear.
    This:
    chxAllowToClose.IsChecked
    Looks like a checkbox to me, seeing as you have IsChecked.
    That presumably means you already have that bound to a viewmodel and visible to the user.
    You can therefore just test that value from the view.
    If you prefer to hide that instead then there are several options.
    You could have a dependency property and a binding in code behind which binds to the viewmodel. Test that in your event.
    Or
    You could save the value when it changes to application.current.resources.  Since dependency properties and bindings are a bit wordy this is easier.
    Or
    You could have just a variable in the view code behind and use messenger to tell that when the value changes from the viewmodel:
    http://social.technet.microsoft.com/wiki/contents/articles/26070.communicating-between-classes.aspx
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • How to handle html:multibox in jsp with ADF Data Binding

    Hi,
    I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
    "JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
    Here is my jsp code:
    <c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
    <c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
    <br>
    <html:multibox property="selectedSystemType">
    <c:out value="${type.SystemType}"/>
    </html:multibox>
    <c:out value="${type.TypeDesc}"/>
    </c:if>
    </c:forEach>
    Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • Handling userlogin in struts

    Dear all
    i want to know how to handle user login in struts.
    when user logsin i create a variable in session (storing user name and email id in session as a object )
    my file strutcure is
    layouts
    [contains layout for struts]
    pages
    [contains including files (combines layouts and tiles)]
    tiles
    [indivudual tiles of page]
    where should i write my session checking ? and how to forware to login page.
    please help me thanks you
    archi

    you could create yourself a custom tag
    if the tag detects tha the user is not logged in it uses the response object of the page to forward to the login page

  • How to handle exception CX_SY_REF_IS_INITIAL

    hi experts,
    im working on a test scenario for abap mapping in SAP XI im getting this error
    An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
    i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
    can any one please suggest me how to handle this exception for the following code...
    method IF_MAPPING~EXECUTE.
      break x1149.
    * initialize iXML
      TYPE-POOLS: ixml.
      class cl_ixml definition load.
    ** Instances & Variable declaration =======================
    * instance main factory
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA: l_ixml TYPE REF TO if_ixml,
    * instance input stream factory
       l_streamfactory TYPE REF TO if_ixml_stream_factory,
    * instance input stream
      l_istream  TYPE REF TO if_ixml_istream,
    * instance input document
      l_document TYPE REF TO if_ixml_document,
    * instance parse input document
      l_parser TYPE REF TO if_ixml_parser,
    * instance for elements within the nodes
      node      TYPE REF TO if_ixml_node,
    *instance of nodemap
      nodemap   TYPE REF TO if_ixml_named_node_map,
    * instance for iterator
      iterator  TYPE REF TO if_ixml_node_iterator,
      name      TYPE string,
      value     TYPE string,
    * instance main factory
       o_ixml   TYPE REF TO if_ixml,
    * instance output document
       o_document TYPE REF TO if_ixml_document,
    * instance output stream
      o_istream  TYPE REF TO if_ixml_ostream,
    * instance parse output document
      o_parser  TYPE REF TO if_ixml_parser,
    * instance fot renderer
      renderer type ref to if_ixml_renderer,
      irc type i,
      l_xml_size   TYPE i,
    *ROOT ELEMENT
    l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
    *NEXT CHILD ELEMENT FROM THE ABOVE PARENT
    l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
    *CHILDREN1 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_WHSE  TYPE REF TO if_ixml_element,
    *CHILDREN2 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_DC    TYPE REF TO if_ixml_element,
    *CHILDREN3 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_PLANT    TYPE REF TO if_ixml_element,
    *CHILDREN4 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_QTY    TYPE REF TO if_ixml_element.
    *saving the xml document
      DATA: l_xml_table       TYPE TABLE OF t_xml_line.
      types: begin of t_source,
              whse(5),
              dc(4) ,
              plant(4),
              qty    type i,
             end of t_source.
      types: tt_source TYPE STANDARD TABLE OF t_source.
      data:  wa_source type t_source.
      data: it_source TYPE  tt_source,
            ivalue type string.
    * Procedures and business logic =======================================
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    * how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
    endmethod.
    full reward points for answers.
    Thanks & Regards,
    Uday Kumar.
    Edited by: UDAY on May 6, 2008 9:32 PM

    Hi Uday,
    Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
    " Define a class exception object to get error message......
    DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
    "// Use the statment Try block to catch the error.
    TRY.
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    "   The Statement CATCH define a block that catches the exceptions of the
    "   exception class cx_sy_ref_is_initial
        CATCH cx_sy_ref_is_initial INTO o_exception.
    " If you need to get the error message text do as follow
    DATA errorMsg type string.
    " Get the message text
      errorMsg = o_exception->GET_TEXT( ).
    " Display the error information
      MESSAGE errorMsg TYPE 'I'.
      ENDTRY.
    The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
    Font: SAP Help
    You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
    Best Regards.
    Marcelo Ramos

  • How to handle null values in RTF templates

    Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the template I use the below code to print or not print a section.
    <?if:number(CF_ELE_CNT +CF_ELE_CNT1) >0?>    
    The problem is when there is no data in the second group its not creating the XML tag for CF_ELE_CNT1, though CF_ELE_CNT has 13, it still does not print that partucular section. If I remove CF_ELE_CNT1 from the condition it works fine. I was wondering how to handle this.
    Any help would be appreciated!!
    Thanks,
    Rav

    Hey Rav,
    You can add a check to identify it the element/tag is present or not
    <?if:(CF_ELE_CNT1)?> will give true, if the element is present otherwise falsesince you are adding the two elements, you have to add a or condition.
    <?if:(CF_ELE_CNT and number(CF_ELE_CNT) >0 ) or ( CF_ELE_CNT1 and CF_ELE_CNT1 >0)?>

  • How to handle file on application server without coading?

    HI all,
    can anybody tell me How to handle file on application server without coading? Is there any solution?
    Thanks in advance.

    > can anybody tell me How to handle file on application server without coading? Is there any solution?
    what is that you want to handle. what you do if you don't code ...

Maybe you are looking for

  • Report to show average days it takes customers to pay their invoices

    I am wondering if there is a report in SAP that can help me determine the average days it takes customers to pay their invoices?

  • Where to download the earliest release of 11g (11.1.0.6) ?

    where can i find all the archives of db server 11g? i want the earliest one but when i go to the oracle website, there is only the lastest released on the 10/13. I want the one without the date attached to the download file. Thanks,

  • Creative Mediasource Player quest

    Does Creative Mediasource 2 (v2.02.06) for Audigy 2ZS support international characters? Or is there a way to make it support them? I have some greek songs in my Music Library and Mediasource does't recognize them, it simply writes ? instead of the fi

  • Newb Question: Can someone explain what a bus is in layman's terms?

    What is a bus and how is it helpful? Sorry for my ignorance. I am going to get the videos as soon as I save up. Purchasing this new Mac Pro wiped me out.

  • Forms 6i and Xterm

    Hi, I have Oracle 8+ database on HP-UX and using Forms 6i to generate User Interfaces. I am using Exceed on Win 95 (for Xterm) to generate develop the forms and generate the .fmx on Unix box. But, when users connect to Unix and with Exceed and xterm