# Split Container Limiter

**URL:** <https://forum.inductiveautomation.com/t/split-container-limiter/76793>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 24, 2023, 4:08pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793 "2023-07-24T16:08:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Choi](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David\_Choi](https://forum.inductiveautomation.com/u/David_Choi)\
**Post date:** [July 24, 2023, 4:08pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/1 "2023-07-24T16:08:38Z")

</div>

Hello All!

I see there's no feature of putting limit for the Split Container, where it can be designed so that the user can have split container no smaller than certain % or larger than certain %.

Is this achievable is some other way?

Thank you!

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 24, 2023, 8:18pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/2 "2023-07-24T20:18:37Z")

</div>

You could put a change script on the property which sets the handle back to some limiting value if it is dragged beyond the limiting value. Note that this doesn't prevent a user from dragging beyond the limit - it only places the handle of the split container back at the limit location whenever the value is re-calculated.

```auto
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue:
		current = float(currentValue.value.rstrip("%"))
		limit = self.custom.limit
		if current - limit <= 0:
			self.props.split.position = str(limit) + "%"
		elif current + limit >= 100:
			self.props.split.position = str(100 - limit) + "%"

```

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [July 24, 2023, 8:38pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/3 "2023-07-24T20:38:26Z")

</div>

Is this the correct implementation? I couldn't get it working in v8.1.23.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e69246d700607ca4d6f4f402a7f84a95aed6be93.png)

I was able to implement the event though for when 0% is reached.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/a/daa99ad97a2932ea2a792ed6540cb63b769113a7.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 24, 2023, 8:40pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/4 "2023-07-24T20:40:05Z")

</div>

The `limit` property in this example is understood to be in "percent". As you've supplied a value of 100, your script is going to have issues as EVERY value would be an offending value.

---

<div class="post-metadata">

**Author:** ![David\_Choi](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David\_Choi](https://forum.inductiveautomation.com/u/David_Choi)\
**Post date:** [July 24, 2023, 8:45pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/5 "2023-07-24T20:45:01Z")

</div>

I think your first screenshot's if statements after the 1st if statements require to be further indented.  
... At least to my knowledge Python is sensitive to it.

---

<div class="post-metadata">

**Author:** ![David\_Choi](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David\_Choi](https://forum.inductiveautomation.com/u/David_Choi)\
**Post date:** [July 24, 2023, 8:46pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/6 "2023-07-24T20:46:27Z")

</div>

Thanks this worked!  
I only needed the first if statement in my application because I only needed it to prevent further going below 50%.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fcf4668cdfec6d5244e13716b8e84ced632dbf59.png)

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [July 24, 2023, 8:54pm UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/7 "2023-07-24T20:54:43Z")

</div>

I still couldn't get it to work in my version though.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37922a6b3110ac27198097aa84723ae98f9b5e9c.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 25, 2023, 12:30am UTC](https://forum.inductiveautomation.com/t/split-container-limiter/76793/8 "2023-07-25T00:30:22Z")

</div>

Using the code from the latest screenshot, you should see the handle go "back" to the 10% mark if you drag it all of the way to the left (or really anywhere left of 10%). If you drag it right you will see no effect.
