0

I a div popup where there is an input field

            <apex:inputfield id="CommentDate" value="{!AModel.dateTimeofComment}"/> 
            <apex:commandButton action="{!AModel.saveComment}" value="Save" id="saveButton"/>         
            <input type="submit" value="Cancel" class="btn" onclick="window.reload(); return false;" />

Here what I want is to pass the value of dateTimeofComment to the controller on savebutton click, without binding the value to any object. I tried using a getter setter global valiable, but that is not working either. Any help would be appreciated.

1

1 Answer 1

0

From your Visualforce, you appear to have a class (referenced via the property AModel) that has all the necessary plumbing. You just need to use the dateTimeofComment value in the saveComment method:

public DateTime dateTimeofComment {get; set;}

public PageReference saveComment() {
    // You can just use the dateTimeofComment value in here as it will be automatically
    // populated from the input field by Visualforce's bi-directional data binding
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .