Radiobutton like behaviour suggestion

Hi.

I have been given the ‘challenge’ to implement a radio button like function that looks like the screenshot below. The values comes from several keyword documents. The less pretty solution i have now is ordinary radio buttons with a @dblookup to fetch the keywords.

Any ideas ? (It’s supposed to work in the client, not on web)

Thanks in advance…

Subject: Radiobutton like behaviour suggestion

Use a table. Create your 6 rows and 2 columns and change the background color on alternate rows. In the first column add your row headings then in the column next to each heading create a radio button field with only 1 choice, maybe “Yes” or “1”, so that it can be selected. Change border style of the radio button field to “None” and change the text color to match the color of the row; this way the field choice will not show. Use the Entering event of each field to set all of the other radio buttons to “” so that the user can change their mind. I just did it and it looks exactly as you want it to. There is only 1 slight caveat that I have not been able to get rid of, the choice has a dotted border around it when in edit mode.

Subject: RE: Radiobutton like behaviour suggestion

I did something very similar to this in an application I developed for a client. I used the InputTranslation on the Single Value radio button to clear the other radio buttons. Took a bit of fooling around to get it, but really did work pretty well.

I created fields Called Check1, Check2 etc for as many check fields that you might need. Then on the inputTranslation I put this code

@If(

	(Check1 = "Yes" & LastCheck1 != "Yes");

		@Do(@SetField(Check2;"");@Return("Yes"));

	@If(@IsDocBeingSaved & Check1 = "Yes" & LastCheck1 = "Yes";

		"Yes";

		""

		)

)

You will need to work with the formula to get it to work in your situation, but it worked well in the application I developed.

Subject: RE: Radiobutton like behaviour suggestion

If using Inuut Translation event I am assuming you have to enable “Refresh fields on keyword change” to get the values to clear in real time. I tried fooling with that too but found the Entering event to be more efficient. Guess it’s all a matter of preference.

Subject: RE: Radiobutton like behaviour suggestion

Just proves that there are lots of different ways to accomplish the same thing. I think that if I was starting over that I might take a different approach, but once starting down a road it was easier to keep going rather than turn around and kill everything and start over.

Subject: Radiobutton like behaviour suggestion

Thanks alot for the input, much appreciated, but…

The number of rows will change from time to time, since the values are stored in x-number of keyword documents. Right now there are 5, but in time there might be 10-15…

So i was searching for a solution where I only had 1 field if possible.

Subject: RE: Radiobutton like behaviour suggestion

Yes you can.You will need a view to list radio button text from each keyword document. This view would serve for a simple @dbcolumn or @dblookup, it depends upon your need there.

Then, you add a single radio button to your form - or change an existing one - to collect text from the view using @dbcolumn or @dblookup.

This will result in a single field in your form that will list 5 (or 10-15 later) options in it.

Let me know if you still have doubts.

Subject: RE: Radiobutton like behaviour suggestion

If i understand you correct, that suggestion is what i’m currently doing. Only problem with this approach is that there there is no alternate row colors. See example og how it looks with my current approach:

My ‘client’ is very determined to have alternate row colors though :frowning:

Subject: RE: Radiobutton like behaviour suggestion

You still can have this, but not using a ‘traditional’ Notes implementation.You will have to code the RB generation in javascript, using CSS properties to alternate colors.

You can still have @db(column|lookup) to grab data.

Subject: RE: Radiobutton like behaviour suggestion

The code is supposed to work in the Notes client only, so CSS and such might not be a way to go…

But I actually got a very creative suggestion from a developer from http://i-seven.com (a bit of free advertise for them there :slight_smile:

Who suggested that I put my radiobutton field in a table cell, and then made a background image that would fit the alternate row colors that i was looking for. I think that’s the only ‘solution’ to this. Of course there will be problems if the end user have another screen resolution than me, but I guess i can work around that…