Skip to Main Content

PeopleSoft Enterprise

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Hide Fluid Tile from a Homepage

user7976626Jun 5 2017 — edited Apr 23 2018

I search through the Knowledge Base looking for any information on hiding a fluid tile on a homepage if there is no reason to click the tile.  I am in Campus Solutions although I would imagine it could be any PeopleSoft environment.  I have a request to hide the tile (ghost or gray would work as well) if the student does not meet a criteria, say they have no balance in Student Finance.  I can't find what I need to do so the Student can't click the tile or see the tile.  If this is possible, where would the criteria go.  I have some ideas but not sure at this time.

Any Help would be appreciated.

Thanks in Advance.

Comments

Sasank Vemana

Navigate to:

PeopleTools > Portal > Structure and Content

- Root > Fluid Structure and Content > Fluid Homepages

- Find the Homepage that you are interested in and click on 'Edit'.

- Select the 'Tile Content' tab and remove the tiles that you don't need.

E.g.:

pastedImage_1.png

Sasank Vemana

If you want to change the Tile content/styling dynamically, then you could use the Tile Wizard API.

Understanding Application Class Tile Content

If you want to dynamically hide an existing (delivered) tile, then  you could write some custom CSS, target that tile on the Fluid Homepage and hide it using CSS.

https://pe0ples0ft.blogspot.com/2016/07/fluid-ui-custom-development-styling.html

https://pe0ples0ft.blogspot.com/2016/09/fluid-ui-styling-tiles-part-ii.html

user7976626

Sasank,

Thank you for the information, this is useful.  The situation above is on the homepage display.  The tile is setup to show a balance for the student if the student has a balance.  If there is no balance then we did not want the tile to even show on the homepage when the student logged in.

Is there someplace to put a bit of people code to check for a student balance then remove or hide the tile.  Like on a component Pre-Build event.  So when the system displays the HomePage, is there any way to stop a tile from displaying?

Thanks

CameronS

Please read @"Sasank Vemana"'s documentation - it is pretty clear what PeopleCode to use here (hint - he has linked directly to the relevant PeopleBook).

Sasank Vemana

@"user7976626"

I tried playing with some of the properties but the way it works, it may not be straightforward to target a certain tile and completely hide it. I used the same use-case as in the following post:

https://pe0ples0ft.blogspot.com/2017/04/fluid-ui-tile-wizard-api-part-3.html

I tried using the GroupletIDStyleClass to see if that can be used to toggle the display (as shown in below screenshot).

pastedImage_1.png

But it resulted in the following:

pastedImage_2.png

What you are looking for is actually hiding the ancestor div. So using the Tile Class as I originally suggested may not be an option.

Of course, you can always write some custom PeopleCode on the Fluid Landing Page somewhere to conditionally hide your tile but I have not tried it myself.

CameronS

Have you tried using javascript to dynamically hide these?

e.g. Set the class of the tile as mentioned, however this does not need anything in the CSS stylesheet.  Instead, add a script like (happy to use Sasank's style name ).

var x = document.getElementsByClassName("sv_hide");

var i;

for (i = 0; i < x.length; i++) {

    x[i].parentElement.parentElement.parentElement.parentElement.style.display = "none";

}

I haven't tested this - don't currently have fluid.  Therefore, I'm not sure that I have included enough ".parentElements".  You'll probably want to include it within an onload() event processor.

CameronS

I've just had another thought on this.

Is it possible to use a dynamic role (assigned to users based with balance > 0) and secure the tile to a specific permission list that only exists in this role?

Divesh Gupta

Hi,

We had exact same requirement. I developed a framework that wouldn't require any customization and uses Event Mapping Framework to hide the tiles based on any business criteria.

A simple way is to do the following at the end of PT_LANDINGPAGE.PostBuild component peoplecode:

&rs_lp = GetLevel0()(1).GetRowset(Scroll.PTNUI_LP_PAGE); /* Landing Page Rowset*/

 

   For &i = 1 To &rs_lp.ActiveRowCount /* Loop through Landing Pages */

      &rs_tile = &rs_lp(&i).GetRowset(Scroll.PTNUI_LAND_REC); /* Tiles Rowset */

    

      For &j = &rs_tile.ActiveRowCount To 1 Step - 1 /* Loop through Tiles on each Landing Page */

       

         &rec_tile = &rs_tile(&j).PTNUI_LAND_REC;

         &LP_Label = &rs_lp(&i).PTNUI_LP_PAGE.PTNUI_LP_LABEL.Value;

         &TILE_Title = &rec_tile.TITLE.Value;

            If 'Landing Page - Label' = &LP_Label And & 'Tile to Hide - label' = &TILE_Title Then

                 if (Your other business condition) Then

                      If WANT_TO_HIDE = "Y" Then

                                    &rs_tile(&j).Visible = False; /* Hide tile row if configured to be hidden */

                      Else

                         If WANT_TO_DISABLE = "Y" Then

                                   &rs_tile(&j).PTNUI_LAND_REC.GROUPLET.SetGroupletActionUrl(""); /* Disable tile row if configured to be disabled */

                          End-If;

                       End-If;

                 End-If;

            End-If;

     End-For;

   End-For;

As I said, you would be better off using a framework that can be configured to run a app package dynamically to dynamically call an app package for (Your other business condition)  and use EMF to avoid any unnecessary customization

Sasank Vemana

Great idea to use EMF!

kmoura

Hi Divesh,

I tried this solution and the tile was indeed hidden, but it also broke the navigation header (the formatting is all out):

pastedImage_0.png

I placed the code against Fluid Structure Content > Fluid PeopleTools > Fluid PeopleTools Framework > Fluid Homepage: Post Build-Post Process.

Any ideas about what I may have done wrong ? Or another way show/hide a tile conditionally ?

Divesh Gupta

I am on CS9.2 PUM 6. I placed the EMF at Fluid Structure Content > Fluid Pages > PeopleSoft Applications > Fluid Home. But I did have similar issue. And not able to recall what was

the exact issue but the catch was to catch all errors. So put your code in Try-Catch block. You may need to find out what is throwing the error and fix it but always put try catch for these tricky things

kmoura

Thank you so much for the prompt reply. I will try that.

Divesh Gupta

Out of curiosity, was your issue fixed?

kmoura

No, unfortunately try-catch didn't fix it. Guess we'll just have to wait for Oracle to release some 'official' way to achieve this.

There seems to be enough interest out there to warrant a delivered solution I would think.

Jim Marion ACE ♠

@"user10892434", Based on your screenshot, I am going to assume you are using a PT version less than 8.55.15? EMF breaks Fluid UI on earlier versions of PT. Some Events work, as long as you don't use AddStylesheet or AddJavaScript, but most don't. Better to avoid EMF prior to 8.55.15. I have had great success with EMF on Fluid post 8.55.15.

@"Divesh Gupta", since tiles represent CREFs, what do you think about using CREF attributes to identify hide/show conditions?

Daniel JW

Hello,

In our organization, we use dynamic role assignment to show or hide a given tile.  If the tile is mapped to a component, then the component must be assigned to specific permission list(s), and the perm. list(s) is/are assigned to role(s).

We also have sign-on peoplecode to control and assign dynamic role assignment based on a given set of eligibility. 

Sign-on peoplecode was set by our PeopleSoft admin, which invoke a particular custom funclib, and in that funclib, we call Oracle PL/SQL which does the following:

1. For a given OPRID who login, check if that user is eligible for getting a specific role.

2. If the user is eligible, then a role is inserted into PSROLEUSER with an indicator of dynamic role in DYNAMIC_SW column.

3. And also update the version of the profile along with PSVERSION and PSLOCK tables, the updates statements are the following:

    select version + 1

      into V_UPM_PSVERSION

      from psversion

      where objecttypename = 'UPM'

      for update of version;

    update psversion

      set version = V_UPM_PSVERSION

      where objecttypename = 'UPM';

    update pslock

      set version = V_UPM_PSVERSION

      where objecttypename = 'UPM';

    update psversion

      set version = version + 1

      where objecttypename = 'SYS';

    update psoprdefn

      set version      = V_UPM_PSVERSION

        , LASTUPDDTTM  = SYSDATE

        , LASTUPDOPRID = 'DYNAMIC'

      where OPRID      = v_oprid;

4. It also check, if the dynamic role was already there, and if the user is still eligible, then it does not need to delete and reinsert the dynamic role.

Now, because the eligibled user is having the dynamic role, therefore the tile is available, and vice versa, the not-eligibled user is not getting the dynamic role, therefore, the tile is not appearing on the homepage.

Hope that helps.

Regards,

Daniel

gmorphis

Hi, I'm relatively new to Peopletools and am trying to accomplish the original poster's request on our system. What is meant by: "I placed the EMF at Fluid Structure Content > Fluid Pages > PeopleSoft Applications > Fluid Home" ?

Where do you put the code? That path is the PIA, I went there but don't see a spot to put the code? I thought maybe it was in App Designer somewhere and I don't think it's there either. Help?

Jim Marion ACE ♠

EMF refers to Event Mapping Framework. EMF code is written in Application Classes in Application Designer and attached to Content references through service definitions in PeopleTools > Portal > Related Content Service. The path Fluid Structure and Content > Fluid Pages > PeopleSoft Applications > Fluid Home refers to the content reference to which the EMF application class service is attached. Just FYI, though, I believe the correct path for EMF for homepages would be Fluid Structure Content > Fluid PeopleTools > Fluid PeopleTools Framework > Fluid Homepage

gmorphis

Thanks Jim. Clearly I need more training, here's to hoping for a training budget this year.

Jim Marion ACE ♠

@"gmorphis" haha don't feel bad. The topic of this thread is actually quite advanced, but covered in my PeopleTools delta course.

Divesh Gupta

Hi Jim,

Thanks for the suggestion about the CREF attributes. Could you please elaborate on how we can use it to hide/unhide tiles? All I could find at the time was that there was a read only IsVisible attribute and was not sure it could be used?

Thanks

Divesh Gupta

Hi gmorphis,

Please let me know if you still need help with this. Sorry for the late reply, I was busy with some critical project work.

Jim Marion ACE ♠

I apologize. There is no delivered attribute for this. You would need still need to write Event Mapping code as described by others, but your code could evaluate the CREF attribute to determine if an item should be shown or hidden.

Jim Marion ACE ♠

I apologize. There is no delivered attribute for this. You would need still need to write Event Mapping code as described by others, but your code could evaluate the CREF attribute to determine if an item should be shown or hidden.

1 - 24
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 21 2018
Added on Jun 5 2017
24 comments
4,681 views