Hi Priti,
The issue is timing. The "afterCreate" handlers are fired when the
component it exists within is created (after it is created). The
"command" handlers are fired when a button / href (actually an
implementation of ActionSource) processes its action. This means
command handlers are only fired when the button/href is clicked on. And
also means that beforeCreate will only be fired when a page is first
displayed (not on a "post-back" request). FYI, the "initPage" event is
available for initialization that needs to happen for the page each request.
I hope this clears up what you are seeing... let me know if you have
more questions.
Thanks!
Ken
Priti Tiwary wrote:
> Hi Ken,
> I have the following snippet in my jsf file and expected the upload
> attribute to have true value but am getting null (as seen in server.log)
> <sun:radioButton id="rdBtn1" label="$resource{i18n.jbi.wizard.upload.app
> server.text}" name="cpOrUpload">
> <!command
> setAttribute(key="upload", value="true");/>
> </sun:radioButton>
> <event>
> <!afterCreate
> getAttribute(key="upload",value=>$attribute{uploadValue})
> println(value="dgdfgdfyuiyiyu")
> println(value="$attribute{uploadValue}")
> println(value="asdasdasdasdasd")
> dumpAttributes(value=>$attribute{uploadValue})
> />
> </event>
>
> output in server.log
>
> [#|2006-09-05T11:43:57.253-0700|INFO|sun-appserver-ee9.1|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-8080-1;|
> dgdfgdfyuiyiyu|#]
>
> [#|2006-09-05T11:43:57.254-0700|INFO|sun-appserver-ee9.1|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-8080-1;|
> null|#]
>
> [#|2006-09-05T11:43:57.254-0700|INFO|sun-appserver-ee9.1|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-8080-1;|
> asdasdasdasdasd|#]
>
> I am unable to get my netbeans debugger to stop at the setAttibute
> method to debug it , hence the qs?
>
> Do you see some error in usage?
>
> Priti
>
>