# Sender is not valid anymore?

**URL:** <https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250>\
**Category:** General\
**Created:** [January 3, 2018, 7:35pm UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250 "2018-01-03T19:35:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hilmi\_BORAN](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/hilmi_boran/32/635_2.png) [@Hilmi\_BORAN](https://forums.fusetools.com/u/Hilmi_BORAN)\
**Post date:** [January 3, 2018, 7:35pm UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250/1 "2018-01-03T19:35:09Z")

</div>

Hi fuse,

Im trying to access element name in js but sender prop is now not showing.

```auto
pagecontrol
     each
         elem
             child1 has clicked prop with ux:Name="item1"
             child2 has clicked prop with ux:Name="item2"

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [January 4, 2018, 10:20am UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250/2 "2018-01-04T10:20:51Z")

</div>

Mind showing the code you have? I just tested with this and I get the `sender` in args just fine:

```auto
<App>
	<JavaScript>
		module.exports = {
			test: function(args) {
				console.log(JSON.stringify(args));
			}
		};
	</JavaScript>
	<Panel ux:Name="test" HitTestMode="LocalBounds">
		<Clicked>
			<Callback Handler="{test}" />
		</Clicked>
	</Panel>
</App>

```

Note: if you’re using the `Clicked` as a property on an element (e.g., `<Panel Clicked="{test}" />)`, sender was never available there. It’s something that `Callback` adds.

---

<div class="post-metadata">

**Author:** ![Hilmi\_BORAN](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/hilmi_boran/32/635_2.png) [@Hilmi\_BORAN](https://forums.fusetools.com/u/Hilmi_BORAN)\
**Post date:** [January 4, 2018, 1:27pm UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250/3 "2018-01-04T13:27:50Z")

</div>

Thanks UIdis, now i understand problem my code has own name inner

```auto
<JavaScript>
module.exports={
fn:arg=>{
console.log(JSON.stringify(arg,0,2)); // sender name rect but i override it when use
}
};
</JavaScript>

<Card ux:Name="Card1">
    <Clicked>
          <Callback Handler="{fn}" />
    <Clicked>
<Card>

<Card ux:Name="Card2">
    <Clicked>
          <Callback Handler="{fn}" />
    <Clicked>
<Card>

 <Container ux:Class="Card" Subtree="rect" BackColor="{Resource Material.CardColor}" CornerRadius="2" ShadowEnabled="true">
	<bool ux:Property="ShadowEnabled" />
	<float4 ux:Property="CornerRadius" /> 
	<float4 ux:Property="StrokeColor" />
	<float4 ux:Property="BackColor" />
	<int ux:Property="StrokeWidth" />

	<Rectangle ux:Name="rect" ux:Binding="Children" Color="{Property BackColor}" CornerRadius="{ReadProperty CornerRadius}" Fill="0,0,0,0" HitTestMode="LocalVisualAndChildren">
		<InteractiveTransform ux:Name="transform" />
		<WhilePressed ux:Name="wp">
			<Change this.Opacity=".85" Duration="0.5" Easing="Material.StandardCurve" />
		</WhilePressed>
		<Stroke Width="{Property StrokeWidth}" Color="{Property StrokeColor}" />
		<WhileTrue Value="{ReadProperty ShadowEnabled}">
			<Shadow Color="#0004"
			        Angle="{Property transform.Rotation} * (180/3.14159) + 90"
			     Distance="max(1, ({ReadProperty transform.ZoomFactor} - 1) * 25)"
			         Size="max(2, ({ReadProperty transform.ZoomFactor} - 1) * 30)" />
		</WhileTrue>
	</Rectangle>
</Container>

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [January 4, 2018, 1:31pm UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250/4 "2018-01-04T13:31:57Z")

</div>

Okay. I should add that relying on `sender` being present, or that it means something particular _is not recommended_. The interface may change in the future, and `sender` might be removed entirely.

A better/recommended approach is to raise separate callback functions from different sources.

---

<div class="post-metadata">

**Author:** ![Hilmi\_BORAN](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/hilmi_boran/32/635_2.png) [@Hilmi\_BORAN](https://forums.fusetools.com/u/Hilmi_BORAN)\
**Post date:** [January 4, 2018, 1:41pm UTC](https://forums.fusetools.com/t/sender-is-not-valid-anymore/3250/5 "2018-01-04T13:41:44Z")

</div>

Okay. Now i solved my problem with seperate callback fn. But, there may be a problem when there are too many items.

Thanks for helps. Best regard 🙂
