iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
We have some pages where we need to show or hide an editable grid based on a combo box selection of some type. The show/hide seems to work fine, on my test page, the first time, but after that it causes a javascript error to come up per the attached flash video.
Note the value of v6ba86 is:
<TD style="WIDTH: 138px" class="GridHeader ctl00ContentPrismGridViewTest-Header" type="Column" sortOrder="Ascending" isSorted="True" isGrouped="False" dataBound="True" colName="percentFulfillment"></TD>
We use update panels to do the updates. Our markup code is as follows:
<asp:UpdatePanel ID="upButtons" runat="server" RenderMode="Inline" ChildrenAsTriggers="true" UpdateMode="Always"> <ContentTemplate> <PRISM:PrismButton ID="btnShow" runat="server" Text="Show" OnClick="btn_Click" /> <PRISM:PrismButton ID="btnHide" runat="server" Text="Hide" OnClick="btn_Click" /> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="upContracStepsMain" runat="server" RenderMode="Inline" ChildrenAsTriggers="false" UpdateMode="Conditional"> <ContentTemplate> <PRISM:PrismPanel ID="PrismPanelMenu" runat="server" Width="400px"> <PRISM:PrismMenuControl ID="MenuTest" runat="server" MenuArea="Contract_Edit_Steps" OnMenuItemClicked="MenuItemClicked" LoadMenuInSession="true" LinkedGridId="PrismGridViewTest" /> </PRISM:PrismPanel> <asp:UpdatePanel ID="upTestGrid" runat="server" RenderMode="Inline" ChildrenAsTriggers="false" UpdateMode="Conditional"> <ContentTemplate> <PRISM:PrismPanel ID="PrismPanelContainer" runat="server" Width="400px"> <PRISM:PrismGridViewEdit ID="PrismGridViewTest" runat="server" DisableForcedPageRedirect="true" Width="100%" MenuArea="Contract_Edit_Steps" OnAddRow="AddRow" OnUpdateRow="UpdateRow" LinkedMenuControlId="MenuTest" EnableRowContextMenu="false" Height="230px"> </PRISM:PrismGridViewEdit> </PRISM:PrismPanel> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger EventName="MenuItemClicked" ControlID="MenuTest" /> <asp:AsyncPostBackTrigger EventName="Click" ControlID="btnHide" /> <asp:AsyncPostBackTrigger EventName="Click" ControlID="btnShow" /> </Triggers> </asp:UpdatePanel> </ContentTemplate> </asp:UpdatePanel>
Note that PrismGridViewEdit is our custom control deriving from WebGrid and PrismMenuControl derives from WebMenuBar.
How we hide/show is, after the partial-page post back is done, we register our client-side calls that show/hide with the ajax script manager which executes the grid's and menu's respective Show() and Hide() functions.
The grid client side function is simple:
function ShowOrHideGrid(gridId, bShow) { // get the grid object and make sure it's valid oGrid = HaveGrid(gridId); if (!jsg_PrismUtility.IsVo(oGrid)) { return false; } if (bShow) { oGrid.Show(); } else { oGrid.Hide(); } return true; }
The menu bar client-side is simple too:
function ShowOrHideMenu(menuId, bShow) { var oMenuBar = ISGetObject(menuId + menuBarIdSuffix); if (!jsg_PrismUtility.IsVo(oMenuBar)) { return false; } if (bShow) { oMenuBar.Show(); } else { oMenuBar.Hide(); } return true; }
UPDATE: this thread is still an ongoing discussion
The attached sample already use both WebMenu and WebGrid. Both issue could be solved using WebFlyPostBackManager as demonstrated in the attached sample on my previous post. No javascript error encountered in the sample.
I wanted to make a correction to the flash video. The only reason the error did not occur on the original Show is because I was not configuring the grid correctly. That was my bad. I had a conditional that was not initially setting the required properties.
Once I fixed this, the error now occurs EVERY TIME the grid is Shown.
The issue is replicated on my test using the scenario you described. A bug report has been submitted to our developer.
Thanks Glenn. Please note that this is a critical issue for us and we really need it fixed quickly as we're looking to release our product soon and this is crashing one of our major pages. If you can find out if there's a workaround that would be great.
I also ran into a similar problem with the WebMenuBar since we hide it along with the grid, but I'll post that in another post once I have the info for it.
I have already increase the bug report priority per your request and regarding the workaround, I will need to discuss it with the developer to determine if a workaround is available.
We really appreciate it Glenn. Thank you.
BTW, would you update your test that you were able to duplicate by adding a WebMenuBar to the panel you show/hide? Put one or two menu items that will post back the panel from the menu bar object. If the post back is fine, try to navigate away from the page. I'm curious to see if you get any errors when doing this.
This is bascially what happens with our implementation of the WebMenuBar object and since you already have an example of the grid. I'll get a thread posted on that one today if time allows. Thank you.
Based on my test, you could try using WebFlyPostBackManger for a workaround in such scenario. Attached is the test page for the scenario you described using WebFlyPostBackManger.
In my test, WebMenuBar will produce a JS error "Unspecified Error" using AJAX UpdatePanel if we try to navigate to anotehr page.
Hi Glenn,
Okay, I'll give this a try and see how it works. And I get similar errors on the WebMenuBar too, i.e., on navigating away is when it occurs. Any idea on that one for a solution/workaround right now?
We use the WebMenuBar and WebGrid together which works out real nice when they function so hopefully we can get both figured out. I'll keep you posted on my results with the grid.
Perfect, thanks Glenn.
Based on my test, you could try using WebFlyPostBackManger for a workaround in such scenario. Attached is the test page for the scenario you described using WebFlyPostBackManger. In my test, WebMenuBar will produce a JS error "Unspecified Error" using AJAX UpdatePanel if we try to navigate to anotehr page.
Glenn, for the FunctionParameter object, are the parameter types documented anywhere? I know the examples show "string" but what other values are valid, i.e., "bool" or "boolean" and so on? Would appreciate the full list of acceptable types.
Glenn,
I've unfortunately have been unable to get this working successfully under our environment. I've modified your example to more closely resemble our environment. You'll be able to duplicate the issue using the attached. Please note the following:
Since you are already using WebFlyPostBack, my suggestion is to use WebFlyPostback for all the scenario. There might be incompatibility if we mix the use of UpdatePanel and during FlyPostBack.
I have update your attached sample to completely use WebFlyPostBack. The upButtons section is changed to a panel for simpler update.
Unfortunately, I could not find any documentation for the FunctionParameter, but I believe it also accept numeric data type and boolean.
The attached file seems to be corrupt. Would you please reattach another one? Thanks.
Also, here's an exerpt from the documentation for WebFlyPostBackManager. Could these types be supported by FunctionParameter as well? I need to know what to pass it for sure for boolean, i.e., "bool" or "boolean" please.
Here are the list of simple data types supported by WebFlyPostBackManager : string int decimal long float bool DateTime array[] Advanced Data Types that is supported by WebFlyPostBackManager are : DataSet DataTable Custom Object that can be serialized
Here are the list of simple data types supported by WebFlyPostBackManager :
Advanced Data Types that is supported by WebFlyPostBackManager are :
So which one of these would be correct?
ISNet.WebUI.FunctionParameter[] parms = new ISNet.WebUI.FunctionParameter[2]; parms[0] = new ISNet.WebUI.FunctionParameter(containerId,"bool");...
or
ISNet.WebUI.FunctionParameter[] parms = new ISNet.WebUI.FunctionParameter[2]; parms[0] = new ISNet.WebUI.FunctionParameter(containerId,"boolean");...
We really need this bug fixed by the way even if we get the page working with WebFlyPostBackManager due to our infrastructure using update panels and we also leverage the AJAX page manager for pre/post page loads to accomplish tasks. We can't redesign our entire infrastructure at this state of development and we really shouldn't need to. Also, many of our custom controls use UpdatePanels along with our master pages and other components. So it's critical the grid and menu bar be fixed to work in this type of infrastructure. Thanks.
[EDIT] Glenn,
Would you please not mark any post as the answer and let me/customer/poster do that? I'd appreciate it if you can unmark what is currently the answer to this thread as it is not. Please don't jump the gun on what may be the answer until the poster has confirmed it. Thanks much.
Re-attached the code.
The update panel compatibility is being fixed by the developer. The flypostbask is a workaround we provided for such scenario while the fix is being develop.
Based on my discussion with the developer, the function parameter currently only accept string and number. For your scenario, you could use number to determine if the value is true or false, 0 is false positive number is true.
FunctionParameter boolVal1 = new FunctionParameter("1", "number"); //TrueFunctionParameter boolVal2 = new FunctionParameter("0", "number"); //False
I am very sorry for the mark of answer issue. Unfortunately, the mark as answer can not be undone. I will update the mark as answer post to inform that this is still an ongoing discussion.
How's the progress on the fix for this? We really need this fixed as it's holding up one of our major screens so it's critical. Thank you.
Based on my test, the nightly build for the WebDesktop and WebGrid already implement the fix for this issue. We are still doing some testing for the build. This build will be released with 2010 R1 release on August 18, 2010.
That's great news, thank you.
123
I just realized you said the fix will be in 2010 R1. We need it fixed in 2009. We can't just commit to 2010 R1 right away without regression testing as we have many of your controls customized since they do not provide what we need "out of the box," so it's not realistic for you guys to assume and force your customers to updgrade right away. Please make sure the bug fix is available in 2009. We have to have this and we need it by mid August.
The build will be released with 2010 R1, however it is still WebGrid 7 and WebDesktop 3.5. In WebUI 2010 R1 WebGrid and WebDesktop does not have major version update. By the time of 2010 R1 release you could also be able to use the Update Manager to retrieve the latest build.
As of this writing, the 2010 R1 released is still scheduled for August 18, 2010
We're going to upgrade anyway but we want to be sure that the new version won't cause issues with our current 2009 r2 controls. We're on a time crunch so this makes it a bit of a risk to upgrade in the middle of this month. I hope you understand why we'd like to see this fix in 2009 if at all possible please. Thank you.
As I explained before, the new build for WebGrid and WebDesktop will be release with the 2010 R1. However since the WebGrid and WebDesktop does not recieve a major version upgrade, the compatibility issue should be minimal. This will be similar to hotfix since no major version update occurs for those controls.
Please clarify something for me. Are you saying that for those who have 2009 r2, 2010 r1 will be available as an upgrade via Update Manager?
For some control that does not recieve a major upgrade yes. In your case, since the WebGrid and WebDesktop does not recieve a major version update it is possible to retrieve the new build using the update manager.
Thanks for the clarification Glenn. I had misunderstood what you said earlier as it sounded like we'd have to upgrade to 2010 R1 right away which would have been risky for us less than two weeks away from a first release. You can probably understand that. This way we can get the fixes and then after the release we'll have a "breather" where we can upgrade to 2010 and have time to test everything. Thanks.
I just checked UpdateManager and it's not showing anything available for upgrade. Any ideas on when the updates will be available? Thanks.
I have just been informed that the update manager server will take some more time, probably in a few more days, before being updated to the latest build. However the WebUI 2010 R1 release is being slightly delayed and it will be release soon.
Because it will take some time for the update manager server to update the build, I suggest you download and install the WebUI 2010 R1and get WebGrid and WebDesktop build from the installation folder. This way you could retrieve the latest build faster. As I explained before, in this release WebGrid and WebDesktop does not have any major version upgrade.
Hello Glenn,
We've finally at a point where I can update and check this out. Unfortunately, even though the hide/show doesn not produce an error, we have run into other problems that need to be fixed right away please.
I've used the existing sample that's attached to reproduce the errors/problems identified below. Please note that the sample uses the WebFlyPostBackManager but we cannot use this in our project but we're experiencing the same issues with UpdatePanels.
Use the steps the below and you should be able to see the problem.
Using the Show/Hide BUTTONS: - click Show - shows the grid - click Hide - hides the grid - click Show - now resize and/or maximize the browser - click Hide - now resize and/or maximize the browser Now using the Show/Hide CHECK BOX: - click Show/Hide - grid does not show - click Show/Hide to uncheck, then check it again - no grid - now try to resize and/or maximize the browser - you should get the javascript error at "var v4de16 =v1d291.parentNode.offsetWidth;" or similar Reload the page fresh. - click Show/Hide to check the check box - no grid Once the check box is used, you run into several issues: - the grid does not show - the grid does now show if you use the buttons at this point - any resizing of the browser crashes with the javascript error
Based on my test using the attached sample, the resize issue could be solved by forcing grid refresh during the Show function.
Regarding the CheckBox issue, I modify the page so the showing / hiding grid functionality is invoked after update panel call is over, as detailed in this article. Based on the validation on the server side, assigned a hidden variable to determine which function, show or hide , will be invoked. The button event handler has also been updated using this new process.
Based on my analysis, the JS error is caused by the WebMenuBar. For this issue, I have submitted a bug report so the issue will be analyzed further by the developer.
Attached is the modifed page using the functionality described in this post.
Thanks Glenn. I'll give this a try. Yes, most of our grids are accompanied by our custom menu bar which is derived from WebMenuBar. We have the pair that interact with each other. I the menu crash can be fixed very soon. I'll post back when I've had a chance to look this over and try to implement your workaround in our code.
[EDIT] Glenn, the attached file is corrupted and cannot be unzipped. I tried to unzip it with both WinRAR and WinZip. Can you please reattach? After you reattach, would you ensure the file is fine, by downloading it yourself and making sure you can unzip it? Thanks.
[EDIT2] Glenn, in regards to the Ajax article you reference, we already use this methodology. All our client-side script calls are registered and executed after the load has loaded. We execute all our registered calls in our custom page request manager in the page load override, i.e., the PageRequestManager's instance add_pageLoaded.
Glenn is currently not available until Tuesday, September 28th, 2010.
I can’t help you to re-attach the sample at this moment, since the sample is located inside Glenn’s tester PC. It would require Glenn’s credential in order to login to that PC.
I have left a note to Glenn regarding your request. I’m sure that he’ll contact and respond to you.
Okay, thanks Yudi. Would you please create a shared location internally for stuff like this so you can help each other out and we don't have to wait.
Also, it would be helpful if you guys can verify the attachments by downloading and unzipping it after you've attached it to ensure it's fine. Thanks much.
I am very sorry that the attachment is corrupted, I have re-attached the sample. Thank you for the feedback, I will consult your suggestion to my supervisor.
In the sample, in the JS function executed after the ajax request, the function to show / hide the grid and menubar is executed. I also refresh the grid to resolve the maximize issue.
Hi Glenn. Well I tried your sample and it blows up too. See attached video. I commented out the "alert" command only.
Also, in the sample, you've basically nullified the UpdatePanel objects which we can't do in our application. We must use UPs to update specific other sections of the page and we use a mix of controls with WebCombo, WebMenuBar and WebGrid from InterSoft. Our grid/menus work in pairs so they go together.
Do you know if this error is "benign," i.e., won't impact the usability of the menu/grid controls? I'll have to test it to see too.
How soon will a fix/patch be available for the WebMenuBar?
As I mentined the JS error still occured and has been reported as a bug. A fix for the issue is available in the WebDesktop latest nightly build, which could be downloaded here.
In the previous sample, the showing and hiding is done using WebFlyPostBackManager by invoking javascript function. However, during checked change the flypostbackmanager will not invoke the javascript function. The proposed resolution is a workaround for the checked change event, by setting a variable value and based on the value invoke the corresponding function after the AJAX request.
Perhaps you could share the function to show / hide the control you will be using in the project so we could analyse the issue further.
Thanks Glenn. I'll try the build you provided and let you know the results.
The code is available in the first post for both the grid and menu hide/show functions. As I mentioned earlier, all our client-side functions are queued up and then executed after the page loads. On post backs, the queue of client-side functions is run in the AJAX pageLoaded method which is our override as I mentioned before.
But let me try the new build and go from there. I'll post back with my results.
The new build did fix the error when resizing the browser, however, now another crash occurs when posting the page. It's another WebMenuBar client-side crash on this line:
var vcf51 =v9d256.XmlDt.documentElement;
The XmlDt object is null which is why it crashes. It also keeps the page from continuing with the post.
Using the previous attached sample, I failed to replicate the issue. I tried invoking postback in the WebMenubar by clicking a command or reposting the page using ASP button, however there is no JS error in my environment.
Have you modify the sample to use the first post technique?
Did you reenable the UpdatePanel objects and triggers? That will probably take care of it since it'll more accurately duplicate our environment. I'll update the sample here and see if I can get the error to occur and if I do, I'll post back with the attachment.
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname