cancel
Showing results for 
Search instead for 
Did you mean: 

Change string for UI without binding

Former Member
0 Kudos

HI,

There is a way to change the secondary value (remove the first path) but bind the all path

for example in the sedonray value I have like following example

JS Bin - Collaborative JavaScript Debugging</title> <link rel="alternate" type=&q...

e.g. I've userid: "/c01/b2/u3/u44"  so when you type de ,you got the userid: "/c01/b2/u3/u44"   in the list of the auto complete.

I want just for display (in the list) to remove the first path like when user type de he will see in the list "b2/u3/u44"  and not "/c01/b2/u3/u44"

(remove the /c01/) ,but when it selected under the hood to bind the full path which is "/c01/b2/u3/u44" ,

there is a way to do it ?

I know how to get the string after change with the following code

var result = '/' + value.split('/').slice(2).join('/');


this will return from the full path "/c01/b2/u3/u44"  the follwoing

"/b2/u3/u44"

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos
Former Member
0 Kudos

HI Maksim

Thanks! its a bit more complicated....the only problem with you example is that when you select some value you see the orignal path in the auto complete text box ...

I want it to be like the value that was selected like "/b2/u3/u44" but under the hood bind it to the full value which is "/c01/b2/u3/u44" (the model should have this value "/c01/b2/u3/u44" ) just for display in the text field and in the list box I get the shorter value...

Regards

Stephane

former_member182372
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Maksim,

The only problem that was remain is that if I choose value and save it I saw the shorter value(in the text box ) which is what I need , but when I open the screen again I see in the auto complite text box the full path. since I bind  the full value to the required property .

is it possible to handle it that when I open the screen and when it read the value to provide in the text box the shorther value ?

Regards,

Stephane

Former Member
0 Kudos

This issue solved via formatter...

Thanks Maksim!

former_member182372
Active Contributor
0 Kudos

please, share the solution

Former Member
0 Kudos

HI Maksim,

I put formatter for value

and return the following

return '/' + value.slice(2).join('/');


Regards,

Stephane

Answers (1)

Answers (1)

Qualiture
Active Contributor
0 Kudos

So if you know how to strip the first part of the path, then what is your problem?

I mean, if you use a formatter function which strips the first part of your additionalText property, that should work. Or am I missing something?

Former Member
0 Kudos

HI Robin,

Can you provide example? im not sure how to use the formatter in this case and where,

the problem is that I use one way binding (auto complete )and I do the update in the change event ...

Regards,

Stephane