NetTalk Central

Author Topic: NetWebForm Include and Hide Conditions  (Read 4407 times)

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
NetWebForm Include and Hide Conditions
« on: February 02, 2014, 07:15:24 PM »
Hi,

1. When I use Include or Hide condition and enter a value on the field, clicking the SAVE button deletes the field from view plus the value isn't saved.

2. Deleting a previously set hide condition does not remove the generated code but using empty fields, so it generates coding errors.

I get the same issue on both 6.50 and 7.31.

TIA


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebForm Include and Hide Conditions
« Reply #1 on: February 02, 2014, 08:38:20 PM »
Hi Vince,

Include condition, and hide condition are different things. Fields not INLUDED are not on the form at all. From a code perspective they do not exist. They cannot be made to appear dynamically since they are not there.

Hidden fields also do not exist, but a stub exists for them, so they can be made to exists. When hidden they are removed from the form, so when the save is done they are not included I the post.

For question 2 i need more information in order to duplicate. Preferably an example.

Cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: NetWebForm Include and Hide Conditions
« Reply #2 on: February 02, 2014, 09:25:50 PM »
Hi Bruce,


It's an update form for a table wherein inclusion of fields are dependent on the selection of other fields, and it works as such except that once I enter a value to the included fields and accepts or move to the next field to fill in, the field disappears.

second case is say on a hide condition I set tbl:unitno =2. then after successful compilation I decided to delete the hide condition, when I try to recompile, it will result in a coding error because the generated code still included a hide condition except with no defined field this time.

Thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebForm Include and Hide Conditions
« Reply #3 on: February 02, 2014, 10:36:05 PM »
Hi Vince,

>> It's an update form for a table wherein inclusion of fields are dependent on the selection of other fields,

so you want to use the "Hide Field" not "Include field" option.
Remember always to use Session Values in your Hide Field expression.

bl:unitno = 2

should be
p_web.GetSessionValue('bl:unitno') = 2

If in doubt, post an example.

I am unable to duplicate the second case - perhaps an example there would be handy as well. (ie post an example app where the condition has been removed, but incorrect code is generated.)

cheers
Bruce


de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: NetWebForm Include and Hide Conditions
« Reply #4 on: February 03, 2014, 06:43:09 PM »
Hi Bruce,

That was another GOTCHA moment for me. <bg>

Yes, problem 2 didn't happen any more once I used Session Values.

Thanks a lot!

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: NetWebForm Include and Hide Conditions
« Reply #5 on: February 09, 2014, 04:27:43 PM »
Bruce,

It happened again. Attached are snap shots of the source entry and the compilation error.

In this example I deleted the entry p_web.GetSessionValue('ALE:Alert_Type')=5 from the Include condition and inserted p_web.GetSessionValue('ALE:Alert_Type')<> 5 in the hide condition instead.

Btw, I encountered this after I noticed that some fields are being included and hidden when in "Change/Modify" but not in "Insert" mode of the NetWebForm. So I was trying to figure out what was the difference of the fields behaving normally from those not, that's when I encountered the above error again.

Thanks,



[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebForm Include and Hide Conditions
« Reply #6 on: February 09, 2014, 09:50:38 PM »
The screen-shot with the code is the useful one.
I _suspect_ the Include field in the template still contains some spaces.
I've tweaked the next build so it's a little more careful here, but in the meantime see if there are spaces in that template entry.

cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: NetWebForm Include and Hide Conditions
« Reply #7 on: February 13, 2014, 06:42:46 PM »
Hi Bruce,

Sorry for the delayed response. The immediate work-around is to do a recompile as soon as you delete, before adding the replacement include or hide condition and then do a final recompile.

Thanks,