Kodi Community Forum

Full Version: In MyMusicNav.xml , search box is not working why?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
In MyMusicNav.xml I have placed an edit control whose id is 8.

Now according to wiki , it should act like search box , typing something in to which will display all matching items
throughout database.

When I open Songs the window displays list of songs.
But even if I type matching string in edit/search box it always displays empty view with no items why?


Does it search or something is wrong.

Please Help.
Thank You.
Example:

PHP Code:
<item id="xxxxx">
<
label>search</label>
<
onclick>ActivateWindow(MusicLibrary)</onclick>
<
onclick>SendClick(8)</onclick>
</
item
Working fine here. How does your edit control code look?
Hi, `Black Following is the edit control code which I have written in another file in <include> tag and I am including this in MyMusicNav.xml file.
According to wiki if I set any edit control id=8 in MyMusicNav.xml it will act like search and if id=19 it will work like filter , though filter is working when I change id to 19 but search is not working when I set it back to 8.
My requirement is "search".
PHP Code:
<control type="edit" id="8">
            <
description>Search text box</description>
            <
posx>400</posx>
            <
posy>5</posy>
            <
width>500</width>    
            <
textwidth>490</textwidth>
            <
label>587</label>
            <
onleft>4724</onleft>
            <
onright>2</onright>
            <
visible>!StringCompare(Skin.String(choice1),"Settings")</visible>
            <
texturefocus>buttonFO.png</texturefocus>    
            <
texturenofocus>buttonNF.png</texturenofocus>    
</
control
Thanks For Help !!
Include could be the problem. Try writing it to MyMusicNav.xml directly. If you want to include it, do it like this:

Code:
<control type="edit" id="8">
  <include>MusicSearchControl</include>
</control>

<include name="MusicSearchControl">
  <description>Search text box</description>
  <posx>400</posx>
  <posy>5</posy>
  <width>500</width>    
  <textwidth>490</textwidth>
  <label>587</label>
  <onleft>4724</onleft>
  <onright>2</onright>
  <visible>!StringCompare(Skin.String(choice1),"Settings")</visible>
  <texturefocus>buttonFO.png</texturefocus>    
  <texturenofocus>buttonNF.png</texturenofocus>
</include>

Btw. "" are not needed in the stringcompare unless your string is really "Settings". In fact it could not work if your string is Settings and you compare it to "Settings".
Hi `Black This time I wrote in MyMusicNav.xml:
<control type="edit" id="8">
<description>Search text box</description>
<posx>400</posx>
<posy>5</posy>
<width>500</width>
<label>Search</label>
<visible>true</visible>
<texturefocus>buttonFO.png</texturefocus>
<texturenofocus>buttonNF.png</texturenofocus>
</control>
But still it's not working like "search", when I tyoe something in the box all items becomes invisible means empty list showing that search could not find any result.
But when I change the id to 19 it works perfectly like "Filter".
How is it possible that if Filter searches only in current list labels it finds some thing and if search searches in entire database it could not find the same string.
Help Help Please !!
Hey I am trying to make an edit control the search box by assigning it's id = 8 , but in confluence and many other skins they have taken this control as button. Means search should be a button instead of box?
But Wiki tells it can be edit control.

Please Please Some one Help, Thanks !!

Check you haven't got another control using the same ID.
I checked it , it's at only one place.
Is it necessary to make it a button?
According to the wiki it should be editcontrol.

http://wiki.xbmc.org/index.php?title=Edit_Control

EDIT: I use a button and the MyVideoNav also uses a button for it's search so the wiki could be wrong.
OK so If I have to do that any how , then what way will you suggest?
May be scripting will help ,or some thing else.
I want a search box in MyMusicNav.xml.
Typing into to search box should search the string in entire music database and should show the matching items in the panel container.

How can I do it. Please tell me.
Thanks for help in advance.
Edit control works fine here... so you can use a button or edit control. Maybe you don't get any results because of visible conditions you used for the list? Does it work in other skins?
What about global search script? Maybe give it a try?
@ `Black , I have not seen any skin so far which has search box on the MusicLibrary page( MyMusicNav.xml ) .
All Skins contain Search as a button clicking on which displays another dialog keyboard which is from other xml file .

My requirement is that, the search box should be present on the same page( MyMusicNav.xml ) at top.

@butchabay , I don't know about global search script , can u clarify or give a link?
(2012-04-17, 16:30)Hitcher Wrote: [ -> ]According to the wiki it should be editcontrol.

http://wiki.xbmc.org/index.php?title=Edit_Control

There is nothing called editcontrol , only edit is there actually.
wiki is wrong. Some one from xbmc team should confirm this and change this on wiki.

I copied and pasted following in a window nothing appeared, I changed editcontrol to edit an edit box appeared.
<control type="editcontrol" id="1">
<description>My First edit control</description>
<posx>80</posx>
<posy>60</posy>
<width>250</width>
<visible>true</visible>
<aligny>center</aligny>
<label>Search</label>
<hinttext>Enter search string</hinttext>
<font>font14</font>
<textcolor>FFB2D4F5</textcolor>
</control>
Pages: 1 2