Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Radio button in Read/Write Grid.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Radio button in Read/Write Grid.
 Login/Join
 
Guru
posted
Hi,
I have a requirement in maintain where I have a Read/Write grid. In grid I want my first column to be radio buttons associated with all the records.When user select a radio button and click on SAVE button the row will be updated in database table. How to handle this scenario in maintain? Please suggest.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
Instead of a radio button, I would use a check box.

Use this code, in a loop, to add the object to a stack and then in the grid, select HTML as the content for the cell:
 
  Compute Stk(I).cbox/a100 =  "<input type=checkbox name=check" || I | "  value=1>";

Then when you return to the Maintain code you can use this code, in a stack to retrieve the values:

Compute Stk(i).sel/a3 = Form1.GetHTMLField('check' || I);

All of the rows that have a 1 are selected. Note in my case, Form1 is the name of the form.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Guru
posted Hide Post
Hi,
I want to allow user to select only one record at a time.Can we have radio button instead of checkbox? Please advice.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
Here is the code for a radio button

 
compute Stk(I).AnswerType = 
"<input type=radio name=radio " || i ||  " value='Excellent'>Excellent 
<input type=radio name=radio " || i ||   " value='Good'>Good 
<input type=radio name=radio " || i ||   " value='Fair'>Fair 
<input type=radio name=radio " || i ||   " value='Poor'>Poor 
<input type=radio name=radio " || i ||   " value='No Response '>No Response"
 


to get the value use this code:

Compute Stk(i).sel/a10 = Form1.GetHTMLField('radio' || I);

There is a problem with scrolling though. Sometimes with the JS grid, when you scroll you lose the selection. We are working on a solution for this.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Guru
posted Hide Post
Hi,
I am using below piece of code for radio buttons in one column of HTMLTable now. Here,MailTempStk is the stack which holds data and AddTemplate is the form.

  
Case GetRadio

compute i/10 =1 ;
compute MailTempStk.radioBut/a0;

REPEAT MailTempStk.FocCount
MailTempStk(i).radioBut = '<input type="radio" name="radioBut" />';

COMPUTE i=i+1;
ENDREPEAT

EndCase



On HTMLTable Click event I call function SaveTemplate
  
Case SaveTemplate

row/i4 = AddTemplate.HTMLTable1.ClickRow;
col/i4 = AddTemplate.HTMLTable1.ClickColumn;

type row;
type col;

EndCase



The problem is that everytime I click on radio button it displays me correct row and col values but the page get refreshed and the selected radio button get deselected. I want to retain selected radio button until the user click on SAVE button to update the record in datasource.What can be the possible reason for this? Please suggest.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
The values in any constructs in both the grid and the HTMLTable will reset with the form refreshes.

What I am recommending is that you use JavaScript. When the user makes a selection, use Javascript code to populate another column in the grid that you can then retrieve when you want to process all of the data on the grid. I do not currently have an example of how to code this.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Guru
posted Hide Post
Hi,
Can anybody provide code for this?

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Radio button in Read/Write Grid.

Copyright © 1996-2020 Information Builders