show message

Forum sobre a ferramenta Oracle JDeveloper, ADF, OAF, etc. (Não é destinado ao aprendeziado da Linguagem Java em geral)
Post Reply
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Hi everyone ...

I wanted to know how I do .. to relate the values ??and components that are on my page .jsp with my backing bean ... for example your self I have an inputtext on my page as I do to refer to that value ... I think I still do not understand this issue of 'ui' ... could anyone explain to me how it works or tell me a tutorial ...

and how I do to show a message box pro user, which can choose between yes and no ... (Those typical messages ... for example: "You want to continue ? .. "Yes' or 'in')

vlw ...
Qualuer help will be very welcome !!
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Friend
I would like to help you but I do not think I'm being clear ne .. of a feed back of my answer so I can try to improve the way I express myself
]
on your JSP code Position the mouse over your AF: InputText with a click, go to the 'Structure' tab (if there is this tab, VA in the View menu and make it appear) notice that jdev has already selected your same object in this structure tab and only you click with the right button of the mouse then go to 'properties' dai in the 'advanced properties' tab in 'general' will have the 'binding' attribute You point to a class that has already created by your faces-config and give a name for your object that will be created in this class.

JSP

Select all

 
<af:inputText value="#{bindings.BeclNumMtr.inputValue}"                           
              binding="#{manutencaoBemClienteBean.matricula}"> 
		<f:convertNumber groupingUsed="true" pattern="#,##0.00"/> 
</af:inputText>	 
Notice that the binding attribute mentions 'maintenanceobemclientbean' which is the class alias (backing bean alias created on the faces-config) and then 'enrollment' that is the name of the object that was created in your class (backing bean) EU references to your JSP component

in your Java class will thus be

Select all

 
private CoreInputText matricula; 
 
//pegando o valor da componente na tela 
String valorDoComponenteNaTela = matricula.getValue(); 
to work with the interaction of the User I think you can create an applet that shoot JOPTIONPANE but here we do this ..
We created a file within the project to contain the Java script functions and we call them inside the components in the JSP

Select all

 
//arquivo funcoesJS.js 
function confirmDelete() { 
  if (confirm("Confirma exclusão do registro?")) { 
    return true; 
  } else { 
   return false; 
  } 
} 
 
//JSP 
<afh:script source="../js/funcoesJS.js"/> 
 
<af:commandLink text="Deletar" 
                action="#{testeBean.excluirTeste}" 
                onclick="return confirmDelete();"/>	 
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

friend no 'friend' .. hehe .. my name is michele ... hehe

but this does not come to the case ... Victor ... I want to thank you .. you have me Helped a lot ...
especially with this last post ... I had no idea how I was going to do a simple confirmation window ... it's like I'm starting now in jdeveloper .. . For me everything is still very complicated ... this binding binding there and here .. it's kind of hard to understand ... but now things are getting lighter .. hehe; ..

I was able to do what you gave me ... right ...

now only with another problem ...

for example .. . I want to call a sql function on my backing bean ... as soon as I click the button ... and depending on the result that this function returns me ... I should do a certain action ... but when I went to try to do this ... everything compiles right .. but when I click on the button gives a series of mistakes ... take a look at my category .. and see what you Do you think ... and how do I call the confirmation window inside the backing bean? ... is it just me to create a binding pro god: script?

Select all

 
 
    private CoreOutputText carga_retorno; 
    private CoreOutputText id_solicitacao; 
 
    public String commandButton_action() { 
        // Add event code here... 
         
        String wservico = null;     
        String wid_solicitacao = (String)id_solicitacao.getValue(); 
        if (wid_solicitacao != null) { 
         PreparedStatement plsqlBlock = null ; 
                  String statement; 
                  statement = "SELECT JMS_SERVICO("+ 
                              ":1"+ 
                              ") FROM DUAL"; 
                 plsqlBlock = getDBTransaction().createPreparedStatement(statement,0); 
                 try 
                 { 
                    plsqlBlock.setInt(1,Integer.parseInt(wid_solicitacao)); 
                    ResultSet resultado= plsqlBlock.executeQuery(statement); 
                    while(resultado.next()){ 
                        wservico=resultado.getString("descricao"); 
                    } 
                 } 
                 catch (SQLException sqlException) 
                 { 
                     throw new SQLStmtException (CSMessageBundle.class, 
                                                 CSMessageBundle.EXC_SQL_EXECUTE_COMMAND, 
                                                 statement, 
                                                 sqlException); 
                 } 
                 finally 
                 { 
                  try 
                  { 
                     plsqlBlock.close(); 
                  } 
                  catch (SQLException e) 
                  { 
                    e.printStackTrace(); 
                  } 
                 } 
            carga_retorno.setValue(wservico); 
        } else { 
        carga_retorno.setValue("teste");} 
        return null; 
    } 
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Sorry for my friend ...

for everything
Are you using ADF BC ?? Do you have Module Application in your application ??

1 - getdbtransaction () I do not know what you did to access this method in a bean, but I say that you do not follow the good programming practices because the control class should call a method of your AM that is therefore access to the bank
Example of a bean calling a method in the AM

Select all

 
        BindingContainer bindings = getBindings(); 
        OperationBinding operationBinding = bindings.getOperationBinding("nomeDoMetodoNoAM");         
        operationBinding.execute(); 
2 - You can create another AFH component: script and Invests to point to a file to place the function LA and then through a binding to run this guy, but I say that it is also not legal, JS is a client side, and then you want to invoke a function from your control class that is in Server Side

In the example I sent you the pop up lock or not running the method that is called by the button, in case delete
what do you really want to do?

You can imply a Dialog window
I created a JSP and Name navigation as follows: 'Dialog: anytask'. In your button that will call it you should put the option Usewindows = true and then you will have a greater power over your dialog but I have alert you not to do this ... Explain your situation and try to find a new path

Anything we are there
stays in peace
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

SELECT JMS_SERVICO(:1) FROM DUAL
This would be your query ??
I do not know what she would do ..
Post the errors generated ??

It would be good for you to give a close up in your result set too
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Hi Victor ....

I'm using yes ADF BC and in my application has application module também ....
Maybe then I stonna wear the wrong ways to do what I want ...

How do I create a method Am ...? .. because the only method I have here .. and that I can call this way that you explain, With "bindings.getoperationbinding", it is the "executewithparams" method that is the result of the select that is in my 'sql statement' of my 'view object editor' will pray to create other methods beyond this ...?

But anyway .. I'll explain what I need to do ... and you know you do not tell me a more appropriate solution, than that I'm trying to do ...

I need to check on the bank a certain condition ... For example: I have a table on my JSP page .... As soon as the user select certain element of this table ... I need to get this element and do a search in the bank ... depending on the result of this research ... I should show a message pro user .. that what he wants to do is possible or not ...
then I need Get this table element again .. Do a new search in the bank .. to check another condition .. and then make a calculation ... that I should show the user ....
could you understand? ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

vamo la ... rs

Your am is an XML that of the origin to an interface and a java class
when you go in this class and implements a method it should be published In the client interface so that it can be accessed from your bean and should also be made a methodaciton in the pouchedefinition of your JSP

step by step
1 - Double click on your am.xml
2 - In the left list has the 'client interface' session. Your implemented method must be in the list of Left Just select and place in the right list
3 - Click with the right button on your JSP and VA in 'Go to Page Definition'
Tab 'Structure' Search for 'Bindings' session and click with the right button and go in 'Insert Inside Bindings' after 'Methodaction'
5 - Choose the AM that contains the method and then choose the method that was implemented

Now you are able to call the method by Bean in that way that I showed you above

the executewithparams and refer to a that is inside your am, and does this you have to contain bindingsvariables or a clause where with? (Question marks style the Java prepared statment) that will be replaced by parameters at the time when VO Query is performed

You have Java implementations also including Row, o que allows you have to do select direct in the bank
you can from inside your am to give a getvo () and after Getvo () give a getCurrentRow () and then you will have the selected line in your table
if you give me more data I try to improve my solution to your problem there

stays in peace
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Ahh .. ok .. now I understand ... the issue of methods ....

good .. then .. when I go to create this method .. inside it I can access a function .. The way I posted in the code up there? .. or not? ...

is that I use this function to do a check in the bank according to data that the user selects. .. then with the data that this function returns me .. I need to show a confirmation message for it .. if it is confirmed .. I need to make a new search through another function ... and with this data I will do A calculation ... and show on page .jsp Pro user ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I believe that your problem will not be solved by JS, you will have to implement a JSP dialog that returns the user's choices

look for something how to implement a LOV that you will see the ReturnListener attribute in action

When the messages you want to send does not need decisions
do so

Put <AF: Messages /> soon after your tag Body ..
JSP

Select all

 
    <afh:body> 
      <af:messages/> 

Bean

Select all

 
JSFUtils.addFacesMessage("Salvo com sucesso." , FacesMessage.SEVERITY_INFO); 
JSFUtils.addFacesMessage("Informe o Grupo de Crédito." , FacesMessage.SEVERITY_ERROR); 
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Hi Victor ...

I'm with a DoubDazinha .... I was using the preparedstatement, as you can see in the code that I posted ... but then I had the following error when I went to test it on my .JSP page. :

Select all

# ORA-03115: unsupported network datatype or representation 
I believe it is because of:

Select all

 SELECT jms_verificar_restricao_altura(:1,:2) FROM DUAL;
So now I'm trying to use a callablestatement, but how do I call the connection that already exists in the jdeveloper ... by java ... the ways I know ... I need to pass all the parameters of the connection ... but I believe that doing this Be a bullshit .. since jdeveloper already has the connection ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Oh Michele
Sorry for my ignorance but I do not understand this syntax

Select all

SELECT jms_verificar_restricao_altura(:1,:2) FROM DUAL;
by 'JMS' I believe you are trying to recover data from a queue .. And that? !?!?!

I do not see the porque of working you exchanging prepared by callable, and I honestly do not have an idea of ??the porque of this error ..

From what I understand you are not Connecting this way ne?!?! try doing so and if you give the error post your code so I try to help you

Select all

 
       PreparedStatement pstmt = null; 
       ResultSet rs = null; 
       String strSQL; 
          strSQL =  
                " SELECT 1 " + 
                "  FROM SCR_BEM_PPT PPT " +  
                "   WHERE PPT.BECL_CHV_BEM_CLI = ? "; 
 
          pstmt = getDBTransaction().createPreparedStatement(strSQL, 0); 
          pstmt.setLong(1, new Long(1)); 
          rs = pstmt.executeQuery(); 
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

This select search for function that I created ..
The function calls jms_verificar_restricao_altura, has two parameters and returns a number, which I am playing in an int ...
and I'm doing exactly this way that you step ...
take a look at the code:

Select all

 
        PreparedStatement plsqlBlock = null ; 
        String statement; 
        int restricao=0; 
        statement = "SELECT JMS_SERVICO("+ 
                       ":1,"+ 
                       ":2) FROM DUAL;"; 
        plsqlBlock = getDBTransaction().createPreparedStatement(statement,0); 
        try 
        { 
                plsqlBlock.setInt(1,wid_pessoa); 
                plsqlBlock.setString(2,wplaca); 
                ResultSet resultado= plsqlBlock.executeQuery(statement); 
                while(resultado.next()) 
                  {                 
                    String s=resultado.toString(); 
                    restricao=Integer.parseInt(s); 
                  } 
        } 
Ah .. a detail ... I made this conversion in the end ... of resultset for string .. and then .. string for int .. porque when I put direct as' restriction = result.getint (1); 'He accused that the column index did not exist ...
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Correcting ..

This is the code:

Select all

 
PreparedStatement plsqlBlock = null ; 
        String statement; 
        int restricao=0; 
        statement = "SELECT JMS_VERIFICAR_RESTRICAO_ALTURA("+ 
                       ":1,"+ 
                       ":2) FROM DUAL;"; 
        plsqlBlock = getDBTransaction().createPreparedStatement(statement,0); 
        try 
        { 
                plsqlBlock.setInt(1,wid_pessoa); 
                plsqlBlock.setString(2,wplaca); 
                ResultSet resultado= plsqlBlock.executeQuery(statement); 
                 String s=resultado.toString(); 
                 restricao=Integer.parseInt(s); 
                 
        }  
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Michele
complicated for me ..

Good if you are calling a function I think it should be more coherent to use the callable

Select all

 
CallableStatement cs = getDBTransaction().createCallableStatement(strSQL,0); 
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Ahhh ....

I was able to solve this problem ...

I had to register a parameter out ... to receive the value returned by Function. .. I was not giving to receive this value directly ....

Select all

 
 
        CallableStatement plsqlBlock = null ; 
        String statement; 
        int restricao=0; 
        statement = "begin ? := JMS_VERIFICAR_RESTRICAO_ALTURA(?,?); END;"; 
        plsqlBlock = getDBTransaction().createCallableStatement(statement,0); 
        try 
        { 
                plsqlBlock.registerOutParameter(1, java.sql.Types.INTEGER); 
                plsqlBlock.setInt(2,wid_pessoa); 
                plsqlBlock.setString(3,wplaca); 
                plsqlBlock.execute(); 
                restricao=plsqlBlock.getInt(1); 
        } 
Now only I need to solve the problems of messages ... I'll give you a studied in Lov .. that you had told me ... but only one thing ... I prize to do some import to do this that you step me:

Select all

 
 
JSFUtils.addFacesMessage("Salvo com sucesso." , FacesMessage.SEVERITY_INFO); 
JSFUtils.addFacesMessage("Informe o Grupo de Crédito." , FacesMessage.SEVERITY_ERROR);  
porque He does not recognize jsfutils ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
  /** 
   * Get component id of the view root. 
   * @return component id of the view root 
   */ 
  public static String getRootViewComponentId() { 
     return getFacesContext().getViewRoot().getId(); 
   } 
 
     FacesContext ctx = getFacesContext(); 
     FacesMessage fm = new FacesMessage(severity,msg,null);  ctx.addMessage(getRootViewComponentId(),fm); 
Try there anything tells me
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Good ..

I was taking a look at the 'Message' and 'Messages' component and what I understood .. Messages displays messages at the top of the page and Message presents messages near the Component to which he references ... I think it will not be useful for me .. because I really needed .. of those pop-up windows .. just with the 'yes' or 'no' .... in that same style of JS .... but as I said .. I will give another study in the Lov first ....

Now another thing ... I just hope I'm not bothering too much !! ... .: Roll:

How do I select an item in a ListBox and so I select it running an action? ... without having to press a button? .... I tried to use it The 'OnClick' property ... but it does not work ... I wanted to know how to do this in an 'ADF Read Only Table' ... as soon as the user selected a line .. I wanted you to execute an action. .. but on his 'onclick' property is not running the action ....
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

In no way do you bother
it would be good to separate the subjects by topics to keep the rules of the forum

let's go ...
You need to mecher in 2 attributes of the Its component
1 - autosubmit = "true"
2 - valuechangelistener = "# {nomedobean.nomedomode}"

In case you must define your action inside of the method that you will call the above form

another thing ...
All that has 'on' on the front is JS ie, can implement script there or call the function of your js .. only works js in these attributes tended
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Okay then ...

I'll open another topic to talk about this subject ....
because it did not work ...
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

So Victor ... I guess I will not adopt Lov .. at least not in this situation .... because I just need even that the user clicks OK or cancel .... that way you passed me in JS. ..

Then you had told me the following:

"Create another AFH component: script and instead of pointing to a file put the LA function and then through a binding to run this guy "

put the function there .. you say in place of source? ...
and how is I going to run the function By Binding ... in Bean? ....
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

in the source of the source js

I think it can not run him from the bean not ...
eq I never did that you are wanting to understand

try through the source code of your page that was generated by the JSP .. try to find this component that you want to implement the functionality ... of an ID on your table and with ctrl + f você find and see what the adf component turns in html

until now I did not understand the situation that you need a dialog that I passed you do not solve ....: roll:
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Well .. Dexa I explain ...

I only need that the user clickke on 'Yes' or 'No': Wink: .... Only I can not put that same way that you step on the first time .. to put on the 'onclick' button of the button ... because it is not always that I will show this message ... I only show the message .. when the function sql I called Return a certain value ..
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

this is not easy to do not michele
will have to do some gambiarras and I do not know how to explain very well because I did something similar but not the same

would have to help Hidden with the value of the SELECT and your JS code of a GetElementByid () and in your js you decide whether or not to display the dialog

understood + or-
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

see what you take from here [url=http://www.google.com.br/search?q=dialo ... =firefox-a]oh
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Mick wrote: Well .. Dexa I explain ...

I only need that the user clickke on 'Yes' or 'No': Wink: .... Only that I can not put that same way you step on the first time .. put on the 'OnClick' button on the button ... Because it's not always that I'm going to show this message ... I just show the message .. When the SQL function I called me to return a certain value ..
Let's solve your problem ...

1- Implement a JSP with btn yes and no
2- Create a navigating of your JSP arara this jspdialog
3- in the method you had called in the action attribute of your button that will be in the jsp, you should go to AM do your select and return the value of the query and then you decided on the method of the bean o que will return if navigation for the jspdialog or null to do nothing

obs.: The buttons yes and no will call methods that you can implement in the same bean that you are using
I think it will be very simple huh ...
Good luck
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

but it is the following ....

I used the same backing bean for the two JSP ... so if one of them changed some value I could check after ... so I created a verifiable Boolean Private ... and when on the dialog page I clicked on the button .. I arrived this value to true .... (initially this value was false) and when I returned to the first page and I checked this value ... he was like false ... as if no method had changed his value ... I tried to do this in a class the part ... but it did not work .. I think I'll even have to use the returnListener ... but at least My first attempts were frustrated !! ....

know what I was thinking about doing ... use a swing dialog ... but then I do not know what was happening with my frame .. ,. q every time I call him .. he was tiny in the corner of the page ... many times I did not even see that he had appeared ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

tries to delcar its boolean variable as static

Select all

private static boolean nomeVariavel;
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Ah ... this way it worked out yes !! ...

now just a deteal .. how do I call a JSP page from inside the bean? ..
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

q good
how to call bean jsp ??? Redirection ??

v C is not using JSF navigations ??
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Yes .. I'm using JSF navigations ...

On my faces-config.xml, I turned on the two pages .....

but if in the action attribute of my button ... I call the backing bean ... there is no way I can put there também the call of the other page ...

and também .. I You need to make this call from inside the bean ,,, because I need to make checks before calling it ... if it would not fall in the same as the js code directly ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

this redirection is from the of its form ...

of the action of your jsp you call a bean method dai you will decide if you will pass or not navigation ... or then you go Decide which navigation sends

What is the problem of you pass or not a navigation .. or choose a navigation to pass?
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

I think the problem is this ...

How do I pass the navigation?
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

the method that you call from the action of your button should receive a string or the method that is called la no bean returns a string ..
and only you return the navigation that you set it on your face-config

Select all

 
     if (condição123) 
          return "irParaJSP123"; 
     if (condição456) 
          return "irParaJSP456"; 
     else 
          return "irParaJSP789"; 
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Ahh ... yes now I understand ....

now gave everything right .... !! : D

Now on this .. Only one last question ...: Roll: Can you make this Dialog appear in the center of the screen? ....
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Yes, yes ....

You can get this ready already and some site out there ....

is a JS code that captures the resolution of client screen and calculates the middle of the screen and then positions the JSP


already was asked to implement this but however I orched the hours they said that it could be like that 99]] It's a lot of work for little functionality ... but as I said there's it ready for ai eso give a good googada
:)
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

valeu .. For all the tips and patience: P
I already managed to solve my problem !!
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

q good
anything tamo ai
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

Oh I d new aqui !! ...

Victor .. The solution I had given was not a good solution ... I returned to try this same solution .. from calling a Dialog. . and I'm new with the problem of centralizing the message screen ... I'm trying to put on the 'OnLoad' attribute of the AFH: Body, from this page .jsp being opened as a dialog, a function JavaScript:

Select all

 
function Centraliza() { 
 
    posx = (screen.width/2)-(400/2);   
    posy = (screen.height/2)-(200/2);   
    window.resizeTo(400,200); 
    window.moveTo(posx,posy); 
}  
But I do not know if I'm doing something wrong because he's not centralizing ... When I do a run from the jdeveloper straight on the page Dialog it opens in the center Bunny ... But when I call from another page it continues to appear in the upper left corner.

In fact, what I'm trying to do is run a JavaScript code as soon as the JSP page is open ... I do not know if I'm putting it in the right place ..
I do not know também If you could understand !! .. hehe
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

I'm talking to me that works when it calls JSP Dialog alone I tell you that it does not make sense because you are only declaring a function
and does not call it anywhere
..
No need to have phd to deduce that when dialog and opened by a redirect, the onload js code is not running
1- In order to be sure of this Put an alert in your JS

If the problem is this same
I suggest doing the following ...

Select all

 
<afh:script source="arquivoContendoFuncaoCentralizar.js"/> 
<afh:body onload="javascript:Centralizar()"> 
Good Luck
Anything we are there
stays in peace
Mick
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 69
Joined: Fri, 08 Feb 2008 11:20 am
Location: São Paulo - SP

but I did it yes !! ... I called this function at the free of the body .. exactly this way ... and I already put an alert to see if it was worked ... it appears the alert .. but does not reposition the window !! ... :(
[99]
I do not believe something so simple, that is to show a popup, and common to be so complicated so if it implies in JSP !! ...
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

already tried to change the values ??of x and y

I do not know what may be happening: oops:
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests