NetTalk Central

Author Topic: Suppresss browse not working  (Read 3754 times)

mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Suppresss browse not working
« on: April 11, 2013, 07:48:41 PM »
I have a NetWebPage that has <!-- Net:Browse_Registrations --> in the XHTML. When the NetWebPage displays I get the Browse_Registrations browse displayed as expected.  

I now want to suppress the browse when it is empty OR when a condition is not met. I've checked off "Suppress browse if empty" on the general tab of the the NetWebBrowse procedure and have added (for testing) a 1=1 in the IF condition located under the Suppress browse if empty checkbox. I also added a PageName.

However the browse displays all the time. Is there something else I must do to suppress the browse on the NetWebPage?  
« Last Edit: April 12, 2013, 07:55:32 PM by mtabakin »

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Suppresss browse not working
« Reply #1 on: April 15, 2013, 08:47:54 AM »
Not sure if this applies but could you test a sessionvalue in the condition where you placed your Xhtml in the netwebpage?
if its false, nothing would be generated.

Re: suppress empty, if its there and its really empty, you should be able to suppress or display a message.
i'd guess your filter is not Filtering as expected, and therefore its not empty?

mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Suppresss browse not working
« Reply #2 on: April 16, 2013, 08:18:20 PM »
Thanks for the idea. Yes this does work although it would have been nice if the NTWS template would have allowed me to do it on the browse end instead of the NetWebPage. But it works and I guess that's all that matters at this point. Thanks again.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Suppresss browse not working
« Reply #3 on: April 17, 2013, 10:50:07 PM »
Hi Mike,

I tested in the "pages" example, turning on the "suppress if empty" switch, and deleting the tps file, and it seemed to "go invisible". So I think Poul might be on the right track - the browse was not really empty?

If you can duplicate in an example though I'm happy to take a look.

cheers
Bruce


mtabakin

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Suppresss browse not working
« Reply #4 on: April 18, 2013, 05:52:48 AM »
I guess I'm not understanding the correct use of the NetWebBrowse settings General tab. My NetWebPage has an XHtml entry to call a  NetWebBrowse procedure  <!-- Net:Browse_Registrations -->.. This works fine.

I want to suppress the Browse IF it is either empty (Suppress if empty) OR under other conditions that I choose. So I went to the NetWebBrowse procedure in the NetWebBrowse Settings area, on the General tab and did two things:

1. I CHECKED "Suppressed if empty" and
2. In the IF that is right under the suppress if empty checkbox I added a condition (for testing I just entered TRUE).

In the source I see that this added the code in the NetWebBrowse proecedure:

    If (TRUE)
      packet = clip(packet) & p_web.jquery(lower('#Browse_Registrations_div'),'hide','')
    End

I was more interested in having my condition suppress the browse and have not yet actually checked whether the Suppress if empty is working.
However doing what I did does not seem to suppress the browse if my condition evaluates to true in the NetWebBrowse procedure.

I can however suppress the browse if I put my condition into the "condition" in the XHtml entry on the NetWebPage that calls the NetWebBrwose procedure.

So should I be putting my condition to suppress on my condition in NetWebPage AND also checking the box "Suppress if empty" so I get the browse to suppress under both my condition AND when the browse is empty OR can this all be done on the NetWebBrowse setting and if so why if my condition not suppressing the browse? 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Suppresss browse not working
« Reply #5 on: April 18, 2013, 09:45:02 PM »
>> I want to suppress the Browse IF it is either empty (Suppress if empty) OR under other conditions that I choose. So I went to the NetWebBrowse procedure in the NetWebBrowse Settings area, on the General tab and did two things:

yeah, so a couple things are worth clarifying here.
a) the word "hide" is probably better than "suppress". (I've tweaked the template to reflect this.) As in "Hide browse if empty".
b) the IF below that setting refers to the setting. ie as in "Hide browse if empty AND IF ....".

Note that even if the browse is empty the browse is still included "on the page" but it is hidden away. This is necessary so that an ajax browse refresh, that does contain data, will display the new data. So the "container" is there, but it's hidden if there's no data.

>> I can however suppress the browse if I put my condition into the "condition" in the XHtml entry on the NetWebPage that calls the NetWebBrwose procedure.

Correct, and I guess this is what you should do. Note though that this excludes the browse complete from the page, so to make the browse appear at a later stage a complete page refresh will be required.

cheers
Bruce