Ok, about the issue with update, it looks that it comes from
AutocompleteWidget itself because replacing the widget with the default
web2py 1.99.4 autocomplete widget and I still get the issue :

    #widget = AutocompleteWidgetSelectOrAddOption(request,
db.table2.table2field1,
        #    id_field=db.table2.id, limitby=(0,10), min_length=2,
        #    form_title=T('Add new table2 item'), controller="tables",
        #    function="add_table2_item", button_text = T('Add new')),
    widget = AutocompleteWidget(request, db.table2.table2field1,
        id_field=db.table2.id, limitby=(0,10), min_length=2),

Strange that I don't get this issue with my own app, but since my own app
is base on a very old welcome app from web2py 1.6X.X maybe that evolve
differently that the rest of web2py it could come from template or other
internal app element and not from web2py itself.

Richard


On Tue, May 29, 2012 at 3:44 PM, Richard Vézina <ml.richard.vez...@gmail.com
> wrote:

> Can't link the app too big (thanks to google 4 meg max :( )...
>
> Ask me in private I will send you the app directly.
>
> Richard
>
>
> On Tue, May 29, 2012 at 3:40 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Hello,
>>
>> Here a demo app, hope it will help for now... It the best I can do now.
>>
>> Try to understand it carefully, if you can make works the slice about
>> SelectOrAddOption, you will be able to adapt
>> my AutocompleteWidgetSelectOrAddOption to your needs. So follow the slice
>> tutorial carefully and transpose to the need widget. Only the part about
>> *"add" function* that you don't initialize same way, you just pass
>> everything to the widget like this :
>> AutocompleteWidgetSelectOrAddOption(request, db.table2.table2field1,
>>             id_field=db.table2.id, limitby=(0,10), min_length=2,
>>             form_title=T('Add new table2 item'), controller="tables",
>>             *function="add_table2_item"*, button_text = T('Add new'))
>>
>> There is only one error I can't get rid of is that Add Option trigger a
>> not belong field error on update form... I don't have this error in my own
>> app so I should be minor, I will try to find why it not working. I thought
>> that it could be because of similar name between table so I rename form
>> field1 to table1field1 and table2field1, not working neither. Will try to
>> find the origin of the issue.
>>
>> NOTE : It base on Autocomplete available in web2py 1.99.4 and it should
>> works (except the error I am talking about) with web2py 1.99.4.
>>
>> TODO : Look for change that Manuele did to autocomplete widget and use
>> this version of the widget to merge the SelectOrAddOption.
>>
>> Richard
>>
>>
>> On Tue, May 29, 2012 at 1:19 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> Ok, I will work on this to allow possible user to have access to this
>>> ressource.
>>>
>>> I will clean the code a bit and write a tutorial step by step with the
>>> element to adapt to your context.
>>>
>>> Give me a couples of hours.
>>>
>>> Richard
>>>
>>>
>>> On Tue, May 29, 2012 at 6:44 AM, Johann Spies <johann.sp...@gmail.com>wrote:
>>>
>>>> On 25 April 2012 23:48, Richard Vézina <ml.richard.vez...@gmail.com>wrote:
>>>>
>>>>
>>>>
>>>>> Hope it works for you Johann.
>>>>>
>>>>
>>>> Unfortunately I did not have any success with this recipe.  I can get
>>>> the select_or_add widget working but not this one.
>>>>
>>>> Thanks for your trouble anyhow.
>>>>
>>>> Regards
>>>> Johann
>>>> --
>>>> Because experiencing your loyal love is better than life itself,
>>>> my lips will praise you.  (Psalm 63:3)
>>>>
>>>>
>>>
>>
>

Reply via email to