How to make the page dynamic

Posted by caylali on 05-Feb-2016 00:43

Hi, I have below 2 scenarios which could be easy for you guys. 

1> Display different values in the picklist according to the selection of a radio button.

e.g. users need to choose a radio button "Gender" (male or female) first,

if they choose "Male", then the next picklist "color" will have values "Blue","Grey" to choose from; but if they choose "female" for the radio button, they can only choose "Pink" or "Red" in the "color" picklist;

2> Display a section with data in another object according to the selection of a picklist.

e.g. we have picklist wth values "Monday", "Tuesday", etc,  if user choose "Monday", we want to display Monday's lunch special below, which is stored in another object "Meal", which may have fields as "entree" and "desert". 

I am relatively new to this, please help. Thanks. 

Posted by Manooj Murali on 05-Feb-2016 01:28

Hi -

1> Display different values in the picklist according to the selection of a radio button.

We don't have an out of the box solution for this unless you are willing to show Gender as a picklist instead of radio button in which case you can look at using our dependent picklist feature @ documentation.progress.com/.../ . But, if you still need it as radio buttons then there is some custom javascript coding that you can do to achieve this.

2> Display a section with data in another object according to the selection of a picklist.

Can you see if using the Main Lookup / Link Lookup feature we support can fit into your requirement. Refer documentation @ documentation.progress.com/.../

Regards,

Manooj

All Replies

Posted by Manooj Murali on 05-Feb-2016 01:28

Hi -

1> Display different values in the picklist according to the selection of a radio button.

We don't have an out of the box solution for this unless you are willing to show Gender as a picklist instead of radio button in which case you can look at using our dependent picklist feature @ documentation.progress.com/.../ . But, if you still need it as radio buttons then there is some custom javascript coding that you can do to achieve this.

2> Display a section with data in another object according to the selection of a picklist.

Can you see if using the Main Lookup / Link Lookup feature we support can fit into your requirement. Refer documentation @ documentation.progress.com/.../

Regards,

Manooj

Posted by caylali on 11-Feb-2016 00:11

Hi Manooj,

Thank you for your reply. The first one works. I didn't quite get the second one yet. Another example of what I want for the second scenario is the flight booking page. There would be a check-box for you to select "Is there a child travelling with you", if you don't check that, no more details needed, but if you check that, another section will pop up for you to enter in the age of your child, etc...Is it achievable? Thanks.

Regards,

Cayla

Posted by Mohammed Siraj on 11-Feb-2016 00:33

Cayla,

We support customizing a Rollbase page (show or hide form fields on the basis of some condition) by adding script components to a page.

Within the  script components you can leverage client-side API functions like: rbf_showOrHideField()

For additional details, please see:

documentation.progress.com/.../

Posted by Srinivas Panyala on 11-Feb-2016 03:30

Hi Cayla,

You can also use rbf-showorhidesection().

documentation.progress.com/.../

Follow the below steps:

1) Navigate to new record page -> Design this page

2) Add a new section and add required fields to that section when you want to display if check box is checked and save.

3) Again navigate to design this page and add a script component

4) Add below sample code. Provide field integration name for

<script>

function display()

{

var flag=rbf_getFieldValue(<Checkbox Field Integration Name>);

rbf_showOrHideSection(<section Original ID>, flag);

}

$( document ).ready(function(){display()});

</script>

5) Navigate to Object Definition -> Fields -> Checkbox -> Events

6) Invoke javascript funtion on "onchange" event

onchange="display();"

7) Save

8) Now when check the checkbox new section will be displayed if you uncheck the check box new section will be hidden

Thanks

Srinivas

This thread is closed