Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 19 FEB 2012 04:05:26AM Robert Lee wrote:

I'm having difficulty getting O4WRadiobutton to display the correct default. Following is a simplified test program. When I run the program, it defaults to Yes instead of No. I've also tried an alternate version that is commented out with the same result. Any ideas?

SUBROUTINE O4W_TEST(CtlID, Event, Request)

$Insert O4WEquates

BEGIN CASE

CASE Event _eqc 'CREATE' ; GOSUB Create

END CASE

Return

* Create: O4WForm('blank') O4WRADIOBUTTON('Yes', 'Y', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS(, 'N')) O4WRADIOBUTTON('No', 'N', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS(, 'N')) *O4WRADIOBUTTON('Yes', 'Y', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS('0')) *O4WRADIOBUTTON('No', 'N', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS('1')) Return </QUOTE> —- === At 19 FEB 2012 11:07AM bshumsky wrote: === <QUOTE> <QUOTE>I'm having difficulty getting O4WRadiobutton to display the correct default. Following is a simplified test program. When I run the program, it defaults to Yes instead of No. I've also tried an alternate version that is commented out with the same result. Any ideas? SUBROUTINE O4W_TEST(CtlID, Event, Request) $Insert O4WEquates BEGIN CASE CASE Event _eqc 'CREATE' ; GOSUB Create END CASE Return *

Create:

O4WForm('blank')

O4WRADIOBUTTON('Yes', 'Y', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS(, 'N')) O4WRADIOBUTTON('No', 'N', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS(, 'N'))

*O4WRADIOBUTTON('Yes', 'Y', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS('0'))

*O4WRADIOBUTTON('No', 'N', 'EXTEND_GRAPH', 'EXTEND_GRAPH', O4WMARKEDOPTIONS('1'))

Return

Hi, Robert. I believe the problem is related to a problem in your use of the O4WRadioButton.

The fourth parameter is the unique ID of _this_ particular button. In both cases, both your yes and no buttons have the same exact ID (EXTEND_GRAPH), as opposed to having unique IDs (for example, EXTEND_GRAPH_Y and EXTEND_GRAPH_N).

I think if you fix that problem, then perhaps either of the two "marking" approaches will work.

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.

</QUOTE>


At 19 FEB 2012 03:25PM Robert Lee wrote:

Yep that's got it. Thanks Bryan.

So the third parameter needs to be the same as per the examples in 9.3 Reference?

Cheers

Robert


At 19 FEB 2012 05:25PM bshumsky wrote:

Yep that's got it. Thanks Bryan.

So the third parameter needs to be the same as per the examples in 9.3 Reference?

Cheers

Robert

The third parameter (Name) is what associates these multiple radio buttons together into a single radio button "set." So if the third parameter _wasn't_ the same, then clicking one of the buttons wouldn't cause the other button to change its state.

In addition, the third parameter controls what you use in O4WGetValue() to retrieve the value. Again, if the third parameter was different, then you'd have to call O4WGetValue() with _each_ of the different names to see what their value was; by using the same name, a single call to O4WGetValue() will return which one of the (possibly several) values associated with that name has been selected.

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/676e43fd000495d2103ca1d00.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1