How to control a UI5 element in another view?

Hi guys,
I'm developing on a UI5 application. There are two views main.view.js/main.controller.js and detail.view.js/detail.controller.js, both have complex logic and I'm really not willing to merge them together. But I meet with a problem. When I change status of a checkbox in main.view.js, a label in detail.view.js should change accordingly, how can I achieve that?

IMO,(just my personal view) the most elegant way is to use a model like this example.
In the example, there are two views which have the same model. Changing label in the model cause the text of label control to change.
-D

Similar Messages

  • Help,how close pop-up window ,and open another view

    Hello,
    How click the pop-up window button ,then close the pop-up window .
    At the same time open another VIEW,and  transfer PO number to the VIEW.
    thanks

    Hi,
    First step is set the SCREEN TYPE as "Modal Dialog Box" in screen property tab.
    Then in PBO of the popup screen take a new GUI status and select DIALOG BOX as status type.
    Then assign some function code in 'X' button say 'CANCEL'.
    the put ur logic like below :
    PBO
    module gui_status.
    PAI.
    module user_command.
    module gui_status.
       set pf-status 'ZPOPUP'.
    endmodule.
    module user_command.
      if ok_popup = 'CANCEL'. " Where ok_popup is the ok_code variable in ur popup screen , also define it in TOP include
        leave to screen 0.
    endif.
    endmodule.
    Hope this will solve your problem and help you to put your logic.
    Thanks

  • How to use one xsd element in another xsd

    Hi,
    I have an xml as follows.
    <rss version="2.0" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="newtest.xsd">
    <!--Locator Version 1.4.0.0-->
    <channel>
    <title>Locations</title>
    <link>http://mytestlink.com</link>
    <description>location information</description>
    <item>
    <ymaps:Address>Roosevelt Blvd</ymaps:Address>
    <ymaps:CityState>Monroe, NC</ymaps:CityState>
    <ymaps:Zip>28112</ymaps:Zip>
    <ymaps:Country>US</ymaps:Country>
    </item>
    </channel>
    </rss>
    I worte an xsd as follows for the above xml
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="rss">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="channel">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="title" type="xsd:string" />
    <xsd:element name="link" type="xsd:string" />
    <xsd:element name="description" type="xsd:string" />
    <xsd:element ref="ymaps:Address" />
    <xsd:element ref="ymaps:CityState" />
    <xsd:element ref="ymaps:Zip" />
    <xsd:element ref="ymaps:Country" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="version" type="xsd:decimal" />
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    I am getting the below exception for that
    line numbner ---|13|---Column---|41|-----
    org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ymaps:Address'. It was detected that 'ymaps:Address' is in namespace 'http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd', but components from this namespace are not referenceable from schema document 'file:///E:/test/samples/newtest.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ymaps:Address' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///E:/test/samples/newtest.xsd'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    Could any one help me?
    Thanks in advance
    Samba Damerla

    Hi Andrzej,
    please check out this thread: Set parameters values depending on other parameters
    I had a discussion about query results as input for another query in there.
    For creating a workbook, just click on the save button after you ran your query in the bex.
    Siggi
    Message was edited by: Siegfried Szameitat

  • How to copy a text element to another in sapscript

    Question
    Have a bug in the system and need to copy an existing text element to a new one.
    How do you do this.
    I have found the text elelement in tihe MAIN window - the code /E   510-C  <-- this needs to be copied to a new text element called /E    510-A.  I can cust and paste this into the text element screen  But doesn't the 510-A refer to some text created via SO10?  But then doesn't sapscript require you to use an include to get the text in there?
    HELP - 2 days from go -live here!!
    Thanks and big points to who can ever help!

    Text elements are specified with "/E".  These are different from STANDARD TEXT objects that you define in SO10 and reference with the INCLUDE statment.
    Text elements are called from the ABAP print program.  If you copy text element 510-C to 510-A, the ABAP print program has to call element 510-A to execute the statements in this section.
    Are you dealing with errors from a syntax check?

  • How do i install photo elements onto another computer

    i have went online to find out the answer to this question but i am just confused. I don't want to re-buy Photoshop. how do i, step bu step, switch it from one computer to the next?

    Install it and activate it using your serial number.  You are allowed to have it installed and activated on two machines.
    PSE 13 Trial - http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements
    PSE 10, 11, 12 - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html
    PSE 7, 8, 9 - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-7-8-9-downloads.html

  • WCF wsHTTP adapter: How to control WS-A elements, attributes.

    Hello,
    we have a third party soap web service that we invoke using Biztalk BasicHTTP adapter.
    This wasn't working. 
    That's when we were told the web service is a Soap1.2 endpoint.
    So we have changed the adapter to wcf-wsHTTP adapter. This still doesn't work!!
    we get an error like:  Must Understand check failed for header
    http://www.w3.org/2005/08/addressing : To
    I traced the outgoing call from the adapter via Fiddler.
    I see this:
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
     <s:Header>
      <a:MessageID>urn:uuid:637ec5d5-f7c3-</a:MessageID>
      <ActivityId CorrelationId="b56a4554-c373-4479" xmlns="00000000-0000-0000-0000-000000000000</ActivityId">http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId>
      <a:ReplyTo>
               <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">https://xxx.xxx/xx</a:To>
     if i change the mustUnderstand attribute to 0 in the To element, the web service returns
    the right response. This was tested using Fiddler.
    I understand the adapter is adding the headers like To,ReplyTo etc. but not sure
    why. How do i disable them getting generated? or How can i set the mustUnderstand to 0?
    Any suggestions please?
    thanks
    MS

    Hi,
    Refer the SOAP Header Action mustUnderstand Exception.
    Add the addressing annotation to the Web Service class @Addressing(enabled=true, required=true)
    Change namespaces in the <Envelope> tag from:
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
    to
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing">
    Both SOAP 1.1 and SOAP 1.2 specifications enable you to use mustUnderstand attributes with SOAP headers. Not handling these headers properly is a common concern during Web service
    interactions.
    Refer: Understand the Famous "Did not
    understand MustUnderstand header(s)"Error
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • How to control actions printing,export in discoverer viewer for user

    Hi
    we use discoverer viewer .I want to control Printing,export,send email options
    for user for a worksheet.Hoe to do this. thru Enterprise Manager apps server control , i tried to change the settings , but i guess thats for all the users and all the workbooks.
    how do i set this for user??
    rgds

    Hi
    Yes, the settings you can apply are global and will affect all users. You cannot restrict these by user. Sorry.
    Best wishes
    Michael

  • How to Call Event Handler Method in Another view

    Hi Experts,
                       Can anybody tell me how to call Event handler Method which is declared in View A ,it Should be Called in
      view B,Thanks in Advance.
    Thanks & Regards
    Santhosh

    hi,
    1)    You can make the method EH_ONSELECT as public and static and call this method in viewGS_CM/ADDDOC  using syntax
        impl class name of view GS_CM/DOCTREE=>EH_ONSELECT "method name.
                 or
    2)The view GS_CM/ADDDOC which contains EH_ONSELECT method has been already enhanced, so I can't execute such kind of operation one more time.
                         or
    3)If both views or viewarea containing that view are under same window , then you can get the instance ofGS_CM/DOCTREE from view GS_CM/ADDDOC  through the main window controller.
    lr_window = me->view_manager->get_window_controller( ).
        lv_viewname = 'GS_CM/DOCTREE '.
      lr_viewctrl ?=  lr_window ->get_subcontroller_by_viewname( lv_viewname ).
    Now you can access the method of view GS_CM/DOCTREE .
    Let me know in case you face any issues.
    Message was edited by: Laure Cetin
    Please do not ask for points, this is against the Rules of Engagement: http://scn.sap.com/docs/DOC-18590

  • Rfc input from selected element in another view

    Hi,
    In my web dynpro application I  have two views.
    In the first view I fill a variabile (selected_id ) in the custom controller with method onActionSelect.
    Now in the second view I call a rfc using selectd_id as input, but it is empty.
    How can I solve it?
    FirstView
    public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.wdp.IPrivateCatGdfView.IAlberoElement selectedElement )
        //@@begin onActionSelect(ServerEvent)
        if(selectedElement.getIsFoglia().equals("X")){
             wdContext.currentContextElement().setSelected_Id(selectedElement.getId_corso());
             wdThis.wdFirePlugOutCat();
        //@@end
    Custom Controller
         Zhr_Schedapdf_Input input_pdf = new Zhr_Schedapdf_Input();
         wdContext.nodeSchedaPdf_Input().bind(input_pdf);
         String corso = wdContext.currentContextElement().getId_selected();
         input_pdf.setObjid(corso);

    Hi Alfonso,
      Why don't you set this value in View1?
    e.g. 
    public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.wdp.IPrivateCatGdfView.IAlberoElement selectedElement )
        //@@begin onActionSelect(ServerEvent)
        if(selectedElement.getIsFoglia().equals("X")){
             wdContext.currentSchedaPdf_InputElement().setsetObjid(selectedElement.getId_corso());
             wdThis.wdFirePlugOutCat();
        //@@end
    Write the following code in wdDoInit() of Custom Controller
    Zhr_Schedapdf_Input input_pdf = new Zhr_Schedapdf_Input();
         wdContext.nodeSchedaPdf_Input().bind(input_pdf);
    Regards,
    Siva

  • How can i hide elements of a view?

    Hi,, i've got a question about, how can i hide an element of a view?, this element colud be a group, a label, an input field, any element that i can put in the view layout.
    My view has an ALV, an inputfield and a Table with a button, so when i click on a line of the alv, it shows data in the table and in the inputfield, and when i click on the button of the table, i want to hide the table and the inputfield, until i clik on the alv again to make appear  the table and the inputfield.
    how can i hide those element?,,,,,,,,thanks

    Hi Luis Garcia,
    It can be done easily by <b>context binding</b> the visibility property of the table and input field UI element to a node attribute whose type would be WDY_BOOLEAN.
    1. Initially the node attributes default value would be 'X'.
    2. When you click the button in the ALV, in the event handler of that button change the binded node attribute value to ' '.
    3. When on lead selection of the table again change the binded node attribute field value to 'X'.
    4. Below is the sample code to read the binded node attribute and toggle the visiblity attribute to 'X' if it is ' ' and vice versa.
      data:
        Node_If                             type ref to If_Wd_Context_Node,
        Elem_If                             type ref to If_Wd_Context_Element,
        Stru_If                             type If_Main=>Element_If ,
        Item_VISIBILITY                     like Stru_If-VISIBILITY.
    * navigate from <CONTEXT> to <IF> via lead selection
      Node_If = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_If ).
    * get element via lead selection
      Elem_If = Node_If->get_Element(  ).
    * get single attribute
      Elem_If->get_Attribute(
        exporting
          Name =  `VISIBILITY`
        importing
          Value = Item_Visibility ).
    if Item_visibility is initial.
    item_visibility = 'X'.
    else.
    item_visibility = ' '.
    endif.
      Elem_If->set_Attribute(
          Name =  `VISIBILITY`
          Value = Item_Visibility ).
    endmethod.
    Hope it helps.
    Regards,
    Maheswaran.B

  • How to Control authorization for users with certain status for level 2 WBS Element

    Dear All,
    Is there any standard way or enhancement available to control authorization for users with certain status for WBS Element i.e. for example
    Pre-requisite:
    There is only 2 level of project i.e.
    Lev_ WBSE_______Description
    1___ 7-14.E_______summay outage controller
    2___ 7-14.E.2310__ Plant/unit # 2310
    2___ 7-14.E.2310__ Plant/unit # 2220
    Project Controller  (authorization role assigned "Z_PS_OP7_OTGCON_C") have all project level authorization
    Plant/Unit Controller (authorization role assigned "Z_PS_OP7_PLNTOTG_C_2310") have only level 2 authorization with enhancement that we did in system by Z table.
    User ID_ Plant #
    123345_ 2310
    122455_ 2220
    Issue:
    After System Status released and User Status approved the WBS basic date for Plant/Units should be restricted from updating/changing by Plant/Unit Controller level and only project controller should have this authority.
    Solution required: 
    Can any one tell how to control this scenario either by standard or enhancement available to control authorization
    BR
    Saqib Usman   

    Hi,
    Did you explore SAP Enhancement CNEX0002 Using Transaction CMOD?
    Thank you and regards,
    Varshal Kachole
    The SCN Rules of Engagement

  • How do I access array elements in one method from another method?

    Hi all!
    How do I access the array's elements from another method so that method 2 can have access to method 1's array elements? Thanks for any help!
    I am trying to create a simply program that will use a method to create an array and a SEPARATE method that will sort the array's elements (without using java's built in array features). I can create the program by simply having one method and sorting the array within that same method, BUT I want to sort the array from another method.
    Here's my code so far:
    public class ArraySort {
       public static void createArray(int size){
           double myArray[] = new double[size];    //create my new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);   //fill the array with random numbers
       public static void sortArray(){
           // I WANT THIS METHOD TO ACCESS THE ARRAY ELEMENTS IN THE METHOD ABOVE, BUT DON'T KNOW
          //  HOW???? Please help!
        public static void main(String[] args) {
            createArray(4);    //call to create the array
    }Thanks again!
    - Johnny

    Thanks for the help all! I ve managed to get the program working, using java's built in array sort, but when i try to call on the array sort method from WITHIN my main method, nothing happens!
    Can somebody please tell me why I am not able to call on the sort method from within my main class???? Thanks!
    public class ArraySort {
       public void createArray(double[] arrayName, int size){
           double myArray[] = new double[size];  //create new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);    //populate array with
           }                                                 //random Numbers
           sortArray(myArray); 
       } //Sort array(if I delete this & try to use it in Main method --> doesn't work???
       public void sortArray(double[] arrayName){
           DecimalFormat time = new DecimalFormat("0.00");
           Arrays.sort(arrayName);      //sort array using Java's built in array method
           for(int i = 0; i <arrayName.length; i++)
               System.out.println(time.format(arrayName)); //print arary elements
    public static void main(String[] args) {
    ArraySort newArray = new ArraySort(); //create a new instance
    double myArray[] = new double[0]; //create a new double array
    newArray.createArray(myArray,4); //build the array of indicated size
    //newArray.sortArray(myArray); //This will not work???? WHY?????//

  • How can i call another view variables in another view

    how can i call another view variables in another view and pass that variables to the function
    my situation is i have a view FAC which i need to pass par_id_fac TO THE VIEW AGR.AFTER THAT i what to take start_dt in agr view and par_id_fac from Fac and pass this variables to the function i have check the documentation but does not do what i what,the doc simply talk about creating variables and pass then to function.i what to pass variables from the views and return value to my contractno Variables value
    something like if :agr.contract_no is null
    and :agr.agr_start_dt is not null then
         :agr.contract_no := sms_fapp.get_contract_no(:fac.par_id_fac,:agr.agr_start_dt);
    end if;     
    y view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="AGR"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false"
      RowClass="sms1405.AGRRowImpl"
      ComponentClass="sms1405.AGRImpl"
      DefClass="sms1405.AGRDefImpl">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_codeGenFlag2" Value="Access|Def|Coll|Prog|VarAccess"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
    <SQLQuery><![CDATA[SELECT SmsAgreements.ID,
           SmsAgreements.FAPP_ID,
           SmsAgreements.PAR_ID,
           SmsAgreements.SSCH_ID,
           SmsAgreements.COSERV_ID,
           SmsAgreements.IREA_ID_TERMINATED,
           SmsAgreements.IREA_ID_SUSPENDED,
           SmsAgreements.SPTYP_ID,
           SmsAgreements.CLAIM_BASED_YN,
           SmsAgreements.NOTES,
           SmsAgreements.SUSPENSION_DT,
           SmsAgreements.TERMINATION_DT,
           SmsAgreements.SPECIAL_PROJECT_END_DT,
           SmsAgreements.CAPITAL_FUNDING_APPROVED,
           SmsAgreements.PERIODICAL_PAYMENT_AMOUNT,
           SmsAgreements.DATE_CREATED,
           SmsAgreements.DATE_MODIFIED,
           SmsAgreements.MODIFIED_BY,
           SmsAgreements.CREATED_BY,
           SmsAgreements.CONTRACT_NO,
           SmsAgreements.OFF_ID,
           SmsAgreements.DATE_APPROVED,
           SmsAgreements.AGR_START_DT,
           SmsAgreements.AGR_END_DT,
           SmsAgreements.MONTHS_FUNDED,
           SmsAgreements.PFRE_ANNUAL_FREQUENCY,
           SmsAgreements.FUNDED_NO,
           SmsAgreements.REGISTERED_NO,
           SmsAgreements.CONTRACT_NAME,
           SmsAgreements.OPEX_ALLOCATION,
           SmsAgreements.EMERG_ORG_YN,
           SmsAgreements.SCHEDULE,
           SmsAgreements.PERIODICAL_PAYMENT_AVERAGE,
           SmsAgreements.NO_OF_PAYMENTS,
           SmsAgreements.ADVANCE_PAYMENT_PERCENT,
           SmsAgreements.QUALIFY_NO,
           SmsAgreements.ENROLLED_NO,
           SmsAgreements.MULTI_YEAR_ALLOCATION,
           SmsAgreements.AGR_ID_SOURCE,
           SmsAgreements.FYEA_YEAR_ACTIVE,
           SmsAgreements.PTYPE_CODE,
           SmsAgreements.CONTRACT_VALUE,
           SmsAgreements.MAGR_ID,
           SmsAgreements.PROG_ID,
           SmsAgreements.EMERGENCY_BED_#,
           SmsAgreements.drep_id,
           SmsAgreements.srep_id,
           (select name from sms_offices off where off.id = SmsAgreements.off_id)officeName,
           (SELECT  PROG.NAME FROM   sms_programmes prog where PROG.ID = SMSAGREEMENTS.PROG_ID)programe,
           (select prog.code || '.' || bvspro.code || '  ' || bvspro.NAME budget_vote   from sms_subsidy_schemes ssch,
              sms_budget_vote_sub_programs bvspro,
              sms_programmes prog
              WHERE bvspro_id = bvspro.ID AND prog.ID = prog_id
              and prog.id = SMSAGREEMENTS.PROG_ID)Sub_programme,
             (select  ssch.NAME from sms_subsidy_schemes ssch where SSCH.ID = SMSAGREEMENTS.SSCH_ID)subsidy,
           (SELECT master_contract FROM  sms_master_agreements magr WHERE MAGR.ID = SmsAgreements.magr_id)masterContract
    FROM SMS_AGREEMENTS SmsAgreements]]></SQLQuery>
      <ViewAttribute
        Name="ContractNo"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="20"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="CONTRACT_NO"
        SQLType="VARCHAR">
        <TransientExpression><![CDATA[CONTRACT_NO]]></TransientExpression>
        <DesignTime>
          <Attr Name="_DisplaySize" Value="20"/>
        </DesignTime>
      </ViewAttribute>
    <ViewAttribute
        Name="AgrStartDt"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.sql.Timestamp"
        ColumnType="DATE"
        AliasName="AGR_START_DT"
        SQLType="DATE">
        <RecalcCondition><![CDATA[true]]></RecalcCondition>
        <TransientExpression><![CDATA[adf.currentDate]]></TransientExpression>
      </ViewAttribute>
    </ViewObject>and my FAC view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="FAC"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
      </DesignTime>
      <SQLQuery><![CDATA[SELECT SmsFacilityVw.PAR_ID_ORG,
           SmsFacilityVw.ORGANISATION,
           SmsFacilityVw.ORG_KEY,
           SmsFacilityVw.C_CODE,
           SmsFacilityVw.FACILITY,
           SmsFacilityVw.PAR_ID_FAC,
           SmsFacilityVw.NPO_REGISTRATION_NO,
           SmsFacilityVw.ADDRESS,
           SmsFacilityVw.TELNR_WORK,
           SmsFacilityVw.ADDRESSLINE,
           SmsFacilityVw.Town,
           SmsFacilityVw.Suburb,
           SmsFacilityVw.PostalCode,
           SmsFacilityVw.DSD_REGION,
           SmsFacilityVw.SERVICE_DELIVERY_AREA,
           SmsFacilityVw.FAXNR,
           SmsFacilityVw.EMAIL,
           SmsFacilityVw.PAR_TYPE_DEF
    FROM SMS_FACILITY_VW SmsFacilityVw]]></SQLQuery>
      <ViewAttribute
        Name="ParIdOrg"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="PAR_ID_ORG"
        Expression="PAR_ID_ORG"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Organisation"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ORGANISATION"
        Expression="ORGANISATION"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="OrgKey"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="10"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ORG_KEY"
        Expression="ORG_KEY"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="10"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="CCode"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="30"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="C_CODE"
        Expression="C_CODE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="30"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Facility"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="FACILITY"
        Expression="FACILITY"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ParIdFac"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="PAR_ID_FAC"
        Expression="PAR_ID_FAC"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="NpoRegistrationNo"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="30"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="NPO_REGISTRATION_NO"
        Expression="NPO_REGISTRATION_NO"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="30"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Address"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="227"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS"
        Expression="ADDRESS"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="227"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="TelnrWork"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="150"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TELNR_WORK"
        Expression="TELNR_WORK"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="150"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Addressline"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="120"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESSLINE"
        Expression="ADDRESSLINE"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="120"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Town"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TOWN"
        Expression="TOWN"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Suburb"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SUBURB"
        Expression="SUBURB"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Postalcode"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="4"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="POSTALCODE"
        Expression="POSTALCODE"
        SQLType="VARCHAR"
        IsUpdateable="false">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="4"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="DsdRegion"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="40"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="DSD_REGION"
        Expression="DSD_REGION"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="40"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ServiceDeliveryArea"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SERVICE_DELIVERY_AREA"
        Expression="SERVICE_DELIVERY_AREA"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Faxnr"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="FAXNR"
        Expression="FAXNR"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Email"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="80"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="EMAIL"
        Expression="EMAIL"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="80"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ParTypeDef"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="12"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="PAR_TYPE_DEF"
        Expression="PAR_TYPE_DEF"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="12"/>
        </DesignTime>
      </ViewAttribute>
      <ViewLinkAccessor
        Name="AGR"
        ViewLink="sms1405.par_facfkViewLink"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
      <ViewLinkAccessor
        Name="SmsParAddrVwView"
        ViewLink="sms1405.parLink"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
      <ViewLinkAccessor
        Name="DOC"
        ViewLink="sms1405.FAC_DOC"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
    </ViewObject>Edited by: ADF007 on 2012/08/23 6:10 PM

    i try this
    public class SMS_AGREEMENTSImpl extends EntityImpl {
    RowSet newContractNoBeforePost = null;
        public static int NUMBER = Types.NUMERIC;
        public static int DATE = Types.DATE;
        public static int VARCHAR2 = Types.VARCHAR;
      protected Object callStoredFunction(int sqlReturnType, String stmt,
            Object[] bindVars) {
            CallableStatement st = null;
            try {
            // 1. Create a JDBC CallabledStatement
            st = getDBTransaction().createCallableStatement(
            "begin ? := "+stmt+";end;",0);
            // 2. Register the first bind variable for the return value
            st.registerOutParameter(1, sqlReturnType);
            if (bindVars != null) {
            // 3. Loop over values for the bind variables passed in, if any
            for (int z = 0; z < bindVars.length; z++) {
            // 4. Set the value of user-supplied bind vars in the stmt
            st.setObject(z + 2, bindVars[z]);
            // 5. Set the value of user-supplied bind vars in the stmt
            st.executeUpdate();
            // 6. Return the value of the first bind variable
            return st.getObject(1);
            catch (SQLException e) {
            throw new JboException(e);
            finally {
            if (st != null) {
            try {
            // 7. Close the statement
            st.close();
            catch (SQLException e) {}
        protected void doDML(int operation, TransactionEvent e) {
           String amDef = "sms1405.sms1405Module";
           String config = "sms1405ModuleShared";
              String NewContract = null;                 
            ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
            ViewObjectImpl vo = (ViewObjectImpl) am.findViewObject("AGR1");
            vo.executeQuery();
            Row row = vo.first();
            // NewContract = (String)vo
            NewContract = (String)row.getAttribute("ContractNo");
            SMS_AGREEMENTSImpl newcont = new SMS_AGREEMENTSImpl();
           //AGRRowImpl res = new  AGRRowImpl();
           // NewContract = NewContractNo();
            if (operation == 1)  {
                         newcont.setContractNo(NewContractNo());
                         //res.setContractNo( NewContractNo());   
                        //NewContractNo();
            super.doDML(operation, e);
            public void postChanges(TransactionEvent TransactionEvent) {
            /* Only bother to update references if contractno is a NEW one */
            if (getPostState() == STATUS_NEW) {
            * Get a rowset of contract related
            * to this new partyaddress before calling super
             newContractNoBeforePost  = (RowSet)getSMS_AGREEMENTS();
            super.postChanges(TransactionEvent);
        public Date getAgrStartDt() {
            return (Date)getAttributeInternal(AGRSTARTDT);
         * Sets <code>value</code> as the attribute value for AgrStartDt.
         * @param value value to set the AgrStartDt
        public void setAgrStartDt(Date value) {
            setAttributeInternal(AGRSTARTDT, value);
        public String NewContractNo() {
               String amDef = "sms1405.sms1405Module";
               String config = "sms1405ModuleShared";
               String NewContract = null;                 
               ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
               ViewObjectImpl vo = (ViewObjectImpl) am.findViewObject("FAC1");
               // vo.setWhereClause("ParIdFac = 38844");
                vo.executeQuery();
                Row row = vo.first();
               Integer par_id = null;
               //oracle.jbo.domain.Date today = new oracle.jbo.domain.Date(oracle.jbo.domain.Date.getCurrentDate());
               oracle.jbo.domain.Date today = new oracle.jbo.domain.Date();
               //FACRowImpl res = new FACRowImpl();
               //res.setParIdFac(par_id);
               par_id = (Integer)row.getAttribute("ParIdFac");
               today = this.getAgrStartDt();
           return (String)callStoredFunction(VARCHAR2,
           "sms_fapp.get_contract_no(?,?)",
           new Object[]{par_id,today});
    }at the moment am geting this error
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:415)
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:477)
         at oracle.adf.model.binding.DCControlBinding.reportException(DCControlBinding.java:201)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.reportException(JUCtrlActionBinding.java:2007)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1659)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.NullPointerException
         at oracle.jbo.server.EntityImpl.getEntityCache(EntityImpl.java:4665)
         at oracle.jbo.server.EntityImpl.saveEventOrigTransAttrVals(EntityImpl.java:729)
         at oracle.jbo.server.EntityImpl.saveEventOrigAttrVals(EntityImpl.java:719)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1935)
         at sms1405.SMS_AGREEMENTSImpl.setContractNo(SMS_AGREEMENTSImpl.java:998)
         at sms1405.SMS_AGREEMENTSImpl.doDML(SMS_AGREEMENTSImpl.java:1628)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6751)
         at sms1405.SMS_AGREEMENTSImpl.postChanges(SMS_AGREEMENTSImpl.java:1645)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         ... 43 more
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.jbo.server.EntityImpl.getEntityCache(EntityImpl.java:4665)
         at oracle.jbo.server.EntityImpl.saveEventOrigTransAttrVals(EntityImpl.java:729)
         at oracle.jbo.server.EntityImpl.saveEventOrigAttrVals(EntityImpl.java:719)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1935)
         at sms1405.SMS_AGREEMENTSImpl.setContractNo(SMS_AGREEMENTSImpl.java:998)
         at sms1405.SMS_AGREEMENTSImpl.doDML(SMS_AGREEMENTSImpl.java:1628)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6751)
         at sms1405.SMS_AGREEMENTSImpl.postChanges(SMS_AGREEMENTSImpl.java:1645)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • How to control DE USB disk Automounts.

    Hi,
    Can someone please guide me as to how to 'control' Automounts by DE when we plug USB disk drives.
    I have KDE4 on my Arch system. When I connect a pen drive/USB HDD which is formatted as vfat/NTFS, the system(or KDE) 'Automounts' it in /media and I have read/write access to it. But if I use the same drive and format it as ext4, it wont be mounted as read/write for normal users but only for root.
    Now pen drives and USB HDD's are removable storage drives and hence are volatile and could not have a fixed mount point, so it cannot be mounted by putting an entry in fstab or could they?. And I need my USB HDD frequently, and manually mounting it through CLI everytime and working on it as root is a bad idea i guess.
    I am posting this because m confused as to how to control this Automount feature-What is the backend to it? Because I've read that HAL no longer takes care of it and that HAL will be deprecated soon, instead UDEV takes care of it. If that is the case then should I be concerned about polkit? Because that is what's the output provided by Dolphin(freedesktop.org policy prevented blah blah).
    Another thing is if HAL is still in use and Automounts my devices then is it independent or polkit is a part of it. Then, is using hal-easy an option or replacement to standard HAL. ??!!??
    I tried HAL archwiki and used the code to give a user permission to give rw access to automounted ext filesystems, but then nothing is mounted, it sings the same old freedesktop.org prevented bla blah song. And I think this is a question for all linuxes using Gnome and KDE in general.
    Any help is appreciated.

    If by 'ability to mount as user' you mean to mount it manually but read/write access to normal users then yes. But primarily I need automounting as user, also be able to give access to other users for read/write et filesystem automounts.
    Last edited by kapz (2009-11-17 01:12:56)

  • How to fix the Draggable element at its new location after every drag

    Hi All,
    I was trying something new with implementing the "Drag & Drop" control in UI5 .
    The whole functionality involved putting all the items in the list and ,making them draggable.
    After the user drags and drops the item to a new location , it becomes fixed at the position , until its dragged again.
    This is the following piece of code that i was working on :
    $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-core');
      $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-widget');
      $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-mouse');
      $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-draggable');
      $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-sortable');
      $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-droppable');
      var backlog = ["As a site visitor, I can read FAQs","As a site editor, I can maintain an FAQ section","As a site member, I can download the latest training material and methodology PDFs","As a visitor, I can download presentations, PDFs, etc. on Scrum that I can use"];
      backlog.sort();
      jQuery.sap.require("jquery.sap.strings"); //Load the plugin to use 'jQuery.sap.startsWithIgnoreCase'
    var oAdd_backlog = new sap.ui.commons.Button({text:"Add Backlog Item", tooltip:"Submit value",width:"160px"});
           var oHorizontal_Layout = new sap.ui.layout.HorizontalLayout("Layout1", {
            content: [oSearch, oAdd_backlog, oBacklog_status_filter ]
      //vertical layout
        // create a list box to show the backlog items
      //backlog list
      var backlog_list = new sap.ui.commons.ListBox("list1", {visibleItems:100, width : "60%"});
      // initialize the list
      updated_baklog_List(backlog_list);
      backlog_list.addStyleClass("list_css1");
    //drag and drop functionality
      var oOldOnAfterRender = backlog_list.onAfterRendering;
      backlog_list.onAfterRendering = function() {
      oOldOnAfterRender.apply(this);
      var $listBoxId = this.getId();
      $("#"+$listBoxId+"-list").sortable();
      //final layout
      var oVerticalLayout = new sap.ui.layout.VerticalLayout("Layout2", {
      content: [oHorizontal_Layout, backlog_list]
    Your inputs and new approaches are valuable to my research .

    You shouldn't have to do anything.
    Holdend is default and it ought to keep the value.
    I guess something else is happening which interferes.
    Are you stopping the animation?
    Starting another one ( which will effectively stop the first )?
    Or something.
    I did a very quick and dirty test changing a colour:
    <UserControl.Resources>
    <Storyboard x:Name="sb">
    <ColorAnimation
    Storyboard.TargetName="Button1BackgroundBrush"
    Storyboard.TargetProperty="Color"
    From="Red" To="Yellow" Duration="0:0:5"
    FillBehavior="HoldEnd"
    />
    </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
    <Button
    Content="This is a button">
    <Button.Background>
    <SolidColorBrush x:Name="Button1BackgroundBrush" Color="Red" />
    </Button.Background>
    </Button>
    </Grid>
    </UserControl>
    Code behind
    public MainPage()
    InitializeComponent();
    this.sb.Begin();
    It stays yellow.
    Hope that helps.
    Recent Technet articles:
    Property List Editing   ;  
    Dynamic XAML

Maybe you are looking for