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