With a little help from you, i could follow the right way.Thanks.Regards.
--
You received this message because you are subscribed to the Google Groups "weblocks" group.
To view this discussion on the web visit https://groups.google.com/d/msg/weblocks/-/eXCSRaVpiocJ.
To post to this group, send email to webl...@googlegroups.com.
To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.
> i try to write a "search (ldap)" page with weblocks :
> - a widget which display a form with an input text field and a submit button
> - a second widget which display the results
> - a main widget which display the two widgets
The main widget is your composite widget.
>
> i wrote a "data" class and a search function (ldap) stored in src/model/data.lisp
> i wrote defview functions too (table and data), but no Form view because i do not need to modify datas.
Standard scaffold form view should be enough unless you need complex validations.
>
> As far as i understant :
> - i need to write a new widget for the "search" one
> - i need to use a datagrid widget to display results
> - i need a composite widget to the main page
Not all of this is required.
Call the data search function from the form submit function. Capture results of search and assign grid widget data to it. Mark grid widget dirty.
Once you get this working we can work on a cleaner approach, eg maybe just mark parent dirty.
>
> For the new widget (search), can i use an existing one (with inheritance) ?
> Or must i write my own widget with some render functions (like render-input-field) in a render-widget-body method ?
> I looked at simpleform, quickform, login, but i steel do not see how to start.
>
> With a little help from you, i could follow the right way.
>
> Thanks.
>
> Regards.
>
Post code or a github gist for better guidance.
In my opinion, yes, the lambda is the right place.
The only thing I would consider changing is the target of the
mark-dirty. You could give the ldap-search-widget
an ivar, result-widget and store in that ivar your datalist
widget. In that case in the lambda you
can write (mark-dirty (result-widget obj)).
However, your way or what I suggest above, are so similar that
it does not really matter. The only slight advantage I can
see with what I propose is that you do not have to put the
ldap-search-widget together with the datalist widget
in one parent widget. It will give you the freedom
to put the results in a complete different place in the widget tree.
Kind regards,
Wim Oudshoorn.