[Seaside] Re: Ajax that uses server-side rendering

Iwan Vosloo iwan at reahl.org
Thu Jul 16 06:24:16 UTC 2015


On 15/07/2015 18:00, Paul DeBruicker wrote:
> Does
>
> html select
>       ...
>        onChange: (html jQuery id: 'textInputDiv') load html:[:h | self
> renderTextInputForSelectedOn: h]
>
>
> html div id:'textInputDiv'
>
>
> do what you want?

That's the general idea, but we'd like to do that using magritte. Given 
an object (say a IdentificationDocument), with two descriptions - one 
for the type of document and another for the expiry date we'd like to 
control the visibility of the expiry date using magritte and rerender 
the MAContainerComponent of this object with the jQuery load.

Thanks
-i

> Iwan Vosloo wrote
>> We need to let a user choose a "type of ID document" in a dropdown.
>> Underneath this dropdown, a text input should appear via ajax (on change
>> of the dropdown), but it appears only for certain options of the dropdown.
>>
>> This should happen via ajax, but we have one wish... we do not want to
>> use Pharo's javascript library wrappers to code the logic of HOW the DOM
>> should be changed in the browser. We'd rather fetch newly generated HTML
>> from the server via a "jQuery load", and replace a small chunk of the
>> form with this HTML. This way we let the original server-side
>> seaside/magritte code render that (changed) HTML snippet. (Some of our
>> screens are fairly complex, and we'd prefer to keep the logic for what
>> such a screen look like written once, and using Seaside/Magritte.)
>> nfo/seaside


-- 
Reahl, the Python only web framework: http://www.reahl.org



More information about the seaside mailing list