Thursday 17 January 2013

Mapping & Finishing customization (Part – 4)



This is our final steps in this customization. Here we are going to Map our custom physical render & Physical Model.  We are validating the EmailAddress field in contact form applet.
We are mapping our Key. Hope you remember our key, that we used to register.


So in tools go to contact  form applet.
Expand Applet user property
1.       Create a new user property Name -> Physical_Render and Render Key as its value (Shown in fig)
Another user property Physical_Model and Model key as its  value.
Compile Object.
2.       Now Copy our code (Physical Render & Physical model )to SCRIPTS->Siebel->custom folder
3.       Open OBJECTS Folder. There you can see “manifest_extensions.map”. Open  this in a notepad or wordpad.  Map our Key with applet.

4.       Open “custom_manifest.xml” in the same folder.
Find  <PLATFORM_KEY_SPECIFIC>
                                <PLATFORM Name="Desktop">
Here we map our physical render
Open a new node and write our file name as shown in fig

Find <KEY_COMMON>
Here we map our physical Model
And map our new key as shown in fig.


Now we finished everything. Make sure that you compiled applet. Clear your browser cache.  And launch application and change your email. Hope everything works well.

38 comments :

  1. hello, I tried your code as well as others and I have a problem. when I add the mapping file 'manifest_extensions.map' I only see the applet bar.
    example:
    [Presentation_Model]
    Contact List Applet = ValidatePModel
    [Physical_Renderer]
    Contact List Applet = ValidatePRenderer

    can you help me?

    ReplyDelete
    Replies
    1. "I only see the applet bar." you mean when the page rendered you only see Applet head? . If so, there is some problem in your code. (PM/PR)
      Please let me know, which code you used..or send me that code.

      Delete
  2. Hi Prasanth,

    I tried you code the email validation doesn't work and I get the below error in AccNavigationPhyRenderer.js file when I tried debugging in Google Chrome.

    Uncaught TypeError: Object [object Object] has no method 'tabs'

    Can you please help?

    Thanks in advance.

    ReplyDelete
  3. I tried you code, the email validation doesn't work and I get the below error in AccNavigationPhyRenderer.js file when I tried debugging in Google Chrome.

    Uncaught TypeError: Object [object Object] has no method 'tabs'

    Can you please help?

    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi,
      Please send me the code, that you wrote. The code provided in this example is tested and is working.I will help you to debug this. Please let me know about the code in detail.

      Delete
  4. Hi Prasanth,

    Thank you for quick response.

    Below is the code and configuration details

    validatePM.js

    if( typeof( SiebelAppFacade.ValidatePM ) === "undefined" ){

    SiebelJS.Namespace( "SiebelAppFacade.ValidatePM" );
    SiebelApp.S_App.RegisterConstructorAgainstKey( "ValidatePModel","SiebelAppFacade.ValidatePM" );

    SiebelAppFacade.ValidatePM = ( function(){
    function ValidatePM( proxy ){
    SiebelAppFacade.ValidatePM.superclass.constructor.call( this, proxy);
    }

    SiebelJS.Extend( ValidatePM, SiebelAppFacade.PresentationModel );

    ValidatePM.prototype.Init = function(){
    SiebelAppFacade.ValidatePM.superclass.Init.call( this );
    this.AddProperty( "isEmailSet", "" );
    this.AddMethod( "FieldChange", OnFieldChange, { sequence : false, scope: this } );
    };

    function OnFieldChange( control, value ){
    if( control.GetName() === "EmailAddress" ){
    this.SetProperty( "isEmailSet", ( value ? true: false ) );
    }
    }
    return ValidatePM;
    }());
    }

    ------------------------------------------------
    validatePR.js

    if( typeof( SiebelAppFacade.ValidatePR ) === "undefined" ){
    SiebelJS.Namespace( "SiebelAppFacade.ValidatePR" );

    SiebelApp.S_App.RegisterConstructorAgainstKey( "ValidatePRenderer", "SiebelAppFacade.ValidatePR" );

    SiebelAppFacade.ValidatePR = ( function(){


    function ValidatePR( pm ){
    SiebelAppFacade.ValidatePR.superclass.constructor.call( this, pm );
    this.GetPM().AttachPMBinding( "isEmailSet", validateEmail, { scope: this });
    }

    SiebelJS.Extend( ValidatePR, SiebelAppFacade.PhysicalRenderer );

    function validateEmail() {
    alert("going to validate");
    var controls = this.GetPM().Get( "GetControls" );
    var cntrl = controls[ "EmailAddress" ];
    var emailcntrl = cntrl.GetInputName();
    var email = $('input[name="'+emailcntrl+'"]').val();
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
    if( !emailReg.test( email ) ) {
    alert("Please enter a valid Email");
    return false;
    } else {
    alert("This is a valid Email");
    return true;
    }
    }

    return ValidatePR;
    }());
    }

    ------------------------------------------------
    custom_manifest.xml



    siebel/applet.js
    siebel/pmodel.js
    siebel/custom/validatePM.js






    siebel/applet.js
    siebel/pmodel.js
    siebel/custom/validatePM.js




    -----------------------------------------------
    manifest_extensions.map

    [Presentation_Model]
    Contact Form Applet = ValidatePModel


    [Physical_Renderer]
    Contact Form Applet = ValidatePRenderer

    ------------------------------------------------
    Contact Form Applet user property

    Name Value

    Physical_Renderer ValidatePRenderer
    Presentation_Model ValidatePModel

    Thanks a lot

    ReplyDelete
    Replies
    1. Hi,
      Please make sure that you have a control "EmailAddress" in your applet.
      Make sure that you put the custom_manifest.xml is properly prepared.
      Give an alert in PM & PR to make sure that both files are loaded. You can check this using f12 and search file_name.js

      "lets debugg this"
      Let me know your name. :)

      Delete
  5. Hi Prasanth,

    Thank you for quick response.

    The steps suggested by you have already been tried. However, no luck.

    Can you please provide me your email id so that I can send you the actual files/screenshots.

    Thank you.

    Regards,
    V G Nayak

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  6. Hi Prasanth,

    Thanks for providing your mail id.

    I have sent the files and screenshots to the email id provided.

    Thanks for your help in resolving the issue.

    Regards,
    V G Nayak

    ReplyDelete
  7. Hello Prasanth,

    By any chance did you happen to check the files I have sent?

    Thanks & Regards,
    V G Nayak

    ReplyDelete
  8. Hello Prasanth,

    Now it is working. I am still not able to understand what was causing that error.

    Thank you very much for your help. Expecting more articles from you on Siebel Open UI.

    Regards,
    V G Nayak

    ReplyDelete
  9. Hi Nayak,
    What was the fix for the issue?

    Hi Prashant,
    I have started working on Open UI recently. I would like some examples on List Applets. I'm facing an issue with List Applets. When I host the application I dont get the list for the applet (Scenario Example: In the contacts page, when I say "All Contacts" the contact list does not appear. But the Menu bar comes without the record. There is some issue with my PR, PM or the Custom_manifest file. But not sure wat it is. I'm referencing: ListApplet and Listpmodel JS files for PM and jqgridrenderer, jqgrid-ext, jquery.jqGrid.min.js, grid.locale-en.js for PR in Custom_Manifest file.)
    Pls help me.

    ReplyDelete
    Replies
    1. Yea!! May be some issues with PR.
      Happy to help you.. Need more details.

      Delete
    2. can u share me ur email id?

      -Anita

      Delete
    3. prasanths1989mvk@gmail.com

      Delete
    4. Prashanth,
      I figured out an work around for the issue. Thanks for your time.

      Delete
    5. Can you please share the fix for that issue.
      I am extending JQGridRenderer itself in the PR (as commented below)

      Delete
  10. Anybody has a fix for this issue

    ReplyDelete
  11. Hi Prasanth,
    can u help me on the same issue(if i done any customizations for list applet only header part is getting loaded data is not getting loaded)

    Thanks in advance
    Venkat..

    ReplyDelete
    Replies
    1. Your custom code have some error. So the remaining js that helps to load data into list applet will not work. To trouble shoot, PR/PM code is necessary

      Delete
  12. All,

    Issue of List applet not getting loaded with above PM and PR is these are for form applets and not list applet. If you would want to use with list applets change the following line in your PM and PR:
    PM:
    SiebelJS.Extend(SISPM, SiebelAppFacade.PresentationModel);
    with
    SiebelJS.Extend(SISPM, SiebelAppFacade.ListPresentationModel);

    PR:
    SiebelJS.Extend(SISPR, SiebelAppFacade.PhysicalRenderer);
    with
    SiebelJS.Extend(SISPR, SiebelAppFacade.JQGridRenderer);


    --Pankaj

    ReplyDelete
  13. For above issue i.e only header getting displayed for list applet and no data
    In PR:
    Replace
    SiebelJS.Extend(SISPR, SiebelAppFacade.PhysicalRenderer);
    with
    SiebelJS.Extend(SISPR, SiebelAppFacade.JQGridRenderer);

    IN PM:

    Replace
    SiebelJS.Extend(SISPM, SiebelAppFacade.PresentationModel);
    with
    SiebelJS.Extend(SISPM, SiebelAppFacade.ListPresentationModel);

    and do add all the necessary List applet files in custom_manifest file.

    ReplyDelete
    Replies
    1. Thank you Very much Pankaj for sharing this.

      Delete
  14. Hello Prasanth,

    I have a PR which contains the logic of validating an email along with many other logic.I have to re-use this(email) logic for email fields in several other applets. Is it possible? if yes it would be a great help if you could explain it with an example.

    Thanks in advance,
    V G Nayak

    ReplyDelete
  15. Hi Nayak,
    I think we can publish our libraries with global scope and we can reuse them. For example, Siebel open ui adds jQuery Library in global Scope, and uses its functions in PM,PR etc.. Like wise once you write validation script you can use it throughout application.

    ReplyDelete
  16. Hi Prasanth,

    We have a requirement in our project where in we would like to render the list applet as a form. By this what i mean is every record in the list applet must get rendered as a form with each record one below the other. Can you please let me know how should i go about configuring this requirement.

    Also since i am new to open ui can you please tell me which is the .js file that is used to render the list applet OOB.

    Thanks,
    Sukhesh

    ReplyDelete
    Replies
    1. List applets are generally showing the data in Data table(jQGrid).It uses "table" tags in HTML, and difficult to alter "table" tags. So a CSS expert can do something. Anyway nothing is impossible. Play with CSS and bring changes. The javascript level changes is not recommended.

      I didn't get your second question.

      Delete
    2. Hi,

      Thanks for the update. My second question what what is the physical renderer file used to render the list applet in siebel open ui out of the box without any customization.

      Delete
  17. Hi,

    Has anyone found the fix for this issue? I am not able to get any alerts for the email validation.

    ReplyDelete
    Replies
    1. Hi,
      Please include your name in comment, otherwise very difficult to track your old comments.

      Delete
  18. Hi Prasanth,

    We have installed Open UI .Under particular view, list applet and form applet are there referring to same BC. On navigating to the view, I can see the data in list applet but form applet is empty. No data in any of the control. Also, except 'menu' all the other controls are missing. Kindly guide me where I need to check.

    Regards,
    Madhu

    ReplyDelete
  19. Hi Prasanth,

    I followed above procedure. after compiling i am unable to see the contact list applet.

    please help to solve the issue.

    Thanks
    Nagesh.P

    ReplyDelete
    Replies
    1. HI Nagesh,
      For List Applet, We need to something else(jqgrindrenderer), you can try this example with Form Applet

      Delete
  20. Hi Can you help me how to get the Profile Attribute value in PM level?

    ReplyDelete
  21. Hi,Can anyone please help me how to get the Profile Attribute at PM level with code example.

    ReplyDelete
    Replies
    1. SiebelAppFacade.S_App.GetProfileAttr("name") & Same for Set with two arguments, same as in eScript but instead of TheApplication(), use SiebelAppFacade.S_App

      Delete