[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Embedded view and radiobuttons

I have a embedded view in a form and i want to have
one column i that view
calculated upon a set of 12 radiobuttons. How do I write
a formula that show (in this case text) different field from the
database. The field depends on what button the user have selected.
1 Solution
Use the IF logic to achieve this.


You cannot do that. It is not possible to give parameters to a view, not even if it is embedded on the form where your buttons are on.

It might be doable in another way though, but I'd have to know whether you want to do this on the web or inside a Notes client, and if you are using R5 or 4.5 or 4.6.
seko22anAuthor Commented:
I have Version 5. I think it maybe possible with
enwironment variables but I have not a working
Seko22an -

You have two choices:
a) specify your embedded view as a 'single category' embedded view
b) replace your existing embedded view with an embedded view 'selected by formula.'

Choice 'A' above is easily documented in the Notes Designer help -- but does not achieve your goal.  It limits the documents displayed in the view according to a single category (for example it would show all the parts of a specified COLOR using your radiobutton field to select the color).  Note that single category views are used to limit/select ROWS not COLUMNS from your data and design.

Choice 'B' will allow your form to intelligently select a different view for each of your RadioButton values.  If your RadioButton field has 12 values then your design will require 12 different views appropriately corresponding to those 12 values.

To create the conditionally embedded view:
1. Remove your existing embedded view
2. From the menu bar: Create> Embedded Element> View
3. In the resulting View dialog, check the box for 'Choose view based on formula' and click [ok]
4. In the programmer's pane find the Embedded View's 'Embedded Selection' and enter a formula referencing your radiobutton.

@if(radiobutton!="";radiobutton;"name of a default view")

The values of the radiobutton should match either view NAMES or view ALIASES found in the design of the same database.

Personally, I think that approach 'B' will never meet the "best practices" guidelines -- but if you are certain your application calls for this approach then give it a spin!

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now