Topic on Extension talk:Semantic Forms Inputs

Kghbln (talkcontribs)

The Menuselect input type is depending on the Semantic TreeView extension. Are there plans to further support this input type or will it be phased out? I guess a note about this should be on this extension's page. Cheers

F.trott (talkcontribs)

Semantic TreeView is IMHO not maintainable. Instead I improved the tree format of Extension:SemanticResultFormats. Guess I should also update the menuselect documentation,

M art in (talkcontribs)

I have got an other question abou menuselect: is it possible to select a value the type comma and selcet a second value? Becau in my case the first value is always been overwritten! Thanks for help.

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

Sorry, it is not possible to create a comma separated list with menuselect.

M art in (talkcontribs)

Thank you for the fast answer! What do you recommend instead? More multiselcet fields in a row mapping the same Property? Or maybe change the JavaScript of multiselect? If yes: where?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

You could try some other input type, e.g. the twolistboxes input type available in the development version of the extension. You could of course also have several inputs or use a multiple template form. If you want to patch menuselect, have a look at the libs/menuselect.js file.

M art in (talkcontribs)

If I put more multiselctfields in a row for the same property the last textfield overwrites the others. So I will try to change the libs/menuselect.js file.

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Ok, First sucess. Line 219-227 was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur(); I changed to: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text();}

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

But after clicking "Save" the last value is taken! What do I do wrong? what's missing?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

There is a difference between the displayed value and the value sent back to the server. With your change you only change the displayed value. Try finding a line like jQuery( "#" + inputID ).attr( "value", content.text() ); and work on that.

M art in (talkcontribs)

Thank you for your help!

I made some changes from line 219-246. Origin was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", content.text() );

} return false;

} );

Now my code: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text(); }

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", inputShow.val() );

} return false;

} );

It works ;-)

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Just an other idea: Could it possible to define the behavier in the form with something like:

field|foo|input type=menuselect |structure=... |behavier=add/overwrite

But I'm not so much into php to change this.

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)
M art in (talkcontribs)
Reply to "Menuselect"