Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: IE data binding & JSCRIPT


Message #1 by "Laphan" <laphan@u...> on Sun, 1 Oct 2000 13:55:57 +0100
The guidance Wrox have given me in the past has been impeccable and very
generous and to this I am extremely grateful to them for increasing my
knowledge in this minefield that they call HTML programming.

Although you probably do not want this burden, but you are now my
proclaimed
HTML 'guru' and I am sending you this email as a cry out for help.

Sometime ago, you linked my <OBJECT> binded text file to my JavaScript code,
so that people could click on 'Add' and 'Subtract' buttons so that they
could send their
book requirements via a form.  I still think that the HTML fairies make
this
work and it is not possible to do, but all the same I am very grateful!!

The problems I have now are 1 Microsoft-inflicted and 1 self-inflicted,
which are as follows:

A) Problem with large text files (Microsoft-inflicted)

I have found out that if a text file contains more than say 8 items it
really struggles on the web to get 'on-line' quick enough before the user
starts trying to click the buttons.  When the user performs any movement
such as using the scrollbar  or clicking one of my buttons, it brings up
'the operation couldn't be performed because the object is closed'.  This
is
basically because it hasn't finished loading in the data.

I found out from Microsoft that it is a bug and it needs a
'ondatasetcomplete' operation adding to the code so that this problem is
rectified.

In order to make this more stable, I thought the best option would be to
make 'Pages' , so that the user sees say 8 items per page.
The problems I have is that I have added the 'Pages' code (see ZIP
contents), but it now doesn't tie in with the previous JSCRIPT code (see
ZIP
contents)
that you sent me.  If you looked at the enclosed ZIP, it brings the pages
up
fine, but the
JSCRIPT just doesn't know what is happening.  I have tried to link the 2
scripts (VBSCRIPT one and your JSCRIPT one) together, but they are on a
completely different wave length.

I basically want the code to work as it does, but with the option to show
xx
items per page.  Can you help?


B) Problem with another entity (self-inflicted)

If you look at my example on the enclosed ZIP file, I have attached a
pop-up
menu to each line, so that the user can add the colour of the book,
without
having 3 x maths books for each colour.  I know in the example I have
given
you, it would be easier just to create 3 types of Maths book, but I am
thinking ahead for large quantities and plus I always want to go one
better!!

Following on from my code, I make the pop-up display for each
line and can make the JSCRIPT code go back through these pop-ups so they
each have their own identity (ie, NAME = 'COLOUR:plus whatever the product
name is').

The problem on this occasion is that the value the user selects just
doesn't
transfer through to my JavaScript array (ie, in the books.js file, the
line -> 'self.parent.additem(Product,Price,'Best Sellers',Colour);' needs
the Colour
to equal the value they selected).  I have also added an onChange event to
the pop-up (or SELECT) box, but I think I need to do an equivalent loop
for
this event like the 'document.links' bit you did.

I basically want to allow the user to select the colour type and this
value
gets passed to my JavaScript in the same way as the product description
and
price.  Can you help?

I know this is a lot to ask and believe me if there is any way I could
return the favour I will, but could you please assist on this.

Many, many thanks.

Regards


Laphan

  Return to Index