StablexUI icon indicating copy to clipboard operation
StablexUI copied to clipboard

Access xml from class

Open varadig opened this issue 6 years ago • 2 comments

There is a way to access object which is implemented in xml from haxe class?

upload.xml

<UploadScreen id="'upload'" childPadding="25" widthPt="100" heightPt="100" autoWidth="true">
    <CoreText format-size="30"
              format-font="'Arial'"
              format-color="0x656565"
              label-htmlText="'Drag and drop your pictures here!'"/>
    <CoreBox w="600" h="350"
             skin:Paint-borderColor="0xe7e7e7"
             skin:Paint-color="0xFFFFFF"
             skin:Paint-border="2"
             skin:Paint-corners="[30]">
        <CoreText id="'fileCounter'"
                  format-align="'center'"
                  format-size="60"
                  format-font="'Arial'"
                  format-color="0x636799"/>
    </CoreBox>
    <CoreText format-size="30"
              format-font="'Arial'"
              format-color="0x656565"
              label-htmlText="'or browse your computer'"/>
    <CoreButton text="'browse'"
                format-font="'Arial'"
                on-click="this.sc.getService($FileController.SERVICE_BROWSE_FILES).execute();"/>
    <CoreButton id="'proceedButton'"
                text="'proceed'"
                alpha="0"
                mouseEnabled="false"
                format-font="'Arial'"
                on-click="this.sc.getService($ViewController.SERVICE_SHOW_SCREEN).addParam($BaseController.DATA,{index:2,screenId:'editor',direction:'left'}).execute();"/>
</UploadScreen>

UploadScreen.hx:


package view.screen;
import ru.stablex.ui.UIBuilder;
import view.screen.base.BaseScreen;
class UploadScreen extends BaseScreen{
    public function new() {
        super();
//        trace(this.proceedButton);//no field proceedButton
        trace(UIBuilder.get('proceedButton'));//UploadScreen.hx:8: null
    }
}

varadig avatar May 08 '18 03:05 varadig

If your BaseScreen class is created with ru.stablex.ui.UIBuilder.buildClass() then it should work as you expect. Can you please provide a full minimal sample so i can reproduce your issue?

RealyUniqueName avatar May 10 '18 11:05 RealyUniqueName

StablexuiTest.zip

varadig avatar May 14 '18 19:05 varadig