Seaside and Ajax/JQuery

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Seaside and Ajax/JQuery

Dominique Dartois-4
Hello All.
I try to use Ajax/JQuery to update a value in a HTML table by clicking on the table heading.
The new value (the update) is not written in the tabledata I associated an id with, but before the table.

The code :

renderContentOn: html

html table: [

html tableHead: [

html tableRow: [

html tableHeading: [ html anchor url: 'javascript:void(0)'; onClick:

((html jQuery: #changeMe) load html: 'BBB'); with: 'Update'].

]

].

html tableBody: [

html span id: #changeMe; with: [html tableData: [html render: 'AAA']].

]

]


The debugger in Firefox displays clearly that the "span id: #changeMe" is not written at the correct place in the generated javascript.

Images intégrées 1

What am I doing wrong?
Regards
--
Dominique
Reply | Threaded
Open this post in threaded view
|

Re: Seaside and Ajax/JQuery

CyrilFerlicot
Le 19/02/2018 à 21:56, Dominique Dartois a écrit :

> Hello All.
> I try to use Ajax/JQuery to update a value in a HTML table by clicking
> on the table heading.
> The new value (the update) is not written in the tabledata I associated
> an id with, but before the table.
>
> The code :
>
> renderContentOn: html
>
> html table: [
>
> html tableHead: [
>
> html tableRow: [
>
> html tableHeading: [ html anchor url: 'javascript:void(0)'; onClick:
>
> ((html jQuery: #changeMe) load html: 'BBB'); with: 'Update'].
>
> ]
>
> ].
>
> html tableBody: [
>
> html span id: #changeMe; with: [html tableData: [html render: 'AAA']].
>
> ]
>
> ]
>
>
> The debugger in Firefox displays clearly that the "span id: #changeMe"
> is not written at the correct place in the generated javascript.
>
> Images intégrées 1
>
> What am I doing wrong?
> Regards
> --
> Dominique
Hi,

This is possibly because in HTML5 a table element can only contains:
- tr
- th
- td
- caption
- col
- colgroup
- thead
- tbody
- tfoot

It should not contains span to be valid. Maybe your browser make this
change to make the HTML valid.

--
Cyril Ferlicot
https://ferlicot.fr


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Seaside and Ajax/JQuery

Dominique Dartois-4

2018-02-19 22:02 GMT+01:00 Cyril Ferlicot D. <[hidden email]>:
Le 19/02/2018 à 21:56, Dominique Dartois a écrit :
> Hello All.
> I try to use Ajax/JQuery to update a value in a HTML table by clicking
> on the table heading.
> The new value (the update) is not written in the tabledata I associated
> an id with, but before the table.
>
> The code :
>
> renderContentOn: html
>
> html table: [
>
> html tableHead: [
>
> html tableRow: [
>
> html tableHeading: [ html anchor url: 'javascript:void(0)'; onClick:
>
> ((html jQuery: #changeMe) load html: 'BBB'); with: 'Update'].
>
> ]
>
> ].
>
> html tableBody: [
>
> html span id: #changeMe; with: [html tableData: [html render: 'AAA']].
>
> ]
>
> ]
>
>
> The debugger in Firefox displays clearly that the "span id: #changeMe"
> is not written at the correct place in the generated javascript.
>
> Images intégrées 1
>
> What am I doing wrong?
> Regards
> --
> Dominique

Hi,

This is possibly because in HTML5 a table element can only contains:
- tr
- th
- td
- caption
- col
- colgroup
- thead
- tbody
- tfoot

It should not contains span to be valid. Maybe your browser make this
change to make the HTML valid.

--
Cyril Ferlicot
https://ferlicot.fr


Thank you so much Cyril.

The right code is :
html tableData id: #changeMe ; with: [html render: 'AAA'].
and not :
html span id: #changeMe; with: [html tableData: [html render: 'AAA']].

Thanks again Regards


--
Dominique
Reply | Threaded
Open this post in threaded view
|

Re: Seaside and Ajax/JQuery

Herby Vojčík


Dominique Dartois wrote:

>
> 2018-02-19 22:02 GMT+01:00 Cyril Ferlicot D. <[hidden email]
> <mailto:[hidden email]>>:
>
>     Le 19/02/2018 ?? 21:56, Dominique Dartois a ??crit :
>      > Hello All.
>      > I try to use Ajax/JQuery to update a value in a HTML table by
>     clicking
>      > on the table heading.
>      > The new value (the update) is not written in the tabledata I
>     associated
>      > an id with, but before the table.
>      >
>      > The code :
>      >
>      > renderContentOn: html
>      >
>      > html table: [
>      >
>      > html tableHead: [
>      >
>      > html tableRow: [
>      >
>      > html tableHeading: [ html anchor url: 'javascript:void(0)'; onClick:
>      >
>      > ((html jQuery: #changeMe) load html: 'BBB'); with: 'Update'].
>      >
>      > ]
>      >
>      > ].
>      >
>      > html tableBody: [
>      >
>      > html span id: #changeMe; with: [html tableData: [html render:
>     'AAA']].
>      >
>      > ]
>      >
>      > ]
>      >
>      >
>      > The debugger in Firefox displays clearly that the "span id:
>     #changeMe"
>      > is not written at the correct place in the generated javascript.
>      >
>      > Images int??gr??es 1
>      >
>      > What am I doing wrong?
>      > Regards
>      > --
>      > Dominique
>
>     Hi,
>
>     This is possibly because in HTML5 a table element can only contains:
>     - tr
>     - th
>     - td
>     - caption
>     - col
>     - colgroup
>     - thead
>     - tbody
>     - tfoot
>
>     It should not contains span to be valid. Maybe your browser make this
>     change to make the HTML valid.
>
>     --
>     Cyril Ferlicot
>     https://ferlicot.fr
>
>
> Thank you so much Cyril.
>
> The right code is :
> html tableData id: #changeMe ; with: [html render: 'AAA'].

Why not simply

   html tableData id: #changeMe; with: 'AAA'.

?

> and not :
> html span id: #changeMe; with: [html tableData: [html render: 'AAA']].
>
> Thanks again Regards
>
>
> --
> Dominique