Ravi,

So, first, I changed api-2.0 to api-2.1.0 so that it would work on IE8. 
Then, I make sure that those data files are local (in the same directory 
as the HTML file); otherwise, they can't be accessed. Finally, I changed 
'off' to just '' (an empty string). That seems to make it work on 
Firefox 3 and IE8 RC1. If I didn't change 'off' to '', then both options 
get selected, which is different from what you observed. Could you try 
the steps I did?

David

thotakura ravi.chandu wrote:
> Hi David,
>
> Hope this example helps me in letting you know my need.
> Creating an HTML file with the following code should render Exhibit in 
> IE (for some reason it's not working in FF).
>
> /<html>
> <head>
>     <title>CIA World Factbook - People</title>
>
>     <link 
> href="http://simile.mit.edu/exhibit/examples/factbook/countries.js"; 
> type="application/json" rel="exhibit/data" />
>     <link 
> href="http://simile.mit.edu/exhibit/examples/factbook/people.js"; 
> type="application/json" rel="exhibit/data" />
>     <link 
> href="http://simile.mit.edu/exhibit/examples/factbook/government.js"; 
> type="application/json" rel="exhibit/data" />
>
>     <script 
> src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js"; 
> type="text/javascript"></script>
>     <script 
> src="http://static.simile.mit.edu/exhibit/extensions-2.0/chart/chart-extension.js";
>  
> type="text/javascript"></script>
>
>     <style>
>         body {
>             font-family:    Tahoma, Arial, sans serif;
>             font-size:      10pt;
>             margin:         0;
>             padding:        0;
>         }
>         table {
>             font-size:      100%;
>         }
>         tr {
>             vertical-align: top;
>         }
>         #title-area {
>             padding:        1em 2em;
>             background:     #BCB79E;
>         }
>     </style>
> </head>
> <body>
>     <div id="title-area">
>         <h1>CIA World Factbook - People</h1>
>     </div>
>     <div id="content-area"><div style="width: 100%;">
>         <table width="100%" cellspacing="20">
>             <tr>
>
>                 <td width="20%">
>                     <div ex:role="facet"
>                         ex:expression=".speaks"
>                         ex:facetLabel="Languages"
>                         ex:height="40em"></div>
>                 </td>
>                 <td>
>                     <div ex:role="viewPanel">
>                         <div ex:role="view"
>                            ex:viewClass="Exhibit.ScatterPlotView"
>                            ex:label="Birthrate vs. Deathrate"
>                            ex:x=".birthrate"
>                            ex:xLabel="Birthrate"
>                            ex:y=".deathrate"
>                            ex:yLabel="Deathrate">
>                         </div>
>                         <div ex:role="view"
>                            ex:viewClass="Exhibit.BarChartView"
>                            ex:label="Populations"
>                            ex:x=".population"
>                            ex:xLabel="Population"
>                            ex:y="value"
>                            ex:yLabel="Country Name"
>                            ex:xAxisType="log">
>                         </div>
>
>                     </div>
>                 </td>
>                 <td width="20%">
>                     <div ex:role="facet"
>                         ex:expression=".member-of"
>                         ex:facetLabel="Members Of"
>                         ex:height="10em"></div>
>                     <div ex:role="facet" 
> ex:facetClass="Exhibit.NumericRangeFacet"
>                         ex:expression=".population"
>                         ex:interval="10000000"
>                         ex:facetLabel="Population"
>                         ex:height="20em"></div>
>                 </td>
>             </tr>
>
> <tr><td>
>     <table width="580px" ex:role="lens" cellspacing="0" cellpadding="0">
>        <tr>
>            <td >
>           <b>Country Name:&nbsp;</b><a accesskey="U" 
> ex:href-content=".uri" target="_blank"><span ex:content=".label" 
> ></span></a></td>
>
>         </tr>
>        <tr>
>            <td >
>
>             <b>Type:&nbsp;
>
> <!-- The following do not select the last radio button by default -->
>  <!-- <input type=radio name="test">
>  <input type=radio name="test">
>  <input type=radio name="test">
>  <input type=radio checked name="test">  -->
>
>
>  <!-- The following throws an error
> Unexpected text = at position 10 -->
> <!-- <input type="radio" ex:name-subcontent="radiogroup-{{value}}"
> ex:checked-content="if(.type == 'Country', 'on', 'off')">Country
> <input type="radio" ex:name-subcontent="radiogroup-{{value}}"
> ex:checked-content="if(.type == 'State', 'on', 'off')">State     -->     
>
> // <!-- This too did not work -->
> <!-- <input type="radio" ex:name-subcontent="radiogroup-{{value}}"
> ex:checked-content="if(.type = 'Country', 'on', 'off')">Country
> <input type="radio" ex:name-subcontent="radiogroup-{{value}}"
> ex:checked-content="if(.type = 'State', 'on', 'off')">State     --> /
> /
> <input type="radio" ex:name-subcontent="radiogroup-{{.id}}"
> ex:checked-content="if(contains(.type, 'State'), 'on', 'off')">State
> <input type="radio" ex:name-subcontent="radiogroup-{{.id}}"
> ex:checked-content="if(contains(.type, 'Country'), 'on', 'off')">Country
>
>  </tr>
>         </table>
> </td></tr>
>
>         </table>
>     </div></div>
>
> </body>
> </html>/
>
>
> I am trying to make the second radio button checked by default, using 
> the value from 'type'.  The value for 'type' is always 'Country'. But 
> the second radio button never gets selected.
>
> Thanks in advance,
> Ravi.
>
> On Thu, Feb 19, 2009 at 12:56 AM, David Huynh <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
>     Ravi,
>
>     It is best if you can make a barebone exhibit with a bit of fake data
>     that illustrates this problem and send us the files here. It's much
>     easier for me or someone else to try to debug them ourselves.
>
>     David
>
>     chandu wrote:
>     > Hi David,
>     > Thanks very much for the reply.
>     >
>     > if(.yourated == 'Good', 'on', 'off')  - did not work.
>     > Tried if(.yourated == 'Good', 'true', 'false') - This too did not
>     > work.
>     >
>     > Any other thoughts please...
>     > Thanks,
>     > Ravi.
>     >
>     > On Feb 11, 6:58 am, David Huynh <[email protected]
>     <mailto:[email protected]>> wrote:
>     >
>     >> chandu wrote:
>     >>
>     >>> Hi David,
>     >>>
>     >>> Thanks for the example.
>     >>>
>     >>> In
>     >>> if(.yourated == 'Good', 'on', 'off')
>     >>> the double equals to gave a JS error while opening the lens. So
>     >>> changed it single equals to (though I know that it wont be
>     correct).
>     >>> The approach did not work. I mean all theradiobuttons were getting
>     >>> presented but none is getting checked.
>     >>>
>     >> Hi Ravi,
>     >>
>     >> Would you mind giving it another shot, with this expression
>     instead?
>     >>     if(contains(.yourated, 'Good'), 'on', 'off')
>     >>
>     >> David
>     >>
>     > >
>     >
>
>
>
>
>
>
> -- 
> A day is a wonderful blessing,
> Either stormy or sunny,
> It stands for hope,
> Giving us another chance of what we call *L*I*F*E*.
> Live a beautiful LIFE.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to