You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Luiz Gustavo <lu...@gmail.com> on 2011/07/17 15:31:30 UTC
Problems reading bxml resources
Hi,
I'm facing problems trying to run in browser an application that runs fine
in desktop.
When I click on a menu item that calls an action that just open an Alert (I
did it for testing pourpose) it works, but if the called action tries to
open a frame, it doesn't work.
Here's an example of an action that doesn't work:
Action.getNamedActions().put("abrirCentrosCusto", new Action() {
@Override
public void perform(Component source) {
try {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
Resources resources = new Resources(CentroCustoFrm.class
.getName(), locale);
// só irá criar a tela uma única vez
if (centroCusto == null) {
*centroCusto = (CentroCustoFrm) bxmlSerializer
.readObject(CentroCustoFrm.class
.getResource("centro_custo.bxml"),
resources);*
}
if (centroCusto.isClosed()) {
centroCusto.open(window);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SerializationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
*Alert.alert(e.getMessage(), window);*
e.printStackTrace();
}
}
});
I have put some Alert dialogs along this method, to identify where it was
possible to reach and discovered that bxmlSerializer and resources instances
are created, but *centroCusto* don't.
*Alert.alert(e.getMessage(), window) *shows this message:
*descricao is not accessible
descricao *is an bxml:id in the centro_custo.bxml file:
<TablePane.Row height="50">
<Form>
<Form.Section>
<TextInput Form.label="%lblDescricao" textSize="40"
bxml:id="descricao"/>
</Form.Section>
</Form>
</TablePane.Row>
Any ideas of what can be done for this method to work fine?
--
Luiz Gustavo S. de Souza
http://luizgustavoss.wordpress.com
Re: Problems reading bxml resources
Posted by Chris Bartlett <cb...@gmail.com>.
Good to hear! :)
On 18 July 2011 07:47, Luiz Gustavo <lu...@gmail.com> wrote:
> Chris,
>
> thank you very much. It works now.
> I had to sign all the jars and now it works fine.
>
> Best regards,
> Luiz Gustavo
>
> 2011/7/17 Chris Bartlett <cb...@gmail.com>
>>
>> Luiz,
>>
>> Are you using the @BXML annotation to refer to the 'descricao'
>> TextInput? If so, it might be related to applet signing.
>> Here is a recent thread that discussed how to get access to objects in
>> unsigned applets.
>>
>> http://apache-pivot-users.399431.n3.nabble.com/Examples-still-using-namespace-get-instead-of-BXML-td3030718.html#a3031859
>>
>> And here is the result of a search of the nabble Pivot User mailing
>> list archives
>>
>> http://apache-pivot-users.399431.n3.nabble.com/template/NamlServlet.jtp?macro=search_page&node=399431&query=applet+sign+jar&days=0
>>
>> I don't run any of my apps as applets, so hopefully someone will
>> correct me soon if I have told you the wrong thing!
>>
>> Chris
>>
>> On 17 July 2011 20:31, Luiz Gustavo <lu...@gmail.com> wrote:
>> > Hi,
>> >
>> > I'm facing problems trying to run in browser an application that runs
>> > fine
>> > in desktop.
>> >
>> > When I click on a menu item that calls an action that just open an Alert
>> > (I
>> > did it for testing pourpose) it works, but if the called action tries to
>> > open a frame, it doesn't work.
>> >
>> >
>> > Here's an example of an action that doesn't work:
>> >
>> >
>> >
>> > Action.getNamedActions().put("abrirCentrosCusto", new Action() {
>> > @Override
>> > public void perform(Component source) {
>> > try {
>> > BXMLSerializer bxmlSerializer = new
>> > BXMLSerializer();
>> > Resources resources = new
>> > Resources(CentroCustoFrm.class
>> > .getName(), locale);
>> > // só irá criar a tela uma única vez
>> > if (centroCusto == null) {
>> > centroCusto = (CentroCustoFrm) bxmlSerializer
>> > .readObject(CentroCustoFrm.class
>> >
>> > .getResource("centro_custo.bxml"),
>> > resources);
>> > }
>> >
>> > if (centroCusto.isClosed()) {
>> > centroCusto.open(window);
>> > }
>> > } catch (IOException e) {
>> > // TODO Auto-generated catch block
>> > e.printStackTrace();
>> > } catch (SerializationException e) {
>> > // TODO Auto-generated catch block
>> > e.printStackTrace();
>> > } catch (Exception e) {
>> > // TODO Auto-generated catch block
>> > Alert.alert(e.getMessage(), window);
>> > e.printStackTrace();
>> > }
>> > }
>> > });
>> >
>> >
>> > I have put some Alert dialogs along this method, to identify where it
>> > was
>> > possible to reach and discovered that bxmlSerializer and resources
>> > instances
>> > are created, but centroCusto don't.
>> > Alert.alert(e.getMessage(), window) shows this message:
>> >
>> >
>> > descricao is not accessible
>> >
>> >
>> > descricao is an bxml:id in the centro_custo.bxml file:
>> >
>> >
>> >
>> > <TablePane.Row height="50">
>> > <Form>
>> > <Form.Section>
>> >
>> > <TextInput Form.label="%lblDescricao"
>> > textSize="40"
>> > bxml:id="descricao"/>
>> >
>> > </Form.Section>
>> > </Form>
>> > </TablePane.Row>
>> >
>> >
>> > Any ideas of what can be done for this method to work fine?
>> >
>> >
>> > --
>> > Luiz Gustavo S. de Souza
>> >
>> > http://luizgustavoss.wordpress.com
>> >
>> >
>> >
>
>
>
> --
> Luiz Gustavo S. de Souza
>
> http://luizgustavoss.wordpress.com
>
>
>
Re: Problems reading bxml resources
Posted by Luiz Gustavo <lu...@gmail.com>.
Chris,
thank you very much. It works now.
I had to sign all the jars and now it works fine.
Best regards,
Luiz Gustavo
2011/7/17 Chris Bartlett <cb...@gmail.com>
> Luiz,
>
> Are you using the @BXML annotation to refer to the 'descricao'
> TextInput? If so, it might be related to applet signing.
> Here is a recent thread that discussed how to get access to objects in
> unsigned applets.
>
> http://apache-pivot-users.399431.n3.nabble.com/Examples-still-using-namespace-get-instead-of-BXML-td3030718.html#a3031859
>
> And here is the result of a search of the nabble Pivot User mailing
> list archives
>
> http://apache-pivot-users.399431.n3.nabble.com/template/NamlServlet.jtp?macro=search_page&node=399431&query=applet+sign+jar&days=0
>
> I don't run any of my apps as applets, so hopefully someone will
> correct me soon if I have told you the wrong thing!
>
> Chris
>
> On 17 July 2011 20:31, Luiz Gustavo <lu...@gmail.com> wrote:
> > Hi,
> >
> > I'm facing problems trying to run in browser an application that runs
> fine
> > in desktop.
> >
> > When I click on a menu item that calls an action that just open an Alert
> (I
> > did it for testing pourpose) it works, but if the called action tries to
> > open a frame, it doesn't work.
> >
> >
> > Here's an example of an action that doesn't work:
> >
> >
> >
> > Action.getNamedActions().put("abrirCentrosCusto", new Action() {
> > @Override
> > public void perform(Component source) {
> > try {
> > BXMLSerializer bxmlSerializer = new BXMLSerializer();
> > Resources resources = new
> Resources(CentroCustoFrm.class
> > .getName(), locale);
> > // só irá criar a tela uma única vez
> > if (centroCusto == null) {
> > centroCusto = (CentroCustoFrm) bxmlSerializer
> > .readObject(CentroCustoFrm.class
> >
> .getResource("centro_custo.bxml"),
> > resources);
> > }
> >
> > if (centroCusto.isClosed()) {
> > centroCusto.open(window);
> > }
> > } catch (IOException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (SerializationException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (Exception e) {
> > // TODO Auto-generated catch block
> > Alert.alert(e.getMessage(), window);
> > e.printStackTrace();
> > }
> > }
> > });
> >
> >
> > I have put some Alert dialogs along this method, to identify where it was
> > possible to reach and discovered that bxmlSerializer and resources
> instances
> > are created, but centroCusto don't.
> > Alert.alert(e.getMessage(), window) shows this message:
> >
> >
> > descricao is not accessible
> >
> >
> > descricao is an bxml:id in the centro_custo.bxml file:
> >
> >
> >
> > <TablePane.Row height="50">
> > <Form>
> > <Form.Section>
> >
> > <TextInput Form.label="%lblDescricao"
> textSize="40"
> > bxml:id="descricao"/>
> >
> > </Form.Section>
> > </Form>
> > </TablePane.Row>
> >
> >
> > Any ideas of what can be done for this method to work fine?
> >
> >
> > --
> > Luiz Gustavo S. de Souza
> >
> > http://luizgustavoss.wordpress.com
> >
> >
> >
>
--
Luiz Gustavo S. de Souza
http://luizgustavoss.wordpress.com
Re: Problems reading bxml resources
Posted by Luiz Gustavo <lu...@gmail.com>.
Chris,
you're right. I'm using @BXML to refer to the TextInput.
I will read the topics you pointed.
Thank you very much for the tip.
Best regards,
Luiz Gustavo
2011/7/17 Chris Bartlett <cb...@gmail.com>
> Luiz,
>
> Are you using the @BXML annotation to refer to the 'descricao'
> TextInput? If so, it might be related to applet signing.
> Here is a recent thread that discussed how to get access to objects in
> unsigned applets.
>
> http://apache-pivot-users.399431.n3.nabble.com/Examples-still-using-namespace-get-instead-of-BXML-td3030718.html#a3031859
>
> And here is the result of a search of the nabble Pivot User mailing
> list archives
>
> http://apache-pivot-users.399431.n3.nabble.com/template/NamlServlet.jtp?macro=search_page&node=399431&query=applet+sign+jar&days=0
>
> I don't run any of my apps as applets, so hopefully someone will
> correct me soon if I have told you the wrong thing!
>
> Chris
>
> On 17 July 2011 20:31, Luiz Gustavo <lu...@gmail.com> wrote:
> > Hi,
> >
> > I'm facing problems trying to run in browser an application that runs
> fine
> > in desktop.
> >
> > When I click on a menu item that calls an action that just open an Alert
> (I
> > did it for testing pourpose) it works, but if the called action tries to
> > open a frame, it doesn't work.
> >
> >
> > Here's an example of an action that doesn't work:
> >
> >
> >
> > Action.getNamedActions().put("abrirCentrosCusto", new Action() {
> > @Override
> > public void perform(Component source) {
> > try {
> > BXMLSerializer bxmlSerializer = new BXMLSerializer();
> > Resources resources = new
> Resources(CentroCustoFrm.class
> > .getName(), locale);
> > // só irá criar a tela uma única vez
> > if (centroCusto == null) {
> > centroCusto = (CentroCustoFrm) bxmlSerializer
> > .readObject(CentroCustoFrm.class
> >
> .getResource("centro_custo.bxml"),
> > resources);
> > }
> >
> > if (centroCusto.isClosed()) {
> > centroCusto.open(window);
> > }
> > } catch (IOException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (SerializationException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (Exception e) {
> > // TODO Auto-generated catch block
> > Alert.alert(e.getMessage(), window);
> > e.printStackTrace();
> > }
> > }
> > });
> >
> >
> > I have put some Alert dialogs along this method, to identify where it was
> > possible to reach and discovered that bxmlSerializer and resources
> instances
> > are created, but centroCusto don't.
> > Alert.alert(e.getMessage(), window) shows this message:
> >
> >
> > descricao is not accessible
> >
> >
> > descricao is an bxml:id in the centro_custo.bxml file:
> >
> >
> >
> > <TablePane.Row height="50">
> > <Form>
> > <Form.Section>
> >
> > <TextInput Form.label="%lblDescricao"
> textSize="40"
> > bxml:id="descricao"/>
> >
> > </Form.Section>
> > </Form>
> > </TablePane.Row>
> >
> >
> > Any ideas of what can be done for this method to work fine?
> >
> >
> > --
> > Luiz Gustavo S. de Souza
> >
> > http://luizgustavoss.wordpress.com
> >
> >
> >
>
--
Luiz Gustavo S. de Souza
http://luizgustavoss.wordpress.com
Re: Problems reading bxml resources
Posted by Chris Bartlett <cb...@gmail.com>.
Luiz,
Are you using the @BXML annotation to refer to the 'descricao'
TextInput? If so, it might be related to applet signing.
Here is a recent thread that discussed how to get access to objects in
unsigned applets.
http://apache-pivot-users.399431.n3.nabble.com/Examples-still-using-namespace-get-instead-of-BXML-td3030718.html#a3031859
And here is the result of a search of the nabble Pivot User mailing
list archives
http://apache-pivot-users.399431.n3.nabble.com/template/NamlServlet.jtp?macro=search_page&node=399431&query=applet+sign+jar&days=0
I don't run any of my apps as applets, so hopefully someone will
correct me soon if I have told you the wrong thing!
Chris
On 17 July 2011 20:31, Luiz Gustavo <lu...@gmail.com> wrote:
> Hi,
>
> I'm facing problems trying to run in browser an application that runs fine
> in desktop.
>
> When I click on a menu item that calls an action that just open an Alert (I
> did it for testing pourpose) it works, but if the called action tries to
> open a frame, it doesn't work.
>
>
> Here's an example of an action that doesn't work:
>
>
>
> Action.getNamedActions().put("abrirCentrosCusto", new Action() {
> @Override
> public void perform(Component source) {
> try {
> BXMLSerializer bxmlSerializer = new BXMLSerializer();
> Resources resources = new Resources(CentroCustoFrm.class
> .getName(), locale);
> // só irá criar a tela uma única vez
> if (centroCusto == null) {
> centroCusto = (CentroCustoFrm) bxmlSerializer
> .readObject(CentroCustoFrm.class
> .getResource("centro_custo.bxml"),
> resources);
> }
>
> if (centroCusto.isClosed()) {
> centroCusto.open(window);
> }
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (SerializationException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (Exception e) {
> // TODO Auto-generated catch block
> Alert.alert(e.getMessage(), window);
> e.printStackTrace();
> }
> }
> });
>
>
> I have put some Alert dialogs along this method, to identify where it was
> possible to reach and discovered that bxmlSerializer and resources instances
> are created, but centroCusto don't.
> Alert.alert(e.getMessage(), window) shows this message:
>
>
> descricao is not accessible
>
>
> descricao is an bxml:id in the centro_custo.bxml file:
>
>
>
> <TablePane.Row height="50">
> <Form>
> <Form.Section>
>
> <TextInput Form.label="%lblDescricao" textSize="40"
> bxml:id="descricao"/>
>
> </Form.Section>
> </Form>
> </TablePane.Row>
>
>
> Any ideas of what can be done for this method to work fine?
>
>
> --
> Luiz Gustavo S. de Souza
>
> http://luizgustavoss.wordpress.com
>
>
>