- Fórum
- Protheus/Microsiga/Totvs
- AdvPL (Advanced Protheus Language)
- Dúvidas Gerais
- MVC modelo 3 - incluir não funciona
×
Linguagem de Programação ADVPL
Perguntas MVC modelo 3 - incluir não funciona
- renatosever
- Autor do Tópico
- Desconectado
- Membro Júnior
Menos
Mais
- Postagens: 23
- Obrigados Recebidos: 0
9 anos 9 meses atrás #27028
por renatosever
MVC modelo 3 - incluir não funciona foi criado por renatosever
Boa tarde, estou tentando criar uma browser utilizando MVC, quando clico na opção incluir não acontece nada, quando debugo fica parado no retorno da rotina:
Return aRotina
Mas não informa erro nenhum.
Alguém tem alguma ideia?
Segue o código abaixo:
/*
******
*/
User Function MVC_ZPF
Local cAlias := "ZPF"
Local cTitle := "Controle de EPI"
Local oBrowse := FWMBrowse():New()
Private aRotina := MenuDef()
oBrowse:SetAlias(cAlias)
oBrowse:SetDescription(cTitle)
oBrowse:Activate()
Return NIL
//
//
Static Function MenuDef()
Private aRotina := {}
ADD OPTION aRotina TITLE "Pesquisar" ACTION "PESQBRW" OPERATION 1 ACCESS 0
ADD OPTION aRotina TITLE "Visualizar" ACTION "VIEWDEF.M3_MVC" OPERATION 2 ACCESS 0
ADD OPTION aRotina TITLE "Incluir" ACTION "VIEWDEF.M3_MVC" OPERATION 3 ACCESS 0
ADD OPTION aRotina TITLE "Alterar" ACTION "VIEWDEF.M3_MVC" OPERATION 4 ACCESS 0
ADD OPTION aRotina TITLE "Excluir" ACTION "VIEWDEF.M3_MVC" OPERATION 5 ACCESS 0
ADD OPTION aRotina TITLE "Imprimir" ACTION "VIEWDEF.M3_MVC" OPERATION 8 ACCESS 0
//ADD OPTION aRotina TITLE "Copiar" ACTION "VIEWDEF.M3_MVC" OPERATION 9 ACCESS 0
Return aRotina
//
//
Static Function ModelDef()
Local oStruZPF := FWFormStruct(1, "ZPF")
Local oStruZPI := FWFormStruct(1, "ZPI")
Local oModel := MPFormModel():New("M3M")
oModel:AddFields("ZPFMASTER", /*cOwner*/, oStruZPF)
oModel:AddGrid("ZPIDETAIL", "ZPFMASTER", oStruZPI)
oModel:SetRelation("ZPIDETAIL", {{'ZPI_FILIAL', 'xFilial("ZPI")'}, {"ZPI_CODIGO", "ZPF_CODIGO"}}, ZPI->(IndexKey(5)))
oModel:SetDescription("Controle de EPI")
oModel:GetModel("ZPFMASTER"):SetDescription("Ficha Funcionario")
oModel:GetModel("ZPIDETAIL"):SetDescription("Itens de EPI")
Return oModel
//
//
Static Function ViewDef()
Local oStruZPF := FWFormStruct(2, "ZPF")
Local oStruZPI := FWFormStruct(2, "ZPI")
//Local oModel := FWLoadModel("MVC_ZPF")
Local oModel := FWLoadModel("M3_MVC")
Local oView := NIL
oView := FWFormView():New()
oView:SetModel(oModel)
oView:AddField("VIEW_ZPF", oStruZPF, "ZPFMASTER")
oView:AddGrid("VIEW_ZPI", oStruZPI, "ZPIDETAIL")
oView:CreateHorizontalBox("SUPERIOR", 50)
oView:CreateHorizontalBox("INFERIOR", 50)
oView:SetOwnerView("VIEW_ZPF", "SUPERIOR")
oView:SetOwnerView("VIEW_ZPI", "INFERIOR")
oView:EnableTitleView("VIEW_ZPF")
oView:EnableTitleView("VIEW_ZPI")
Return oView
Return aRotina
Mas não informa erro nenhum.
Alguém tem alguma ideia?
Segue o código abaixo:
/*
******
*/
User Function MVC_ZPF
Local cAlias := "ZPF"
Local cTitle := "Controle de EPI"
Local oBrowse := FWMBrowse():New()
Private aRotina := MenuDef()
oBrowse:SetAlias(cAlias)
oBrowse:SetDescription(cTitle)
oBrowse:Activate()
Return NIL
//
//
Static Function MenuDef()
Private aRotina := {}
ADD OPTION aRotina TITLE "Pesquisar" ACTION "PESQBRW" OPERATION 1 ACCESS 0
ADD OPTION aRotina TITLE "Visualizar" ACTION "VIEWDEF.M3_MVC" OPERATION 2 ACCESS 0
ADD OPTION aRotina TITLE "Incluir" ACTION "VIEWDEF.M3_MVC" OPERATION 3 ACCESS 0
ADD OPTION aRotina TITLE "Alterar" ACTION "VIEWDEF.M3_MVC" OPERATION 4 ACCESS 0
ADD OPTION aRotina TITLE "Excluir" ACTION "VIEWDEF.M3_MVC" OPERATION 5 ACCESS 0
ADD OPTION aRotina TITLE "Imprimir" ACTION "VIEWDEF.M3_MVC" OPERATION 8 ACCESS 0
//ADD OPTION aRotina TITLE "Copiar" ACTION "VIEWDEF.M3_MVC" OPERATION 9 ACCESS 0
Return aRotina
//
//
Static Function ModelDef()
Local oStruZPF := FWFormStruct(1, "ZPF")
Local oStruZPI := FWFormStruct(1, "ZPI")
Local oModel := MPFormModel():New("M3M")
oModel:AddFields("ZPFMASTER", /*cOwner*/, oStruZPF)
oModel:AddGrid("ZPIDETAIL", "ZPFMASTER", oStruZPI)
oModel:SetRelation("ZPIDETAIL", {{'ZPI_FILIAL', 'xFilial("ZPI")'}, {"ZPI_CODIGO", "ZPF_CODIGO"}}, ZPI->(IndexKey(5)))
oModel:SetDescription("Controle de EPI")
oModel:GetModel("ZPFMASTER"):SetDescription("Ficha Funcionario")
oModel:GetModel("ZPIDETAIL"):SetDescription("Itens de EPI")
Return oModel
//
//
Static Function ViewDef()
Local oStruZPF := FWFormStruct(2, "ZPF")
Local oStruZPI := FWFormStruct(2, "ZPI")
//Local oModel := FWLoadModel("MVC_ZPF")
Local oModel := FWLoadModel("M3_MVC")
Local oView := NIL
oView := FWFormView():New()
oView:SetModel(oModel)
oView:AddField("VIEW_ZPF", oStruZPF, "ZPFMASTER")
oView:AddGrid("VIEW_ZPI", oStruZPI, "ZPIDETAIL")
oView:CreateHorizontalBox("SUPERIOR", 50)
oView:CreateHorizontalBox("INFERIOR", 50)
oView:SetOwnerView("VIEW_ZPF", "SUPERIOR")
oView:SetOwnerView("VIEW_ZPI", "INFERIOR")
oView:EnableTitleView("VIEW_ZPF")
oView:EnableTitleView("VIEW_ZPI")
Return oView
Por favor Acessar ou Registrar para participar da conversa.
- Fórum
- Protheus/Microsiga/Totvs
- AdvPL (Advanced Protheus Language)
- Dúvidas Gerais
- MVC modelo 3 - incluir não funciona
Tempo para a criação da página:0.116 segundos