Visualizing Validation Errors next to Components that cause them

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

Visualizing Validation Errors next to Components that cause them

Felix Leipold-2
Hi there,

is there anyway to visualize errors next the components that caused them?
One solution I can think of is actually validating every single one of these components, however it doesn't feel nice.

I am currently using a bespoke sublcass of MAToOneRelationDescription to structure my form into different sections. It is cascading the validation to all these embedded objects.

Any ideas?

Cheers,
Felix
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Visualizing Validation Errors next to Components that cause them

Lukas Renggli
> is there anyway to visualize errors next the components that caused them?

Sure. The default renderer MATableRenderer adds the class '.error' to
the element, so that you can highlight the validation errors using CSS
styles.

I assume that you also want to display the error message somewhere
close-by? In this case you have to implement your own renderer and
assign it to the container description (see the reference to
MATableRenderer).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Visualizing Validation Errors next to Components that cause them

Felix Leipold-2
Hi Lukas,

unfortunately the whole case is a bit more difficult because I am using nested components. The situation is visulised in this screenshot:
http://wuetender-junger-mann.de/screenshot-nested-components.png

The trouble is, that the embedded components don't have access to the errors, as the outer component starts calling into the descriptors and inside the validation logic there is no reference to the embedded components, so the errors can't be added to those.

I am a bit lost. Should I perhaps abandon the idea of flattening multiple objects into a single form?

Cheers,
Felix


On Tue, Apr 14, 2009 at 4:19 PM, Lukas Renggli <[hidden email]> wrote:
> is there anyway to visualize errors next the components that caused them?

Sure. The default renderer MATableRenderer adds the class '.error' to
the element, so that you can highlight the validation errors using CSS
styles.

I assume that you also want to display the error message somewhere
close-by? In this case you have to implement your own renderer and
assign it to the container description (see the reference to
MATableRenderer).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Visualizing Validation Errors next to Components that cause them

Lukas Renggli
> I am a bit lost. Should I perhaps abandon the idea of flattening multiple
> objects into a single form?

Personally I've never really used the internal editors.

What I usually do in such situations is to build individual components
(without buttons and validation) for the the different objects and
then present these components from a normal Seaside component.

Another possibility is to build a single flat description consisting
the descriptions of multiple objects. Search the mailing list on how
to build such a composite description. This sometimes works well.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki