首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Smalltalk seaside #call:渲染空白页面

Smalltalk seaside #call:渲染空白页面
EN

Stack Overflow用户
提问于 2017-01-31 08:50:07
回答 1查看 157关注 0票数 1

所以我有一个海滨应用程序。第一个组件只是渲染子组件:

代码语言:javascript
复制
MCRootComponent>>initialize
 super initialize.
 self main: MCMainComponent new.
MCRootComponent>>renderComponentOn:html
 renderContentOn: html
 html render: main 

现在,正在渲染的子组件如下所示:

代码语言:javascript
复制
MCMainComponent>>renderContentOn: html
 html tbsForm:[
  html tbsContainerFluid: [ 
   html anchor
     callback:  [  self call: (MCServiceOrderComponent from: MCServiceOrder new)];
     with: 'New Service Order' ]]

和MCServiceOrderComponent:

代码语言:javascript
复制
MCServiceOrderComponent>>initialize
super initialize.   
customerComponent := MCClienteComponent new.
vehicleComponent := MCVehicleComponent new.
vehicleComponent lookupCallback: [
    self show:(MCVehicleLookupComponent new) onAnswer:[:vehicle|    
    vehicle ifNotNil: [ 
        serviceOrder vehicle: vehicle.
        vehicleComponent objectToRender: vehicle.
        customerComponent objectToRender: vehicle customer ]]]

MCServiceOrderComponent>>renderContentOn: html
html heading level1 with: 'ServiceOrder'.   
html tbsForm with: [ 
    html render: vehicleComponent.
    html render: customerComponent.     
]

到目前为止,这一切都很好。请注意,查找回调被传递给MCVehicleComponent。此块被传递给在MCVehicleComponent中呈现的按钮上的回调。

代码语言:javascript
复制
MCVehicleComponent>>renderContentOn: html
    self renderContainer: 'Vehicle' on: html  with:  [      
        self renderSearchFor: #id on: html with: self lookupCallback.                
        self renderInputFor: #maker on: html.
        self renderInputFor: #model on: html.       
        self renderInputFor: #color on: html ]

MCVehicleComponent>>renderSearchFor: aSymbol on: html with: aBlock
html tbsFormGroup: [ 
       html label: aSymbol asCapitalizedPhrase.
        html tbsInputGroup: [ 
               html textInput tbsFormControl on: aSymbol of: self objectToRender.                   
                        html tbsInputGroupButton: [
                            html tbsButton callback: aBlock;                    
                            with: [ html tbsGlyphIcon iconSearch ] ] ]]

它应该# MCVehicleLookupComponent : to a call并返回结果。然而,实际情况是,一旦调用#call:,页面内容就会变成空白。我尝试过直接从MCMainComponent调用MCVehicleLookupComponent,它工作得很好,所以我知道问题不在这里。你知道是什么导致了这种行为吗?

我是smalltalk的新手,所以请耐心面对愚蠢的问题和可怕的代码(这是我的第一个应用程序。欢迎任何建议)。

EN

回答 1

Stack Overflow用户

发布于 2017-02-02 23:13:06

事实证明我调用了错误的组件。每件事都像是一种魔力。抱歉的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41947994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档