CA Service Management

Expand all | Collapse all

Align Properties list from right to left in request

  • 1.  Align Properties list from right to left in request

    Posted Nov 13, 2017 04:06 AM

    Hi guys;

     

    i have a properties attached to request area that written in arabic language so when the end user select the request area it list the properties in arabic but the order want to be aligned. He have a list of properties as the fillowing order “property name in arabic” at left then the “value” fiels on the right which confusing the customer

     

    any suggestion on this



  • 2.  Re: Align Properties list from right to left in request

    Posted Nov 13, 2017 08:25 AM

    Hi Mohamed,

    If I am understanding you correctly, that is just the way the properties form is aligned by default, regardless of the language used.   I am not sure that this would be easily changed, but you can certainly try editing the form in WSP to see if you are able to change it. My guess is that it may be done in javascript and not HTMPL at that level, but I havent played around with that form much to be honest.

    Anyone else out there have some ideas for Mohamed on this one?

    Jon



  • 3.  Re: Align Properties list from right to left in request

    Posted Nov 13, 2017 02:54 PM

    Hello Jon;

     

    Can you please advice with the forum that i need to check to find the workaround.

     

    Mohamed



  • 4.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 13, 2017 10:25 AM

    Mohamed, currently SDM displays the property using macro dtlWriteproperty:

    <PDM_MACRO name=dtlWriteproperty label="propx.label" make_required="propx.required" propnum=x sample="propx.sample" validation_rule=propx.validation_rule.id validation_type="propx.validation_type" value="propx.value">

    so in order to change the display order you would need to rewrite this macro. I don't think this is a good idea as

    this macro is internally saved in mdb so even somehow you modify it then next time you install a patch or upgrade

    then it will be gone. I think may be you can consider user education instead of modify this macro. Thanks _Chi



  • 5.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 13, 2017 03:07 PM

    further looked into it and found that the macro calls detailWriteProperty() js function. This function is in detail_forms.js file so you could try to modify the function there. If you go this path, please do this on a test install first and follow the standard js customization practice. But again, you would still face maintenance issue when install patch or upgrade.



  • 6.  Re: Align Properties list from right to left in request

    Posted Nov 14, 2017 03:51 AM

    Chi, kindly advice with the file name that contain <PDM_MACRO name=dtlWriteproperty label="propx.label" make_required="propx.required" propnum=x sample="propx.sample" validation_rule=propx.validation_rule.id validation_type="propx.validation_type" value="propx.value"> as i cant find it in the detail_form.js



  • 7.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 14, 2017 09:34 AM

    Haytham, you should be able to see detailWriteProperty() in detail_form.js file. This is the function that is called by

    dtlWriteproperty macro so eventually, changes are pretty much with detailWriteProperty() in detail_form.js. Thanks _Chi



  • 8.  Re: Align Properties list from right to left in request

    Posted Nov 14, 2017 04:17 AM

    Guys iam attaching a screenshot for my case, as you can see i want to get the arabic name into the right of the values to the 



  • 9.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 14, 2017 10:04 AM

    Hey, you didn't mentioned employee web interface(lol)...in that case, take a look at cst_cat.js file in the scripts folder. It has:

    out += "<tr>" +
    "<td class='" + (this.properties[e].required == true ? "required" : "") + "labeltext'>" +
    this.properties[e].label +
    "</td>" +
    "<td><input type='text' name='SET.prop" + String(e) + ".value'></td>" +
    "<td>" + this.properties[e].sample + "</td>" +
    "</tr>";

    and now you can change the order label, value, sample by modify this part to sample, value, label as

    out += "<tr>" +
    "<td><input type='text' name='SET.prop" + String(e) + ".value'></td>" +
    "<td>" + this.properties[e].sample + "</td>" +

    "<td class='" + (this.properties[e].required == true ? "required" : "") + "labeltext'>" +
    this.properties[e].label +
    "</td>" +
    "</tr>";

    Please follow the standard js customization practice when you do this. Thanks _Chi



  • 10.  Re: Align Properties list from right to left in request

    Posted Nov 14, 2017 10:06 AM

    Thanks Chi, Appreciate if you can tell me what is the standard js Customization practice as it my first time



  • 11.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 14, 2017 10:26 AM

    Mohamed, please follow these steps

    1. copy sitemods.js file from sdm-install-root-folder\bopcfg\www\wwwroot\scripts to sdm-install-root-folder\site\mods\www\wwwroot\scripts

    2. open sitemods.js in sdm-install-root-folder\site\mods\www\wwwroot\scripts folder and copy the whole function script 

        of function CategorySink(factory, form) {...} and modify the statements here. save the changes.
    3. recycle sdm

    4. clear the browser cache and test

    Thanks _Chi



  • 12.  Re: Align Properties list from right to left in request

    Posted Nov 15, 2017 04:22 AM

    hi Chi;

     

    i tried your suggestion by editing the following file: cst_cat on the following path: site\mods\www\wwwroot\scripts

     

    i recycled SDM Services, Cleared the cash restarted the server but the problem still the same

     

    plz advice



  • 13.  Re: Align Properties list from right to left in request

    Posted Nov 15, 2017 04:23 AM

    this is my edit as per your suggest:

     

    CategorySink.prototype.showProperties = function()
    {
    var e;
    if (_browser.supportsLayers)
    {
    var layer = document.layers["prop_layer"];

    var out = "<form name='prop_form'><table>";

    for (e = 0; e < this.properties.length; e++)
    out += "<tr>" +
    "<td><input type='text' name='SET.prop" + String(e) + ".value'></td>" +
    "<td>" + this.properties[e].sample + "</td>" +
    "<td class='" + (this.properties[e].required == true ? "required" : "") + "labeltext'>" +
    this.properties[e].label +
    "</td>" +
    "</tr>";
    out += "</table></form>";



  • 14.  Re: Align Properties list from right to left in request

    Posted Nov 15, 2017 05:59 AM

    HI Chi;

     

    quick update after copying the below:

    out += "<tr>" +
    "<td><input type='text' name='SET.prop" + String(e) + ".value'></td>" +
    "<td>" + this.properties[e].sample + "</td>" +

    "<td class='" + (this.properties[e].required == true ? "required" : "") + "labeltext'>" +
    this.properties[e].label +
    "</td>" +
    "</tr>";

    in the cst_cat.js on the following path:

    bopcfg\www\wwwroot\scripts

     

    The label has become to the right on the value as attached; but the label is acting as example as attached.

     

    Kindly Advice?



  • 15.  Re: Align Properties list from right to left in request

    Broadcom Employee
    Posted Nov 15, 2017 04:45 PM

    Sorry for the late reply...have been busy on things...

    I took a look again in that file...can you change

    var txt = "(i.e. " + String(prop.sample) + ")";

    to

    var txt = "   " + String(prop.label);

    and see what happens?



  • 16.  Re: Align Properties list from right to left in request
    Best Answer

    Posted Nov 14, 2017 04:36 AM

    Hi,

     

    regarding to HTML attributes you can use attr named dir, HTML5 fully compatible browsers like Chrome and Firefox can work with dir="auto", which will change text alignment depending on input language but this will not work for IE (including Edge) what is not inappropriate for most corporatative standarts.

    My suggestion is to apply attribute dir="rtl"  using jquery after form loads for specified inputs. More about dir you can found here: 

    HTML5, dir=auto: Summarized test results 

    dir - HTML | MDN 

    Hope this helps.

     

    Regards,

    cdtj