' Ver tb. 1: LoadTableDocumentos
' Ver tb. 2: LoadArticulosTable
public Sub BuildPage()
' initialize the theme
BuildTheme
' initialize this page using our theme
page.InitializeWithTheme(Name, "/ws/" & AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
page.ShowLoader=True
' SPECIAL ONE, we're going to add chips later for the zip attachments, but not in the build
' however, we want all javascript code and css code to be loaded.
' Note: in case you add chips in BuildPage() this is done automatically by ABMaterial
' page.NeedsChips = True
' page.PageTitle = "ABMFeedback"
' page.PageDescription = "Feedback App for the ABMaterial Framework for B4J"
page.PageTitle = "Pedidos"
page.PageDescription = "Consulta de Pedidos"
page.PageHTMLName = "index.html"
page.PageKeywords = ""
page.PageSiteMapPriority = ""
page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_YEARLY
'page.DisableBackButton = True
page.ShowConnectedIndicator = True
ABMShared.BuildNavigationBar(page, "Consulta de Pedidos", "../images/logo.png", "Cases", "", "")
' create the page grid
page.AddRowsM(2,True,0,0, "").AddCells12(1,"")
page.AddRows(1,True, "").AddCellsOS(1,0,0,0,6,6,8,"").AddCellsOS(1,0,0,0,4,4,2,"").AddCellsOSMP(1,0,0,0,2,2,1,14,0,0,0,"")
page.AddRows(4,True, "").AddCells12(1,"")
page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
' add a modal sheet template to enter user information
'page.AddModalSheetTemplate(BuildInputSheet)
Log("antes carga 1")
page.AddModalSheetTemplate(BuildEdicionCabDoc(True))
If ABMShared.lDocumentoConFolder = False Then '// AMM Al 01/08/2016
Log("antes carga 2")
page.AddModalSheetTemplate(BuildEdicionCabDoc(False))
End If
Log("fin carga")
page.AddModalSheetTemplate(BuildEdicionArticulo)
' add a modal sheet template for a yes no msgbox
page.AddModalSheetTemplate(BuildMsgBoxYesNo)
' add a modal sheet template for a msgbox
page.AddModalSheetTemplate(BuildMsgBox)
page.AddModalSheetTemplate(BuildBusca)
page.AddModalSheetTemplate(BuildFrmCliArt)
page.AddModalSheetTemplate(buildMuestraFoto)
page.AddModalSheetTemplate( ABMShared.BuildVisorPdf(page) )
#Region comun_todas_paginas_1
page.AddModalSheetTemplate( ABMShared.BuildSelectorClientes(page) )
#end region
' add paragraph
'page.CellR(1,1).AddComponent(ABMShared.BuildParagraphBQ(page,"par1","Before submitting a new case, please check if it is not in the Feedback already!") )
page.CellR(1,1).AddComponent(ABMShared.BuildParagraphBQ(page,"par1","Pulse sobre la cabecera de las columnas para ordenar ascendente / descendentemente") )
'If ABMShared.lAplClienteDirecto = False Then
If True Then
Dim searchCase As ABMInput
''searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Search case", False, "lightblue")
'searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Búsqueda por nombre de cliente", False, "lightblue")
searchCase.Initialize(page, "searchCase", ABM.INPUT_TEXT, "Referencia", False, "lightblue")
page.CellR(1,1).AddComponent(searchCase)
Else
' Pongo un label por poner algo para el grid de de la pagina
Dim xsearchCase As ABMLabel
xsearchCase.Initialize(page, "xid", ".", ABM.SIZE_H6, True, "")
page.CellR(1,1).AddComponent(xsearchCase)
End If
Dim casestatussearch As ABMCombo
'casestatussearch.Initialize(page, "casestatussearch", "Status", 650 , "lightblue")
casestatussearch.Initialize(page, "casestatussearch", "Estado", 650 , "lightblue")
' add items
''casestatussearch.AddItem("statsearchmycases", "My cases", BuildSimpleItem("SSTMC", "mdi-action-account-box", "{NBSP}{NBSP}My cases"))
casestatussearch.AddItem("statsearch0", "Grabado" , BuildSimpleItem("SST0", "mdi-image-filter-1", "{NBSP}{NBSP}Grabado" ))
casestatussearch.AddItem("statsearch1", "Gestionado" , BuildSimpleItem("SST2", "mdi-image-filter-2", "{NBSP}{NBSP}Gestionado" ))
casestatussearch.AddItem("statsearch2", "Preparación", BuildSimpleItem("SST3", "mdi-image-filter-3", "{NBSP}{NBSP}Preparación"))
casestatussearch.AddItem("statsearch3", "Preparado" , BuildSimpleItem("SST1", "mdi-image-filter-4", "{NBSP}{NBSP}Preparado" ))
casestatussearch.AddItem("statsearch4", "Enviado" , BuildSimpleItem("SST4", "mdi-image-filter-5", "{NBSP}{NBSP}Enviado " ))
casestatussearch.SetActiveItemId("statsearch")
page.CellR(0,2).AddComponent(casestatussearch)
Dim lBotonBuscar As Boolean = True '''''''''''''''''''''''''''''''''''''''''''''''False ' Ahora busca al pulsar en el combo
If lBotonBuscar Then
Dim btnSearch As ABMButton
btnSearch.InitializeFloating(page, "btnSearch", "mdi-action-search", "")
page.CellR(0,3).AddComponent(btnSearch)
End If
If lTableScrollableCabDoc = False Then
Dim pagination As ABMPagination
pagination.Initialize(page, "pagination", 10, True, True, "")
pagination.SetTotalNumberOfPages(20)
page.CellR(1,1).AddComponent(pagination)
End If
' create a table
Dim tblCases As ABMTable
If lTableScrollableCabDoc = False Then
tblCases.IsResponsive = True
End If
If lTableScrollableCabDoc = False Then
tblCases.Initialize(page, "tblCabDoc", True, True, True, "tbltheme")
End If
Dim lstWidths As List
'tblCases.
Dim lMostrarObservaciones As Boolean = ABMShared.lModoDistribuidor = False
Dim cLeyeObservac As String = "Observaciones"
Dim nSizeObservac As Int
Dim nSum As Int = 0
If ABMShared.lAplClienteDirecto = False Then
' Esto de aqui abajo no sirve: cuando sea distribuidor SIEMPRE sera SI cliente directo.
nSizeObservac = 20 '30
If lMostrarObservaciones = False Then
cLeyeObservac = ""
nSizeObservac = 0
nSum = 100
End If
' 08/09/16. A este le falta borrador y factura
tblCases.SetHeaders( Array As String ("ID" , "Referencia", "Estado" , "" , "Nº Pedido", "Borrador", "Fecha Pedido" , "Cód. Centro" , "Nombre Centro" , "Nombre Comercial", "Total Pedido", cLeyeObservac , "Editar" , "Impri." , "Borrar", "Factura" ))
tblCases.SetHeaderThemes( Array As String ("bg" , "bg" , "bg" , "bg" , "bg" , "bgc2" , "bg" , "bg" , "bg" , "bg" , "bg" , "bg" ,"bgc" , "bgc" , "bgc" , "bgc" ))
tblCases.SetHeaderHeights( Array As Int (0 , 0 , 0 , 0 , 0 , 48 , 0 , 0 , 0 , 0 , 0 , 0 , 48 , 48 , 48 , 48 ))
' Modificar tb. TableDocumentos_1
' Modificar tb. AQUI_5
tblCases.SetColumnVisible( Array As Boolean(False, True , True , True , True , True , True , True , True , True , True , True , True , True , True , True ))
tblCases.SetColumnSortable( Array As Boolean(False, True , True , True , True , False , True , True , True , True , True , False ,False , False , False , False ))
tblCases.SetColumnDataFields(Array As String ("" , "speped" , "staped" , "" , "numped" , "brrped" , "fecped" , "cliped" , "nclped" , "estped" , "totped" , "ob1ped" ,"" , "" , "" , "numfacped"))
lstWidths = Array As Int (0 , 100 , 50 , 90 , 80 , 70 , 110 , 100 , 200 , 200 , 140 , nSizeObservac ,60 , 60 , 60 , 60 )
Else
nSizeObservac = 350
If lMostrarObservaciones = False Then
cLeyeObservac = ""
nSizeObservac = 0
nSum = 10 ' 60
End If
Dim nMargen As Int = 0 ''''200 ' Para que salga bien cuando ABMShared.lAplClienteDirecto = False pq aqui parece se reserva el espacio (carga estatica)
tblCases.SetHeaders( Array As String ("ID" , "Referencia", "Estado" , "" , "Nº Pedido", "Borrador" , "Fecha Pedido" , "Total Pedido", cLeyeObservac , "Editar" , "Imprimir", "Borrar", "Factura" ))
tblCases.SetHeaderThemes( Array As String ("bg" , "bg" , "bg" , "bg" , "bg" , "bgc2" , "bg" , "bg" , "bg" ,"bgc" , "bgc" , "bgc" , "bgc" ))
tblCases.SetHeaderHeights( Array As Int (0 , 0 , 0 , 0 , 0 , 48 , 0 , 0 , 0 , 48 , 48 , 48 , 48 ))
' Modificar tb. TableDocumentos_1
' Modificar tb. AQUI_5
tblCases.SetColumnVisible( Array As Boolean(False, True , True , True , True , True , True , True , True , True , True , True , True ))
tblCases.SetColumnSortable( Array As Boolean(False, True , True , True , True , False , True , True , False ,False , False , False , False ))
tblCases.SetColumnDataFields(Array As String ("" , "speped" , "staped" , "" , "numped" , "brrped" , "fecped" ,"totped" , "ob1ped" ,"" , "" , "" , "numfacped"))
lstWidths = Array As Int (0 , 100 , 60 , 100 , 150+ nSum , 100 , 150+ nSum , 150+ nSum , nSizeObservac ,150 , 150 , 150 , 150+ nMargen )
End If
If lTableScrollableCabDoc Then
tblCases.InitializeScrollable(page, "tblCabDoc", True, True, True, lstWidths, "tbltheme")
'tblCases.Initialize(page, "tblCabDoc", True, True, True, "tbltheme")
End If
tblCases.SetFooter("Total número de pedidos: 0", 10,"bg")
If lTableScrollableCabDoc Then
''page.Cell(5,1).SetFixedHeight(360)
page.CellR(1,1).SetFixedHeight(650) ' Ver SetFixedHeight_1
page.Cell(page.CurrentRow, 1).AddComponent(tblCases)
Else
page.CellR(1,1).AddComponent(tblCases)
End If
'If ABMShared.lAplClienteDirecto Then ' AMM Al 20/10/16
' create the action button
Dim AddCaseBtn As ABMActionButton
AddCaseBtn.Initialize(page, "btnAddDocumento", "mdi-content-add", "bigblue", "")
AddCaseBtn.MainButton.Size = ABM.BUTTONSIZE_LARGE
' add to page
page.AddActionButton(AddCaseBtn)
'End If
End Sub