• Jennifer Simonds
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Something strange is going on and I can't figure it out. Data binding to variables in an Apex controller is not working if the <apex:input> tags are within a jQuery UI Dialog box. I've confirmed action method executes when called from a dialog box and rerenders are working but data binding is not. Unfortunately all else I can can provide is this very simple page to reproduce and then hope someone can help figure this out.

 

Page:

 

<apex:page controller="JQDialog">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"/>
    <apex:stylesheet value="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/ui-lightness/jquery-ui.css"/>
    
    <script type="text/javascript">
        var j$ = jQuery.noConflict();
        
        j$(document).ready(function(){
            //Creat modal
            j$("#popup").dialog();
        });
    </script>
    
    <apex:outputPanel id="count">
        Count: {!count} <br/>
        Checkbox: {!myCheckBox} <br/>
        String: {!myString}
    </apex:outputPanel>
    
    <apex:form >
        <div id="popup">
            <apex:inputCheckbox value="{!myCheckbox}"/> <br/>
            <apex:inputText value="{!myString}"/> <br/>
            <apex:commandButton value="Do Something" action="{!doSomething}" rerender="count" oncomplete="closeModal();"/>
        </div>
    </apex:form>
</apex:page>

 Controller:

 

public class JQDialog {

    public Integer count {get; set;}
    public Boolean myCheckbox {get; set;}
    public String myString {get; set;}
    
    public JQDialog(){
        count = 0;
    }

    public void doSomething(){
        count++;
    }
}

 

 

Thanks,

Jason

 

 

  • January 07, 2011
  • Like
  • 0

hi

 

can u please help me how to parse an XML.

 

Actually my requirement is create a webservice in APEX. The parameter for webservice is in the form of XML String. in that webservice i have to parse that XML. for example my input xml is in the form of

 

<?xml version="1.0" encoding="UTF-8" ?>
- <Body>
- <InvoiceRequest>
- <Item>
  <ItemName>num1</ItemName>
  <ItemPrice>$11.0</ItemPrice>
  <ItemId>01278390921098209AB872190</ItemId>
  <ItemType>NULL</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Service</ItemName>
  <ItemPrice>$23.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Service</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Product</ItemName>
  <ItemPrice>$36.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Product</ItemType>
  </Item>
  </InvoiceRequest>
  </Body>

 

for the above XML how can i parse this xml. Please help me. The above xml is related to Item Custom object. so i have to construct a List<Item__c> object for this XML.

 

 

Please help me.

  • September 16, 2009
  • Like
  • 0