NetTalk Central

Author Topic: Page Reloads question/suggestion  (Read 4349 times)

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Page Reloads question/suggestion
« on: September 21, 2007, 08:34:40 AM »
Hello   ???  (apologies for the length)
I have in several places the need to hide/unhide entries & tabs based on a selection by the user. On a memory form, the user selects a type of data to transfer. Once it is selected, a field is displayed for the file transfer. This might work if the file entry had the read-only condition added to the template (I might try that later)
So in my Hide condition I put - DataType=''
-This doesn't work!! - Until the user clicks on the refresh button on the browser. Then the page refreshes and the entry appears. As a test I put this -
'<A href="javascript: location.reload()">Reload Window</A> '
as the comment for the datatype entry. so the user can select the type and then click the reload to get the next entry to show up.  It works but looks very bad.  :-\

When you set an entry field to 'send new value to server', you get this code added to the entry field in the browser -
onchange="transfer_datatype_value(1,FieldValue(DataType));"
and you get this function added below it in the browser which apparently does a refresh but not completely or certain values are not set until after the refresh.
---------------------------
function transfer_datatype_value(ev,val,par,sil){
var options = {onComplete: function(){GreenAll('')}};if(par==undefined){
  options.parameters = "event=" + ev + '&' + "value=" +val;
}else{
  options.parameters = ev+ '&' +val+ '&' +par+ '&' +sil;
};ajaxEngine.sendRequest('transfer_datatype_value',options);
}
registerRico('transfer_datatype_value');</script></td>
-------------------------------
I added a ;location.reload(); to the end of the onchange code and it did reload the page but it also reset the value of the dtatatype.

So my suggestion is, can we add a reload somewhere else to give us this ability?
Or can we make better use of the DOM and reset the visibility of elements on the page?

chris

Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page Reloads question/suggestion
« Reply #1 on: September 24, 2007, 11:32:53 PM »
Hi Chris,

I think the original issue is your hide condition:
you had

>>  DataType=''

should be

p_web.GSV('Datatype') = ''

Cheers
Bruce

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Page Reloads question/suggestion
« Reply #2 on: September 25, 2007, 04:53:22 AM »
Hi Bruce,

While that is _an_ issue, the larger problem I have is that the ajax response being generated is only done on the field level. I have/wanted to have the filter on the Tab, but that structure doesn't get sent or rebuilt with the ajax stuff, only on a complete refresh.

I ran out of time trying to work out how that could be done.

chris
Real programmers use copy con newapp.exe