From: Chuck H. <ch...@gl...> - 2010-05-30 15:55:46
|
On May 30, 2010, at 8:16 AM, James Cicenia wrote: > Ok - > > If I use your code I get a null pointer error: if > (AjaxUtils.isAjaxRequest(ERXWOContext.currentContext().request())) { > > Now I also noticed that my Application is not (can't) subclass > ERXApplication. Could this be causing the erratic behavior? Not if it is subclassing ERXAjaxApplication. Chuck > > Thanks > James > > On May 30, 2010, at 9:50 AM, Ricardo J. Parada wrote: > >> >> I've had problems before where actions don't get called after the >> first time. But for me, those problems seem to show on Internet >> Explorer only. >> So I'm not sure if that's the same thing you are running into. >> >> I made sure the application's isPageRefreshOnBacktrackEnabled() >> return true. My application was configured to return false and so >> I added code to return true for AJAX requests which causes >> WOComponentRequestHandler to call disableClientCaching() on the >> response. >> >> Something like this: >> >> public boolean isPageRefreshOnBacktrackEnabled() { >> // For AJAX request we return true so that >> WOComponentRequestHandler:301 calls >> // disableClientCaching() on the response which sets the headers >> for "don't cache this". >> if >> (AjaxUtils.isAjaxRequest(ERXWOContext.currentContext().request())) { >> return true; >> } >> >> // Otherwise, don't skip invokeAction() phase for non-AJAX requests >> return false; >> } >> >> >> >> On May 30, 2010, at 9:50 AM, James Cicenia wrote: >> >>> OK - >>> >>> I took out the redundant one in the submit button but now.. while >>> the table >>> now doesn't disappear the action doesn't get called say after the >>> first time. >>> >>> Very strange bug to try to find. >>> >>> any other things you can see? >>> >>> James >>> >>> >>> On May 30, 2010, at 8:22 AM, Chuck Hill wrote: >>> >>>> Have you run this in FireFox with FireBug enabled? Look for >>>> JavaScript errors. >>>> >>>> This seems redundantly wrong: >>>> >>>>> RatingAddActionBox: AjaxModalDialog { >>>>> ... >>>>> closeUpdateContainerID = "ratingsUpdateContainer"; >>>>> >>>>> RatingsSubmitButton : AjaxSubmitButton { >>>>> updateContainerID = "ratingsUpdateContainer"; >>>> ... >>>> >>>> >>>> Let the AMD do this. >>>> >>>> >>>> Chuck >>>> >>>> >>>> On May 30, 2010, at 4:21 AM, James Cicenia wrote: >>>> >>>>> I have spent hours trying to make this work consistently and it >>>>> just won't. >>>>> >>>>> There seems to be no rhyme or reason why it doesn't work. >>>>> >>>>> Here is my code again.. very straightforward. I have a >>>>> repetition and my >>>>> form outside it to add, edit and delete. >>>>> >>>>> Any help or hints or such will be greatly appreciated. >>>>> >>>>> Thanks >>>>> james >>>>> >>>>> >>>>> <webobject name = "RatingsUpdateContainer"> >>>>> <table width="100%" border="0" cellpadding="0" cellspacing="0"> >>>>> <tr> >>>>> <th colspan="3" scope="col"> >>>>> Ratings >>>>> <div class="edit"> >>>>> <webobject name = "AddRatingsOpener" >Add</webobject> >>>>> </div> >>>>> </th> >>>>> </tr> >>>>> <webobject name = "RepetitionRatings"> >>>>> <tr> >>>>> <td class="icon"><webobject name = "DeleteRatingRow"><img >>>>> src="/images/cancel-red.png" alt="delete rating" width="12" >>>>> height="12" border="0" /></webobject></td> >>>>> <td class="icon"><webobject name = "EditRatingsOpener" >>>>> ><img src="/images/edit.png" alt="demote rating" width="12" >>>>> height="12" border="0" /></webobject></td> >>>>> <td class="description"><webobject name = "RatingName" /></ >>>>> td> >>>>> </tr> >>>>> </webobject name = "RepetitionRatings"> >>>>> </table> >>>>> </webobject name = "RatingsUpdateContainer"> >>>>> >>>>> <webobject name="RatingAddActionBox"> >>>>> <webobject name="AddRatingForm"> >>>>> <webobject name = "RatingsNameField" /> >>>>> <webobject name = "RatingsSubmitButton" /> >>>>> </webobject> >>>>> </webobject> >>>>> >>>>> <webobject name="RatingEditActionBox"> >>>>> <webobject name="RatingForm"> >>>>> <webobject name = "RatingsEditNameField" /> >>>>> <webobject name = "RatingsEditSubmitButton" /> >>>>> </webobject> >>>>> </webobject> >>>>> >>>>> <webobject name="RatingConfirmDeleteBox"> >>>>> <webobject name="RatingDeleteForm"> >>>>> <webobject name = "RatingsShowNameField" /> >>>>> <webobject name = "RatingsDeleteSubmitButton" /> >>>>> </webobject> >>>>> </webobject> >>>>> >>>>> >>>>> FOR EXAMPLE BINDINGS: >>>>> >>>>> AddRatingsOpener: AjaxModalDialogOpener { >>>>> dialogId = "AddRatingDialog"; >>>>> title = "Add Rating"; >>>>> } >>>>> >>>>> >>>>> RatingAddActionBox: AjaxModalDialog { >>>>> label = "Add"; >>>>> closeLabel = "Close"; >>>>> title = "Add Rating"; >>>>> id = "AddRatingDialog"; >>>>> showOpener = false; >>>>> transitions = false; >>>>> locked = false; >>>>> centerVertically= true; >>>>> width = 240; >>>>> height = 120; >>>>> overlayOpacity = 0; >>>>> closeUpdateContainerID = "ratingsUpdateContainer"; >>>>> } >>>>> AddRatingForm: WOForm { >>>>> multipleSubmit = true; >>>>> name = "RatingAddForm"; >>>>> } >>>>> >>>>> RatingsNameField : WOTextField { >>>>> value = ratingName; >>>>> } >>>>> >>>>> >>>>> RatingsSubmitButton : AjaxSubmitButton { >>>>> updateContainerID = "ratingsUpdateContainer"; >>>>> value = "Add new rating"; >>>>> onClick = "AMD.close();Element.show('busyRating');"; >>>>> onComplete = "function(x){Element.hide('busyRating')}"; >>>>> action = addRating; >>>>> id = "ratingDialogAddButton"; >>>>> } >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Wonder-disc mailing list >>>>> Won...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>> >>>> -- >>>> Chuck Hill Senior Consultant / VP Development >>>> >>>> Practical WebObjects - for developers who want to increase their >>>> overall knowledge of WebObjects or who are trying to solve >>>> specific problems. >>>> http://www.global-village.net/products/practical_webobjects >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Wonder-disc mailing list >>> Won...@li... >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> > > ------------------------------------------------------------------------------ > > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects |