Thank you very much for your input.
@Paul: It works now using the AjaxModalDialogOpener, it looks like that was the
problem (but I'm not entirely sure, I’m just getting into the ajax stuff).
@Theodore: Is there any significant difference between the methods
updateContainerWithID("itemList", context()) and appendScript(context(),
itemListUpdate())? Or which one would you recommend for everyday use? (btw: the
“ItemListUpdateContainer” was a typo ;), sorry for the confusion).
> On 24 Nov 2015, at 19:11, Theodore Petrosky <[email protected]> wrote:
>
> not sure, but if you copied and pasted your code I see:
>
> <webobject name = “ItemListUpdateContainer”>
>
> and you refer to it as:
>
> itemListUpdateContainer : AjaxUpdateContainer {
> id = “itemList";
> action = updateItemListContainer;
> }
>
> Is it case sensitive? Item vs. item
>
> Did you look at the ajax examples? What is your form wrapping?
>
>
> you could also try adding an onClose directive:
>
>
> createItemDialog: AjaxModalDialog {
> id = "createItemDialog";
> title = "Create New Item";
> label = "Create New Item";
> locked = true;
> onClose = refreshContainer;
> }
>
>
> then in the java:
>
> public void refreshContainer() {
>
> AjaxUpdateContainer.updateContainerWithID("itemList",
> context());
>
> }
>
>> On Nov 24, 2015, at 11:40 AM, Benjamin Steiner <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> Hi list,
>>
>> I have a problem with getting an AjaxUpdateContainer to actually update. My
>> idea is to have an AjaxUpdateContainer with a list of Items and an
>> AjaxModalDialog to insert a new item into said list. At the moment my code
>> looks something like this:
>>
>> HTML
>>
>> <webobject name = “ItemListUpdateContainer”>
>> (LIST TO REFRESH)
>> <webobject name = "createItemDialog">
>> <webobject name = "form”>
>> (FORM FOR NEW ITEM)
>> <webobject name = "createItemSubmitButton"/>
>> </weboject>
>> </weboject>
>> </weboject>
>>
>> Bindings
>>
>> itemListUpdateContainer : AjaxUpdateContainer {
>> id = “itemList";
>> action = updateItemListContainer;
>> }
>>
>> createItemDialog: AjaxModalDialog {
>> id = "createItemDialog";
>> title = "Create New Item";
>> label = "Create New Item";
>> locked = true;
>> }
>>
>> form : WOForm {
>> }
>>
>> createItemSubmitButton : CCSmartAjaxButton {
>> action = createItem;
>> useAjax = true;
>> value = "Create";
>> updateContainerID = "itemList";
>> }
>>
>> Java
>>
>> public WOActionResults updateItemListContainer() {
>> return null;
>> }
>>
>> public WOActionResults createItem() {
>> (SETTING ALL THE VALUES AND STUFF)
>> ec.insertObject(newItem);
>> ec.saveChanges();
>> AjaxUtils.appendScript(context(), "AMD.close(); itemListUpdate();");
>> return null;
>> }
>>
>> Does anyone have an idea what i’m doing wrong? It’s probably a trivial
>> mistake, but i really don’t see it right now.
>>
>> Thanks,
>> Beni
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected]
>> <mailto:[email protected]>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>> <https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com>
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]