Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-10669

topGroup should only be displayed when there are items to show

    Details

    • Similar issues:
      KULRICE-9693topGroup AND View header needs to display updated information (ie. when a page loads, not just the view)
      KULRICE-7130Asterisk should not be displayed for read only fields
      KULRICE-10872Improve Read-Only Disclosure Behavior
      KULRICE-1163multiple value lookups - do not show the "return" buttons until the result set displays.
      KULRICE-10911Lookup: Hide page message if only number of results message is displayed
      KULRICE-10264add line always displayed when using datatables w/ server paging
      KULRICE-8888Show recent items (of similar type)
      KULRICE-1900Problems deleting collection items in maintenance documents
      KULRICE-10935Datatable pagination should not appear if there aren't enough items to paginate
      KULRICE-10882Read only property on collection items gets overridden
    • Rice Module:
      KRAD
    • KRAD Feature Area:
      UIF Component
    • Application Requirement:
      KS
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      We are using topGroup to show some context related information in the page.

      The current relaease of RICE(2.3) draws the topGroup when the view is loaded and on each page requests it refreshes the topGroup with the original items in the topGroup.

      This is causing some problems for us.

      1- We want the topGroup to show only when there are items to show in the topGroup. In other words topGroup should be removed when there is nothing to show in the topGorp

      2- We would like to have a hook so that we can manipulate the topGroup as the context changes page to page. By context I don't mean jsut the value of some properties in the topGroup changing. From page to page we may want to remove some fields or add some fields to the topGroup

      The following is an example to illustrate this:

      We color the topGroup's left border depending on what day of the year we are in. We use a gradient which is defined of some color to reflect the days of the year. Then on document ready we call a JS fuction to retrieve the color for a given day(the current day).
      Then we change the left-border color accordingly.
      This is okay for when the view is loaded. However when the page is loaded in the view (i.e. on page request) this color is redrawn. This is done in krad.initialize.js in function setupPage

      <code>
      setupPage(validate){

      ...

      // update the top group per page
      var topGroupUpdate = jQuery("#" + kradVariables.TOP_GROUP_UPDATE).find("> div").detach();
      if (topGroupUpdate.length && !initialViewLoad)

      { jQuery("#Uif-TopGroupWrapper > div").replaceWith(topGroupUpdate); }

      ...

      }

      </code>

      We have overriden the setupPage just for the purpose of this Jira but we are not using it. We have some other workaround we can use for now.

      <code>
      setupPage(validate){

      ...

      // update the top group per page
      var topGroupUpdate = jQuery("#" + kradVariables.TOP_GROUP_UPDATE).find("> div").detach();
      if (topGroupUpdate.length && !initialViewLoad) {
      jQuery("#Uif-TopGroupWrapper > div").replaceWith(topGroupUpdate);
      var onLoadScript = jQuery("#Uif-TopGroupWrapper > div").data("oncomponentload");
      if (onLoadScript != undefined && onLoadScript.length)

      { eval(onLoadScript); }

      }
      ...

      }
      </code>

      In the xml file we have added a datAttribute as follows:
      <code>
      <property name="dataAttributes">
      <map merge="true">
      <entry key="oncomponentload" value="setSeasonalColor('KS-CourseOffering-ContextBar', @

      {#dp.contextBar.termDayOfYear}, '@{#ConfigProperties['application.url']}');"/>
      </map>
      </property>
      </code>
      This gives us a hook to manipulate the topGroup as the contect changes.

      I am not recommending to use this to add a hook. This is merely a suggestion. You could easily add a property to do the same thing. for example:

      <code>
      <property name="onTopGroupLoad" value="setSeasonalColor('KS-CourseOffering-ContextBar', @{#dp.contextBar.termDayOfYear}

      , '@

      {#ConfigProperties['application.url']}

      ');"/>
      </code>

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Hossein Aliabadi (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Structure Helper Panel