Discussion:
[CalendarX-users] subject bar checkboxes losing state on refresh -- this time with the relevant code
galen pewtherer
2006-07-01 00:40:35 UTC
Permalink
i'm having a problem with the checkboxes in the subject bar losing
their state when i click the "refresh" button, (if i just hit f5 the
boxes retain their state).

anyone have any ideas (see code below, and yes, i know it's ugly ;o))

thanks,

--
-galen

<span
tal:condition="python:here.getCXAttribute('useMultiSubjects')">
<input tal:attributes="type string:hidden; name
string:currentDate; value python:url_quote(currentDate.Date());" />
<input tal:attributes="type string:hidden; name
string:xmy; value python:xmy;" />
<input tal:attributes="type string:hidden; name
string:xsub; value string:;" />

<!-- subject checkboxes start here -->

<span class="nowrap">
<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tr style="background-color:#FFFFFF;">
<td colspan="2" align="center">
<span class="nowrap">
<input i18n:attributes="value" value="label_sublinks_viewall"
tal:attributes="type string:checkbox;
name string:xsubALL;
value string:ALL;
checked
python:count(xsub,'ALL') or nothing;
onclick
string:fixCategories('ALL');;" />
<span i18n:translate="label_sublinks_viewall">View
Allll</span>
</span>
</td>
<td colspan="2" align="center">
<span>
<input type="submit" i18n:attributes="value"
value="Refresh"/>
</span>
</td>
<td colspan="2" align="center">
<span class="addNewEvent"
tal:define="isAnon
python:container.portal_membership.isAnonymousUser();"

tal:condition="python:context.getCXAttribute('showAddEventLink') and
not isAnon">
<span tal:define="ANEnoticestring
string:/folder_contents?portal_status_message=Add a new Event here.;
ANEUrl
python:context.getAddNewEventURL();
urlAddNewEvent
string:${ANEUrl}${ANEnoticestring};
urlAddNewEvent
python:test(context.getCXAttribute('useCreateObjectOnClick'),ANEUrl,
ANEUrl + ANEnoticestring);"
tal:condition="python:ANEUrl">
<a href="#" tal:attributes="href urlAddNewEvent"
i18n:translate="label_sublinks_addevent"
style="color:#000000;text-decoration:none;">Add a New Event here,
eh?</a>
</span>
</span>
</td>
</tr>
<tr class="hello3">
<td>&nbsp;</td>
<td>AR</td>
<td>Mtb</td>
<td>Run</td>
<td>Nav</td>
<td>Other</td>
</tr>
<tr class="hello0">
<td>Race</td>
<td><input type="checkbox" name="xsub" value="AR Race"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="MTB Race"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Run Race"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Nav Race"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Other Race"
onclick="fixCategories();" /></td>
</tr>
<tr class="hello1">
<td>Train</td>
<td><input type="checkbox" name="xsub" value="AR Training"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="MTB Training"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Run Training"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Nav Training"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Other Training"
onclick="fixCategories();" /></td>
</tr>
<tr class="hello2">
<td>Event</td>
<td><input type="checkbox" name="xsub" value="AR Event"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="MTB Event"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Run Event"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Nav Event"
onclick="fixCategories();" /></td>
<td><input type="checkbox" name="xsub" value="Other Event"
onclick="fixCategories();" /></td>
</tr>
</table>
</span>
</span>
</td>
</tr>
</table>

</form>

</td>
</tr>
</span>

Loading...