NetTalk Central

Author Topic: Design / Implementation Question  (Read 3353 times)

RichBowman

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Email
Design / Implementation Question
« on: March 14, 2012, 12:19:09 PM »
I have a browse with 3 drop down fields. Based on the value from the 1st drop down I want to do one of 2 things. (1) Continue on with the 2nd and 3rd drop down fields and display the browse using Key # 1 and a filter (this is the way it works now). (2) Use a locator and display the browse using Key # 2. The format of the browse in both cases is the same.

I think I can put a condition on the 2nd and 3rd drop down fields so they will not display if field 1 is equal to a certain value, but what about the browse? Is this 2 browses with 1 hidden all the time?

Any ideas?

Remember I'm very "newbie".

Thank you,

Rich

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Design / Implementation Question
« Reply #1 on: March 14, 2012, 11:50:09 PM »
Hi Rich,

Browses do not use "keys". The key that you set for a browse has to do with the identification of the rows, not their sort order.

Now, before you panic, key's are used. But you don't get to specify them. The View engine automatically picks the best key to match the ORDER of the view. A browse has a SORT ORDER - that may, or may not, match a key. The View engine is responsible for deciding (and you can't specify what it should do.)

[aside: incidentally this is exactly the same as the way a Windows browse works.]

So your #2 becomes;
Use a locator and
Set the "order" of the browse.

If you take a look at the "Locators" example, you'll see how the locator can be turned on an off at runtime.

And if you follow along the same sort of pattern, and look at the generated code, you'll see how the sort order can be set at runtime as well. This may take a bit more effort, but if you get stuck just ask.

So you don't hide/unhide the browse, you just use embed code in the browse itself so it modifies it's behaviors based on the drop-down session values.

cheers
Bruce


cheers
Bruce
 

RichBowman

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Email
Re: Design / Implementation Question
« Reply #2 on: March 15, 2012, 04:26:45 AM »
Very helpful post. It's working quite well. Just several questions about the Locator:

1. Can the Locator field have the UPPERCASE attribute?

2. Can I get rid of the "Locator (Position)" portion of the prompt and just use what I entered in the template?

3. Can I take the Locator value entered and modify it (add a 3 character prefix) before it is applied to the browse?

Thank you,

Rich

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Design / Implementation Question
« Reply #3 on: March 15, 2012, 05:34:12 AM »
>> 1. Can the Locator field have the UPPERCASE attribute?

hmm - well yes, you can put CSS on the field
text-transform:uppercase
but that only changes so it "looks" upper case. You will still need to UPPER the
Loc:LocatorValue
after the call;
Loc:LocatorValue = p_web.GetLocatorValue(....

>> 2. Can I get rid of the "Locator (Position)" portion of the prompt and just use what I entered in the template?

I'm not 100% sure what you mean, but
a) there is a template option to suppress the locator prompt and
b) yes you can change the text of the prompt if you like by setting
p_web.site.LocatePromptTextPosition
before the call to p_web.CreateLocator

>> 3. Can I take the Locator value entered and modify it (add a 3 character prefix) before it is applied to the browse?

yes. modify Loc:LocatorValue after the call to
Loc:LocatorValue = p_web.GetLocatorValue(....

cheers
Bruce