NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: linas@debetas.lt on October 09, 2011, 03:05:48 PM

Title: Lookup button on readonly string field
Post by: linas@debetas.lt on October 09, 2011, 03:05:48 PM
Hi Bruce and  Nettalks gurus,

I use Nettalk 5.37 and I have a sittuation on a complex NetWebForm where entry fields(Strings) are conditional lookups. To avoid entry mistakes we have readOnly String fields which the user have to fill (For Filling We Provide Lookup) and if you add a lookup to that field nothing happens because the generated text by template is:

if not loc:viewonly and not loc:readonly
      loc:fieldclass = ''
      packet = clip(packet) & p_web.CreateStdButton('submit',Net:Web:LookupButton,loc:formname,p_web._MakeURL('XEnterprise?LookupField=auxEnterprise&Tab=1&ForeignField=Con:companyname1&_sort=&Refresh=sort'),,,,,loc:fieldclass)
    End

If I remove the readonly then it is all good.

If it is not possible to use string/readonly+lookup , I Could use the single buttone for that, but can someone post an example of code for use "LookupProcedure"  on a simple button when you click it opens popup o single page and then returns the selection to the desired field?

Thank you for tips...
Title: Re: Lookup button on readonly string field
Post by: linas@debetas.lt on October 09, 2011, 03:10:45 PM
to explain why I don't use drop box: the lookup window offers solutions like search, sord by columns, display more columns than one. One Word: The lookup window is 200% more convenient  to use.
Title: Re: Lookup button on readonly string field
Post by: kevin plummer on October 09, 2011, 04:29:31 PM
Try the following:

Remove read-only
On the template check the option "User Must choose from lookup"

I think that will do what you want...
Title: Re: Lookup button on readonly string field
Post by: linas@debetas.lt on October 09, 2011, 06:14:22 PM
It did the trick.  ;D and i used custom css on String to look like like readOnly- with different color.



I am still wondering how to do a lookup on "button" not on string.
Title: Re: Lookup button on readonly string field
Post by: Bruce on October 09, 2011, 11:17:17 PM
Hi Linus,

Kevin had the right answer there - lookups occur on strings, not fields.
If you wish to hide the entry field itself use css for that (nt-hidden)

cheers
Bruce

Title: Re: Lookup button on readonly string field
Post by: linas@debetas.lt on October 10, 2011, 03:59:43 PM
yes. Solution was implemented successfully.

Nettalk is ... wOW