Results 1 to 6 of 6

Thread: Grid Section - Hyperlink click

  1. #1
    Senior Member
    Join Date
    Jan 2016
    Posts
    160

    Grid Section - Hyperlink click

    I have a grid section that I have set up a hyperlink on but do not have it pointing to anything. I would like to have the operator click on the hyperlink and simply store that value in a variable. I have tried putting my procedure in click and click hyperlink but it does not appear to work. Any suggestions on the best way to do this. It is basically a table of invoices and I need to store an invoice number of a selected record in the grid section on a click. the process seems simple enough.

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Rdd1963.

    When you set a grid field as a hyperlink, you need use the "Link click delegate" on the section.
    Name:  2018-01-06 11_36_57-Lianja App Builder v4.1Beta21 [sfm] - UTF-8 - sfm - Licensed to Soft up Solu.jpg
Views: 141
Size:  62.3 KB

    In this case, I've a column "File" whith the "Hyperlink" set to "true".

    My code is:
    Code:
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'linkclick' event
    proc Documenti_linkclick(hyperlinktext, _text)
    	
    	? "Documenti_linkclick"
    	? "1 " + hyperlinktext
    	? "2 " + _text
    	
    	Q_selectTable("progetti")
    	locate for progetti.id = documenti.progettoid
    	
    //	MessageBox("You clicked '" + hyperlinktext + "' with text " + _text + "'")
    	
    	// insert your code here
    	m_default = default()
    	? "comando " + hyperlinktext + " " + _text
    	if hyperlinktext == "m_load_documenti_file"
    		
    		create_link_file()
    	
    	endif
    
    	if hyperlinktext == "m_edit_caso"
    		
    		select documenti
    		
    		? "documenti.id = " + etos(documenti.id)
    		m_filtro = "page:documento.Documento_documento?action=search&" + "text=" + etos(documenti.id)
    				
    		? "m_filtro" + m_filtro
    		Documento_changed()
    	
    // apre nella stess app
    //		Lianja.showDocument(m_filtro)
    		
    // apre la nuova app
    		lianja.spawnapp("SFM_Documento","","", "page:documento?action=search&text=" + etos(documenti.id))
    		
    //		Lianja.showDocument("page:documento.Documento_documento?action=show")	
    	
    //		Lianja.showDocument("page:documento?action=show")		
    	endif
    	
    	if hyperlinktext == "m_load_allegati_file"
    		select allegati
    
    		if empty(allegati.file)
    			nReturn = 6
    		else			
    			nReturn = messagebox("Sei sicuro?", 36, "Attenzione, c'è già un file assegnato")
    		endif			
    		if nReturn = 6
    	
    			m_recno = recno()		
    			oGrid = Lianja.Get("documento.documento_allegati").grid
    			
    			m_newDefault = mline(progetti.path, 1)
    			if !empty(m_newDefault)
    				set default to &m_newDefault
    			endif
    			
    			m_file = getfile()
    			if !empty(m_file)
    				select allegati
    				goto m_recno
    	
    				replace allegati.file with m_file
    				if m_recno > 1
    					oGrid.refreshRecord( m_recno )
    				endif
    			endif
    		else
    		    // user selected 'No', process accordingly
    		endif			
    	endif
    	
    	set default to &m_default
    			
    	if hyperlinktext = "m_open_documenti_file"
    		? "Apertura file " + mline(documenti.file, 1)
    		showdocument("file:///" + mline(documenti.file, 1))
    	endif
    
    	if hyperlinktext = "m_open_allegati_file"
    		? "Apertura file " + mline(allegati.file, 1)
    		showdocument("file:///" + mline(allegati.file, 1))
    	endif
    
    	if hyperlinktext = "CASO"
    		select documenti
    		m_filtro = "page:documento.documento_documento?action=search&text=" + etos(documenti.id)
    				
    		? m_filtro
    		Lianja.showDocument(m_filtro)
    		Lianja.showDocument("page:documento.documento_documento?action=show")
    	endif
    		
    		
    endproc

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    When you click a link in a grid the row and record are made current before calling the delegate so you can reference the record number to link invoices together.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  4. #4
    Senior Member
    Join Date
    Jan 2016
    Posts
    160
    OK, I am sure I am overlooking something simple. Just to test to see if the hyperlink was working I created a procedure and went from there Below is what I created, but it does not appear to work when I click on the hyperlink in runtime. Nothing happens when I click the hyperlink. Below are the screen shots of what I created.

    Name:  Capture.jpg
Views: 129
Size:  62.9 KB
    Name:  Capture 2.jpg
Views: 76
Size:  62.7 KB
    Name:  Capture 3.jpg
Views: 130
Size:  62.4 KB

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    show() not show as it is a method.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Senior Member
    Join Date
    Jan 2016
    Posts
    160
    Thank you. I knew it was something easy, probably syntax.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us