Hi Madan,

just one tip, may be this helps. You can use the (internally) Tobago function
Tobago.reloadComponent() to execute a serveside action, get back a value via ajax
and finally execute some _javascript_. Example:

function checkOrderIdAndConfirmSubmit() {
    var options = {
      onComplete:
        function() {
          confirmSubmit();
        }
    };
    Tobago.reloadComponent(<panel to reload>, <button with the action>, options);
 }

function confirmSubmit() {
  if (orderId exists) {
       if (confirmDialog(...)) {
          Tobago.submit(...);
        }
    }
}


Regards
Helmut

 
Hi All,

Am bit in a urgency to complete my application as my project deadline is ahead.

Am stuck with a few issues like this  and the mouseOver functionality for <tc:link/>

Could anyone plz suggest me how to proceed with this case ?

Regards,
Madan

----- Original Message ----
From: madan chowdary <[EMAIL PROTECTED]>
To: MyFaces Discussion <[email protected]>
Sent: Friday, 2 March, 2007 5:27:56 PM
Subject: [Tobago] Form submit using _javascript_

Hi All,

I have a usecase which does as follows,

-> User has to enter an orderID
->If orderId is already present in the database, then he should be asked to confirm with the same orderId or cange the orderId.
->This would be asked with a _javascript_ confirm dialog .
-> if  'Ok' is clicked, the form must be submitted. else if 'Cancel' does not do any thing.

The first time he enters with the po number, it should go to the server process , if poNumber already exists, then it should come back to the same page , render all the text and then show the _javascript_ confirm dialog asking to choose the above case.

I was able to achieve this as under

<tc:cell>
    <tc:panel>
        <f:facet name="layout">
            <tc:gridLayout/>
        </f:facet>
        <tc:cell>
            <tc:button label="#{bundle.buy}" action="" id="buyButton">
                <tc:attribute name="renderedPartially" value=":page:confirmPoNumberExists"/>
            </tc:button>
        </tc:cell>
    </tc:panel>
</tc:cell>
<%-- poNumberExists Confirmation --%>                   
<tc:cell>
    <tc:panel id="confirmPoNumberExists">
        <f:facet name="layout">
            <tc:gridLayout rows="10px;10px;" border="1"/>
        </f:facet>
        <tc:cell rendered="#{checkout.poNumberExists}">
            <tc:out value="true"/>
        </tc:cell>
        <tc:cell rendered="#{!checkout.poNumberExists}">
            <tc:out value="false"/>
        </tc:cell>
    </tc:panel>
</tc:cell>
Just for testing i kept as follows to print true or false, when i click on buy button, was able to send a request with ajax and get back the value as true or false.

But i was stuck how to proceed with "_javascript_ confirm" and submitting the form.

Plz suggest me with this,

Thnx in Advance

Regards,
Madan


Here’s a new way to find what you're looking for - Yahoo! Answers



Here’s a new way to find what you're looking for - Yahoo! Answers

Reply via email to