Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Changing ComboBoxItem PickListMenu in load_skin.js

    Hi Isomorphic,

    I'm still on this one
    I saw ComboBoxItem.setPickListConstructor() and think it is possible to change the 2nd rule only for this ComboBoxItem using a PickListMenu with different setBodyStyleName().
    But how to customize the "scrollingMenu"-class? Is this possible?
    from this thread. I started a new post as the other thread now has a bug report and I can provide a testcase here as well.

    I decided to do a deep (?) dive into SmartClient and am stuck now where everything *should* work, but it does not.
    I was able to create my own JS class and use it via:
    load_skin.js addition (above "if (isc.setCurrentSkin) isc.setCurrentSkin("Simplicity");"):
    Code:
            isc.ClassFactory.defineClass("SearchPickListMenu", "PickListMenu").addProperties({
                bodyStyleName: "searchPickListMenuBody",
                bodyStyle: "searchPickListMenuBody"
            });
    and in my ComboBoxItem: setPickListConstructor("SearchPickListMenu");

    This now result in this generated code:
    Click image for larger version

Name:	ChangePickListMenuBody.png
Views:	55
Size:	83.4 KB
ID:	238080

    As you can see, my class SearchPickListMenu is used. You can also see that the "pickListMenuBody" was not replaced. The easiest assumption is that the properties I set (I tried "bodyStyleName" and "bodyStyle") are not the right ones. I also tried this in JS after the already mentioned addition, but it did not change anything:
    Code:
    isc.SearchPickListMenu.setProperties({
                bodyStyleName: "searchPickListMenuBody",
                bodyStyle: "searchPickListMenuBody"
            });
    Should this work?
    How can I also modify scrollingMenu?

    The testcase is the one from here plus the mentioned additions.
    I use SmartGwtEENoScriptNoTheme in my BuiltInDs.gwt.xml and load the skin manually. This is my BuiltInDs.html:
    Code:
    <!DOCTYPE html>
    <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>BuiltInDS</title>
            <script> var isomorphicDir = "builtinds/sc/"; </script>
      </head>
    
      <body>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_Core.js"></script>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_Foundation.js" ></script>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_Containers.js"></script>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_Grids.js"></script>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_Forms.js"></script>
            <script type="text/javascript" src="builtinds/sc/modules/ISC_DataBinding.js"></script>
    
        <script src="builtinds/sc/DataSourceLoader?dataSource=supplyItem,animals,employees"></script>
        
        <script type="text/javascript" src="builtinds/sc/skins/Simplicity/load_skin.js"></script>
        <script type="text/javascript" language="javascript" src="builtinds/builtinds.nocache.js"></script>
        <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
      </body>
    </html>
    Thank you & Best regards
    Blama

    #2
    Hi Isomorphic,

    do you have any pointers on this one?

    Best regards
    Blama

    Comment


      #3
      We've made a change to address this issue. Please try the next nightly build, dated May 25.

      You can use the following code to use your custom styles:

      Code:
              isc.ClassFactory.defineClass("SearchPickListMenu", "PickListMenu").addProperties({
                  bodyStyleName: "searchPickListMenuBody"
                  styleName: "searchPickListMenu"
              });
      Regards
      Isomorphic Software

      Comment


        #4
        Hi Isomorphic,

        I retested using v10.1p_2016-05-25 and it is working as expected. I did think it would have been a usage error on my part, though :)

        Thank you for fixing and once again: impressive.

        Best regards
        Blama

        Comment

        Working...
        X