<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Dropdown Menu Behavior After Ajax Fail]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8919&amp;type=atom" />
	<updated>2020-08-29T21:11:07Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8919</id>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38210#p38210" />
			<content type="html"><![CDATA[<p>Since _last is set with e.selectedIndex before making ajax request. If ajax fails input value are not populated with data. but selected drop down option is e.selectedIndex. This can result in data loss or data overwrite on records.</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-29T21:11:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38210#p38210</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38209#p38209" />
			<content type="html"><![CDATA[<p>Mantis Bug Tracking For This Issue - http://mantis.frontaccounting.com/view.php?id=5201</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-29T20:57:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38209#p38209</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38001#p38001" />
			<content type="html"><![CDATA[<p>@joe: is this the solution?</p><p>Past references are in Posts 7 and 10 of:<br />https://frontaccounting.com/punbb/viewtopic.php?id=8672</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-08-14T07:26:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38001#p38001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37998#p37998" />
			<content type="html"><![CDATA[<p>In inserts.js I found this line 142<br /></p><div class="codebox"><pre><code>            if ((this.selectedIndex != this.getAttribute(&#039;_last&#039;))
                ||((string_contains(this.className, &#039;combo&#039;) || string_contains(this.className, &#039;combo3&#039;)) &amp;&amp; _update_box(this))
                )</code></pre></div><p>should it be<br /></p><div class="codebox"><pre><code>            if ((this.selectedIndex != this.getAttribute(&#039;_last&#039;))
                &amp;&amp; ((string_contains(this.className, &#039;combo&#039;) || string_contains(this.className, &#039;combo3&#039;)) &amp;&amp; _update_box(this))
                )</code></pre></div><p>Also <br /></p><div class="codebox"><pre><code>e.setAttribute(&#039;_last&#039;, e.selectedIndex);</code></pre></div><p>must be set after JsHttpRequest.request(update) request is completed</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-14T04:16:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37998#p37998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37997#p37997" />
			<content type="html"><![CDATA[<p>You are correct, anyways thanks for your help. Let me see if I can work this out.</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-14T02:16:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37997#p37997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37995#p37995" />
			<content type="html"><![CDATA[<p>The issue with your reload option is if it is NOT pressed.&nbsp; That is, if the list is left with option C as the user selected, the rest of the page is now inconsistent because the page was not loaded with the option C data.</p><p>I do not have any more to say about this problem other than to recommend detkenn&#039;s solution which minimizes the data loss to the user when ajax fails to load the page properly.</p><p>Good luck.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-08-14T01:20:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37995#p37995</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37994#p37994" />
			<content type="html"><![CDATA[<p>Thanks for your reply Braath Waate</p><p>I have read the thread your mentioned above</p><p>to retry is good option but if retry fail as per code</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(retry)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JsHttpRequest._request(trigger, form, tout, retry-1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else location.reload(true);</p><p>this will refresh page as this failing process will be happening in background, to see page refreshing without knowing error will make user worried about what is happening. Further it will clear all fields including selected customer/supplier/inventory option.</p><p>Warning Indicator is seen only when there is ajax error so user is aware something is wrong. Further I have noticed for example there are</p><p>OPTION A<br />OPTION B<br />OPTION C</p><p>user first selected OPTION A ajax call is made and failed mean while user has already selected OPTION C during ajax process. Now user want details of OPTION C not OPTION A</p><p>Reload button after ajax fail will eliminate this issue. Now when user will click reload only details of selected option will be populated into input fields.</p><p>Regards</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-14T00:31:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37994#p37994</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37993#p37993" />
			<content type="html"><![CDATA[<p>See, https://frontaccounting.com/punbb/viewtopic.php?id=8672.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-08-13T23:38:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37993#p37993</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Dropdown Menu Behavior After Ajax Fail]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37991#p37991" />
			<content type="html"><![CDATA[<p>Hello Everyone</p><p>When select onchange ajax request fail on dropdown menu in customer/supplier/inventory. When we get see warning triangle, the selected customer/supplier/inventory is different from populated input field. To get the correct data we have to change customer/supplier/inventory to other value then back to previous value.</p><p>Here is screenshot example<br />https://mpulse.in/images/FA_feature_suggestion.jpg</p><p>In the above example while selecting customer Keshav Enterprise my ajax request failed. The input field below are populated with previous selected user which is K.K. Enterprises. Now to get details of Keshav Enterprises We have to select some other customer then again Keshav Enterprises.</p><p>It would be appreciated, if reload button with onclick ajax function to populate the input field could be added beside warning triangle .</p><p>Thanks and Regards</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2020-08-13T22:17:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37991#p37991</id>
		</entry>
</feed>
