CodeChargenewbie
Posts: 114
|
| Posted: 07/24/2008, 10:19 AM |
|
I have a page which have a few include pages. Now, each include page is in its own div, taking advantage of codecharge's built-in tab tab feature. The problem is ajax refreshes the entire page, instead of just one of the include pages. Say I have an include page that contains a search form and a grid. When I click the submit button to search, the page should not refresh. Without include pages, this works as expected. The inclusion of include pages throws a monkey wrench into the equation, however. Is there a fix, either by codecharge or a manual one, so that I can marry ajax and include pages in codecharge?
Thank you very much.
|
 |
 |
CodeChargenewbie
Posts: 114
|
| Posted: 07/29/2008, 12:59 PM |
|
Ok, I guess either no one knows or no one cares.
OK, then, here is a diffrent but related issue that should hopefully be easier to figure out.
I have another page that uses tabbed view with two tabbed tabs. There are no include pages here. All the code is written on one page. Now I set up an ajax refresh panel, one for each tab. The contents of the tabs are very basic record forms, nothing fancy. When I click submit on either tab, without making any further adjustments, it says "Loading..." on the top right-hand corner, indicating it's doing an ajax refresh. This works just fine, submitting only the tab I specified.
However, if I turn off Children as Trigger and specify my own event to refresh on, it doesn't work. The event I'd like to refresh on is an onsubmit on the form. Again, no luck. I tried selecting the onsubmit event on the panel which encompasses the record and no luck. All it does is refresh the entire page, as if ajax was turned off. Is there a quandry with ajax and yahoo's tabbed views feature?
The other thing I noticed is I can't do the return false trick in javascript to stop an onsubmit with ajax enabled. Why? in the Project Explorer pane, it shows the precedence of execution. So, if I have custom javascript for an onsubmit and ajax, the custom code may or may not execute and it certainly will not prevent the ajax from running, since it's executed beorehand. It'd be nice if there was a solution or work-around for client-side validation then.
Any help would be appreciated.
|
 |
 |
mentecky
Posts: 321
|
| Posted: 07/29/2008, 1:33 PM |
|
My best guess is you don't have any JavaScript events in your main page... therefore the include page BindEvents is not getting called. Try adding a Client Side event to Set Focus on your main page.
Rick
_________________
http://www.ccselite.com |
 |
 |
CodeChargenewbie
Posts: 114
|
| Posted: 07/30/2008, 12:08 PM |
|
Thanks for the suggestion. I tried what you said and it failed to work. I don't think it likes include pages, but the other example is also problematic.
Speaking of the other example, I'm still baffled. If I don't make any custom javascript of my own involving submission of the page, it refreshes fine. As soon as I try to perform validation via onclick or onsubmit, it refreshes the entire page, instead of one tab. How? The validation is fairly simple. I have a button of type button with a client-side onclick event. This onclick event is the validation. The validation checks input and returns false if any condition has failed. If validation is successful, that means all the conditions are met and the last line of the custom javascript is document.forms["Formname"].submit() or $("PanelNameFormname").submit(). For whatever reason, whole page refreshes. I should note I created the panels BEFORE I added any custom code. That may mean something or nothing, I don't know (might be useful to know if (hopefully) someone from YES is gazing at this thread)(I honestly believe it's a bug that, ahem, needs to be fixed).
|
 |
 |
ReneS
Posts: 225
|
| Posted: 07/30/2008, 1:09 PM |
|
Maybe the documentation can help?
Peterr and Yes said that it should be sufficient.............. (and a lot more dots....)
I think that AJAX is used as a marketing tool, however it is still poorly documented and shaky..
Rene
|
 |
 |
CodeChargenewbie
Posts: 114
|
| Posted: 07/30/2008, 1:31 PM |
|
Quote ReneS:
Maybe the documentation can help?
Peterr and Yes said that it should be sufficient.............. (and a lot more dots....)
I think that AJAX is used as a marketing tool, however it is still poorly documented and shaky..
Rene
I checked the standard documentation and it's pretty substandard. Unless YES has new documentation that I'm unware of (i.e. wiki), there's no sufficient info that even alerts me in the right direction to investigate -- I had to figure that out for myself.
I'd love for Peterr to tell me what is the problem. I redid the page just to confirm my suspicions regarding the issue. I created three forms, with the first one inside an update panel. The forms are completely bare-bone, btw. I submitted forms two and three and they both refresh the entire page. Good. I submitted form one and it submits va AJAX just fine. I changed the button to be of type button and added some validation code and attempted to submit the form in javascript. Unfortunately, it refreshes the entire page. What's the problem? It's not include pages. It's not yahoo tabbed views or tabbed tabs.
Perhaps what's happeng is the page submits, then ajax is called; because ajax is set as async by default, the javascript submit() does not care to wait for the ajax routine to return something back to the client. So, the page refreshes before the ajax routine is complete. At least, this is my educated assumption of the why and how. Obviously, what I'd like it to do is emulate the process of clicking on a submit button using codecharge ajax. But it seems submitting the form in javascript corrupts it.
Interestingly enough, if I type in onsubmit() instead of submit() in javascript, it appears to work. Why? I have no idea. In fact, AFAIK, onsubmit() should throw up an error!
Does anyone know where can one get their hands on the javascript documentation that defines "onsubmit"? I don't mean how to use onsubmit. I mean the code that creates the keyword itself. Maybe that could provide some clue as to the functionality of onsubmit(). Correction: It's not javascript; I should've said HTML.
|
 |
 |
Intexk
Posts: 6
|
| Posted: 07/31/2008, 3:41 AM |
|
the object name u add to include the page...must be equal as the name of the page u are including.
it's a bug of codecharge..it generate the scripts in the included page using as reference the name of the page..so if u incclude that page..and the object doesn't have same name as the page without the .cpp..the java scripts fails to bind.
|
 |
 |
CodeChargenewbie
Posts: 114
|
| Posted: 07/31/2008, 6:27 AM |
|
Well, I checked it and names do match up properly. I typed in onsubmit() in the javascript for the page with include pages and it worked there, too. I can't find anything on the Internet with a reference to onsubmit(), as opposed to onsubmit, but it does work. I don't understand why typing in document.formname.submit() basically cancels out the ajax and refreshes the entire page, whereas document.formname.onsubmit() permits an ajax refresh. It's a mystery.
|
 |
 |
andrefogelman
Posts: 117
|
| Posted: 08/03/2008, 3:13 AM |
|
I have a related issue which I have not been able to solve with the yahoo tab.
I have two tabs, one with a grid view and the other with a record.
I am trying to mimick the two page that the builders create into one page with ajax.
Meaning when you click on the insert button you automatically get the record tab.
Also if you select a row in the grid you are shown the record tab with appropriate information.
I have submitted this to support and there answer was wait for CCS 4.1
Any help or insights would be appreciated
|
 |
 |
|