Hi all, I had an instance called <instance xmlns=""> <record> <selected>false</selected> </record> <record> <selected>false</selected> </record> <record> <selected>false</selected> </record> </instance> I want to change this value when ever I click a button. <xforms:trigger appearance="minimal" id="confirm-delete-trigger"> <xforms:label>Select</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="selected" value="if(selected='true') then 'false' else 'true'"/> <xforms:send submission="select"/> </xforms:action> </xforms:trigger> its value is changing for the first time only. how do i repeatedly change the value between true and false by clicking select button. -- Phani. S M.Tech(Software Engineering) Motilal Nehru National Institute of Technology (+91) 9010093398 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Phani,
When you use the 'ref' attribute in <xforms:setvalue>, it already puts you within the context of the <selected> element in your instance. Since there is no additional <selected> element within your <selected> elements, the first part of the if statement fails, and thus it is set to 'true' the first time but is not changed back to 'false' after that. This is where the "." XPath operator helps, to refer to the current node. I'll bet if you change your <xforms:setvalue> markup to: <xforms:setvalue ref="selected" value="if(. = 'true') then 'false' else 'true'"/> it will work just fine! And let me know if anything I said is unclear, or if what I said doesn't work. --Philip
|
thanks Philip,
it worked perfectly for me. thanks for your help. On Sat, Jul 18, 2009 at 12:04 AM, Philip.Cantin <[hidden email]> wrote:
-- Phani. S M.Tech(Software Engineering) Motilal Nehru National Institute of Technology (+91) 9010093398 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |