Rollbase: Design This Page List's

Posted by MarkT on 25-May-2015 14:56

Hi All,

I'm finding a fair amount of the screens I'm designing in Rollbase are single records - but to get to the record view I'm having to click through a list of one record first.  Does anyone have a strategy for going straight to the view in these cases?

Thanks,

Mark

Posted by Thierry Ciot on 29-May-2015 21:09
Mark,
 
I just tried this on my environment and it works well.  The key principles:

è You create some html elements with well known IDs to easily access them via jquery

è Javascript makes Ajax call to retrieve the values based on objectId and list of fields you need to retrieve

è On Ajax completion callback, use jquery to find the html elements to which you want to dynamically add the retrieved values

 
I hope this works well for you too, the details are below.  I’m curious though on the use case.  Why do you have so many “singletons”?
 
Thierry.
 
Here are the steps:

1)      Take note of:

a.      The object id of your object (click on your object and use the id at the end of the url, for example: main.jsp?pageId=41601&tabId=41689&id=43901

b.      The link to the edit page

2)      Create a generic page and add a section

3)      In section add html component (See content below)

4)      In section add javascript component with this (See content below)

 

 

HTML for step 3: replace the link with your own link to edit object
 
<h3>This is one Record from Object1 List</h3>
<p>Int 1 Field: <span id="item1Id"></span> <br /> Int 2 Field: <span id="item2Id"></span></p>
<p>&nbsp;</p>
<p><a href="http://localhost:8080/prod1/m/main.jsp?id=41739&amp;pageId=40262&amp;view">Edit</a></p>
<p>&nbsp;</p>
 
JavaScript for Step 4: replace with your actual objectId and your fields of interest.
<script>
  function my_callback(objName, objId, values) {
    var int1 = values['intFieldOne'];
    var int2 = values['intFieldTwo'];
    console.log("int1: " + int1 + " - int2: "+int2);
    $("#item1Id").text(int1);
               $("#item2Id").text(int2);                       
  }
     
//  debugger;
  var x = rbf_getFields("Object1", 41739, "intFieldOne,intFieldTwo", my_callback);
  console.log("Ajax call made");
</script>
 
Here is the object on my system in the grid: it’s called o1 and has 2 int fields
 
 
Here the generic page output:
 
 
[collapse]
From: Thierry Ciot
Sent: Friday, May 29, 2015 1:26 PM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Sure, I will provide you with an example later on. I have a couple of things to attend to.
 
[collapse]
From: MarkT [mailto:bounce-MarkT@community.progress.com]
Sent: Friday, May 29, 2015 12:10 PM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by MarkT

Hi tciot,

Do you have any examples on how you'd render a generic page with the data you get back from rbf_getFields?  I'm used to the {!fieldName} replacements - but obviously you wouldn't be able to do that sort of thing in this case.  Would I need to write some JQuery that dynamically built up the screen - or something along those lines?

Thanks!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

All Replies

Posted by coates_aj on 29-May-2015 06:33

Hi all,

Does anyone have any ideas how this type of task might be approached? I also have a tab with a list that only ever contains 1 record. Currently the user would click the tab, then click the record to view. Ideally I would like to implement a solution where clicking the tab displays the record in view mode.

I have attempted to do a few things with limited success. I have tried putting a script into the list screen to redirect to the view page, but this gave an annoying flashing effect. I have also tried to use some JQuery in the application header to change the link on my tab to link directly to the view page, however I couldn't reliably select the tab as there does not seems to be a sensible way to identify the tab as there are no ids or names associated with any of the tab elements.

I welcome any ideas on how to solve this.

Thanks

Posted by Thierry Ciot on 29-May-2015 08:21
I don’t know how you would do what you are describing below, but I may have an indirect way (see below).
The list of records is designed and intended to display a fair number of items, often the list is changing (items, added, deleted…).
 
In your case, since there is only 1 record ever, assuming it’s not changing, why don’t you create a generic page with an html control and render the data exactly how you want it?
[collapse]
From: coates_aj [mailto:bounce-coates_aj@community.progress.com]
Sent: Friday, May 29, 2015 7:34 AM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by coates_aj

Hi all,

Does anyone have any ideas how this type of task might be approached? I also have a tab with a list that only ever contains 1 record. Currently the user would click the tab, then click the record to view. Ideally I would like to implement a solution where clicking the tab displays the record in view mode.

I have attempted to do a few things with limited success. I have tried putting a script into the list screen to redirect to the view page, but this gave an annoying flashing effect. I have also tried to use some JQuery in the application header to change the link on my tab to link directly to the view page, however I couldn't reliably select the tab as there does not seems to be a sensible way to identify the tab as there are no ids or names associated with any of the tab elements.

I welcome any ideas on how to solve this.

Thanks

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
Posted by Thierry Ciot on 29-May-2015 08:43
And if the record is changing, you can use client side API like this one to retrieve latest value:
 
 
[collapse]
From: tciot [mailto:bounce-tciot@community.progress.com]
Sent: Friday, May 29, 2015 9:22 AM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by tciot
I don’t know how you would do what you are describing below, but I may have an indirect way (see below).
The list of records is designed and intended to display a fair number of items, often the list is changing (items, added, deleted…).
 
In your case, since there is only 1 record ever, assuming it’s not changing, why don’t you create a generic page with an html control and render the data exactly how you want it?
[collapse]
From: coates_aj [mailto:bounce-coates_aj@community.progress.com]
Sent: Friday, May 29, 2015 7:34 AM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by coates_aj

Hi all,

Does anyone have any ideas how this type of task might be approached? I also have a tab with a list that only ever contains 1 record. Currently the user would click the tab, then click the record to view. Ideally I would like to implement a solution where clicking the tab displays the record in view mode.

I have attempted to do a few things with limited success. I have tried putting a script into the list screen to redirect to the view page, but this gave an annoying flashing effect. I have also tried to use some JQuery in the application header to change the link on my tab to link directly to the view page, however I couldn't reliably select the tab as there does not seems to be a sensible way to identify the tab as there are no ids or names associated with any of the tab elements.

I welcome any ideas on how to solve this.

Thanks

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]
Posted by MarkT on 29-May-2015 11:09

Hi tciot,

Do you have any examples on how you'd render a generic page with the data you get back from rbf_getFields?  I'm used to the {!fieldName} replacements - but obviously you wouldn't be able to do that sort of thing in this case.  Would I need to write some JQuery that dynamically built up the screen - or something along those lines?

Thanks!

Posted by Thierry Ciot on 29-May-2015 12:26
Sure, I will provide you with an example later on. I have a couple of things to attend to.
 
[collapse]
From: MarkT [mailto:bounce-MarkT@community.progress.com]
Sent: Friday, May 29, 2015 12:10 PM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by MarkT

Hi tciot,

Do you have any examples on how you'd render a generic page with the data you get back from rbf_getFields?  I'm used to the {!fieldName} replacements - but obviously you wouldn't be able to do that sort of thing in this case.  Would I need to write some JQuery that dynamically built up the screen - or something along those lines?

Thanks!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
Posted by Thierry Ciot on 29-May-2015 21:09
Mark,
 
I just tried this on my environment and it works well.  The key principles:

è You create some html elements with well known IDs to easily access them via jquery

è Javascript makes Ajax call to retrieve the values based on objectId and list of fields you need to retrieve

è On Ajax completion callback, use jquery to find the html elements to which you want to dynamically add the retrieved values

 
I hope this works well for you too, the details are below.  I’m curious though on the use case.  Why do you have so many “singletons”?
 
Thierry.
 
Here are the steps:

1)      Take note of:

a.      The object id of your object (click on your object and use the id at the end of the url, for example: main.jsp?pageId=41601&tabId=41689&id=43901

b.      The link to the edit page

2)      Create a generic page and add a section

3)      In section add html component (See content below)

4)      In section add javascript component with this (See content below)

 

 

HTML for step 3: replace the link with your own link to edit object
 
<h3>This is one Record from Object1 List</h3>
<p>Int 1 Field: <span id="item1Id"></span> <br /> Int 2 Field: <span id="item2Id"></span></p>
<p>&nbsp;</p>
<p><a href="http://localhost:8080/prod1/m/main.jsp?id=41739&amp;pageId=40262&amp;view">Edit</a></p>
<p>&nbsp;</p>
 
JavaScript for Step 4: replace with your actual objectId and your fields of interest.
<script>
  function my_callback(objName, objId, values) {
    var int1 = values['intFieldOne'];
    var int2 = values['intFieldTwo'];
    console.log("int1: " + int1 + " - int2: "+int2);
    $("#item1Id").text(int1);
               $("#item2Id").text(int2);                       
  }
     
//  debugger;
  var x = rbf_getFields("Object1", 41739, "intFieldOne,intFieldTwo", my_callback);
  console.log("Ajax call made");
</script>
 
Here is the object on my system in the grid: it’s called o1 and has 2 int fields
 
 
Here the generic page output:
 
 
[collapse]
From: Thierry Ciot
Sent: Friday, May 29, 2015 1:26 PM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Sure, I will provide you with an example later on. I have a couple of things to attend to.
 
[collapse]
From: MarkT [mailto:bounce-MarkT@community.progress.com]
Sent: Friday, May 29, 2015 12:10 PM
To: TU.General@community.progress.com
Subject: RE: [Community Groups - General] Rollbase: Design This Page List's
 
Reply by MarkT

Hi tciot,

Do you have any examples on how you'd render a generic page with the data you get back from rbf_getFields?  I'm used to the {!fieldName} replacements - but obviously you wouldn't be able to do that sort of thing in this case.  Would I need to write some JQuery that dynamically built up the screen - or something along those lines?

Thanks!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]
Posted by MarkT on 01-Jun-2015 04:17

Thanks Thierry,

Secretly I was hoping it would be possible to redirect straight to an edit or view page (as that would save a lot of effort in the future) - unfortunately it seems that that isn't possible.  I've had a test of the principles of your idea and they seem to work pretty well - only problem being getting the object id of the record I want to display.

A lot of the singletons we have will be settings screens - for example personal preferences and the like.  However, there are also examples when I'd need the top record (i.e. the latest) and just to display that on the screen.  Thanks a lot for your help with this!

Thanks,

Mark

This thread is closed