Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access xml from class #278

Open
varadig opened this issue May 8, 2018 · 2 comments
Open

Access xml from class #278

varadig opened this issue May 8, 2018 · 2 comments

Comments

@varadig
Copy link

varadig commented May 8, 2018

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
    }
}

@RealyUniqueName
Copy link
Owner

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?

@varadig
Copy link
Author

varadig commented May 14, 2018

StablexuiTest.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants