History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-3741
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: -- --
Assignee: Unassigned
Reporter: Philip Romanik
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Amazon demo: Error after deleting a radio button that is selected

Created: 19/Mar/07 07:20 AM   Updated: 30/Apr/07 01:59 PM
Component/s: SA - Amazon
Affects Version/s: OL4B1
Fix Version/s: 4.0.2

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 4,461
Runtime: N/A
Fix in hand: False


 Description  « Hide
If you select a radio button, delete that item, and attempt to select another item, an error is generated. The action of the delete button is to delete a node in the dataset. It doesn't do anything to adjust the currently selected item.

You can test on either the shipping address or payment information pane.

The easiest fix is to test for a null image in the select() method below. This will make the error go away, but I'm not sure what happens if you:
  - select an entry
  - delete that entry
  - proceeed to checkout


classlib.lzx:

    <class name="radiobutton" onclick="select()">

        <attribute name="selectionobject" type="expression" />
        <attribute name="val" type="string"/>

        <view name="img" resource="radio_rsc" y="2"/>

        <method name="select">
          if (selectionobject.selectedItem) { Debug.write("selectionobject.selectedItem", selectionobject.selectedItem);
            selectionobject.selectedItem.img.setResourceNumber(1); <===== ****ERROR. img does not exist

          }
          this.img.setResourceNumber(2);
          selectionobject.setAttribute("selectedItem", this);
          selectionobject.setAttribute("val", this.val);
        </method>

    </class>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Philip Romanik - 23/Mar/07 09:14 AM
Change 20070322-Philip-8 by Philip@Philip-DC on 2007-03-22 11:39:29 EDT
   in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/legals

Summary: Fix radio button issue in Amazon app

New Features:

Bugs Fixed: LPP-3741

Technical Reviewer: jcrowley
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
When you delete a radio button that is selected, the next time you select an ite
m, it attempts to turn off the non-existant button.


Tests:
amazon in dhtml no longer generates a dhtml error. To verify, select a radio but
ton in the shipping address and/or payment information panes. Delete the selecte
d item and attempt to select another item.

Files:
M demos/amazon/classlib.lzx

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070322-Philip-8.tar

Mamye Kratt - 30/Apr/07 01:59 PM
(legals build 4842)
Fixed